@opentinyvue/vue-grid 2.25.0 → 2.27.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 +807 -707
- package/package.json +17 -17
- package/src/config.d.ts +2 -0
- package/src/table/src/utils/handleGlobalMousedownEvent.d.ts +0 -24
- package/src/validator/src/methods.d.ts +1 -0
package/lib/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t } from '@opentinyvue/vue-locale';
|
|
2
2
|
import '@opentinyvue/vue-theme/grid/index.css';
|
|
3
3
|
import { Interceptor, StoreMap } from '@opentinyvue/vue-renderless/grid/core';
|
|
4
|
-
import { throttle, addClass, removeClass, debounce, PopupManager, PopperJS, extend, browserInfo, isObject, isEmptyObject, isServer, getDataset, random, isNull, fastdom, toDecimal, logger, tryToCurrency, tryToDecimal, tryToInt, toFileSize, truncate, toRate, isNumber as isNumber$1, toBoolValue, on, toDate, getDateWithNewTimezone, isDate, formatDateByPattern, toDateStr, off, Validator as Validator$1, getObj, getStyle, preventDefault, callInterceptor, hasClass } from '@opentinyvue/utils';
|
|
4
|
+
import { throttle, addClass, removeClass, debounce, PopupManager, PopperJS, extend, browserInfo, isObject, isEmptyObject, isServer, getDataset, random, isNull, getActualTarget, fastdom, toDecimal, logger, tryToCurrency, tryToDecimal, tryToInt, toFileSize, truncate, toRate, isNumber as isNumber$1, toBoolValue, on, toDate, getDateWithNewTimezone, isDate, formatDateByPattern, toDateStr, off, Validator as Validator$1, getObj, getStyle, preventDefault, 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
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, isEqual, filterTree, arrayEach, isNumber, findTree as findTree$1, sum, template, assign, objectMap, eachTree, sortBy, isString, remove, toStringJSON, toArray, arrayIndexOf } from '@opentinyvue/vue-renderless/grid/static/';
|
|
@@ -122,7 +122,7 @@ function _regenerator() {
|
|
|
122
122
|
var e, t2, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag";
|
|
123
123
|
function i(r2, n2, o2, i2) {
|
|
124
124
|
var c2 = n2 && n2.prototype instanceof Generator ? n2 : Generator, u2 = Object.create(c2.prototype);
|
|
125
|
-
return _regeneratorDefine2(u2, "_invoke", function(r3, n3, o3) {
|
|
125
|
+
return _regeneratorDefine2(u2, "_invoke", (function(r3, n3, o3) {
|
|
126
126
|
var i3, c3, u3, f2 = 0, p = o3 || [], y = false, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d2(t3, r4) {
|
|
127
127
|
return i3 = t3, c3 = 0, u3 = e, G.n = r4, a;
|
|
128
128
|
} };
|
|
@@ -155,7 +155,7 @@ function _regenerator() {
|
|
|
155
155
|
}
|
|
156
156
|
return { value: t2, done: y };
|
|
157
157
|
};
|
|
158
|
-
}(r2, o2, i2), true), u2;
|
|
158
|
+
})(r2, o2, i2), true), u2;
|
|
159
159
|
}
|
|
160
160
|
var a = {};
|
|
161
161
|
function Generator() {
|
|
@@ -187,15 +187,12 @@ function _regeneratorDefine2(e, r, n, t2) {
|
|
|
187
187
|
i = 0;
|
|
188
188
|
}
|
|
189
189
|
_regeneratorDefine2 = function _regeneratorDefine(e2, r2, n2, t3) {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
return this._invoke(r3, n3, e3);
|
|
195
|
-
});
|
|
196
|
-
};
|
|
197
|
-
o("next", 0), o("throw", 1), o("return", 2);
|
|
190
|
+
function o(r3, n3) {
|
|
191
|
+
_regeneratorDefine2(e2, r3, function(e3) {
|
|
192
|
+
return this._invoke(r3, n3, e3);
|
|
193
|
+
});
|
|
198
194
|
}
|
|
195
|
+
r2 ? i ? i(e2, r2, { value: n2, enumerable: !t3, configurable: !t3, writable: !t3 }) : e2[r2] = n2 : (o("next", 0), o("throw", 1), o("return", 2));
|
|
199
196
|
}, _regeneratorDefine2(e, r, n, t2);
|
|
200
197
|
}
|
|
201
198
|
function asyncGeneratorStep(n, t2, e, r, o, a, c) {
|
|
@@ -266,12 +263,14 @@ function _extends() {
|
|
|
266
263
|
var GlobalConfig$1 = {
|
|
267
264
|
validConfig: {
|
|
268
265
|
message: "tooltip",
|
|
266
|
+
highlightError: false,
|
|
269
267
|
icon: iconError()
|
|
270
268
|
},
|
|
271
269
|
editConfig: {
|
|
272
270
|
trigger: "click",
|
|
273
271
|
mode: "cell",
|
|
274
|
-
showStatus: true
|
|
272
|
+
showStatus: true,
|
|
273
|
+
validateOnActive: true
|
|
275
274
|
},
|
|
276
275
|
// 默认开启点击头部单元格触发排序
|
|
277
276
|
sortConfig: {
|
|
@@ -683,8 +682,8 @@ function defaultFilterRender(h2, renderOpts, params, context) {
|
|
|
683
682
|
function defaultFilterMethod(_ref2) {
|
|
684
683
|
var option = _ref2.option, row2 = _ref2.row, column = _ref2.column;
|
|
685
684
|
var cellValue = get(row2, column.property);
|
|
686
|
-
var
|
|
687
|
-
return cellValue ==
|
|
685
|
+
var data7 = option.data;
|
|
686
|
+
return cellValue == data7;
|
|
688
687
|
}
|
|
689
688
|
function renderSelectEdit(h2, renderOpts, params, context) {
|
|
690
689
|
var column = params.column, $table = params.$table, row2 = params.row;
|
|
@@ -894,10 +893,10 @@ var Formatter = {
|
|
|
894
893
|
label: "label",
|
|
895
894
|
value: "value"
|
|
896
895
|
}, this.own.formatConfig);
|
|
897
|
-
var
|
|
896
|
+
var data7 = Array.isArray(format2.data) && find$1(format2.data, function(item) {
|
|
898
897
|
return item[format2.value] === value;
|
|
899
898
|
});
|
|
900
|
-
return
|
|
899
|
+
return data7 ? data7[format2.label] : "";
|
|
901
900
|
},
|
|
902
901
|
select: function select(cellValue) {
|
|
903
902
|
var _this$editor = this.editor, options = _this$editor.options, optionGroups = _this$editor.optionGroups, _this$editor$optionPr = _this$editor.optionProps, optionProps = _this$editor$optionPr === void 0 ? {} : _this$editor$optionPr, _this$editor$optionGr = _this$editor.optionGroupProps, optionGroupProps = _this$editor$optionGr === void 0 ? {} : _this$editor$optionGr;
|
|
@@ -1819,9 +1818,9 @@ var _getTreeLength = function getTreeLength(tree, childrenKey) {
|
|
|
1819
1818
|
return length;
|
|
1820
1819
|
};
|
|
1821
1820
|
var getTiledLength = function getTiledLength2(props) {
|
|
1822
|
-
var
|
|
1821
|
+
var data7 = props.data || [];
|
|
1823
1822
|
var _ref14 = props.treeConfig || {}, childrenKey = _ref14.children;
|
|
1824
|
-
return props.treeConfig ? _getTreeLength(
|
|
1823
|
+
return props.treeConfig ? _getTreeLength(data7, childrenKey) : data7.length;
|
|
1825
1824
|
};
|
|
1826
1825
|
var useData = function useData2(props) {
|
|
1827
1826
|
var _hooks$getCurrentInst3;
|
|
@@ -2037,6 +2036,38 @@ var getEventParams = function getEventParams2(_ref17, $table) {
|
|
|
2037
2036
|
var isOperateMouse = function isOperateMouse2($table) {
|
|
2038
2037
|
return $table._isResize || $table.lastScrollTime && Date.now() < $table.lastScrollTime + $table.optimizeOpts.delayHover;
|
|
2039
2038
|
};
|
|
2039
|
+
var hideAlignLines = function hideAlignLines2($table, cell) {
|
|
2040
|
+
var _$table$mouseConfig;
|
|
2041
|
+
if (!((_$table$mouseConfig = $table.mouseConfig) != null && _$table$mouseConfig.hover) || cell) {
|
|
2042
|
+
return;
|
|
2043
|
+
}
|
|
2044
|
+
var xBar = $table.elemStore["main-body-alignXBar"];
|
|
2045
|
+
var yBar = $table.elemStore["main-body-alignYBar"];
|
|
2046
|
+
if (xBar) {
|
|
2047
|
+
xBar.style.display = "none";
|
|
2048
|
+
}
|
|
2049
|
+
if (yBar) {
|
|
2050
|
+
yBar.style.display = "none";
|
|
2051
|
+
}
|
|
2052
|
+
};
|
|
2053
|
+
var showAlignLines = function showAlignLines2($table, cell) {
|
|
2054
|
+
var _$table$mouseConfig2;
|
|
2055
|
+
if (!((_$table$mouseConfig2 = $table.mouseConfig) != null && _$table$mouseConfig2.hover)) {
|
|
2056
|
+
return;
|
|
2057
|
+
}
|
|
2058
|
+
var xBar = $table.elemStore["main-body-alignXBar"];
|
|
2059
|
+
var yBar = $table.elemStore["main-body-alignYBar"];
|
|
2060
|
+
if (xBar) {
|
|
2061
|
+
xBar.style.display = "block";
|
|
2062
|
+
xBar.style.top = cell.offsetTop - 1 + "px";
|
|
2063
|
+
xBar.style.setProperty("--after-top-offset", cell.offsetHeight + "px");
|
|
2064
|
+
}
|
|
2065
|
+
if (yBar) {
|
|
2066
|
+
yBar.style.display = "block";
|
|
2067
|
+
yBar.style.left = cell.offsetLeft - 1 + "px";
|
|
2068
|
+
yBar.style.setProperty("--after-left-offset", cell.offsetWidth + "px");
|
|
2069
|
+
}
|
|
2070
|
+
};
|
|
2040
2071
|
var useCellEvent = function useCellEvent2(_ref21) {
|
|
2041
2072
|
var table = _ref21.table, $table = _ref21.$table;
|
|
2042
2073
|
var isBound = false;
|
|
@@ -2084,7 +2115,7 @@ var useCellEvent = function useCellEvent2(_ref21) {
|
|
|
2084
2115
|
var source = getEventSource(e, $table);
|
|
2085
2116
|
if (source) {
|
|
2086
2117
|
var params = getEventParams(source, $table);
|
|
2087
|
-
var _$table$
|
|
2118
|
+
var _$table$mouseConfig3 = $table.mouseConfig, mouseConfig = _$table$mouseConfig3 === void 0 ? {} : _$table$mouseConfig3;
|
|
2088
2119
|
if (source.part === "header" && mouseConfig.checked) {
|
|
2089
2120
|
$table.triggerHeaderCellMousedownEvent(e, params);
|
|
2090
2121
|
}
|
|
@@ -2102,7 +2133,7 @@ var useCellEvent = function useCellEvent2(_ref21) {
|
|
|
2102
2133
|
var satisfy = function satisfy2(equal, trigger2) {
|
|
2103
2134
|
return trigger2 === "row" || equal(column) && trigger2 === "cell";
|
|
2104
2135
|
};
|
|
2105
|
-
var editConfig = $table.editConfig, _$table$expandConfig = $table.expandConfig, expandConfig = _$table$expandConfig === void 0 ? {} : _$table$expandConfig, highlightCurrentColumn = $table.highlightCurrentColumn, highlightCurrentRow = $table.highlightCurrentRow, _$table$
|
|
2136
|
+
var editConfig = $table.editConfig, _$table$expandConfig = $table.expandConfig, expandConfig = _$table$expandConfig === void 0 ? {} : _$table$expandConfig, highlightCurrentColumn = $table.highlightCurrentColumn, highlightCurrentRow = $table.highlightCurrentRow, _$table$mouseConfig4 = $table.mouseConfig, mouseConfig = _$table$mouseConfig4 === void 0 ? {} : _$table$mouseConfig4, _$table$radioConfig = $table.radioConfig, radioConfig = _$table$radioConfig === void 0 ? {} : _$table$radioConfig, _$table$selectConfig = $table.selectConfig, selectConfig = _$table$selectConfig === void 0 ? {} : _$table$selectConfig, sortOpts2 = $table.sortOpts, tableListeners = $table.tableListeners, _$table$treeConfig = $table.treeConfig, treeConfig = _$table$treeConfig === void 0 ? {} : _$table$treeConfig;
|
|
2106
2137
|
if (source.part === "header" && (highlightCurrentColumn || tableListeners["header-cell-click"] || mouseConfig.checked || sortOpts2.trigger === "cell")) {
|
|
2107
2138
|
$table.triggerHeaderCellClickEvent(e, params);
|
|
2108
2139
|
}
|
|
@@ -2234,6 +2265,7 @@ var useCellEvent = function useCellEvent2(_ref21) {
|
|
|
2234
2265
|
if (tableListeners["cell-mouseleave"]) {
|
|
2235
2266
|
emitEvent($table, "cell-mouseleave", [params, e]);
|
|
2236
2267
|
}
|
|
2268
|
+
hideAlignLines($table, curCell);
|
|
2237
2269
|
}
|
|
2238
2270
|
}
|
|
2239
2271
|
if (curCell) {
|
|
@@ -2243,6 +2275,7 @@ var useCellEvent = function useCellEvent2(_ref21) {
|
|
|
2243
2275
|
if (tableListeners["cell-mouseenter"]) {
|
|
2244
2276
|
emitEvent($table, "cell-mouseenter", [_params, _e]);
|
|
2245
2277
|
}
|
|
2278
|
+
showAlignLines($table, curCell);
|
|
2246
2279
|
}
|
|
2247
2280
|
}
|
|
2248
2281
|
});
|
|
@@ -2439,7 +2472,7 @@ var doSpan = function doSpan2(_ref31) {
|
|
|
2439
2472
|
attrs.visible = rowspan > 0 && colspan > 0;
|
|
2440
2473
|
};
|
|
2441
2474
|
var rowSpanMethod = function rowSpanMethod2(rowSpan, _ref33) {
|
|
2442
|
-
var row2 = _ref33.row, $rowIndex = _ref33.$rowIndex, column = _ref33.column,
|
|
2475
|
+
var row2 = _ref33.row, $rowIndex = _ref33.$rowIndex, column = _ref33.column, data7 = _ref33.data;
|
|
2443
2476
|
var fields = [];
|
|
2444
2477
|
if (column.visible && rowSpan) {
|
|
2445
2478
|
rowSpan.forEach(function(item) {
|
|
@@ -2447,8 +2480,8 @@ var rowSpanMethod = function rowSpanMethod2(rowSpan, _ref33) {
|
|
|
2447
2480
|
});
|
|
2448
2481
|
var cellVal = row2[column.property];
|
|
2449
2482
|
if (cellVal && fields.includes(column.property)) {
|
|
2450
|
-
var prevSiblingRow =
|
|
2451
|
-
var nextSiblingRow =
|
|
2483
|
+
var prevSiblingRow = data7[$rowIndex - 1];
|
|
2484
|
+
var nextSiblingRow = data7[$rowIndex + 1];
|
|
2452
2485
|
if ((prevSiblingRow == null ? void 0 : prevSiblingRow[column.property]) === cellVal) {
|
|
2453
2486
|
return {
|
|
2454
2487
|
rowspan: 0,
|
|
@@ -2458,7 +2491,7 @@ var rowSpanMethod = function rowSpanMethod2(rowSpan, _ref33) {
|
|
|
2458
2491
|
var rowspanCount = 1;
|
|
2459
2492
|
while (((_nextSiblingRow = nextSiblingRow) == null ? void 0 : _nextSiblingRow[column.property]) === cellVal) {
|
|
2460
2493
|
var _nextSiblingRow;
|
|
2461
|
-
nextSiblingRow =
|
|
2494
|
+
nextSiblingRow = data7[++rowspanCount + $rowIndex];
|
|
2462
2495
|
}
|
|
2463
2496
|
if (rowspanCount > 1) {
|
|
2464
2497
|
return {
|
|
@@ -2783,7 +2816,7 @@ function renderColumn(_ref39) {
|
|
|
2783
2816
|
row: row2,
|
|
2784
2817
|
column
|
|
2785
2818
|
} : _ref40$params;
|
|
2786
|
-
var isMessageDefault = validOpts2.isMessageDefault, isMessageInline = validOpts2.isMessageInline;
|
|
2819
|
+
var isMessageDefault = validOpts2.isMessageDefault, isMessageInline = validOpts2.isMessageInline, highlightError = validOpts2.highlightError;
|
|
2787
2820
|
var actived = editStore.actived;
|
|
2788
2821
|
var validated = validatedMap[column.id + "-" + row2[rowId]];
|
|
2789
2822
|
var validError = validStore.row === row2 && validStore.column === column;
|
|
@@ -2812,7 +2845,7 @@ function renderColumn(_ref39) {
|
|
|
2812
2845
|
"rowspan": attrs.rowspan > 1 ? attrs.rowspan : void 0,
|
|
2813
2846
|
"colspan": attrs.colspan > 1 ? attrs.colspan : void 0
|
|
2814
2847
|
},
|
|
2815
|
-
"class": ["tiny-grid-body__column", column.id, (_ref41 = {}, _ref41["col__" + cellAlign] = cellAlign, _ref41["col__edit"] = editor, _ref41["col__index"] = column.type === "index", _ref41["col__radio"] = column.type === "radio", _ref41["col__selection"] = column.type === "selection", _ref41["col__ellipsis"] = cellOverflowHint, _ref41["edit__visible"] = editor && editor.type === "visible", _ref41["col__dirty"] = isDirty, _ref41["col__actived"] = columnActived, _ref41["col__valid-error"] = validError && validated, _ref41["col__valid-success"] = columnActived ? !validError && !validated : isDirty && !validated, _ref41["col__treenode"] = column.treeNode, _ref41), getClass(className, params), getClass(cellClassName, params), getFixedClass(column, $table), attrs._stickyClass || ""]
|
|
2848
|
+
"class": ["tiny-grid-body__column", column.id, (_ref41 = {}, _ref41["col__" + cellAlign] = cellAlign, _ref41["col__edit"] = editor, _ref41["col__index"] = column.type === "index", _ref41["col__radio"] = column.type === "radio", _ref41["col__selection"] = column.type === "selection", _ref41["col__ellipsis"] = cellOverflowHint, _ref41["edit__visible"] = editor && editor.type === "visible", _ref41["col__dirty"] = isDirty, _ref41["col__actived"] = columnActived, _ref41["col__highlight-error"] = highlightError && validated, _ref41["col__valid-error"] = validError && validated, _ref41["col__valid-success"] = columnActived ? !validError && !validated : isDirty && !validated, _ref41["col__treenode"] = column.treeNode, _ref41), getClass(className, params), getClass(cellClassName, params), getFixedClass(column, $table), attrs._stickyClass || ""]
|
|
2816
2849
|
}, [[
|
|
2817
2850
|
// 行拖拽手柄
|
|
2818
2851
|
dropConfig.rowHandle === "index" && column.type === "index" ? h("div", {
|
|
@@ -2849,7 +2882,7 @@ function renderHeaderRows(_vm) {
|
|
|
2849
2882
|
var $table = _vm.$parent, headerTable = _vm.headerTable;
|
|
2850
2883
|
var headerCellClassName = $table.headerCellClassName, headerRowClassName = $table.headerRowClassName, headerSuffixIconAbsolute = $table.headerSuffixIconAbsolute;
|
|
2851
2884
|
var allAlign = $table.align, border = $table.border, allHeaderAlign = $table.headerAlign, resizable = $table.resizable;
|
|
2852
|
-
var editConfig = $table.editConfig, operationColumnResizable = $table.operationColumnResizable, _$table$
|
|
2885
|
+
var editConfig = $table.editConfig, operationColumnResizable = $table.operationColumnResizable, _$table$mouseConfig5 = $table.mouseConfig, mouseConfig = _$table$mouseConfig5 === void 0 ? {} : _$table$mouseConfig5, _$table$dropConfig2 = $table.dropConfig, dropConfig = _$table$dropConfig2 === void 0 ? {} : _$table$dropConfig2;
|
|
2853
2886
|
return headerTable.map(function(cols, $rowIndex) {
|
|
2854
2887
|
return h("tr", {
|
|
2855
2888
|
"attrs": {
|
|
@@ -3002,8 +3035,12 @@ function renderRows(_vm) {
|
|
|
3002
3035
|
value: 0
|
|
3003
3036
|
};
|
|
3004
3037
|
var $seq = "";
|
|
3005
|
-
rowPool.
|
|
3006
|
-
var
|
|
3038
|
+
var lastVisibleIndex = rowPool.findLastIndex(function(_ref48) {
|
|
3039
|
+
var used = _ref48.used;
|
|
3040
|
+
return Boolean(used);
|
|
3041
|
+
});
|
|
3042
|
+
rowPool.forEach(function(_ref49, $rowIndex) {
|
|
3043
|
+
var id3 = _ref49.id, _ref49$item = _ref49.item, row2 = _ref49$item.payload, rowLevel = _ref49$item.level, used = _ref49.used;
|
|
3007
3044
|
var rowActived = editConfig && actived.row === row2;
|
|
3008
3045
|
var virtualRow = isVirtualRow(row2);
|
|
3009
3046
|
var isSkipRowRender = hideMethod && hideMethod(row2, rowLevel) || virtualRow;
|
|
@@ -3040,7 +3077,8 @@ function renderRows(_vm) {
|
|
|
3040
3077
|
isSkipRowRender,
|
|
3041
3078
|
row: row2,
|
|
3042
3079
|
rowActived,
|
|
3043
|
-
rowClassName
|
|
3080
|
+
rowClassName,
|
|
3081
|
+
lastVisibleIndex
|
|
3044
3082
|
};
|
|
3045
3083
|
Object.assign(args, {
|
|
3046
3084
|
rowIndex,
|
|
@@ -3124,8 +3162,8 @@ function renderRowExpanded(args) {
|
|
|
3124
3162
|
}
|
|
3125
3163
|
}
|
|
3126
3164
|
}
|
|
3127
|
-
function renderRowAfter(
|
|
3128
|
-
var $table =
|
|
3165
|
+
function renderRowAfter(_ref50) {
|
|
3166
|
+
var $table = _ref50.$table, _vm = _ref50._vm, row2 = _ref50.row, rowIndex = _ref50.rowIndex, rows = _ref50.rows, id3 = _ref50.id, used = _ref50.used;
|
|
3129
3167
|
typeof $table.renderRowAfter === "function" && $table.renderRowAfter({
|
|
3130
3168
|
rows,
|
|
3131
3169
|
row: row2,
|
|
@@ -3137,9 +3175,9 @@ function renderRowAfter(_ref49) {
|
|
|
3137
3175
|
}, h);
|
|
3138
3176
|
}
|
|
3139
3177
|
function renderRow(args) {
|
|
3140
|
-
var
|
|
3178
|
+
var _ref51;
|
|
3141
3179
|
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;
|
|
3142
|
-
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;
|
|
3180
|
+
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, lastVisibleIndex = args.lastVisibleIndex;
|
|
3143
3181
|
if (isSkipRowRender) {
|
|
3144
3182
|
return;
|
|
3145
3183
|
}
|
|
@@ -3163,7 +3201,7 @@ function renderRow(args) {
|
|
|
3163
3201
|
"style": {
|
|
3164
3202
|
display: used ? void 0 : "none"
|
|
3165
3203
|
},
|
|
3166
|
-
"class": ["tiny-grid-body__row", (
|
|
3204
|
+
"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["row__last-visible"] = lastVisibleIndex === $rowIndex, _ref51), rowClassName ? isFunction(rowClassName) ? rowClassName({
|
|
3167
3205
|
$table,
|
|
3168
3206
|
$seq,
|
|
3169
3207
|
seq,
|
|
@@ -3173,8 +3211,8 @@ function renderRow(args) {
|
|
|
3173
3211
|
rowIndex,
|
|
3174
3212
|
$rowIndex
|
|
3175
3213
|
}) : rowClassName : ""]
|
|
3176
|
-
}, [columnPool.map(function(
|
|
3177
|
-
var id4 =
|
|
3214
|
+
}, [columnPool.map(function(_ref52, $columnIndex) {
|
|
3215
|
+
var id4 = _ref52.id, column = _ref52.item, used2 = _ref52.used;
|
|
3178
3216
|
return renderColumn({
|
|
3179
3217
|
$columnIndex,
|
|
3180
3218
|
$table,
|
|
@@ -3188,8 +3226,8 @@ function renderRow(args) {
|
|
|
3188
3226
|
});
|
|
3189
3227
|
})]));
|
|
3190
3228
|
}
|
|
3191
|
-
function renderRowGroupTds(
|
|
3192
|
-
var $table =
|
|
3229
|
+
function renderRowGroupTds(_ref53) {
|
|
3230
|
+
var $table = _ref53.$table, closeable = _ref53.closeable, render19 = _ref53.render, renderGroupCell = _ref53.renderGroupCell, row2 = _ref53.row, tds = _ref53.tds, title = _ref53.title, _vm = _ref53._vm;
|
|
3193
3231
|
var targetColumn = $table._rowGroupTargetColumn;
|
|
3194
3232
|
var value = row2.value || "";
|
|
3195
3233
|
var columnPool = _vm.columnPool;
|
|
@@ -3230,8 +3268,8 @@ function renderRowGroupTds(_ref52) {
|
|
|
3230
3268
|
}, [row2.children.length])]) : renderGroupCell ? renderGroupCell(h, params) : null])]));
|
|
3231
3269
|
}
|
|
3232
3270
|
}
|
|
3233
|
-
function renderRowGroupData(
|
|
3234
|
-
var $table =
|
|
3271
|
+
function renderRowGroupData(_ref54) {
|
|
3272
|
+
var $table = _ref54.$table, _vm = _ref54._vm, id3 = _ref54.id, row2 = _ref54.row, rowGroup = _ref54.rowGroup, rowid2 = _ref54.rowid, rows = _ref54.rows, used = _ref54.used, virtualRow = _ref54.virtualRow;
|
|
3235
3273
|
if (!virtualRow) return;
|
|
3236
3274
|
var title = rowGroup.title, _rowGroup$closeable2 = rowGroup.closeable, closeable = _rowGroup$closeable2 === void 0 ? true : _rowGroup$closeable2, render19 = rowGroup.render, renderGroupCell = rowGroup.renderGroupCell, className = rowGroup.className;
|
|
3237
3275
|
var tds = [];
|
|
@@ -3276,8 +3314,8 @@ function renderRowGroupData(_ref53) {
|
|
|
3276
3314
|
}
|
|
3277
3315
|
}, [tds]));
|
|
3278
3316
|
}
|
|
3279
|
-
function renderTable(
|
|
3280
|
-
var $table =
|
|
3317
|
+
function renderTable(_ref55) {
|
|
3318
|
+
var $table = _ref55.$table, _vm = _ref55._vm;
|
|
3281
3319
|
var tableLayout = $table.tableLayout, scrollXLoad = $table.scrollXLoad, scrollYLoad = $table.scrollYLoad, bodyTableWidth = $table.bodyTableWidth, isColumnWidthAssigned = $table.isColumnWidthAssigned;
|
|
3282
3320
|
var columnPool = _vm.columnPool, isNoData = _vm.isNoData;
|
|
3283
3321
|
if (!isColumnWidthAssigned) {
|
|
@@ -3300,8 +3338,8 @@ function renderTable(_ref54) {
|
|
|
3300
3338
|
// 列分组(用于指定列宽)
|
|
3301
3339
|
h("colgroup", {
|
|
3302
3340
|
"ref": "colgroup"
|
|
3303
|
-
}, [columnPool.map(function(
|
|
3304
|
-
var id3 =
|
|
3341
|
+
}, [columnPool.map(function(_ref56) {
|
|
3342
|
+
var id3 = _ref56.id, column = _ref56.item, used = _ref56.used;
|
|
3305
3343
|
return h("col", {
|
|
3306
3344
|
"key": id3,
|
|
3307
3345
|
"attrs": {
|
|
@@ -3401,9 +3439,9 @@ var Body = defineComponent({
|
|
|
3401
3439
|
tableData: Array,
|
|
3402
3440
|
footerData: Array
|
|
3403
3441
|
},
|
|
3404
|
-
setup: function setup3(props,
|
|
3442
|
+
setup: function setup3(props, _ref57) {
|
|
3405
3443
|
var _hooks$getCurrentInst4;
|
|
3406
|
-
var slots =
|
|
3444
|
+
var slots = _ref57.slots;
|
|
3407
3445
|
var vm = (_hooks$getCurrentInst4 = hooks.getCurrentInstance()) == null ? void 0 : _hooks$getCurrentInst4.proxy;
|
|
3408
3446
|
var $table = vm == null ? void 0 : vm.$parent;
|
|
3409
3447
|
var rowHeight = hooks.computed(function() {
|
|
@@ -3424,6 +3462,8 @@ var Body = defineComponent({
|
|
|
3424
3462
|
var thead = hooks.ref();
|
|
3425
3463
|
var tbody = hooks.ref();
|
|
3426
3464
|
var ySpace = hooks.ref();
|
|
3465
|
+
var alignXBar = hooks.ref();
|
|
3466
|
+
var alignYBar = hooks.ref();
|
|
3427
3467
|
hooks.watch(wrapperScrollLeft, function(wrapperScrollLeft2) {
|
|
3428
3468
|
var el = stickyWrapper.value;
|
|
3429
3469
|
if (!el) return;
|
|
@@ -3449,13 +3489,15 @@ var Body = defineComponent({
|
|
|
3449
3489
|
$table
|
|
3450
3490
|
});
|
|
3451
3491
|
var _useCellSpan = useCellSpan(vm, props), normalRows = _useCellSpan.normalRows, footerRows = _useCellSpan.footerRows;
|
|
3452
|
-
hooks.watch([body, table, thead, tbody, ySpace], function() {
|
|
3492
|
+
hooks.watch([body, table, thead, tbody, ySpace, alignXBar, alignYBar], function() {
|
|
3453
3493
|
var elemStore = $table.elemStore;
|
|
3454
3494
|
elemStore["main-body-wrapper"] = body.value;
|
|
3455
3495
|
elemStore["main-body-table"] = table.value;
|
|
3456
3496
|
elemStore["main-body-headerList"] = thead.value;
|
|
3457
3497
|
elemStore["main-body-list"] = tbody.value;
|
|
3458
3498
|
elemStore["main-body-ySpace"] = ySpace.value;
|
|
3499
|
+
elemStore["main-body-alignXBar"] = alignXBar.value;
|
|
3500
|
+
elemStore["main-body-alignYBar"] = alignYBar.value;
|
|
3459
3501
|
});
|
|
3460
3502
|
var bodyClientWidth = hooks.ref(0);
|
|
3461
3503
|
var resizeObserver = new ResizeObserver(function(entries) {
|
|
@@ -3530,6 +3572,8 @@ var Body = defineComponent({
|
|
|
3530
3572
|
thead,
|
|
3531
3573
|
tbody,
|
|
3532
3574
|
ySpace,
|
|
3575
|
+
alignXBar,
|
|
3576
|
+
alignYBar,
|
|
3533
3577
|
normalRows,
|
|
3534
3578
|
footerRows,
|
|
3535
3579
|
resetStickyWrapperScrollPos
|
|
@@ -3551,11 +3595,26 @@ var Body = defineComponent({
|
|
|
3551
3595
|
"no-data": isNoData && $table.isShapeTable
|
|
3552
3596
|
},
|
|
3553
3597
|
"style": {
|
|
3598
|
+
"--body-container-scroll-height": containerScrollHeight + "px",
|
|
3599
|
+
"--body-container-scroll-width": containerScrollWidth + "px",
|
|
3554
3600
|
height: bodyWrapperHeight ? bodyWrapperHeight + "px" : void 0,
|
|
3555
3601
|
minHeight: bodyWrapperMinHeight ? bodyWrapperMinHeight + "px" : void 0,
|
|
3556
3602
|
maxHeight: bodyWrapperMaxHeight ? bodyWrapperMaxHeight + "px" : void 0
|
|
3557
3603
|
}
|
|
3558
3604
|
}, [[
|
|
3605
|
+
mouseConfig != null && mouseConfig.hover ? [h2("div", {
|
|
3606
|
+
"ref": "alignYBar",
|
|
3607
|
+
"class": "tiny-grid-body__hover-align-y-bar",
|
|
3608
|
+
"style": {
|
|
3609
|
+
height: containerScrollHeight + "px"
|
|
3610
|
+
}
|
|
3611
|
+
}), h2("div", {
|
|
3612
|
+
"ref": "alignXBar",
|
|
3613
|
+
"class": "tiny-grid-body__hover-align-x-bar",
|
|
3614
|
+
"style": {
|
|
3615
|
+
width: containerScrollWidth + "px"
|
|
3616
|
+
}
|
|
3617
|
+
})] : null,
|
|
3559
3618
|
h2("div", {
|
|
3560
3619
|
"class": "tiny-grid-body__x-space",
|
|
3561
3620
|
"style": {
|
|
@@ -3643,18 +3702,18 @@ var Body = defineComponent({
|
|
|
3643
3702
|
var $el = this.$el, $table = this.$parent;
|
|
3644
3703
|
var dragClientX = event.clientX, dragBtnElem = event.target;
|
|
3645
3704
|
var column = params.column;
|
|
3646
|
-
var
|
|
3705
|
+
var _ref58 = {}, _ref58$dragLeft = _ref58.dragLeft, dragLeft = _ref58$dragLeft === void 0 ? 0 : _ref58$dragLeft, _ref58$minInterval = _ref58.minInterval, minInterval = _ref58$minInterval === void 0 ? 40 : _ref58$minInterval;
|
|
3647
3706
|
var _$table$$refs = $table.$refs, resizeBarElem = _$table$$refs.resizeBar, tableBody = _$table$$refs.tableBody;
|
|
3648
|
-
var
|
|
3649
|
-
var
|
|
3707
|
+
var _ref59 = {}, _ref59$cell = _ref59.cell, cell = _ref59$cell === void 0 ? dragBtnElem.parentNode : _ref59$cell, _ref59$dragBtnWidth = _ref59.dragBtnWidth, dragBtnWidth = _ref59$dragBtnWidth === void 0 ? dragBtnElem.clientWidth : _ref59$dragBtnWidth;
|
|
3708
|
+
var _ref60 = {}, _ref60$pos = _ref60.pos, pos = _ref60$pos === void 0 ? getOffsetPos(dragBtnElem, $el) : _ref60$pos, _ref60$tableBodyElem = _ref60.tableBodyElem, tableBodyElem = _ref60$tableBodyElem === void 0 ? tableBody.$el : _ref60$tableBodyElem;
|
|
3650
3709
|
var dragMinLeft = pos.left - cell.clientWidth + dragBtnWidth + minInterval;
|
|
3651
3710
|
var dragPosLeft = pos.left + Math.floor(dragBtnWidth);
|
|
3652
|
-
var
|
|
3711
|
+
var _ref61 = {}, _ref61$oldMousemove = _ref61.oldMousemove, oldMousemove = _ref61$oldMousemove === void 0 ? document.onmousemove : _ref61$oldMousemove, _ref61$oldMouseup = _ref61.oldMouseup, oldMouseup = _ref61$oldMouseup === void 0 ? document.onmouseup : _ref61$oldMouseup;
|
|
3653
3712
|
var handleMousemoveEvent = function handleMousemoveEvent2(event2) {
|
|
3654
3713
|
var _$table$resizableConf;
|
|
3655
3714
|
event2.stopPropagation();
|
|
3656
3715
|
event2.preventDefault();
|
|
3657
|
-
var
|
|
3716
|
+
var _ref62 = {}, _ref62$offsetX = _ref62.offsetX, offsetX = _ref62$offsetX === void 0 ? event2.clientX - dragClientX : _ref62$offsetX, _ref62$left = _ref62.left, left = _ref62$left === void 0 ? offsetX + dragPosLeft : _ref62$left;
|
|
3658
3717
|
var scrollLeft = tableBodyElem.scrollLeft;
|
|
3659
3718
|
dragLeft = Math.max(left, dragMinLeft);
|
|
3660
3719
|
if ((_$table$resizableConf = $table.resizableConfig) != null && _$table$resizableConf.limit) {
|
|
@@ -3729,14 +3788,14 @@ var Radio = defineComponent({
|
|
|
3729
3788
|
return this.size || this.$parent.size || this.$parent.vSize;
|
|
3730
3789
|
}
|
|
3731
3790
|
},
|
|
3732
|
-
setup: function setup4(props,
|
|
3733
|
-
var slots =
|
|
3791
|
+
setup: function setup4(props, _ref63) {
|
|
3792
|
+
var slots = _ref63.slots;
|
|
3734
3793
|
return {
|
|
3735
3794
|
slots
|
|
3736
3795
|
};
|
|
3737
3796
|
},
|
|
3738
3797
|
render: function render2() {
|
|
3739
|
-
var
|
|
3798
|
+
var _ref64, _this2 = this;
|
|
3740
3799
|
var disabled = this.disabled, vSize3 = this.vSize, modelValue = this.modelValue, label = this.label, name = this.name;
|
|
3741
3800
|
var $slots = this.slots;
|
|
3742
3801
|
var disableClass = "disabled";
|
|
@@ -3753,7 +3812,7 @@ var Radio = defineComponent({
|
|
|
3753
3812
|
return content;
|
|
3754
3813
|
};
|
|
3755
3814
|
return h("label", {
|
|
3756
|
-
class: ["tiny-grid-radio", (
|
|
3815
|
+
class: ["tiny-grid-radio", (_ref64 = {}, _ref64["size__" + vSize3] = vSize3, _ref64["is__" + disableClass] = disabled, _ref64)]
|
|
3757
3816
|
}, [h("input", {
|
|
3758
3817
|
attrs: {
|
|
3759
3818
|
type: "radio",
|
|
@@ -3785,8 +3844,8 @@ Radio.model = {
|
|
|
3785
3844
|
event: "update:modelValue"
|
|
3786
3845
|
};
|
|
3787
3846
|
$install(Radio);
|
|
3788
|
-
var renderInputArgs = function renderInputArgs2(
|
|
3789
|
-
var _vm =
|
|
3847
|
+
var renderInputArgs = function renderInputArgs2(_ref65) {
|
|
3848
|
+
var _vm = _ref65._vm, inputFilter = _ref65.inputFilter;
|
|
3790
3849
|
var isAddbyProgram = false;
|
|
3791
3850
|
if (typeof inputFilter.relations_addby !== "undefined") {
|
|
3792
3851
|
isAddbyProgram = inputFilter.relations_addby === "program";
|
|
@@ -3814,9 +3873,9 @@ var renderInputArgs = function renderInputArgs2(_ref64) {
|
|
|
3814
3873
|
inputRelations
|
|
3815
3874
|
};
|
|
3816
3875
|
};
|
|
3817
|
-
var renderInputProps = function renderInputProps2(
|
|
3876
|
+
var renderInputProps = function renderInputProps2(_ref66) {
|
|
3818
3877
|
var _on3;
|
|
3819
|
-
var InputComponent =
|
|
3878
|
+
var InputComponent = _ref66.InputComponent, condition2 = _ref66.condition, event = _ref66.event, inputFilter = _ref66.inputFilter, isNativeInput = _ref66.isNativeInput, prop = _ref66.prop;
|
|
3820
3879
|
var inputProps = {
|
|
3821
3880
|
style: "width:100%",
|
|
3822
3881
|
on: (_on3 = {}, _on3[event] = function(value) {
|
|
@@ -3862,8 +3921,8 @@ var iconRender = function iconRender2(checked, index2, halfChecked) {
|
|
|
3862
3921
|
}])) : h(Check, _mergeJSXProps6([{}, props]));
|
|
3863
3922
|
}
|
|
3864
3923
|
};
|
|
3865
|
-
var renderEnumableOptions = function renderEnumableOptions2(
|
|
3866
|
-
var iconRender3 =
|
|
3924
|
+
var renderEnumableOptions = function renderEnumableOptions2(_ref67) {
|
|
3925
|
+
var iconRender3 = _ref67.iconRender, _vm = _ref67._vm, filterStore = _ref67.filterStore, selectAll = _ref67.selectAll, searchable = _ref67.searchable;
|
|
3867
3926
|
var resultList = filterStore.options.filter(function(value) {
|
|
3868
3927
|
var _value$label;
|
|
3869
3928
|
return (_value$label = value.label) == null ? void 0 : _value$label.toString().includes(filterStore.searchValue);
|
|
@@ -3952,7 +4011,7 @@ var Panel$1 = defineComponent({
|
|
|
3952
4011
|
};
|
|
3953
4012
|
},
|
|
3954
4013
|
render: function render3() {
|
|
3955
|
-
var _this3 = this,
|
|
4014
|
+
var _this3 = this, _ref68;
|
|
3956
4015
|
var h2 = arguments[0];
|
|
3957
4016
|
var filterStore = this.filterStore, $grid = this.$grid, $table = this.$parent, optimizeOpts = this.optimizeOpts, renderInput2 = this.renderInput, renderEnumable2 = this.renderEnumable, renderDefault2 = this.renderDefault, renderExtends2 = this.renderExtends, renderBase2 = this.renderBase, renderSimple2 = this.renderSimple;
|
|
3958
4017
|
var args = filterStore.args, column = filterStore.column, options = filterStore.options, _filterStore$layout = filterStore.layout, layout2 = _filterStore$layout === void 0 ? "input,enum,default,extends,base" : _filterStore$layout;
|
|
@@ -3974,9 +4033,9 @@ var Panel$1 = defineComponent({
|
|
|
3974
4033
|
attrs: filterStore.attrs
|
|
3975
4034
|
} : filterStore.attrs;
|
|
3976
4035
|
return h2("div", _mergeJSXProps6([{}, wrapperAttrs, {
|
|
3977
|
-
"class": ["tiny-grid__wrapper", "tiny-grid__filter-wrapper", "filter__prevent-default", (
|
|
4036
|
+
"class": ["tiny-grid__wrapper", "tiny-grid__filter-wrapper", "filter__prevent-default", (_ref68 = {
|
|
3978
4037
|
"tiny-grid__animat": optimizeOpts.animat
|
|
3979
|
-
},
|
|
4038
|
+
}, _ref68[map.filterActive] = filterStore.visible, _ref68["tiny-grid__filter-simple"] = layout2.includes("simple"), _ref68["filter-wrapper-saas"] = $table.isThemeSaas, _ref68)],
|
|
3980
4039
|
"style": filterStore.style
|
|
3981
4040
|
}]), [filterStore.visible ? h2("div", {
|
|
3982
4041
|
"class": ["tiny-grid__filter-body", {
|
|
@@ -4093,7 +4152,7 @@ var Panel$1 = defineComponent({
|
|
|
4093
4152
|
renderExtends: function renderExtends() {
|
|
4094
4153
|
var _this6 = this;
|
|
4095
4154
|
var h2 = this.$createElement;
|
|
4096
|
-
var filterStore = this.filterStore;
|
|
4155
|
+
var filterStore = this.filterStore, condition2 = this.condition;
|
|
4097
4156
|
if (!filterStore.extends) {
|
|
4098
4157
|
return null;
|
|
4099
4158
|
}
|
|
@@ -4101,7 +4160,9 @@ var Panel$1 = defineComponent({
|
|
|
4101
4160
|
"class": "tiny-grid__filter-panel filter-panel__clear"
|
|
4102
4161
|
}, [filterStore.extends.map(function(item) {
|
|
4103
4162
|
return h2("li", {
|
|
4104
|
-
"class": "tiny-grid__filter-option",
|
|
4163
|
+
"class": ["tiny-grid__filter-option", {
|
|
4164
|
+
active: condition2.value === (item.value || item.label)
|
|
4165
|
+
}],
|
|
4105
4166
|
"on": {
|
|
4106
4167
|
"click": function click() {
|
|
4107
4168
|
_this6.filterExtends(item);
|
|
@@ -4142,8 +4203,8 @@ var Panel$1 = defineComponent({
|
|
|
4142
4203
|
"class": "tiny-grid__filter-panel"
|
|
4143
4204
|
}, [isAddbyProgram ? null : h2("li", {
|
|
4144
4205
|
"class": "tiny-grid__filter-option filter-option__radios"
|
|
4145
|
-
}, [inputRelations.map(function(
|
|
4146
|
-
var label =
|
|
4206
|
+
}, [inputRelations.map(function(_ref69) {
|
|
4207
|
+
var label = _ref69.label, value = _ref69.value, method = _ref69.method;
|
|
4147
4208
|
return h2(Radio, {
|
|
4148
4209
|
"attrs": {
|
|
4149
4210
|
"modelValue": condition2.relation,
|
|
@@ -4509,8 +4570,8 @@ var Panel$1 = defineComponent({
|
|
|
4509
4570
|
});
|
|
4510
4571
|
}
|
|
4511
4572
|
});
|
|
4512
|
-
function handleFilterConditionCustom(
|
|
4513
|
-
var column =
|
|
4573
|
+
function handleFilterConditionCustom(_ref70) {
|
|
4574
|
+
var column = _ref70.column, condition2 = _ref70.condition, method = _ref70.method, property = _ref70.property, row2 = _ref70.row;
|
|
4514
4575
|
var ret = {
|
|
4515
4576
|
flag: false,
|
|
4516
4577
|
result: null
|
|
@@ -4525,8 +4586,8 @@ function handleFilterConditionCustom(_ref69) {
|
|
|
4525
4586
|
}
|
|
4526
4587
|
return ret;
|
|
4527
4588
|
}
|
|
4528
|
-
function handleFilterConditionExtend(
|
|
4529
|
-
var column =
|
|
4589
|
+
function handleFilterConditionExtend(_ref71) {
|
|
4590
|
+
var column = _ref71.column, condition2 = _ref71.condition, property = _ref71.property, row2 = _ref71.row;
|
|
4530
4591
|
var ret = {
|
|
4531
4592
|
flag: false,
|
|
4532
4593
|
result: null
|
|
@@ -4559,8 +4620,8 @@ function findRelationMethod(relation, relations) {
|
|
|
4559
4620
|
return method;
|
|
4560
4621
|
}
|
|
4561
4622
|
}
|
|
4562
|
-
function handleFilterRelations(
|
|
4563
|
-
var inputFilter =
|
|
4623
|
+
function handleFilterRelations(_ref72) {
|
|
4624
|
+
var inputFilter = _ref72.inputFilter;
|
|
4564
4625
|
var relations = [];
|
|
4565
4626
|
if (typeof inputFilter === "object" && Array.isArray(inputFilter.relations)) {
|
|
4566
4627
|
relations = inputFilter.relations;
|
|
@@ -4573,8 +4634,8 @@ function modifyValueCheckStr(value) {
|
|
|
4573
4634
|
}
|
|
4574
4635
|
return value;
|
|
4575
4636
|
}
|
|
4576
|
-
function handleDefaultCheckStr(
|
|
4577
|
-
var column =
|
|
4637
|
+
function handleDefaultCheckStr(_ref73) {
|
|
4638
|
+
var column = _ref73.column, input = _ref73.input, relation = _ref73.relation, relationMethod = _ref73.relationMethod, relations = _ref73.relations, result = _ref73.result, row2 = _ref73.row, value = _ref73.value;
|
|
4578
4639
|
if (typeof relationMethod !== "function") {
|
|
4579
4640
|
relationMethod = findRelationMethod(relation, relations);
|
|
4580
4641
|
}
|
|
@@ -4591,8 +4652,8 @@ function handleDefaultCheckStr(_ref72) {
|
|
|
4591
4652
|
result
|
|
4592
4653
|
};
|
|
4593
4654
|
}
|
|
4594
|
-
function handleFilterCheckStr(
|
|
4595
|
-
var column =
|
|
4655
|
+
function handleFilterCheckStr(_ref74) {
|
|
4656
|
+
var column = _ref74.column, relationMethod = _ref74.relationMethod, relations = _ref74.relations, row2 = _ref74.row;
|
|
4596
4657
|
return function(value, input, relation, dateList) {
|
|
4597
4658
|
var result = false;
|
|
4598
4659
|
value = modifyValueCheckStr(value);
|
|
@@ -4645,8 +4706,8 @@ function handleFilterCheckStr(_ref73) {
|
|
|
4645
4706
|
return result;
|
|
4646
4707
|
};
|
|
4647
4708
|
}
|
|
4648
|
-
function handleFilterCheck(
|
|
4649
|
-
var checkStr =
|
|
4709
|
+
function handleFilterCheck(_ref75) {
|
|
4710
|
+
var checkStr = _ref75.checkStr, empty = _ref75.empty, input = _ref75.input, property = _ref75.property, relation = _ref75.relation, row2 = _ref75.row, valueList = _ref75.valueList, dateList = _ref75.dateList;
|
|
4650
4711
|
return function() {
|
|
4651
4712
|
var value = get(row2, property);
|
|
4652
4713
|
if (empty === true) {
|
|
@@ -4818,8 +4879,8 @@ var Methods$f = {
|
|
|
4818
4879
|
});
|
|
4819
4880
|
return check();
|
|
4820
4881
|
},
|
|
4821
|
-
getOptions: function getOptions(
|
|
4822
|
-
var property =
|
|
4882
|
+
getOptions: function getOptions(_ref76) {
|
|
4883
|
+
var property = _ref76.property, filter2 = _ref76.filter;
|
|
4823
4884
|
var values = filter2.values, _filter$value = filter2.value, value = _filter$value === void 0 ? "value" : _filter$value, _filter$label = filter2.label, label = _filter$label === void 0 ? "label" : _filter$label, dataset = filter2.dataset;
|
|
4824
4885
|
if (typeof values === "function") {
|
|
4825
4886
|
return values({
|
|
@@ -4885,8 +4946,8 @@ var Methods$f = {
|
|
|
4885
4946
|
args: params
|
|
4886
4947
|
}, filter2, {
|
|
4887
4948
|
defaultFilter: isBoolean(filter2.defaultFilter) ? filter2.defaultFilter : true,
|
|
4888
|
-
options: options.map(function(
|
|
4889
|
-
var value =
|
|
4949
|
+
options: options.map(function(_ref77) {
|
|
4950
|
+
var value = _ref77.value, label = _ref77.label;
|
|
4890
4951
|
return {
|
|
4891
4952
|
value,
|
|
4892
4953
|
label,
|
|
@@ -5064,8 +5125,8 @@ var Children = defineComponent({
|
|
|
5064
5125
|
}
|
|
5065
5126
|
}
|
|
5066
5127
|
});
|
|
5067
|
-
var onMenuItem = function onMenuItem2(
|
|
5068
|
-
var tableInstance =
|
|
5128
|
+
var onMenuItem = function onMenuItem2(_ref78) {
|
|
5129
|
+
var tableInstance = _ref78.tableInstance, item = _ref78.item, getEventTargetNode2 = _ref78.getEventTargetNode, toKebab2 = _ref78.toKebab;
|
|
5069
5130
|
return {
|
|
5070
5131
|
click: function click(event) {
|
|
5071
5132
|
tableInstance.ctxMenuLinkEvent(event, item);
|
|
@@ -5120,8 +5181,8 @@ function createMenuItem(args) {
|
|
|
5120
5181
|
}
|
|
5121
5182
|
return res;
|
|
5122
5183
|
}
|
|
5123
|
-
function getMenuItemCreator(
|
|
5124
|
-
var ctxMenuStore =
|
|
5184
|
+
function getMenuItemCreator(_ref79) {
|
|
5185
|
+
var ctxMenuStore = _ref79.ctxMenuStore, getEventTargetNode2 = _ref79.getEventTargetNode, tableInstance = _ref79.tableInstance, toKebab2 = _ref79.toKebab;
|
|
5125
5186
|
return function(options, gIndex) {
|
|
5126
5187
|
return h("ul", {
|
|
5127
5188
|
class: "tiny-grid-menu__option-wrapper",
|
|
@@ -5190,9 +5251,9 @@ var Methods$e = {
|
|
|
5190
5251
|
return this.$nextTick();
|
|
5191
5252
|
},
|
|
5192
5253
|
// 处理菜单的移动
|
|
5193
|
-
moveCtxMenu: function moveCtxMenu(
|
|
5254
|
+
moveCtxMenu: function moveCtxMenu(_ref80) {
|
|
5194
5255
|
var _this0 = this;
|
|
5195
|
-
var event =
|
|
5256
|
+
var event = _ref80.event, keyCode = _ref80.keyCode, ctxMenuStore = _ref80.ctxMenuStore, property = _ref80.property, operKey = _ref80.operKey, operRest = _ref80.operRest, menuList = _ref80.menuList;
|
|
5196
5257
|
var selectIndex = findIndexOf(menuList, function(item) {
|
|
5197
5258
|
return ctxMenuStore[property] === item;
|
|
5198
5259
|
});
|
|
@@ -5433,16 +5494,16 @@ var Loading = defineComponent({
|
|
|
5433
5494
|
}
|
|
5434
5495
|
});
|
|
5435
5496
|
$install(Loading);
|
|
5436
|
-
function handleActivedCheckCell(
|
|
5437
|
-
var actived =
|
|
5497
|
+
function handleActivedCheckCell(_ref81) {
|
|
5498
|
+
var actived = _ref81.actived, column = _ref81.column, editConfig = _ref81.editConfig, row2 = _ref81.row;
|
|
5438
5499
|
return actived.row !== row2 || (editConfig.mode === "cell" ? actived.column !== column : false);
|
|
5439
5500
|
}
|
|
5440
|
-
function handleActivedCanActive(
|
|
5441
|
-
var editConfig =
|
|
5501
|
+
function handleActivedCanActive(_ref82) {
|
|
5502
|
+
var editConfig = _ref82.editConfig, params = _ref82.params;
|
|
5442
5503
|
return !(editConfig != null && editConfig.activeMethod) || editConfig.activeMethod(params);
|
|
5443
5504
|
}
|
|
5444
|
-
function handleActivedDoActive(
|
|
5445
|
-
var _vm =
|
|
5505
|
+
function handleActivedDoActive(_ref83) {
|
|
5506
|
+
var _vm = _ref83._vm, actived = _ref83.actived, canActive = _ref83.canActive, cell = _ref83.cell, column = _ref83.column, editConfig = _ref83.editConfig, event = _ref83.event, params = _ref83.params, row2 = _ref83.row, tableColumn2 = _ref83.tableColumn, type = _ref83.type;
|
|
5446
5507
|
if (canActive) {
|
|
5447
5508
|
if (_vm.keyboardConfig || _vm.mouseConfig) {
|
|
5448
5509
|
_vm.clearCopyed(event);
|
|
@@ -5469,14 +5530,14 @@ function handleActivedDoActive(_ref82) {
|
|
|
5469
5530
|
}
|
|
5470
5531
|
return type;
|
|
5471
5532
|
}
|
|
5472
|
-
function handleActivedClearActive(
|
|
5473
|
-
var _vm =
|
|
5533
|
+
function handleActivedClearActive(_ref84) {
|
|
5534
|
+
var _vm = _ref84._vm, canActive = _ref84.canActive, event = _ref84.event;
|
|
5474
5535
|
if (!canActive) {
|
|
5475
5536
|
_vm.clearActived(event);
|
|
5476
5537
|
}
|
|
5477
5538
|
}
|
|
5478
|
-
function handleActivedTryActive(
|
|
5479
|
-
var _vm =
|
|
5539
|
+
function handleActivedTryActive(_ref85) {
|
|
5540
|
+
var _vm = _ref85._vm, actived = _ref85.actived, cell = _ref85.cell, column = _ref85.column, editor = _ref85.editor, event = _ref85.event, isActiveCell = _ref85.isActiveCell, params = _ref85.params, row2 = _ref85.row;
|
|
5480
5541
|
if (editor && cell && !isActiveCell) {
|
|
5481
5542
|
var oldColumn = actived.column;
|
|
5482
5543
|
if (oldColumn !== column) {
|
|
@@ -5498,8 +5559,8 @@ var insertedField = GlobalConfig$1.constant.insertedField;
|
|
|
5498
5559
|
var getCellRender = function getCellRender2(isTreeNode, treeCellRender, treeRender, context) {
|
|
5499
5560
|
return context[isTreeNode ? treeCellRender : treeRender];
|
|
5500
5561
|
};
|
|
5501
|
-
function processRenderer(
|
|
5502
|
-
var h2 =
|
|
5562
|
+
function processRenderer(_ref86) {
|
|
5563
|
+
var h2 = _ref86.h, params = _ref86.params, renderer = _ref86.renderer, value = _ref86.value;
|
|
5503
5564
|
var result = {
|
|
5504
5565
|
flag: false,
|
|
5505
5566
|
vnodes: null
|
|
@@ -5524,13 +5585,13 @@ function processRenderer(_ref85) {
|
|
|
5524
5585
|
}
|
|
5525
5586
|
return result;
|
|
5526
5587
|
}
|
|
5527
|
-
function processAsyncColumn(
|
|
5528
|
-
var $table =
|
|
5588
|
+
function processAsyncColumn(_ref87) {
|
|
5589
|
+
var $table = _ref87.$table, column = _ref87.column, format = _ref87.format, h2 = _ref87.h, params = _ref87.params, row2 = _ref87.row;
|
|
5529
5590
|
var result = {
|
|
5530
5591
|
flag: false,
|
|
5531
5592
|
vnodes: null
|
|
5532
5593
|
};
|
|
5533
|
-
var
|
|
5594
|
+
var _ref88 = format.async || {}, fetch = _ref88.fetch, loadingText = _ref88.loadingText;
|
|
5534
5595
|
if ($table.isAsyncColumn && row2[insertedField] !== true && typeof fetch === "function") {
|
|
5535
5596
|
var cellText = row2[$table.getAsyncColumnName(column.property)];
|
|
5536
5597
|
var loadingRender = loadingText || "loading ...";
|
|
@@ -5544,8 +5605,8 @@ function processAsyncColumn(_ref86) {
|
|
|
5544
5605
|
}
|
|
5545
5606
|
return result;
|
|
5546
5607
|
}
|
|
5547
|
-
function getColumnRuleTypeIndex(
|
|
5548
|
-
var _vm =
|
|
5608
|
+
function getColumnRuleTypeIndex(_ref89) {
|
|
5609
|
+
var _vm = _ref89._vm, isTreeNode = _ref89.isTreeNode, renMaps = _ref89.renMaps, type = _ref89.type;
|
|
5549
5610
|
return {
|
|
5550
5611
|
match: function match() {
|
|
5551
5612
|
return type === "index";
|
|
@@ -5556,8 +5617,8 @@ function getColumnRuleTypeIndex(_ref88) {
|
|
|
5556
5617
|
}
|
|
5557
5618
|
};
|
|
5558
5619
|
}
|
|
5559
|
-
function getColumnRuleTypeRadio(
|
|
5560
|
-
var _vm =
|
|
5620
|
+
function getColumnRuleTypeRadio(_ref90) {
|
|
5621
|
+
var _vm = _ref90._vm, isTreeNode = _ref90.isTreeNode, renMaps = _ref90.renMaps, type = _ref90.type;
|
|
5561
5622
|
return {
|
|
5562
5623
|
match: function match() {
|
|
5563
5624
|
return type === "radio";
|
|
@@ -5568,8 +5629,8 @@ function getColumnRuleTypeRadio(_ref89) {
|
|
|
5568
5629
|
}
|
|
5569
5630
|
};
|
|
5570
5631
|
}
|
|
5571
|
-
function getColumnRuleTypeSelection(
|
|
5572
|
-
var _vm =
|
|
5632
|
+
function getColumnRuleTypeSelection(_ref91) {
|
|
5633
|
+
var _vm = _ref91._vm, isTreeNode = _ref91.isTreeNode, renMaps = _ref91.renMaps, selectConfig = _ref91.selectConfig, type = _ref91.type;
|
|
5573
5634
|
return {
|
|
5574
5635
|
match: function match() {
|
|
5575
5636
|
return type === "selection";
|
|
@@ -5583,8 +5644,8 @@ function getColumnRuleTypeSelection(_ref90) {
|
|
|
5583
5644
|
}
|
|
5584
5645
|
};
|
|
5585
5646
|
}
|
|
5586
|
-
function getColumnRuleTypeExpand(
|
|
5587
|
-
var _vm =
|
|
5647
|
+
function getColumnRuleTypeExpand(_ref92) {
|
|
5648
|
+
var _vm = _ref92._vm, renMaps = _ref92.renMaps, type = _ref92.type;
|
|
5588
5649
|
return {
|
|
5589
5650
|
match: function match() {
|
|
5590
5651
|
return type === "expand";
|
|
@@ -5595,8 +5656,8 @@ function getColumnRuleTypeExpand(_ref91) {
|
|
|
5595
5656
|
}
|
|
5596
5657
|
};
|
|
5597
5658
|
}
|
|
5598
|
-
function getColumnRuleTypeOperation(
|
|
5599
|
-
var _vm =
|
|
5659
|
+
function getColumnRuleTypeOperation(_ref93) {
|
|
5660
|
+
var _vm = _ref93._vm, renMaps = _ref93.renMaps, type = _ref93.type;
|
|
5600
5661
|
return {
|
|
5601
5662
|
match: function match() {
|
|
5602
5663
|
return type === "operation";
|
|
@@ -5606,8 +5667,8 @@ function getColumnRuleTypeOperation(_ref92) {
|
|
|
5606
5667
|
}
|
|
5607
5668
|
};
|
|
5608
5669
|
}
|
|
5609
|
-
function getColumnRuleTypeOther(
|
|
5610
|
-
var $table =
|
|
5670
|
+
function getColumnRuleTypeOther(_ref94) {
|
|
5671
|
+
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;
|
|
5611
5672
|
return {
|
|
5612
5673
|
match: function match() {
|
|
5613
5674
|
return !~["index", "radio", "selection", "expand", "operation"].indexOf(type);
|
|
@@ -5726,7 +5787,9 @@ var Cell = {
|
|
|
5726
5787
|
}
|
|
5727
5788
|
}
|
|
5728
5789
|
if (typeof title === "function") {
|
|
5729
|
-
return [
|
|
5790
|
+
return [h2("div", {
|
|
5791
|
+
class: "tiny-grid-cell-text"
|
|
5792
|
+
}, [title(h2, params)])];
|
|
5730
5793
|
}
|
|
5731
5794
|
if (type === "card") {
|
|
5732
5795
|
return [formatText(getFuncText(own.title), 1)];
|
|
@@ -5774,7 +5837,7 @@ var Cell = {
|
|
|
5774
5837
|
},
|
|
5775
5838
|
// 树节点
|
|
5776
5839
|
renderTreeIcon: function renderTreeIcon(h2, params) {
|
|
5777
|
-
var
|
|
5840
|
+
var _ref96, _$table$$grid, _$table$$grid$designC, _$table$$grid$designC2, _ref97;
|
|
5778
5841
|
var $table = params.$table, level = params.level, row2 = params.row;
|
|
5779
5842
|
var treeConfig = $table.treeConfig, treeExpandeds = $table.treeExpandeds;
|
|
5780
5843
|
var children = treeConfig.children, indent = treeConfig.indent, renderIcon = treeConfig.renderIcon, trigger = treeConfig.trigger, bubbling = treeConfig.bubbling;
|
|
@@ -5789,13 +5852,13 @@ var Cell = {
|
|
|
5789
5852
|
}
|
|
5790
5853
|
};
|
|
5791
5854
|
var icon = GlobalConfig$1.icon;
|
|
5792
|
-
var defaultIcon = function defaultIcon2(h22,
|
|
5793
|
-
var active =
|
|
5855
|
+
var defaultIcon = function defaultIcon2(h22, _ref95) {
|
|
5856
|
+
var active = _ref95.active;
|
|
5794
5857
|
var IconExpand = iconExpand();
|
|
5795
5858
|
var IconPutAway = iconPutAway();
|
|
5796
5859
|
return active ? h22(IconExpand) : h22(IconPutAway);
|
|
5797
5860
|
};
|
|
5798
|
-
var customExpandIcon = (
|
|
5861
|
+
var customExpandIcon = (_ref96 = renderIcon || ((_$table$$grid = $table.$grid) == null ? void 0 : (_$table$$grid$designC = _$table$$grid.designConfig) == null ? void 0 : (_$table$$grid$designC2 = _$table$$grid$designC.treeConfig) == null ? void 0 : _$table$$grid$designC2.renderIcon)) != null ? _ref96 : defaultIcon;
|
|
5799
5862
|
if (trigger && trigger !== "default") {
|
|
5800
5863
|
listeners = {};
|
|
5801
5864
|
}
|
|
@@ -5818,7 +5881,7 @@ var Cell = {
|
|
|
5818
5881
|
width: level * (indent || 16) + "px"
|
|
5819
5882
|
}
|
|
5820
5883
|
}), h2("span", {
|
|
5821
|
-
class: ["tiny-grid-tree-wrapper", (
|
|
5884
|
+
class: ["tiny-grid-tree-wrapper", (_ref97 = {}, _ref97[map.isActive] = isActive, _ref97)],
|
|
5822
5885
|
on: listeners
|
|
5823
5886
|
}, iconVNode)];
|
|
5824
5887
|
},
|
|
@@ -5840,7 +5903,7 @@ var Cell = {
|
|
|
5840
5903
|
var $table = params.$table, column = params.column, row2 = params.row, seq = params.seq; params.level;
|
|
5841
5904
|
var startIndex = $table.startIndex, treeConfig = $table.treeConfig, treeOrdered = $table.treeOrdered;
|
|
5842
5905
|
var indexMethod = column.indexMethod, slots = column.slots;
|
|
5843
|
-
var
|
|
5906
|
+
var _ref98 = treeConfig || {}, _ref98$temporaryIndex = _ref98.temporaryIndex, temporaryIndex = _ref98$temporaryIndex === void 0 ? "_$index_" : _ref98$temporaryIndex;
|
|
5844
5907
|
var isTreeOrderedFalse = treeConfig && !treeOrdered;
|
|
5845
5908
|
var indexValue = startIndex + seq;
|
|
5846
5909
|
if (isTreeOrderedFalse) {
|
|
@@ -5861,7 +5924,7 @@ var Cell = {
|
|
|
5861
5924
|
return [formatText(value, 1)];
|
|
5862
5925
|
},
|
|
5863
5926
|
renderRadioCell: function renderRadioCell(h2, params) {
|
|
5864
|
-
var
|
|
5927
|
+
var _ref99;
|
|
5865
5928
|
var $table = params.$table, slots = params.column.slots, row2 = params.row;
|
|
5866
5929
|
var _$table$radioConfig2 = $table.radioConfig, radioConfig = _$table$radioConfig2 === void 0 ? {} : _$table$radioConfig2, selectRow = $table.selectRow, vSize3 = $table.vSize;
|
|
5867
5930
|
var labelField = radioConfig.labelField, checkMethod = radioConfig.checkMethod;
|
|
@@ -5886,7 +5949,7 @@ var Cell = {
|
|
|
5886
5949
|
}
|
|
5887
5950
|
};
|
|
5888
5951
|
return [h2("label", {
|
|
5889
|
-
class: ["tiny-grid-radio", (
|
|
5952
|
+
class: ["tiny-grid-radio", (_ref99 = {}, _ref99["size__" + vSize3] = vSize3, _ref99["is__disabled"] = disabled, _ref99)]
|
|
5890
5953
|
}, [h2("input", options), h2("span", {
|
|
5891
5954
|
class: "tiny-grid-radio__icon"
|
|
5892
5955
|
}, [h2(iconRadio(), {
|
|
@@ -5901,7 +5964,7 @@ var Cell = {
|
|
|
5901
5964
|
return Cell.renderTreeIcon(h2, params).concat(Cell.renderRadioCell(h2, params));
|
|
5902
5965
|
},
|
|
5903
5966
|
renderSelectionHeader: function renderSelectionHeader(h2, params) {
|
|
5904
|
-
var
|
|
5967
|
+
var _ref100;
|
|
5905
5968
|
var $table = params.$table, column = params.column;
|
|
5906
5969
|
var slots = column.slots, own = column.own;
|
|
5907
5970
|
var headerCheckDisabled = $table.headerCheckDisabled, isAllSelected = $table.isAllSelected, isIndeterminate = $table.isIndeterminate, selectConfig = $table.selectConfig, vSize3 = $table.vSize;
|
|
@@ -5928,7 +5991,7 @@ var Cell = {
|
|
|
5928
5991
|
}
|
|
5929
5992
|
};
|
|
5930
5993
|
var vnode = h2("label", {
|
|
5931
|
-
class: ["tiny-grid-checkbox tiny-select-header", (
|
|
5994
|
+
class: ["tiny-grid-checkbox tiny-select-header", (_ref100 = {}, _ref100["size__" + vSize3] = vSize3, _ref100["is__disabled"] = headerCheckDisabled, _ref100["is__indeterminate"] = isIndeterminate, _ref100)],
|
|
5932
5995
|
key: random()
|
|
5933
5996
|
}, [h2("input", options), h2("span", {
|
|
5934
5997
|
class: "tiny-grid-checkbox__icon"
|
|
@@ -5950,12 +6013,12 @@ var Cell = {
|
|
|
5950
6013
|
return [vnode, dropdownVnode];
|
|
5951
6014
|
},
|
|
5952
6015
|
renderSelectionCell: function renderSelectionCell(h2, params) {
|
|
5953
|
-
var
|
|
6016
|
+
var _ref102;
|
|
5954
6017
|
var $table = params.$table, column = params.column, row2 = params.row;
|
|
5955
6018
|
var slots = column.slots;
|
|
5956
6019
|
var _$table$selectConfig2 = $table.selectConfig, selectConfig = _$table$selectConfig2 === void 0 ? {} : _$table$selectConfig2, treeConfig = $table.treeConfig, treeIndeterminates = $table.treeIndeterminates, vSize3 = $table.vSize;
|
|
5957
6020
|
var labelField = selectConfig.labelField, checkMethod = selectConfig.checkMethod;
|
|
5958
|
-
var
|
|
6021
|
+
var _ref101 = {}, _ref101$indeterminate = _ref101.indeterminate, indeterminate = _ref101$indeterminate === void 0 ? false : _ref101$indeterminate, _ref101$isDisabled = _ref101.isDisabled, isDisabled = _ref101$isDisabled === void 0 ? !!checkMethod : _ref101$isDisabled;
|
|
5959
6022
|
var options = {
|
|
5960
6023
|
attrs: {
|
|
5961
6024
|
type: "checkbox"
|
|
@@ -5970,7 +6033,7 @@ var Cell = {
|
|
|
5970
6033
|
checked: ~$table.selection.indexOf(row2)
|
|
5971
6034
|
};
|
|
5972
6035
|
var twcls = params.twcls;
|
|
5973
|
-
var labelCls = ["tiny-grid-checkbox tiny-select-cell", (
|
|
6036
|
+
var labelCls = ["tiny-grid-checkbox tiny-select-cell", (_ref102 = {}, _ref102["size__" + vSize3] = vSize3, _ref102["is__indeterminate"] = indeterminate, _ref102["is__disabled"] = isDisabled, _ref102)];
|
|
5974
6037
|
var inputCls = null;
|
|
5975
6038
|
var spanCls = "tiny-grid-checkbox__icon";
|
|
5976
6039
|
var svgCls = "tiny-svg-size icon-checked-sur";
|
|
@@ -6016,12 +6079,12 @@ var Cell = {
|
|
|
6016
6079
|
},
|
|
6017
6080
|
// TODO: 与renderSelectionCell代码方法高度相似,待提取公共逻辑。
|
|
6018
6081
|
renderSelectionCellByProp: function renderSelectionCellByProp(h2, params) {
|
|
6019
|
-
var
|
|
6082
|
+
var _ref104;
|
|
6020
6083
|
var $table = params.$table, column = params.column, row2 = params.row;
|
|
6021
6084
|
var slots = column.slots;
|
|
6022
6085
|
var _$table$selectConfig3 = $table.selectConfig, selectConfig = _$table$selectConfig3 === void 0 ? {} : _$table$selectConfig3, treeConfig = $table.treeConfig, treeIndeterminates = $table.treeIndeterminates, vSize3 = $table.vSize;
|
|
6023
6086
|
var property = selectConfig.checkField, checkMethod = selectConfig.checkMethod, labelField = selectConfig.labelField;
|
|
6024
|
-
var
|
|
6087
|
+
var _ref103 = {}, _ref103$indeterminate = _ref103.indeterminate, indeterminate = _ref103$indeterminate === void 0 ? false : _ref103$indeterminate, _ref103$isDisabled = _ref103.isDisabled, isDisabled = _ref103$isDisabled === void 0 ? !!checkMethod : _ref103$isDisabled;
|
|
6025
6088
|
var options = {
|
|
6026
6089
|
attrs: {
|
|
6027
6090
|
type: "checkbox"
|
|
@@ -6042,7 +6105,7 @@ var Cell = {
|
|
|
6042
6105
|
};
|
|
6043
6106
|
var vnode = h2("label", {
|
|
6044
6107
|
key: random(),
|
|
6045
|
-
class: ["tiny-grid-checkbox", (
|
|
6108
|
+
class: ["tiny-grid-checkbox", (_ref104 = {}, _ref104["size__" + vSize3] = vSize3, _ref104["is__indeterminate"] = indeterminate, _ref104["is__disabled"] = isDisabled, _ref104)]
|
|
6046
6109
|
}, [h2("input", options), h2("span", {
|
|
6047
6110
|
class: "tiny-grid-checkbox__icon"
|
|
6048
6111
|
}, [h2(iconCheck(), {
|
|
@@ -6061,7 +6124,7 @@ var Cell = {
|
|
|
6061
6124
|
},
|
|
6062
6125
|
// 展开行
|
|
6063
6126
|
renderExpandCell: function renderExpandCell(h2, params) {
|
|
6064
|
-
var _column$slots,
|
|
6127
|
+
var _column$slots, _ref105;
|
|
6065
6128
|
var $table = params.$table, row2 = params.row, column = params.column;
|
|
6066
6129
|
var _$table$expandConfig3 = $table.expandConfig, expandConfig = _$table$expandConfig3 === void 0 ? {} : _$table$expandConfig3;
|
|
6067
6130
|
var _expandConfig$showIco = expandConfig.showIcon, showIcon = _expandConfig$showIco === void 0 ? true : _expandConfig$showIco, expandMethod = expandConfig.activeMethod;
|
|
@@ -6076,7 +6139,7 @@ var Cell = {
|
|
|
6076
6139
|
expandActive: "expand__active"
|
|
6077
6140
|
};
|
|
6078
6141
|
return [h2("span", {
|
|
6079
|
-
class: ["tiny-grid__expanded", (
|
|
6142
|
+
class: ["tiny-grid__expanded", (_ref105 = {}, _ref105[map.expandActive] = expandActive, _ref105)],
|
|
6080
6143
|
on: {
|
|
6081
6144
|
click: function click(event) {
|
|
6082
6145
|
if (!hideExpand) {
|
|
@@ -6146,7 +6209,7 @@ var Cell = {
|
|
|
6146
6209
|
return Cell.renderHeader(h2, params).concat(Cell.renderFilterIcon(h2, params, suffixCls[1]));
|
|
6147
6210
|
},
|
|
6148
6211
|
renderFilterIcon: function renderFilterIcon(h2, params, cls) {
|
|
6149
|
-
var
|
|
6212
|
+
var _ref106, _ref107;
|
|
6150
6213
|
if (cls === void 0) {
|
|
6151
6214
|
cls = "";
|
|
6152
6215
|
}
|
|
@@ -6158,9 +6221,9 @@ var Cell = {
|
|
|
6158
6221
|
hasFilter: "has__Filter"
|
|
6159
6222
|
};
|
|
6160
6223
|
return [h2("span", {
|
|
6161
|
-
class: ["tiny-grid-filter-wrapper " + cls, (
|
|
6224
|
+
class: ["tiny-grid-filter-wrapper " + cls, (_ref106 = {}, _ref106[map.isActive] = filterStore.visible && filterStore.column === column, _ref106)]
|
|
6162
6225
|
}, [h2(icon.filter, {
|
|
6163
|
-
class: ["tiny-svg-size tiny-grid-filter__btn " + column.id, (
|
|
6226
|
+
class: ["tiny-svg-size tiny-grid-filter__btn " + column.id, (_ref107 = {}, _ref107[map.hasFilter] = column.filter && column.filter.hasFilter, _ref107)],
|
|
6164
6227
|
on: {
|
|
6165
6228
|
click: function click(event) {
|
|
6166
6229
|
$table.triggerFilterEvent(event, params.column, params);
|
|
@@ -6317,8 +6380,8 @@ var Cell = {
|
|
|
6317
6380
|
};
|
|
6318
6381
|
var handleItemClick = function handleItemClick2(itemData) {
|
|
6319
6382
|
var realName = (itemData == null ? void 0 : itemData.name) || itemData;
|
|
6320
|
-
var buttonConfig = visibleButtons.find(function(
|
|
6321
|
-
var buttonName =
|
|
6383
|
+
var buttonConfig = visibleButtons.find(function(_ref108) {
|
|
6384
|
+
var buttonName = _ref108.name;
|
|
6322
6385
|
return buttonName === realName;
|
|
6323
6386
|
});
|
|
6324
6387
|
buttonConfig.click(window.event || {}, _extends({
|
|
@@ -6372,8 +6435,10 @@ var Cell = {
|
|
|
6372
6435
|
return renderBig(buttonConfig, viewClass);
|
|
6373
6436
|
});
|
|
6374
6437
|
}
|
|
6438
|
+
var rowKey = row2[getRowkey($table)];
|
|
6375
6439
|
return [h2("span", {
|
|
6376
6440
|
class: "tiny-grid__oper-col-wrapper",
|
|
6441
|
+
key: rowKey,
|
|
6377
6442
|
attrs: {
|
|
6378
6443
|
"data-tag": "operation-cell-buttons"
|
|
6379
6444
|
}
|
|
@@ -6420,40 +6485,40 @@ function isTargetRadioOrCheckbox(event, column, colType, targetType) {
|
|
|
6420
6485
|
var target = event.target;
|
|
6421
6486
|
return target && column.type === colType && target.tagName.toLowerCase() === "input" && target.type === (targetType || colType);
|
|
6422
6487
|
}
|
|
6423
|
-
function onClickExpandColumn(
|
|
6424
|
-
var $el =
|
|
6488
|
+
function onClickExpandColumn(_ref109) {
|
|
6489
|
+
var $el = _ref109.$el, _vm = _ref109._vm, column = _ref109.column, event = _ref109.event, expandConfig = _ref109.expandConfig, params = _ref109.params;
|
|
6425
6490
|
if ((expandConfig.trigger === "row" || column.type === "expand" && expandConfig.trigger === "cell") && !_vm.getEventTargetNode(event, $el, "tiny-grid__expanded").flag) {
|
|
6426
6491
|
_vm.triggerRowExpandEvent(event, params);
|
|
6427
6492
|
}
|
|
6428
6493
|
}
|
|
6429
|
-
function onClickTreeNodeColumn(
|
|
6430
|
-
var _vm =
|
|
6494
|
+
function onClickTreeNodeColumn(_ref110) {
|
|
6495
|
+
var _vm = _ref110._vm, column = _ref110.column, event = _ref110.event, params = _ref110.params, treeConfig = _ref110.treeConfig;
|
|
6431
6496
|
if (treeConfig.trigger === "row" || column.treeNode && treeConfig.trigger === "cell") {
|
|
6432
6497
|
_vm.triggerTreeExpandEvent(event, params);
|
|
6433
6498
|
}
|
|
6434
6499
|
}
|
|
6435
|
-
function onHighlightCurrentRow(
|
|
6436
|
-
var $el =
|
|
6500
|
+
function onHighlightCurrentRow(_ref111) {
|
|
6501
|
+
var $el = _ref111.$el, _vm = _ref111._vm, event = _ref111.event, highlightCurrentRow = _ref111.highlightCurrentRow, params = _ref111.params, radioConfig = _ref111.radioConfig;
|
|
6437
6502
|
if (highlightCurrentRow) {
|
|
6438
6503
|
if (radioConfig.trigger === "row" || !_vm.getEventTargetNode(event, $el, "tiny-grid-checkbox").flag && !_vm.getEventTargetNode(event, $el, "tiny-grid-radio").flag) {
|
|
6439
6504
|
_vm.triggerCurrentRowEvent(event, params);
|
|
6440
6505
|
}
|
|
6441
6506
|
}
|
|
6442
6507
|
}
|
|
6443
|
-
function onClickRadioColumn(
|
|
6444
|
-
var $el =
|
|
6508
|
+
function onClickRadioColumn(_ref112) {
|
|
6509
|
+
var $el = _ref112.$el, _vm = _ref112._vm, column = _ref112.column, event = _ref112.event, params = _ref112.params, radioConfig = _ref112.radioConfig;
|
|
6445
6510
|
if ((radioConfig.trigger === "row" || column.type === "radio" && radioConfig.trigger === "cell") && !_vm.getEventTargetNode(event, $el, "tiny-grid-radio").flag) {
|
|
6446
6511
|
_vm.triggerRadioRowEvent(event, params);
|
|
6447
6512
|
}
|
|
6448
6513
|
}
|
|
6449
|
-
function onClickSelectColumn(
|
|
6450
|
-
var _vm =
|
|
6514
|
+
function onClickSelectColumn(_ref113) {
|
|
6515
|
+
var _vm = _ref113._vm, column = _ref113.column, event = _ref113.event, params = _ref113.params, selectConfig = _ref113.selectConfig;
|
|
6451
6516
|
if ((selectConfig.trigger === "row" || column.type === "selection" && selectConfig.trigger === "cell") && !_vm.getEventTargetNode(event, params.cell, "tiny-grid-checkbox").flag) {
|
|
6452
6517
|
_vm.handleToggleCheckRowEvent(params, event);
|
|
6453
6518
|
}
|
|
6454
6519
|
}
|
|
6455
|
-
function onClickCellSelect(
|
|
6456
|
-
var _vm =
|
|
6520
|
+
function onClickCellSelect(_ref114) {
|
|
6521
|
+
var _vm = _ref114._vm, actived = _ref114.actived, cell = _ref114.cell, column = _ref114.column, editConfig = _ref114.editConfig, event = _ref114.event, mouseConfig = _ref114.mouseConfig, params = _ref114.params, row2 = _ref114.row;
|
|
6457
6522
|
if (!mouseConfig.checked && editConfig) {
|
|
6458
6523
|
if (editConfig.trigger === "manual") {
|
|
6459
6524
|
if (actived.args && actived.row === row2 && column !== actived.column) {
|
|
@@ -6472,8 +6537,8 @@ function onClickCellSelect(_ref113) {
|
|
|
6472
6537
|
}
|
|
6473
6538
|
}
|
|
6474
6539
|
}
|
|
6475
|
-
function onGroupHeader(
|
|
6476
|
-
var _vm =
|
|
6540
|
+
function onGroupHeader(_ref115) {
|
|
6541
|
+
var _vm = _ref115._vm, isGroup2 = _ref115.isGroup, headerProps2 = _ref115.headerProps;
|
|
6477
6542
|
if (isGroup2) {
|
|
6478
6543
|
eachTree(_vm.collectColumn, function(column) {
|
|
6479
6544
|
if (column.children && column.children.length) {
|
|
@@ -6484,14 +6549,14 @@ function onGroupHeader(_ref114) {
|
|
|
6484
6549
|
}, headerProps2);
|
|
6485
6550
|
}
|
|
6486
6551
|
}
|
|
6487
|
-
function reassignNotFixed(
|
|
6488
|
-
var centerList =
|
|
6552
|
+
function reassignNotFixed(_ref116) {
|
|
6553
|
+
var centerList = _ref116.centerList, column = _ref116.column;
|
|
6489
6554
|
if (!column.fixed) {
|
|
6490
6555
|
centerList.push(column);
|
|
6491
6556
|
}
|
|
6492
6557
|
}
|
|
6493
|
-
function reassignFixedRight(
|
|
6494
|
-
var column =
|
|
6558
|
+
function reassignFixedRight(_ref117) {
|
|
6559
|
+
var column = _ref117.column, columnIndex = _ref117.columnIndex, isColspan = _ref117.isColspan, rightEndIndex = _ref117.rightEndIndex, rightList = _ref117.rightList;
|
|
6495
6560
|
if (column.fixed === "right") {
|
|
6496
6561
|
if (!isColspan) {
|
|
6497
6562
|
if (rightEndIndex === null) {
|
|
@@ -6510,8 +6575,8 @@ function reassignFixedRight(_ref116) {
|
|
|
6510
6575
|
rightEndIndex
|
|
6511
6576
|
};
|
|
6512
6577
|
}
|
|
6513
|
-
function reassignFixedLeft(
|
|
6514
|
-
var column =
|
|
6578
|
+
function reassignFixedLeft(_ref118) {
|
|
6579
|
+
var column = _ref118.column, columnIndex = _ref118.columnIndex, isColspan = _ref118.isColspan, leftList = _ref118.leftList, leftStartIndex = _ref118.leftStartIndex, letIndex = _ref118.letIndex;
|
|
6515
6580
|
if (column.fixed === "left") {
|
|
6516
6581
|
if (leftStartIndex === null) {
|
|
6517
6582
|
leftStartIndex = letIndex;
|
|
@@ -6531,14 +6596,14 @@ function reassignFixedLeft(_ref117) {
|
|
|
6531
6596
|
isColspan
|
|
6532
6597
|
};
|
|
6533
6598
|
}
|
|
6534
|
-
function showGroupFixedError(
|
|
6535
|
-
var isColspan =
|
|
6599
|
+
function showGroupFixedError(_ref119) {
|
|
6600
|
+
var isColspan = _ref119.isColspan, isGroup2 = _ref119.isGroup, leftStartIndex = _ref119.leftStartIndex, rightEndIndex = _ref119.rightEndIndex, visibleColumn = _ref119.visibleColumn;
|
|
6536
6601
|
if (isGroup2 && (isColspan || leftStartIndex || rightEndIndex !== null && rightEndIndex !== visibleColumn.length)) {
|
|
6537
6602
|
error("ui.grid.error.groupFixed");
|
|
6538
6603
|
}
|
|
6539
6604
|
}
|
|
6540
|
-
function onScrollXLoad(
|
|
6541
|
-
var _vm =
|
|
6605
|
+
function onScrollXLoad(_ref120) {
|
|
6606
|
+
var _vm = _ref120._vm, scrollX = _ref120.scrollX, scrollXLoad = _ref120.scrollXLoad, scrollXStore = _ref120.scrollXStore, tableColumn2 = _ref120.tableColumn, visibleColumn = _ref120.visibleColumn;
|
|
6542
6607
|
if (scrollXLoad) {
|
|
6543
6608
|
if (_vm.resizable || visibleColumn.some(function(column) {
|
|
6544
6609
|
return column.resizable;
|
|
@@ -6557,10 +6622,10 @@ function onScrollXLoad(_ref119) {
|
|
|
6557
6622
|
}
|
|
6558
6623
|
return tableColumn2;
|
|
6559
6624
|
}
|
|
6560
|
-
function mapFetchColumnPromise(
|
|
6561
|
-
var _vm =
|
|
6562
|
-
return fetchColumns.map(function(
|
|
6563
|
-
var format =
|
|
6625
|
+
function mapFetchColumnPromise(_ref121) {
|
|
6626
|
+
var _vm = _ref121._vm, fetchColumns = _ref121.fetchColumns, tableColumn2 = _ref121.tableColumn;
|
|
6627
|
+
return fetchColumns.map(function(_ref122) {
|
|
6628
|
+
var format = _ref122.format, columnValues = _ref122.columnValues;
|
|
6564
6629
|
return format.async.fetch({
|
|
6565
6630
|
columns: tableColumn2,
|
|
6566
6631
|
columnValues,
|
|
@@ -6568,8 +6633,8 @@ function mapFetchColumnPromise(_ref120) {
|
|
|
6568
6633
|
});
|
|
6569
6634
|
});
|
|
6570
6635
|
}
|
|
6571
|
-
function preprocessDataObjectFormat(
|
|
6572
|
-
var columnCount =
|
|
6636
|
+
function preprocessDataObjectFormat(_ref123) {
|
|
6637
|
+
var columnCount = _ref123.columnCount, columnValues = _ref123.columnValues, columnValuesMap = _ref123.columnValuesMap, fields = _ref123.fields;
|
|
6573
6638
|
if (columnCount) {
|
|
6574
6639
|
columnValues.forEach(function(col) {
|
|
6575
6640
|
if (typeof col === "object") {
|
|
@@ -6581,8 +6646,8 @@ function preprocessDataObjectFormat(_ref122) {
|
|
|
6581
6646
|
});
|
|
6582
6647
|
}
|
|
6583
6648
|
}
|
|
6584
|
-
function preventDupRender(
|
|
6585
|
-
var asyncColumnName =
|
|
6649
|
+
function preventDupRender(_ref124) {
|
|
6650
|
+
var asyncColumnName = _ref124.asyncColumnName, cellTexts = _ref124.cellTexts, cellValuesCount = _ref124.cellValuesCount, columnData = _ref124.columnData, columnValuesMap = _ref124.columnValuesMap, isRender = _ref124.isRender, property = _ref124.property, renderCount = _ref124.renderCount, row2 = _ref124.row, splitConfig = _ref124.splitConfig;
|
|
6586
6651
|
var cellEachIndex = 0;
|
|
6587
6652
|
if (!isRender && cellValuesCount) {
|
|
6588
6653
|
var cellLabel;
|
|
@@ -6607,8 +6672,8 @@ function preventDupRender(_ref123) {
|
|
|
6607
6672
|
}
|
|
6608
6673
|
return renderCount;
|
|
6609
6674
|
}
|
|
6610
|
-
function handleResolveColumnComplete(
|
|
6611
|
-
var _vm =
|
|
6675
|
+
function handleResolveColumnComplete(_ref125) {
|
|
6676
|
+
var _vm = _ref125._vm, columnData = _ref125.columnData, complete = _ref125.complete;
|
|
6612
6677
|
if (typeof complete === "function") {
|
|
6613
6678
|
complete({
|
|
6614
6679
|
columnData,
|
|
@@ -6617,8 +6682,8 @@ function handleResolveColumnComplete(_ref124) {
|
|
|
6617
6682
|
}
|
|
6618
6683
|
}
|
|
6619
6684
|
var isWebkit = browserInfo["-webkit"];
|
|
6620
|
-
function computeScrollYLoad(
|
|
6621
|
-
var _vm =
|
|
6685
|
+
function computeScrollYLoad(_ref126) {
|
|
6686
|
+
var _vm = _ref126._vm, scrollLoad = _ref126.scrollLoad, scrollY = _ref126.scrollY, scrollYLoad = _ref126.scrollYLoad, scrollYStore = _ref126.scrollYStore, tableBodyElem = _ref126.tableBodyElem;
|
|
6622
6687
|
if (scrollYLoad || scrollLoad) {
|
|
6623
6688
|
scrollYStore.rowHeight = _vm.rowHeight;
|
|
6624
6689
|
}
|
|
@@ -6638,8 +6703,8 @@ function computeScrollYLoad(_ref125) {
|
|
|
6638
6703
|
_vm.updateScrollYSpace();
|
|
6639
6704
|
}
|
|
6640
6705
|
}
|
|
6641
|
-
function computeScrollXLoad(
|
|
6642
|
-
var _vm =
|
|
6706
|
+
function computeScrollXLoad(_ref127) {
|
|
6707
|
+
var _vm = _ref127._vm, scrollX = _ref127.scrollX, scrollXLoad = _ref127.scrollXLoad, scrollXStore = _ref127.scrollXStore, tableBodyElem = _ref127.tableBodyElem, visibleColumn = _ref127.visibleColumn;
|
|
6643
6708
|
if (scrollXLoad) {
|
|
6644
6709
|
var clientWidth = tableBodyElem.clientWidth;
|
|
6645
6710
|
var width = 0;
|
|
@@ -6679,16 +6744,17 @@ var calcTableWidth = function calcTableWidth2($table) {
|
|
|
6679
6744
|
var pxArr = columnStore.pxList, scaleArr = columnStore.scaleList, pxMinArr = columnStore.pxMinList, scaleMinArr = columnStore.scaleMinList, autoArr = columnStore.autoList, resizeArr = columnStore.resizeList;
|
|
6680
6745
|
var remainWidth = clientWidth;
|
|
6681
6746
|
var totalWidth = 0;
|
|
6682
|
-
pxMinArr.
|
|
6747
|
+
var minArr = new Array(pxMinArr.length + scaleMinArr.length);
|
|
6748
|
+
pxMinArr.forEach(function(column, index2) {
|
|
6683
6749
|
var width = parseInt(column.minWidth);
|
|
6684
6750
|
totalWidth += width;
|
|
6685
|
-
|
|
6751
|
+
minArr[index2 + scaleMinArr.length] = width;
|
|
6686
6752
|
});
|
|
6687
6753
|
var meanWidth = remainWidth / 100;
|
|
6688
|
-
scaleMinArr.forEach(function(column) {
|
|
6754
|
+
scaleMinArr.forEach(function(column, index2) {
|
|
6689
6755
|
var width = Math.floor(parseInt(column.minWidth) * meanWidth);
|
|
6690
6756
|
totalWidth += width;
|
|
6691
|
-
|
|
6757
|
+
minArr[index2] = width;
|
|
6692
6758
|
});
|
|
6693
6759
|
scaleArr.forEach(function(column) {
|
|
6694
6760
|
var width = Math.floor(parseInt(column.width) * meanWidth);
|
|
@@ -6709,9 +6775,9 @@ var calcTableWidth = function calcTableWidth2($table) {
|
|
|
6709
6775
|
meanWidth = remainWidth > 0 ? Math.floor(remainWidth / (scaleMinArr.length + pxMinArr.length + autoArr.length)) : 0;
|
|
6710
6776
|
if (fit) {
|
|
6711
6777
|
if (remainWidth > 0) {
|
|
6712
|
-
scaleMinArr.concat(pxMinArr).forEach(function(column) {
|
|
6778
|
+
scaleMinArr.concat(pxMinArr).forEach(function(column, index2) {
|
|
6713
6779
|
totalWidth += meanWidth;
|
|
6714
|
-
|
|
6780
|
+
minArr[index2] += meanWidth;
|
|
6715
6781
|
});
|
|
6716
6782
|
}
|
|
6717
6783
|
} else {
|
|
@@ -6719,23 +6785,27 @@ var calcTableWidth = function calcTableWidth2($table) {
|
|
|
6719
6785
|
}
|
|
6720
6786
|
autoArr.forEach(function(column, index2) {
|
|
6721
6787
|
var width = Math.max(meanWidth, minCellWidth);
|
|
6722
|
-
|
|
6788
|
+
var renderWidth = width;
|
|
6723
6789
|
totalWidth += width;
|
|
6724
6790
|
if (fit && index2 === autoArr.length - 1) {
|
|
6725
6791
|
var odiffer = clientWidth - totalWidth;
|
|
6726
6792
|
if (odiffer > 0) {
|
|
6727
|
-
|
|
6793
|
+
renderWidth += odiffer;
|
|
6728
6794
|
totalWidth = clientWidth;
|
|
6729
6795
|
}
|
|
6730
6796
|
}
|
|
6797
|
+
column.renderWidth = renderWidth;
|
|
6731
6798
|
});
|
|
6732
6799
|
var remainingSpace = bodyWidth - totalWidth;
|
|
6733
6800
|
if (fit && remainingSpace > 0) {
|
|
6734
|
-
scaleMinArr.concat(pxMinArr).slice(0, remainingSpace).forEach(function(column) {
|
|
6801
|
+
scaleMinArr.concat(pxMinArr).slice(0, remainingSpace).forEach(function(column, index2) {
|
|
6735
6802
|
totalWidth += 1;
|
|
6736
|
-
|
|
6803
|
+
minArr[index2] += 1;
|
|
6737
6804
|
});
|
|
6738
6805
|
}
|
|
6806
|
+
scaleMinArr.concat(pxMinArr).forEach(function(column, index2) {
|
|
6807
|
+
column.renderWidth = minArr[index2];
|
|
6808
|
+
});
|
|
6739
6809
|
return {
|
|
6740
6810
|
totalWidth,
|
|
6741
6811
|
offsetWidth,
|
|
@@ -6745,8 +6815,8 @@ var calcTableWidth = function calcTableWidth2($table) {
|
|
|
6745
6815
|
function calcFixedDetails(_vm) {
|
|
6746
6816
|
var collectColumn2 = _vm.collectColumn, visibleColumn = _vm.visibleColumn, columnStore = _vm.columnStore, isGroup2 = _vm.isGroup;
|
|
6747
6817
|
var leftList = columnStore.leftList, rightList = columnStore.rightList;
|
|
6748
|
-
visibleColumn.forEach(function(
|
|
6749
|
-
var fixedDetails =
|
|
6818
|
+
visibleColumn.forEach(function(_ref128) {
|
|
6819
|
+
var fixedDetails = _ref128.fixedDetails;
|
|
6750
6820
|
if (fixedDetails) {
|
|
6751
6821
|
fixedDetails.isLeftLast = false;
|
|
6752
6822
|
fixedDetails.isRightFirst = false;
|
|
@@ -6757,8 +6827,8 @@ function calcFixedDetails(_vm) {
|
|
|
6757
6827
|
var length = leftList.length;
|
|
6758
6828
|
var value = 0;
|
|
6759
6829
|
if (Array.isArray(leftList) && length > 0) {
|
|
6760
|
-
leftList.forEach(function(
|
|
6761
|
-
var fixedDetails =
|
|
6830
|
+
leftList.forEach(function(_ref129, i) {
|
|
6831
|
+
var fixedDetails = _ref129.fixedDetails, renderWidth = _ref129.renderWidth;
|
|
6762
6832
|
fixedDetails.isLeftLast = i === length - 1;
|
|
6763
6833
|
fixedDetails.left = value;
|
|
6764
6834
|
value += renderWidth;
|
|
@@ -6768,8 +6838,8 @@ function calcFixedDetails(_vm) {
|
|
|
6768
6838
|
value = 0;
|
|
6769
6839
|
if (Array.isArray(rightList) && length > 0) {
|
|
6770
6840
|
var reversed = [].concat(rightList).reverse();
|
|
6771
|
-
reversed.forEach(function(
|
|
6772
|
-
var fixedDetails =
|
|
6841
|
+
reversed.forEach(function(_ref130, i) {
|
|
6842
|
+
var fixedDetails = _ref130.fixedDetails, renderWidth = _ref130.renderWidth;
|
|
6773
6843
|
fixedDetails.isRightFirst = i === length - 1;
|
|
6774
6844
|
fixedDetails.right = value;
|
|
6775
6845
|
value += renderWidth;
|
|
@@ -6841,10 +6911,10 @@ var headerProps = {
|
|
|
6841
6911
|
};
|
|
6842
6912
|
var handleAllColumnPromises = function handleAllColumnPromises2(opt, ctx) {
|
|
6843
6913
|
var startIndex = opt.startIndex, fetchColumns = opt.fetchColumns, tableData = opt.tableData, asyncRenderMap = opt.asyncRenderMap, isScrollLoad = opt.isScrollLoad;
|
|
6844
|
-
return function(
|
|
6845
|
-
if (
|
|
6914
|
+
return function(data7) {
|
|
6915
|
+
if (data7.length) {
|
|
6846
6916
|
ctx._isUpdateData = true;
|
|
6847
|
-
|
|
6917
|
+
data7.forEach(function(item, i) {
|
|
6848
6918
|
var columnValues = [];
|
|
6849
6919
|
var columnValuesMap = {};
|
|
6850
6920
|
var k = startIndex;
|
|
@@ -6852,7 +6922,7 @@ var handleAllColumnPromises = function handleAllColumnPromises2(opt, ctx) {
|
|
|
6852
6922
|
var columnCount = 0;
|
|
6853
6923
|
var columnData = [];
|
|
6854
6924
|
var _fetchColumns$i = fetchColumns[i], _fetchColumns$i$forma = _fetchColumns$i.format, format = _fetchColumns$i$forma === void 0 ? {} : _fetchColumns$i$forma, property = _fetchColumns$i.property;
|
|
6855
|
-
var
|
|
6925
|
+
var _ref131 = format.async || {}, _ref131$splitConfig = _ref131.splitConfig, splitConfig = _ref131$splitConfig === void 0 ? {} : _ref131$splitConfig, _ref131$fields = _ref131.fields, fields = _ref131$fields === void 0 ? {} : _ref131$fields, complete = _ref131.complete;
|
|
6856
6926
|
columnValues = isArray(item) ? item : get(item, fields.data || "values");
|
|
6857
6927
|
columnCount = columnValues.length;
|
|
6858
6928
|
preprocessDataObjectFormat({
|
|
@@ -6903,8 +6973,8 @@ var handleAllColumnPromises = function handleAllColumnPromises2(opt, ctx) {
|
|
|
6903
6973
|
}
|
|
6904
6974
|
};
|
|
6905
6975
|
};
|
|
6906
|
-
function handleGlobalMousedownOnFilterWrapper(
|
|
6907
|
-
var $el =
|
|
6976
|
+
function handleGlobalMousedownOnFilterWrapper(_ref132) {
|
|
6977
|
+
var $el = _ref132.$el, _vm = _ref132._vm, event = _ref132.event, filterStore = _ref132.filterStore, filterWrapper = _ref132.filterWrapper;
|
|
6908
6978
|
if (filterWrapper) {
|
|
6909
6979
|
if (_vm.getEventTargetNode(event, $el, "tiny-grid-filter-wrapper").flag) ;
|
|
6910
6980
|
else if (_vm.getEventTargetNode(event, filterWrapper.$el).flag) ;
|
|
@@ -6915,14 +6985,14 @@ function handleGlobalMousedownOnFilterWrapper(_ref131) {
|
|
|
6915
6985
|
}
|
|
6916
6986
|
}
|
|
6917
6987
|
}
|
|
6918
|
-
function handleGlobalMousedownOnCtxMenu(
|
|
6919
|
-
var _vm =
|
|
6988
|
+
function handleGlobalMousedownOnCtxMenu(_ref133) {
|
|
6989
|
+
var _vm = _ref133._vm, ctxMenuStore = _ref133.ctxMenuStore, event = _ref133.event;
|
|
6920
6990
|
if (ctxMenuStore.visible && _vm.$refs.ctxWrapper && !_vm.getEventTargetNode(event, _vm.$refs.ctxWrapper.$el).flag) {
|
|
6921
6991
|
_vm.closeMenu();
|
|
6922
6992
|
}
|
|
6923
6993
|
}
|
|
6924
|
-
function handleGlobalBlurOutside(
|
|
6925
|
-
var _vm =
|
|
6994
|
+
function handleGlobalBlurOutside(_ref134) {
|
|
6995
|
+
var _vm = _ref134._vm, actived = _ref134.actived, event = _ref134.event;
|
|
6926
6996
|
var custblur = _vm.blurOutside(actived, event);
|
|
6927
6997
|
if (typeof custblur === "boolean") {
|
|
6928
6998
|
custblur || setTimeout(function() {
|
|
@@ -6932,8 +7002,8 @@ function handleGlobalBlurOutside(_ref133) {
|
|
|
6932
7002
|
}
|
|
6933
7003
|
return false;
|
|
6934
7004
|
}
|
|
6935
|
-
function handleGlobalIsClear(
|
|
6936
|
-
var $el =
|
|
7005
|
+
function handleGlobalIsClear(_ref135) {
|
|
7006
|
+
var $el = _ref135.$el, _vm = _ref135._vm, actived = _ref135.actived, editConfig = _ref135.editConfig, event = _ref135.event, isClear = _ref135.isClear, isReadonlyCol = _ref135.isReadonlyCol;
|
|
6937
7007
|
if (editConfig.mode === "row") {
|
|
6938
7008
|
var rowNode = _vm.getEventTargetNode(event, $el, "tiny-grid-body__row");
|
|
6939
7009
|
var isOtherRow = rowNode.flag ? rowNode.targetElem !== actived.args.cell.parentNode : 0;
|
|
@@ -6947,11 +7017,12 @@ function handleGlobalIsClear(_ref134) {
|
|
|
6947
7017
|
}
|
|
6948
7018
|
return isClear;
|
|
6949
7019
|
}
|
|
6950
|
-
function handleGlobalClearActived(
|
|
7020
|
+
function handleGlobalClearActived(_ref136) {
|
|
6951
7021
|
var _vm$$refs$tableBody;
|
|
6952
|
-
var $el =
|
|
7022
|
+
var $el = _ref136.$el, _vm = _ref136._vm, event = _ref136.event, isClear = _ref136.isClear;
|
|
6953
7023
|
var tableContent = (_vm$$refs$tableBody = _vm.$refs.tableBody) == null ? void 0 : _vm$$refs$tableBody.$refs.table;
|
|
6954
|
-
|
|
7024
|
+
var actualTarget = getActualTarget(event);
|
|
7025
|
+
if (isClear || !_vm.getEventTargetNode(event, $el).flag || _vm.$refs.tableHeader && _vm.$refs.tableHeader.$el.contains(actualTarget) || tableContent && !tableContent.contains(actualTarget)) {
|
|
6955
7026
|
setTimeout(function() {
|
|
6956
7027
|
return _vm.clearActived(event);
|
|
6957
7028
|
});
|
|
@@ -6960,8 +7031,8 @@ function handleGlobalClearActived(_ref135) {
|
|
|
6960
7031
|
function checkOtherKey(keyCode) {
|
|
6961
7032
|
return keyCode >= 48 && keyCode <= 57 || keyCode >= 65 && keyCode <= 90 || keyCode >= 96 && keyCode <= 111 || keyCode >= 186 && keyCode <= 192 || keyCode >= 219 && keyCode <= 222 || keyCode === 32;
|
|
6962
7033
|
}
|
|
6963
|
-
function rule1(
|
|
6964
|
-
var isKeyEsc =
|
|
7034
|
+
function rule1(_ref137) {
|
|
7035
|
+
var isKeyEsc = _ref137.isKeyEsc, _vm = _ref137._vm, event = _ref137.event, actived = _ref137.actived, mouseConfig = _ref137.mouseConfig;
|
|
6965
7036
|
return {
|
|
6966
7037
|
match: function match() {
|
|
6967
7038
|
return isKeyEsc;
|
|
@@ -6975,8 +7046,8 @@ function rule1(_ref136) {
|
|
|
6975
7046
|
}
|
|
6976
7047
|
};
|
|
6977
7048
|
}
|
|
6978
|
-
function rule2(
|
|
6979
|
-
var isKeySpacebar =
|
|
7049
|
+
function rule2(_ref138) {
|
|
7050
|
+
var isKeySpacebar = _ref138.isKeySpacebar, keyboardConfig = _ref138.keyboardConfig, selected = _ref138.selected, _vm = _ref138._vm, event = _ref138.event;
|
|
6980
7051
|
return {
|
|
6981
7052
|
match: function match() {
|
|
6982
7053
|
return isKeySpacebar && (keyboardConfig.isArrow || keyboardConfig.isTab) && selected.row && selected.column && (selected.column.type === "selection" || selected.column.type === "radio");
|
|
@@ -7006,8 +7077,8 @@ function rule3(args) {
|
|
|
7006
7077
|
}
|
|
7007
7078
|
};
|
|
7008
7079
|
}
|
|
7009
|
-
function rule4(
|
|
7010
|
-
var isOperCtxMenu =
|
|
7080
|
+
function rule4(_ref139) {
|
|
7081
|
+
var isOperCtxMenu = _ref139.isOperCtxMenu, _vm = _ref139._vm, event = _ref139.event;
|
|
7011
7082
|
return {
|
|
7012
7083
|
match: function match() {
|
|
7013
7084
|
return isOperCtxMenu;
|
|
@@ -7019,8 +7090,8 @@ function rule4(_ref138) {
|
|
|
7019
7090
|
}
|
|
7020
7091
|
};
|
|
7021
7092
|
}
|
|
7022
|
-
function rule5(
|
|
7023
|
-
var isKeyF2 =
|
|
7093
|
+
function rule5(_ref140) {
|
|
7094
|
+
var isKeyF2 = _ref140.isKeyF2, _vm = _ref140._vm, event = _ref140.event, selected = _ref140.selected;
|
|
7024
7095
|
return {
|
|
7025
7096
|
match: function match() {
|
|
7026
7097
|
return isKeyF2;
|
|
@@ -7033,8 +7104,8 @@ function rule5(_ref139) {
|
|
|
7033
7104
|
}
|
|
7034
7105
|
};
|
|
7035
7106
|
}
|
|
7036
|
-
function rule6(
|
|
7037
|
-
var isOperArrowKeys =
|
|
7107
|
+
function rule6(_ref141) {
|
|
7108
|
+
var isOperArrowKeys = _ref141.isOperArrowKeys, keyboardConfig = _ref141.keyboardConfig, _vm = _ref141._vm, event = _ref141.event, selected = _ref141.selected;
|
|
7038
7109
|
return {
|
|
7039
7110
|
match: function match() {
|
|
7040
7111
|
return isOperArrowKeys && keyboardConfig.isArrow;
|
|
@@ -7047,8 +7118,8 @@ function rule6(_ref140) {
|
|
|
7047
7118
|
}
|
|
7048
7119
|
};
|
|
7049
7120
|
}
|
|
7050
|
-
function rule7(
|
|
7051
|
-
var isKeyTab =
|
|
7121
|
+
function rule7(_ref142) {
|
|
7122
|
+
var isKeyTab = _ref142.isKeyTab, keyboardConfig = _ref142.keyboardConfig, _vm = _ref142._vm, event = _ref142.event, selected = _ref142.selected, actived = _ref142.actived;
|
|
7052
7123
|
return {
|
|
7053
7124
|
match: function match() {
|
|
7054
7125
|
return isKeyTab && keyboardConfig.isTab;
|
|
@@ -7077,8 +7148,8 @@ function rule8(args) {
|
|
|
7077
7148
|
}
|
|
7078
7149
|
};
|
|
7079
7150
|
}
|
|
7080
|
-
function rule9(
|
|
7081
|
-
var keyboardConfig =
|
|
7151
|
+
function rule9(_ref143) {
|
|
7152
|
+
var keyboardConfig = _ref143.keyboardConfig, isKeyWithCtrl = _ref143.isKeyWithCtrl, isKeyA = _ref143.isKeyA, isKeyX = _ref143.isKeyX, isKeyC = _ref143.isKeyC, isKeyV = _ref143.isKeyV, _vm = _ref143._vm, event = _ref143.event;
|
|
7082
7153
|
return {
|
|
7083
7154
|
match: function match() {
|
|
7084
7155
|
return keyboardConfig.isCut && isKeyWithCtrl && (isKeyA || isKeyX || isKeyC || isKeyV);
|
|
@@ -7090,8 +7161,8 @@ function rule9(_ref142) {
|
|
|
7090
7161
|
}
|
|
7091
7162
|
};
|
|
7092
7163
|
}
|
|
7093
|
-
function rule10(
|
|
7094
|
-
var keyboardConfig =
|
|
7164
|
+
function rule10(_ref144) {
|
|
7165
|
+
var keyboardConfig = _ref144.keyboardConfig, isKeyWithCtrl = _ref144.isKeyWithCtrl, _vm = _ref144._vm, event = _ref144.event, selected = _ref144.selected, actived = _ref144.actived;
|
|
7095
7166
|
return {
|
|
7096
7167
|
match: function match() {
|
|
7097
7168
|
return keyboardConfig.isEdit && !isKeyWithCtrl && !(selected.row === actived.row && selected.column === actived.column);
|
|
@@ -7284,9 +7355,9 @@ function handleGlobalMousewheelEvent(event) {
|
|
|
7284
7355
|
this.clostTooltip();
|
|
7285
7356
|
this.closeMenu();
|
|
7286
7357
|
}
|
|
7287
|
-
function handleEscKeyDown(
|
|
7358
|
+
function handleEscKeyDown(_ref145) {
|
|
7288
7359
|
var _this11 = this;
|
|
7289
|
-
var event =
|
|
7360
|
+
var event = _ref145.event, actived = _ref145.actived, mouseConfig = _ref145.mouseConfig;
|
|
7290
7361
|
this.closeMenu();
|
|
7291
7362
|
this.closeFilter();
|
|
7292
7363
|
if (actived.row) {
|
|
@@ -7298,9 +7369,9 @@ function handleEscKeyDown(_ref144) {
|
|
|
7298
7369
|
}
|
|
7299
7370
|
}
|
|
7300
7371
|
}
|
|
7301
|
-
function handleEnterKeyDown(
|
|
7372
|
+
function handleEnterKeyDown(_ref146) {
|
|
7302
7373
|
var _this12 = this;
|
|
7303
|
-
var event =
|
|
7374
|
+
var event = _ref146.event, selected = _ref146.selected, actived = _ref146.actived;
|
|
7304
7375
|
var highlightCurrentRow = this.highlightCurrentRow, currentRow = this.currentRow, treeConfig = this.treeConfig;
|
|
7305
7376
|
var isLeftArrow = event.keyCode === 37;
|
|
7306
7377
|
var isUpArrow = event.keyCode === 38;
|
|
@@ -7330,8 +7401,8 @@ function handleEnterKeyDown(_ref145) {
|
|
|
7330
7401
|
}
|
|
7331
7402
|
}
|
|
7332
7403
|
}
|
|
7333
|
-
function handleCtxMenu(
|
|
7334
|
-
var event =
|
|
7404
|
+
function handleCtxMenu(_ref147) {
|
|
7405
|
+
var event = _ref147.event;
|
|
7335
7406
|
var ctxMenuStore = this.ctxMenuStore;
|
|
7336
7407
|
event.preventDefault();
|
|
7337
7408
|
if (ctxMenuStore.showChild && hasChildrenList(ctxMenuStore.selected)) {
|
|
@@ -7356,8 +7427,8 @@ function handleCtxMenu(_ref146) {
|
|
|
7356
7427
|
});
|
|
7357
7428
|
}
|
|
7358
7429
|
}
|
|
7359
|
-
function handleArrowKeyDown(
|
|
7360
|
-
var event =
|
|
7430
|
+
function handleArrowKeyDown(_ref148) {
|
|
7431
|
+
var event = _ref148.event, selected = _ref148.selected;
|
|
7361
7432
|
var highlightCurrentRow = this.highlightCurrentRow, currentRow = this.currentRow;
|
|
7362
7433
|
var isLeftArrow = event.keyCode === 37;
|
|
7363
7434
|
var isUpArrow = event.keyCode === 38;
|
|
@@ -7376,9 +7447,9 @@ function handleArrowKeyDown(_ref147) {
|
|
|
7376
7447
|
this.moveCurrentRow(isUpArrow, isDownArrow, event);
|
|
7377
7448
|
}
|
|
7378
7449
|
}
|
|
7379
|
-
function handleDelKeyDown(
|
|
7450
|
+
function handleDelKeyDown(_ref149) {
|
|
7380
7451
|
var _this13 = this;
|
|
7381
|
-
var event =
|
|
7452
|
+
var event = _ref149.event, selected = _ref149.selected;
|
|
7382
7453
|
var _this$keyboardConfig = this.keyboardConfig, keyboardConfig = _this$keyboardConfig === void 0 ? {} : _this$keyboardConfig, treeConfig = this.treeConfig, highlightCurrentRow = this.highlightCurrentRow, currentRow = this.currentRow;
|
|
7383
7454
|
var isBack = event.keyCode === 8;
|
|
7384
7455
|
if (keyboardConfig.isDel && (selected.row || selected.column)) {
|
|
@@ -7403,8 +7474,8 @@ function handleDelKeyDown(_ref148) {
|
|
|
7403
7474
|
}
|
|
7404
7475
|
}
|
|
7405
7476
|
}
|
|
7406
|
-
function handleSpaceKeyDown(
|
|
7407
|
-
var event =
|
|
7477
|
+
function handleSpaceKeyDown(_ref150) {
|
|
7478
|
+
var event = _ref150.event, selected = _ref150.selected;
|
|
7408
7479
|
event.preventDefault();
|
|
7409
7480
|
if (selected.column.type === "selection") {
|
|
7410
7481
|
this.handleToggleCheckRowEvent(selected.args, event);
|
|
@@ -7412,8 +7483,8 @@ function handleSpaceKeyDown(_ref149) {
|
|
|
7412
7483
|
this.triggerRadioRowEvent(event, selected.args);
|
|
7413
7484
|
}
|
|
7414
7485
|
}
|
|
7415
|
-
function handleTabKeyDown(
|
|
7416
|
-
var event =
|
|
7486
|
+
function handleTabKeyDown(_ref151) {
|
|
7487
|
+
var event = _ref151.event, selected = _ref151.selected, actived = _ref151.actived;
|
|
7417
7488
|
var isShiftKey = event.shiftKey;
|
|
7418
7489
|
var useTab = this.editConfig.useTab;
|
|
7419
7490
|
if (selected.row || selected.column) {
|
|
@@ -7422,8 +7493,8 @@ function handleTabKeyDown(_ref150) {
|
|
|
7422
7493
|
this.moveTabSelected(actived.args, isShiftKey, event, useTab);
|
|
7423
7494
|
}
|
|
7424
7495
|
}
|
|
7425
|
-
function handleCopyKeyDown(
|
|
7426
|
-
var event =
|
|
7496
|
+
function handleCopyKeyDown(_ref152) {
|
|
7497
|
+
var event = _ref152.event;
|
|
7427
7498
|
if (event.keyCode === 65) {
|
|
7428
7499
|
this.handleAllChecked(event);
|
|
7429
7500
|
} else if (event.keyCode === 88 || event.keyCode === 67) {
|
|
@@ -7432,15 +7503,15 @@ function handleCopyKeyDown(_ref151) {
|
|
|
7432
7503
|
this.handlePaste(event);
|
|
7433
7504
|
}
|
|
7434
7505
|
}
|
|
7435
|
-
function handleF2KeyDown(
|
|
7436
|
-
var event =
|
|
7506
|
+
function handleF2KeyDown(_ref153) {
|
|
7507
|
+
var event = _ref153.event, selected = _ref153.selected;
|
|
7437
7508
|
if (selected.row && selected.column) {
|
|
7438
7509
|
event.preventDefault();
|
|
7439
7510
|
this.handleActived(selected.args, event);
|
|
7440
7511
|
}
|
|
7441
7512
|
}
|
|
7442
|
-
function handleOtherKeyDown(
|
|
7443
|
-
var event =
|
|
7513
|
+
function handleOtherKeyDown(_ref154) {
|
|
7514
|
+
var event = _ref154.event, selected = _ref154.selected;
|
|
7444
7515
|
var _this$keyboardConfig2 = this.keyboardConfig, keyboardConfig = _this$keyboardConfig2 === void 0 ? {} : _this$keyboardConfig2;
|
|
7445
7516
|
var keyCode = event.keyCode;
|
|
7446
7517
|
var isOtherKey = checkOtherKey(keyCode);
|
|
@@ -7545,28 +7616,36 @@ var Methods$d = {
|
|
|
7545
7616
|
clearAll: function clearAll(silent) {
|
|
7546
7617
|
var _this$$grid$fetchOpti = this.$grid.fetchOption, fetchOption = _this$$grid$fetchOpti === void 0 ? {} : _this$$grid$fetchOpti;
|
|
7547
7618
|
var isReloadFilter = fetchOption.isReloadFilter, _fetchOption$isReload = fetchOption.isReloadScroll, isReloadScroll = _fetchOption$isReload === void 0 ? false : _fetchOption$isReload;
|
|
7548
|
-
|
|
7549
|
-
|
|
7550
|
-
|
|
7551
|
-
|
|
7552
|
-
|
|
7619
|
+
this.clearSort();
|
|
7620
|
+
this.clearCurrentRow();
|
|
7621
|
+
this.clearCurrentColumn();
|
|
7622
|
+
this.clearSelection();
|
|
7623
|
+
this.clearRowExpand();
|
|
7624
|
+
this.clearTreeExpand();
|
|
7625
|
+
this.clearValidateMap();
|
|
7626
|
+
if (!isReloadScroll) {
|
|
7627
|
+
this.clearScroll();
|
|
7553
7628
|
}
|
|
7554
|
-
run(functionNames, this);
|
|
7555
7629
|
this.cellStatus.clear();
|
|
7556
7630
|
if (typeof isReloadFilter === "undefined" ? Grid$1._filter : !isReloadFilter) {
|
|
7557
7631
|
this.clearFilter(silent);
|
|
7558
7632
|
}
|
|
7559
7633
|
if (this.keyboardConfig || this.mouseConfig) {
|
|
7560
|
-
|
|
7634
|
+
this.clearIndexChecked();
|
|
7635
|
+
this.clearHeaderChecked();
|
|
7636
|
+
this.clearChecked();
|
|
7637
|
+
this.clearSelected();
|
|
7638
|
+
this.clearCopyed();
|
|
7561
7639
|
}
|
|
7562
7640
|
return this.clearActived();
|
|
7563
7641
|
},
|
|
7564
|
-
refreshData: function refreshData(
|
|
7642
|
+
refreshData: function refreshData(data7) {
|
|
7565
7643
|
var _this16 = this;
|
|
7566
7644
|
var next = function next2() {
|
|
7567
7645
|
_this16.tableData = [];
|
|
7568
7646
|
_this16.cellStatus.clear();
|
|
7569
|
-
|
|
7647
|
+
_this16.clearValidateMap();
|
|
7648
|
+
return _this16.loadTableData(data7 || _this16.tableFullData);
|
|
7570
7649
|
};
|
|
7571
7650
|
return this.$nextTick().then(next);
|
|
7572
7651
|
},
|
|
@@ -7595,7 +7674,7 @@ var Methods$d = {
|
|
|
7595
7674
|
// 处理表格数据(过滤,排序,虚拟滚动需要渲染数据的条数)
|
|
7596
7675
|
handleTableData: function handleTableData(force) {
|
|
7597
7676
|
var _this$tableFullColumn, _this$tableFullColumn2;
|
|
7598
|
-
if (force && ((_this$tableFullColumn = this.tableFullColumn) == null ? void 0 : _this$tableFullColumn.length) > 0) {
|
|
7677
|
+
if (force && (((_this$tableFullColumn = this.tableFullColumn) == null ? void 0 : _this$tableFullColumn.length) > 0 || this.viewType !== GlobalConfig$1.viewConfig.DEFAULT)) {
|
|
7599
7678
|
this.updateAfterFullData();
|
|
7600
7679
|
this.updateSelectionStatus();
|
|
7601
7680
|
this.handleSelectionHeader();
|
|
@@ -7674,7 +7753,7 @@ var Methods$d = {
|
|
|
7674
7753
|
},
|
|
7675
7754
|
reloadRow: function reloadRow(row2, record, field) {
|
|
7676
7755
|
var tableData = this.tableData, treeConfig = this.treeConfig, treeOrdered = this.treeOrdered;
|
|
7677
|
-
var
|
|
7756
|
+
var _ref155 = treeConfig || {}, childrenKey = _ref155.children, _ref155$temporaryInde = _ref155.temporaryIndex, temporaryIndex = _ref155$temporaryInde === void 0 ? "_$index_" : _ref155$temporaryInde;
|
|
7678
7757
|
var rowKey = getRowkey(this);
|
|
7679
7758
|
var originRow = this.getOriginRow(row2);
|
|
7680
7759
|
var hasSrc = originRow && row2;
|
|
@@ -7683,7 +7762,7 @@ var Methods$d = {
|
|
|
7683
7762
|
set(originRow, field, get(record || row2, field));
|
|
7684
7763
|
}
|
|
7685
7764
|
if (hasSrcNoField && record) {
|
|
7686
|
-
var _extends4,
|
|
7765
|
+
var _extends4, _ref156;
|
|
7687
7766
|
var backupRow = this.defineField(_extends({}, record, (_extends4 = {}, _extends4[rowKey] = originRow[rowKey], _extends4)));
|
|
7688
7767
|
var rowChildren, clonedRow;
|
|
7689
7768
|
if (treeConfig) {
|
|
@@ -7699,7 +7778,7 @@ var Methods$d = {
|
|
|
7699
7778
|
}
|
|
7700
7779
|
this.setOriginRow(row2, backupRow);
|
|
7701
7780
|
clear(row2, void 0);
|
|
7702
|
-
Object.assign(row2, clonedRow, treeConfig ? (
|
|
7781
|
+
Object.assign(row2, clonedRow, treeConfig ? (_ref156 = {}, _ref156[childrenKey] = rowChildren, _ref156) : null);
|
|
7703
7782
|
this.updateCache();
|
|
7704
7783
|
}
|
|
7705
7784
|
if (hasSrcNoField && !record) {
|
|
@@ -7745,7 +7824,7 @@ var Methods$d = {
|
|
|
7745
7824
|
}
|
|
7746
7825
|
var tableFullData = this.tableFullData, treeConfig = this.treeConfig, treeOrdered = this.treeOrdered;
|
|
7747
7826
|
var rowKey = getRowkey(this);
|
|
7748
|
-
var
|
|
7827
|
+
var _ref157 = treeConfig || {}, childrenKey = _ref157.children, _ref157$temporaryInde = _ref157.temporaryIndex, temporaryIndex = _ref157$temporaryInde === void 0 ? "_$index_" : _ref157$temporaryInde;
|
|
7749
7828
|
var isTreeOrderedFalse = treeConfig && !treeOrdered;
|
|
7750
7829
|
var backupMap = /* @__PURE__ */ new WeakMap();
|
|
7751
7830
|
this.fullDataRowIdData = {};
|
|
@@ -7764,7 +7843,7 @@ var Methods$d = {
|
|
|
7764
7843
|
_this23.fullDataRowIdData[rowId] = rowCache;
|
|
7765
7844
|
_this23.fullDataRowMap.set(hooks.toRaw(row2), rowCache);
|
|
7766
7845
|
if (backup) {
|
|
7767
|
-
var
|
|
7846
|
+
var _ref158;
|
|
7768
7847
|
if (isTreeOrderedFalse) {
|
|
7769
7848
|
var parentIndex;
|
|
7770
7849
|
if (parent) {
|
|
@@ -7772,7 +7851,7 @@ var Methods$d = {
|
|
|
7772
7851
|
}
|
|
7773
7852
|
set(row2, temporaryIndex, (parentIndex ? parentIndex + "." : "") + (index2 + 1));
|
|
7774
7853
|
}
|
|
7775
|
-
var childrenField = treeConfig ? (
|
|
7854
|
+
var childrenField = treeConfig ? (_ref158 = {}, _ref158[childrenKey] = void 0, _ref158) : {};
|
|
7776
7855
|
var backupRow = deepCopy ? clone(_extends({}, row2, childrenField), true) : _extends({}, row2, childrenField);
|
|
7777
7856
|
backupMap.set(row2, backupRow);
|
|
7778
7857
|
return backupRow;
|
|
@@ -7848,8 +7927,8 @@ var Methods$d = {
|
|
|
7848
7927
|
row2 = clone(row2, true);
|
|
7849
7928
|
}
|
|
7850
7929
|
var rowKey = getRowkey(this);
|
|
7851
|
-
this.visibleColumn.forEach(function(
|
|
7852
|
-
var property =
|
|
7930
|
+
this.visibleColumn.forEach(function(_ref159) {
|
|
7931
|
+
var property = _ref159.property, editor = _ref159.editor;
|
|
7853
7932
|
var propNotExist = property && !has(row2, property);
|
|
7854
7933
|
var propDefaultValue = editor && !isUndefined(editor.defaultValue) ? editor.defaultValue : null;
|
|
7855
7934
|
if (propNotExist) {
|
|
@@ -7913,7 +7992,7 @@ var Methods$d = {
|
|
|
7913
7992
|
var value = get(row2, field);
|
|
7914
7993
|
var originalValue = get(originalRow, field);
|
|
7915
7994
|
var column = this.getColumnByField(field);
|
|
7916
|
-
var equals = column.equals || this.equals;
|
|
7995
|
+
var equals = (column == null ? void 0 : column.equals) || this.equals;
|
|
7917
7996
|
var result;
|
|
7918
7997
|
if (equals) {
|
|
7919
7998
|
result = equals({
|
|
@@ -8007,7 +8086,7 @@ var Methods$d = {
|
|
|
8007
8086
|
var _this$selectConfig = this.selectConfig, selectConfig = _this$selectConfig === void 0 ? {} : _this$selectConfig, selection = this.selection;
|
|
8008
8087
|
var tableFullData = this.tableFullData, treeConfig = this.treeConfig;
|
|
8009
8088
|
var checkField = selectConfig.checkField;
|
|
8010
|
-
var
|
|
8089
|
+
var _ref160 = {}, _ref160$rowList = _ref160.rowList, rowList = _ref160$rowList === void 0 ? [] : _ref160$rowList;
|
|
8011
8090
|
if (checkField && treeConfig) {
|
|
8012
8091
|
rowList = filterTree(tableFullData, function(row2) {
|
|
8013
8092
|
return get(row2, checkField);
|
|
@@ -8036,8 +8115,8 @@ var Methods$d = {
|
|
|
8036
8115
|
var tableData = this.tableFullData;
|
|
8037
8116
|
var updateFilter = function updateFilter2(tableData2) {
|
|
8038
8117
|
var remoteFilter = _this27.remoteFilter, visibleColumn = _this27.visibleColumn;
|
|
8039
|
-
var filterColumn = visibleColumn.filter(function(
|
|
8040
|
-
var filter2 =
|
|
8118
|
+
var filterColumn = visibleColumn.filter(function(_ref161) {
|
|
8119
|
+
var filter2 = _ref161.filter;
|
|
8041
8120
|
return !!filter2;
|
|
8042
8121
|
});
|
|
8043
8122
|
return tableData2.filter(function(row2) {
|
|
@@ -8066,8 +8145,8 @@ var Methods$d = {
|
|
|
8066
8145
|
} else {
|
|
8067
8146
|
var sortedFlag = false;
|
|
8068
8147
|
if (sortOpts2.multipleColumnSort) {
|
|
8069
|
-
var sortColumns = visibleColumn.filter(function(
|
|
8070
|
-
var order2 =
|
|
8148
|
+
var sortColumns = visibleColumn.filter(function(_ref162) {
|
|
8149
|
+
var order2 = _ref162.order;
|
|
8071
8150
|
return !!order2;
|
|
8072
8151
|
});
|
|
8073
8152
|
if (sortColumns.length > 1) {
|
|
@@ -8144,16 +8223,13 @@ var Methods$d = {
|
|
|
8144
8223
|
};
|
|
8145
8224
|
},
|
|
8146
8225
|
handleDefault: function handleDefault() {
|
|
8147
|
-
var _this29 = this;
|
|
8148
8226
|
this.handleAsyncColumn(this.tableData);
|
|
8149
8227
|
this.isCheckable && this.selectConfig && this.handleSelectionDefChecked();
|
|
8150
8228
|
this.radioConfig && this.handleRadioDefChecked();
|
|
8151
8229
|
this.expandConfig && this.handleDefaultRowExpand();
|
|
8152
8230
|
this.treeConfig && this.handleDefaultTreeExpand();
|
|
8153
8231
|
this.updateFooter();
|
|
8154
|
-
this.$nextTick(
|
|
8155
|
-
return setTimeout(_this29.recalculate);
|
|
8156
|
-
});
|
|
8232
|
+
this.$nextTick(this.recalculate);
|
|
8157
8233
|
},
|
|
8158
8234
|
// 动态列处理
|
|
8159
8235
|
mergeCustomColumn: function mergeCustomColumn(customColumns, sort2, colWidth) {
|
|
@@ -8178,7 +8254,7 @@ var Methods$d = {
|
|
|
8178
8254
|
});
|
|
8179
8255
|
}
|
|
8180
8256
|
if (hasCustomsOrColWidth && !isGroupOrNonSort) {
|
|
8181
|
-
var
|
|
8257
|
+
var _ref163 = {}, _ref163$collectColumn = _ref163.collectColumn, collectColumn2 = _ref163$collectColumn === void 0 ? [] : _ref163$collectColumn, _ref163$customMap = _ref163.customMap, customMap = _ref163$customMap === void 0 ? {} : _ref163$customMap, _ref163$orderColumn = _ref163.orderColumn, orderColumn = _ref163$orderColumn === void 0 ? [] : _ref163$orderColumn;
|
|
8182
8258
|
mapTree(customColumns, function(customCol) {
|
|
8183
8259
|
var targetCol = find$1(fullColumn, function(item) {
|
|
8184
8260
|
return customCol.property && item.property === customCol.property;
|
|
@@ -8231,11 +8307,11 @@ var Methods$d = {
|
|
|
8231
8307
|
},
|
|
8232
8308
|
// 初始化加载动态列:customColumns 列信息,sort 是否按顺序加载
|
|
8233
8309
|
reloadCustoms: function reloadCustoms(customColumns, sort2, colWidth) {
|
|
8234
|
-
var
|
|
8310
|
+
var _this29 = this;
|
|
8235
8311
|
this.mergeCustomColumn(customColumns, sort2, colWidth);
|
|
8236
8312
|
this.handleTableData(true);
|
|
8237
8313
|
return this.refreshColumn().then(function() {
|
|
8238
|
-
return
|
|
8314
|
+
return _this29.tableFullColumn.slice(0);
|
|
8239
8315
|
});
|
|
8240
8316
|
},
|
|
8241
8317
|
watchColumn: function watchColumn(value) {
|
|
@@ -8282,7 +8358,7 @@ var Methods$d = {
|
|
|
8282
8358
|
* 如果使用了分组表头,固定列必须在左侧或者右侧
|
|
8283
8359
|
*/
|
|
8284
8360
|
refreshColumn: function refreshColumn() {
|
|
8285
|
-
var
|
|
8361
|
+
var _this30 = this;
|
|
8286
8362
|
var leftList = [], centerList = [], rightList = [];
|
|
8287
8363
|
var letIndex = 0, leftStartIndex = null, rightEndIndex = null, isColspan = void 0;
|
|
8288
8364
|
var columnStore = this.columnStore, isGroup2 = this.isGroup;
|
|
@@ -8354,9 +8430,9 @@ var Methods$d = {
|
|
|
8354
8430
|
this.updateFooter();
|
|
8355
8431
|
this.recalculate();
|
|
8356
8432
|
return this.$nextTick().then(function() {
|
|
8357
|
-
|
|
8358
|
-
if (
|
|
8359
|
-
|
|
8433
|
+
_this30.$emit("after-refresh-column");
|
|
8434
|
+
if (_this30.isColumnReady) {
|
|
8435
|
+
_this30.attemptRestoreScroll();
|
|
8360
8436
|
}
|
|
8361
8437
|
});
|
|
8362
8438
|
},
|
|
@@ -8436,7 +8512,7 @@ var Methods$d = {
|
|
|
8436
8512
|
* 支持(width=?、width=?px、width=?%、min-width=?、min-width=?px、min-width=?%)
|
|
8437
8513
|
*/
|
|
8438
8514
|
recalculate: function recalculate() {
|
|
8439
|
-
var
|
|
8515
|
+
var _this31 = this;
|
|
8440
8516
|
var elemStore = this.elemStore, scrollXLoad = this.scrollXLoad, scrollYLoad = this.scrollYLoad, scrollLoad = this.scrollLoad, _tableVisible = this._tableVisible;
|
|
8441
8517
|
var bodyWrapper = elemStore["main-body-wrapper"];
|
|
8442
8518
|
if (!_tableVisible) {
|
|
@@ -8448,7 +8524,7 @@ var Methods$d = {
|
|
|
8448
8524
|
this.autoCellWidth();
|
|
8449
8525
|
if (scrollXLoad || scrollYLoad || scrollLoad) {
|
|
8450
8526
|
return this.computeScrollLoad().then(function() {
|
|
8451
|
-
|
|
8527
|
+
_this31.autoCellWidth();
|
|
8452
8528
|
});
|
|
8453
8529
|
}
|
|
8454
8530
|
return this.computeScrollLoad();
|
|
@@ -8506,17 +8582,17 @@ var Methods$d = {
|
|
|
8506
8582
|
this.currentRow && this.setCurrentRow(this.currentRow);
|
|
8507
8583
|
},
|
|
8508
8584
|
preventEvent: function preventEvent(event, type, args, next, end) {
|
|
8509
|
-
var
|
|
8585
|
+
var _this32 = this;
|
|
8510
8586
|
var eventList = Interceptor.get(type);
|
|
8511
8587
|
if (!eventList.some(function(listener) {
|
|
8512
|
-
return listener(args, event,
|
|
8588
|
+
return listener(args, event, _this32) === false;
|
|
8513
8589
|
})) {
|
|
8514
8590
|
next && next();
|
|
8515
8591
|
}
|
|
8516
8592
|
end && end();
|
|
8517
8593
|
},
|
|
8518
|
-
blurOutside: function blurOutside(
|
|
8519
|
-
var row2 =
|
|
8594
|
+
blurOutside: function blurOutside(_ref164, event) {
|
|
8595
|
+
var row2 = _ref164.row, args = _ref164.args, column = _ref164.column;
|
|
8520
8596
|
var editConfig = this.editConfig, getEventTargetNode2 = this.getEventTargetNode, $el = this.$el;
|
|
8521
8597
|
if (column && row2) {
|
|
8522
8598
|
var editor = column.editor;
|
|
@@ -8545,7 +8621,7 @@ var Methods$d = {
|
|
|
8545
8621
|
} else if (isArray(blurClassConfig)) {
|
|
8546
8622
|
blurClass = blurClassConfig.slice(0);
|
|
8547
8623
|
}
|
|
8548
|
-
if (args != null && args.cell.contains(event
|
|
8624
|
+
if (args != null && args.cell.contains(getActualTarget(event))) {
|
|
8549
8625
|
return true;
|
|
8550
8626
|
}
|
|
8551
8627
|
if (editConfig.mode === "row" && getEventTargetNode2(event, $el, "tiny-grid-body__column").flag) {
|
|
@@ -8576,7 +8652,7 @@ var Methods$d = {
|
|
|
8576
8652
|
// 处理单选框默认勾选
|
|
8577
8653
|
handleRadioDefChecked: function handleRadioDefChecked() {
|
|
8578
8654
|
var fullDataRowIdData = this.fullDataRowIdData;
|
|
8579
|
-
var
|
|
8655
|
+
var _ref165 = this.radioConfig || {}, checkRowKey = _ref165.checkRowKey;
|
|
8580
8656
|
var rowid2 = checkRowKey && encodeURIComponent(checkRowKey);
|
|
8581
8657
|
var rowCache = fullDataRowIdData[rowid2];
|
|
8582
8658
|
if (rowid2 && rowCache) {
|
|
@@ -8586,7 +8662,7 @@ var Methods$d = {
|
|
|
8586
8662
|
// 单选,行选中事件
|
|
8587
8663
|
triggerRadioRowEvent: function triggerRadioRowEvent(event, params) {
|
|
8588
8664
|
var selectRow = this.selectRow;
|
|
8589
|
-
var
|
|
8665
|
+
var _ref166 = this.radioConfig || {}, checkMethod = _ref166.checkMethod;
|
|
8590
8666
|
if (checkMethod && !checkMethod(params)) {
|
|
8591
8667
|
return;
|
|
8592
8668
|
}
|
|
@@ -8685,12 +8761,15 @@ var Methods$d = {
|
|
|
8685
8761
|
},
|
|
8686
8762
|
// 当单元格发生改变时,如果存在规则,则校验
|
|
8687
8763
|
handleChangeCell: function handleChangeCell(event, params) {
|
|
8688
|
-
var
|
|
8764
|
+
var _this33 = this;
|
|
8689
8765
|
this.triggerValidate("blur").catch(function(e) {
|
|
8690
8766
|
return e;
|
|
8691
8767
|
}).then(function() {
|
|
8692
|
-
|
|
8693
|
-
|
|
8768
|
+
_this33.handleActived(params, event).then(function() {
|
|
8769
|
+
var _this33$editConfig;
|
|
8770
|
+
if ((_this33$editConfig = _this33.editConfig) != null && _this33$editConfig.validateOnActive) {
|
|
8771
|
+
return _this33.triggerValidate("change");
|
|
8772
|
+
}
|
|
8694
8773
|
}).catch(function(e) {
|
|
8695
8774
|
return e;
|
|
8696
8775
|
});
|
|
@@ -8761,7 +8840,7 @@ var Methods$d = {
|
|
|
8761
8840
|
},
|
|
8762
8841
|
// 列双击点击事件:如果是双击模式,则激活为编辑状态
|
|
8763
8842
|
triggerCellDBLClickEvent: function triggerCellDBLClickEvent(event, params) {
|
|
8764
|
-
var
|
|
8843
|
+
var _this34 = this;
|
|
8765
8844
|
var editStore = this.editStore, editConfig = this.editConfig;
|
|
8766
8845
|
var actived = editStore.actived;
|
|
8767
8846
|
var isActiveNewCell = !actived.args || event.currentTarget !== actived.args.cell;
|
|
@@ -8770,8 +8849,8 @@ var Methods$d = {
|
|
|
8770
8849
|
this.triggerValidate("blur").catch(function(e) {
|
|
8771
8850
|
return e;
|
|
8772
8851
|
}).then(function() {
|
|
8773
|
-
|
|
8774
|
-
return
|
|
8852
|
+
_this34.handleActived(params, event).then(function() {
|
|
8853
|
+
return _this34.triggerValidate("change");
|
|
8775
8854
|
}).catch(function(e) {
|
|
8776
8855
|
return e;
|
|
8777
8856
|
});
|
|
@@ -8779,7 +8858,7 @@ var Methods$d = {
|
|
|
8779
8858
|
}
|
|
8780
8859
|
if (isDblclickNewCell && editConfig.mode === "cell") {
|
|
8781
8860
|
this.handleActived(params, event).then(function() {
|
|
8782
|
-
return
|
|
8861
|
+
return _this34.triggerValidate("change");
|
|
8783
8862
|
}).catch(function(e) {
|
|
8784
8863
|
return e;
|
|
8785
8864
|
});
|
|
@@ -8838,8 +8917,8 @@ var Methods$d = {
|
|
|
8838
8917
|
this.groupExpandeds.push(row2);
|
|
8839
8918
|
},
|
|
8840
8919
|
// 展开行事件
|
|
8841
|
-
triggerRowExpandEvent: function triggerRowExpandEvent(event,
|
|
8842
|
-
var row2 =
|
|
8920
|
+
triggerRowExpandEvent: function triggerRowExpandEvent(event, _ref167) {
|
|
8921
|
+
var row2 = _ref167.row;
|
|
8843
8922
|
var rest = this.toggleRowExpansion(row2);
|
|
8844
8923
|
var eventParams = {
|
|
8845
8924
|
$table: this,
|
|
@@ -8856,7 +8935,7 @@ var Methods$d = {
|
|
|
8856
8935
|
// 处理默认展开行
|
|
8857
8936
|
handleDefaultRowExpand: function handleDefaultRowExpand() {
|
|
8858
8937
|
var fullDataRowIdData = this.fullDataRowIdData, tableFullData = this.tableFullData;
|
|
8859
|
-
var
|
|
8938
|
+
var _ref168 = this.expandConfig || {}, expandAll = _ref168.expandAll, expandRowKeys = _ref168.expandRowKeys;
|
|
8860
8939
|
if (expandAll) {
|
|
8861
8940
|
this.expandeds = tableFullData.slice(0);
|
|
8862
8941
|
return;
|
|
@@ -8877,7 +8956,7 @@ var Methods$d = {
|
|
|
8877
8956
|
// 设置展开行,二个参数设置这一行展开与否;支持单行;支持多行
|
|
8878
8957
|
setRowExpansion: function setRowExpansion(rows, expanded) {
|
|
8879
8958
|
var expandeds = this.expandeds;
|
|
8880
|
-
var
|
|
8959
|
+
var _ref169 = this.expandConfig || {}, accordion = _ref169.accordion;
|
|
8881
8960
|
var isToggle = arguments.length === 1;
|
|
8882
8961
|
var isAccordionCloseAll = false;
|
|
8883
8962
|
if (!rows) {
|
|
@@ -8909,11 +8988,11 @@ var Methods$d = {
|
|
|
8909
8988
|
return ~this.expandeds.indexOf(row2);
|
|
8910
8989
|
},
|
|
8911
8990
|
clearRowExpand: function clearRowExpand() {
|
|
8912
|
-
var
|
|
8991
|
+
var _this35 = this;
|
|
8913
8992
|
var hasExpand = this.expandeds.length;
|
|
8914
8993
|
this.expandeds = [];
|
|
8915
8994
|
return this.$nextTick().then(function() {
|
|
8916
|
-
return hasExpand ?
|
|
8995
|
+
return hasExpand ? _this35.recalculate() : 0;
|
|
8917
8996
|
});
|
|
8918
8997
|
},
|
|
8919
8998
|
// 获取虚拟滚动状态
|
|
@@ -8932,13 +9011,13 @@ var Methods$d = {
|
|
|
8932
9011
|
this.loadScrollXData(event);
|
|
8933
9012
|
},
|
|
8934
9013
|
debounceScrollX: function debounceScrollX(event) {
|
|
8935
|
-
var
|
|
9014
|
+
var _this36 = this;
|
|
8936
9015
|
if (!this.tasks.debounceScrollX) {
|
|
8937
9016
|
this.tasks.debounceScrollXHandler = null;
|
|
8938
9017
|
this.tasks.debounceScrollX = function() {
|
|
8939
9018
|
return requestAnimationFrame(function() {
|
|
8940
|
-
|
|
8941
|
-
|
|
9019
|
+
_this36.tasks.debounceScrollXHandler = null;
|
|
9020
|
+
_this36.loadScrollXData(event);
|
|
8942
9021
|
});
|
|
8943
9022
|
};
|
|
8944
9023
|
}
|
|
@@ -8953,7 +9032,7 @@ var Methods$d = {
|
|
|
8953
9032
|
var scrollXStore = this.scrollXStore, visibleColumn = this.visibleColumn;
|
|
8954
9033
|
var offsetSize = scrollXStore.offsetSize, renderSize = scrollXStore.renderSize, startIndex = scrollXStore.startIndex, visibleIndex = scrollXStore.visibleIndex, visibleSize = scrollXStore.visibleSize;
|
|
8955
9034
|
var scrollLeft = this.$refs.tableBody.$el.scrollLeft;
|
|
8956
|
-
var
|
|
9035
|
+
var _ref170 = {}, _ref170$preload = _ref170.preload, preload = _ref170$preload === void 0 ? false : _ref170$preload, _ref170$toVisibleInde = _ref170.toVisibleIndex, toVisibleIndex = _ref170$toVisibleInde === void 0 ? 0 : _ref170$toVisibleInde, _ref170$width = _ref170.width, width = _ref170$width === void 0 ? 0 : _ref170$width;
|
|
8957
9036
|
for (var i = 0; i < visibleColumn.length; i++) {
|
|
8958
9037
|
width += visibleColumn[i].renderWidth;
|
|
8959
9038
|
if (scrollLeft < width) {
|
|
@@ -8989,21 +9068,21 @@ var Methods$d = {
|
|
|
8989
9068
|
},
|
|
8990
9069
|
// 处理滚动分页相关逻辑
|
|
8991
9070
|
debounceScrollLoad: function debounceScrollLoad(event) {
|
|
8992
|
-
var
|
|
9071
|
+
var _this37 = this;
|
|
8993
9072
|
if (!this.tasks.debounceScrollLoad) {
|
|
8994
9073
|
this.tasks.debounceScrollLoad = debounce(debounceScrollLoadDuration, function() {
|
|
8995
|
-
var
|
|
8996
|
-
var
|
|
9074
|
+
var _this37$scrollLoadSto = _this37.scrollLoadStore, scrollHeight = _this37$scrollLoadSto.scrollHeight, bodyHeight = _this37$scrollLoadSto.bodyHeight;
|
|
9075
|
+
var _this37$$grid$tablePa = _this37.$grid.tablePage, currentPage = _this37$$grid$tablePa.currentPage, pageSize = _this37$$grid$tablePa.pageSize;
|
|
8997
9076
|
var max = scrollHeight - bodyHeight;
|
|
8998
|
-
var scrollTop = event.
|
|
9077
|
+
var scrollTop = getActualTarget(event).scrollTop;
|
|
8999
9078
|
if (scrollTop > max) {
|
|
9000
9079
|
scrollTop = max;
|
|
9001
9080
|
}
|
|
9002
|
-
var rowHeight =
|
|
9081
|
+
var rowHeight = _this37.scrollYStore.rowHeight;
|
|
9003
9082
|
var visibleIndex = Math.ceil(scrollTop / rowHeight);
|
|
9004
9083
|
var page = Math.ceil(visibleIndex / pageSize) + 1;
|
|
9005
9084
|
if (currentPage !== page) {
|
|
9006
|
-
|
|
9085
|
+
_this37.$grid.pageCurrentChange(page);
|
|
9007
9086
|
}
|
|
9008
9087
|
});
|
|
9009
9088
|
}
|
|
@@ -9011,10 +9090,10 @@ var Methods$d = {
|
|
|
9011
9090
|
},
|
|
9012
9091
|
// 纵向 Y 可视渲染处理
|
|
9013
9092
|
loadScrollYData: function loadScrollYData(event) {
|
|
9014
|
-
var
|
|
9093
|
+
var _this38 = this;
|
|
9015
9094
|
var scrollYStore = this.scrollYStore;
|
|
9016
9095
|
var startIndex = scrollYStore.startIndex, renderSize = scrollYStore.renderSize, offsetSize = scrollYStore.offsetSize, visibleIndex = scrollYStore.visibleIndex, visibleSize = scrollYStore.visibleSize, rowHeight = scrollYStore.rowHeight;
|
|
9017
|
-
var scrollTop =
|
|
9096
|
+
var _getActualTarget = getActualTarget(event), scrollTop = _getActualTarget.scrollTop;
|
|
9018
9097
|
var toVisibleIndex = Math.ceil(scrollTop / rowHeight);
|
|
9019
9098
|
var preload = false;
|
|
9020
9099
|
if (visibleIndex === toVisibleIndex) {
|
|
@@ -9037,7 +9116,7 @@ var Methods$d = {
|
|
|
9037
9116
|
}
|
|
9038
9117
|
scrollYStore.visibleIndex = toVisibleIndex;
|
|
9039
9118
|
this.$nextTick(function() {
|
|
9040
|
-
|
|
9119
|
+
_this38.updateSelectedCls(true);
|
|
9041
9120
|
});
|
|
9042
9121
|
},
|
|
9043
9122
|
getRowHeight: function getRowHeight() {
|
|
@@ -9045,16 +9124,16 @@ var Methods$d = {
|
|
|
9045
9124
|
},
|
|
9046
9125
|
// 计算可视渲染相关数据
|
|
9047
9126
|
computeScrollLoad: function computeScrollLoad() {
|
|
9048
|
-
var
|
|
9127
|
+
var _this39 = this;
|
|
9049
9128
|
return this.$nextTick().then(function() {
|
|
9050
|
-
var $refs =
|
|
9051
|
-
var scrollLoad =
|
|
9129
|
+
var $refs = _this39.$refs, optimizeOpts = _this39.optimizeOpts, visibleColumn = _this39.visibleColumn;
|
|
9130
|
+
var scrollLoad = _this39.scrollLoad, scrollXLoad = _this39.scrollXLoad, scrollXStore = _this39.scrollXStore, scrollYLoad = _this39.scrollYLoad, scrollYStore = _this39.scrollYStore;
|
|
9052
9131
|
var scrollX = optimizeOpts.scrollX, scrollY = optimizeOpts.scrollY;
|
|
9053
9132
|
var tableBody = $refs.tableBody;
|
|
9054
9133
|
var bodyElem = tableBody ? tableBody.$el : null;
|
|
9055
9134
|
if (bodyElem) {
|
|
9056
9135
|
computeScrollXLoad({
|
|
9057
|
-
_vm:
|
|
9136
|
+
_vm: _this39,
|
|
9058
9137
|
scrollX,
|
|
9059
9138
|
scrollXLoad,
|
|
9060
9139
|
scrollXStore,
|
|
@@ -9062,7 +9141,7 @@ var Methods$d = {
|
|
|
9062
9141
|
visibleColumn
|
|
9063
9142
|
});
|
|
9064
9143
|
computeScrollYLoad({
|
|
9065
|
-
_vm:
|
|
9144
|
+
_vm: _this39,
|
|
9066
9145
|
scrollLoad,
|
|
9067
9146
|
scrollY,
|
|
9068
9147
|
scrollYLoad,
|
|
@@ -9070,7 +9149,7 @@ var Methods$d = {
|
|
|
9070
9149
|
tableBodyElem: bodyElem
|
|
9071
9150
|
});
|
|
9072
9151
|
}
|
|
9073
|
-
|
|
9152
|
+
_this39.$nextTick(_this39.updateStyle);
|
|
9074
9153
|
});
|
|
9075
9154
|
},
|
|
9076
9155
|
updateScrollXData: function updateScrollXData() {
|
|
@@ -9100,10 +9179,10 @@ var Methods$d = {
|
|
|
9100
9179
|
}
|
|
9101
9180
|
},
|
|
9102
9181
|
updateScrollYData: function updateScrollYData() {
|
|
9103
|
-
var
|
|
9182
|
+
var _this40 = this;
|
|
9104
9183
|
this.updateScrollYSpace();
|
|
9105
9184
|
this.handleTableData().then(function() {
|
|
9106
|
-
return
|
|
9185
|
+
return _this40.updateStyle();
|
|
9107
9186
|
});
|
|
9108
9187
|
},
|
|
9109
9188
|
// 更新纵向 Y 可视渲染上下剩余空间大小
|
|
@@ -9120,7 +9199,7 @@ var Methods$d = {
|
|
|
9120
9199
|
},
|
|
9121
9200
|
updateScrollLoadBar: function updateScrollLoadBar(event) {
|
|
9122
9201
|
var $el = this.$el, elemStore = this.elemStore, scrollLoad = this.scrollLoad, scrollLoadStore = this.scrollLoadStore;
|
|
9123
|
-
if (scrollLoad && $el.contains(event
|
|
9202
|
+
if (scrollLoad && $el.contains(getActualTarget(event))) {
|
|
9124
9203
|
var wheelDelta = event.wheelDelta ? event.wheelDelta : -event.detail * 40;
|
|
9125
9204
|
var scrollElm = elemStore["main-body-ySpace"];
|
|
9126
9205
|
var scrollHeight = scrollLoadStore.scrollHeight, bodyHeight = scrollLoadStore.bodyHeight;
|
|
@@ -9149,7 +9228,7 @@ var Methods$d = {
|
|
|
9149
9228
|
return this.scrollToColumn(column, isDelayArg, move);
|
|
9150
9229
|
},
|
|
9151
9230
|
scrollToTreeRow: function scrollToTreeRow(row2) {
|
|
9152
|
-
var
|
|
9231
|
+
var _this41 = this;
|
|
9153
9232
|
var tableFullData = this.tableFullData, treeConfig = this.treeConfig;
|
|
9154
9233
|
if (!treeConfig) {
|
|
9155
9234
|
return this.$nextTick();
|
|
@@ -9162,20 +9241,20 @@ var Methods$d = {
|
|
|
9162
9241
|
}
|
|
9163
9242
|
var nodes = matchObj.nodes;
|
|
9164
9243
|
nodes.forEach(function(row22, index2) {
|
|
9165
|
-
if (index2 === nodes.length - 1 ||
|
|
9244
|
+
if (index2 === nodes.length - 1 || _this41.hasTreeExpand(row22)) {
|
|
9166
9245
|
return;
|
|
9167
9246
|
}
|
|
9168
|
-
|
|
9247
|
+
_this41.setTreeExpansion(row22, true);
|
|
9169
9248
|
});
|
|
9170
9249
|
return this.$nextTick();
|
|
9171
9250
|
},
|
|
9172
9251
|
scrollToColumn: function scrollToColumn(column, isDelay, move) {
|
|
9173
|
-
var
|
|
9252
|
+
var _this42 = this;
|
|
9174
9253
|
var hasColCache = this.fullColumnMap.has(column);
|
|
9175
9254
|
column && hasColCache && colToVisible(this, column, move);
|
|
9176
9255
|
return isDelay && (this.scrollXLoad || this.scrollYLoad) ? new Promise(function(resolve) {
|
|
9177
9256
|
return setTimeout(function() {
|
|
9178
|
-
return resolve(
|
|
9257
|
+
return resolve(_this42.$nextTick());
|
|
9179
9258
|
}, 50);
|
|
9180
9259
|
}) : this.$nextTick();
|
|
9181
9260
|
},
|
|
@@ -9183,7 +9262,7 @@ var Methods$d = {
|
|
|
9183
9262
|
this.lastScrollTop = 0;
|
|
9184
9263
|
},
|
|
9185
9264
|
clearScroll: function clearScroll() {
|
|
9186
|
-
var
|
|
9265
|
+
var _this43 = this;
|
|
9187
9266
|
var $grid = this.$grid, scrollXStore = this.scrollXStore, scrollYStore = this.scrollYStore, elemStore = this.elemStore;
|
|
9188
9267
|
var _$grid$fetchOption = $grid.fetchOption, fetchOption = _$grid$fetchOption === void 0 ? {} : _$grid$fetchOption;
|
|
9189
9268
|
var _fetchOption$isReload2 = fetchOption.isReloadScroll, isReloadScroll = _fetchOption$isReload2 === void 0 ? false : _fetchOption$isReload2;
|
|
@@ -9204,7 +9283,7 @@ var Methods$d = {
|
|
|
9204
9283
|
});
|
|
9205
9284
|
return this.$nextTick(function() {
|
|
9206
9285
|
var tableBodyElem = elemStore["main-body-wrapper"];
|
|
9207
|
-
if (
|
|
9286
|
+
if (_this43.afterMounted) {
|
|
9208
9287
|
fastdom.mutate(function() {
|
|
9209
9288
|
tableBodyElem && Object.assign(tableBodyElem, {
|
|
9210
9289
|
scrollLeft: 0,
|
|
@@ -9221,16 +9300,16 @@ var Methods$d = {
|
|
|
9221
9300
|
return;
|
|
9222
9301
|
}
|
|
9223
9302
|
if (footerMethod && showFooter) {
|
|
9224
|
-
var
|
|
9303
|
+
var data7 = footerMethod({
|
|
9225
9304
|
columns: tableColumn2,
|
|
9226
9305
|
data: afterFullData
|
|
9227
9306
|
});
|
|
9228
|
-
if (
|
|
9307
|
+
if (data7.length && data7.some(function(value) {
|
|
9229
9308
|
return !isArray(value);
|
|
9230
9309
|
})) {
|
|
9231
|
-
|
|
9310
|
+
data7 = [data7];
|
|
9232
9311
|
}
|
|
9233
|
-
this.footerData = tableColumn2.length ?
|
|
9312
|
+
this.footerData = tableColumn2.length ? data7 : [];
|
|
9234
9313
|
}
|
|
9235
9314
|
if (summaryConfig) {
|
|
9236
9315
|
var fields = summaryConfig.fields, fraction = summaryConfig.fraction, text = summaryConfig.text, _truncate = summaryConfig.truncate;
|
|
@@ -9250,7 +9329,7 @@ var Methods$d = {
|
|
|
9250
9329
|
},
|
|
9251
9330
|
// 更新列状态:如果组件值v-model发生change,调用该函数更新列的编辑状态。如果单元格配置了校验规则,则进行校验
|
|
9252
9331
|
updateStatus: function updateStatus(scope, cellValue, renderOpts) {
|
|
9253
|
-
var
|
|
9332
|
+
var _this44 = this;
|
|
9254
9333
|
var $refs = this.$refs, editRules = this.editRules, tableData = this.tableData, validStore = this.validStore;
|
|
9255
9334
|
var tableBody = $refs.tableBody;
|
|
9256
9335
|
if (!scope || !tableBody) {
|
|
@@ -9260,9 +9339,9 @@ var Methods$d = {
|
|
|
9260
9339
|
var type = "change";
|
|
9261
9340
|
var refreshStatus = function refreshStatus2() {
|
|
9262
9341
|
if (!isUndefined(cellValue)) {
|
|
9263
|
-
var
|
|
9264
|
-
|
|
9265
|
-
(
|
|
9342
|
+
var _this44$$refs$tableBo;
|
|
9343
|
+
_this44.updateRowStatus(row2);
|
|
9344
|
+
(_this44$$refs$tableBo = _this44.$refs.tableBody) == null ? void 0 : _this44$$refs$tableBo.$forceUpdate();
|
|
9266
9345
|
}
|
|
9267
9346
|
};
|
|
9268
9347
|
if (!editRules || !this.hasCellRules(type, row2, column)) {
|
|
@@ -9281,13 +9360,13 @@ var Methods$d = {
|
|
|
9281
9360
|
if (!cell) {
|
|
9282
9361
|
return;
|
|
9283
9362
|
}
|
|
9284
|
-
return
|
|
9363
|
+
return _this44.validCellRules(type, row2, column, cellValue).then(function() {
|
|
9285
9364
|
refreshStatus();
|
|
9286
|
-
|
|
9287
|
-
}).catch(function(
|
|
9288
|
-
var rule =
|
|
9365
|
+
_this44.clearValidate();
|
|
9366
|
+
}).catch(function(_ref171) {
|
|
9367
|
+
var rule = _ref171.rule;
|
|
9289
9368
|
refreshStatus();
|
|
9290
|
-
|
|
9369
|
+
_this44.showValidTooltip({
|
|
9291
9370
|
rule,
|
|
9292
9371
|
row: row2,
|
|
9293
9372
|
column,
|
|
@@ -9299,15 +9378,15 @@ var Methods$d = {
|
|
|
9299
9378
|
},
|
|
9300
9379
|
/* X/Y 方向滚动 */
|
|
9301
9380
|
updateScrollStatus: function updateScrollStatus() {
|
|
9302
|
-
var
|
|
9381
|
+
var _this45 = this;
|
|
9303
9382
|
if (!this.tasks.updateScrollStatus) {
|
|
9304
9383
|
this.tasks.updateScrollStatus = debounce(AsyncCollectTimeout, function() {
|
|
9305
|
-
var scrollXLoad =
|
|
9384
|
+
var scrollXLoad = _this45.scrollXLoad, scrollYLoad = _this45.scrollYLoad, isAsyncColumn = _this45.isAsyncColumn;
|
|
9306
9385
|
if (isAsyncColumn && (scrollXLoad || scrollYLoad)) {
|
|
9307
|
-
var tableData =
|
|
9386
|
+
var tableData = _this45.tableData, scrollXStore = _this45.scrollXStore, scrollYStore = _this45.scrollYStore, tableFullData = _this45.tableFullData, _this45$scrollDirecti = _this45.scrollDirection, scrollDirection = _this45$scrollDirecti === void 0 ? "N" : _this45$scrollDirecti;
|
|
9308
9387
|
var isInit = scrollXLoad && scrollXStore.visibleIndex === 0 || scrollYLoad && scrollYStore.visibleIndex === 0;
|
|
9309
9388
|
if (isInit || scrollDirection !== "N") {
|
|
9310
|
-
|
|
9389
|
+
_this45.handleResolveColumn(tableFullData, _this45.collectAsyncColumn(tableData));
|
|
9311
9390
|
}
|
|
9312
9391
|
}
|
|
9313
9392
|
});
|
|
@@ -9324,7 +9403,7 @@ var Methods$d = {
|
|
|
9324
9403
|
},
|
|
9325
9404
|
// 收集异步列
|
|
9326
9405
|
collectAsyncColumn: function collectAsyncColumn(tableData) {
|
|
9327
|
-
var
|
|
9406
|
+
var _this46 = this;
|
|
9328
9407
|
var fetchColumns = [];
|
|
9329
9408
|
var rowId = this.rowId, asyncRenderMap = this.asyncRenderMap, tableColumn2 = this.tableColumn;
|
|
9330
9409
|
if (!rowId) {
|
|
@@ -9332,8 +9411,8 @@ var Methods$d = {
|
|
|
9332
9411
|
return fetchColumns;
|
|
9333
9412
|
}
|
|
9334
9413
|
tableColumn2.forEach(function(col) {
|
|
9335
|
-
var
|
|
9336
|
-
var
|
|
9414
|
+
var _ref172 = col.format || {}, async = _ref172.async;
|
|
9415
|
+
var _ref173 = async || {}, fetch = _ref173.fetch, _ref173$splitConfig = _ref173.splitConfig, splitConfig = _ref173$splitConfig === void 0 ? {} : _ref173$splitConfig;
|
|
9337
9416
|
if (typeof fetch === "function") {
|
|
9338
9417
|
var columnValues = [];
|
|
9339
9418
|
tableData.forEach(function(row2) {
|
|
@@ -9343,7 +9422,7 @@ var Methods$d = {
|
|
|
9343
9422
|
}
|
|
9344
9423
|
var cellValuesCount = 1;
|
|
9345
9424
|
var cellValues = [cellValue];
|
|
9346
|
-
var uniqueKey =
|
|
9425
|
+
var uniqueKey = _this46.getAsyncColumnUniqueKey(col.property, row2);
|
|
9347
9426
|
if (splitConfig.enabled === true) {
|
|
9348
9427
|
cellValues = cellValue.split(splitConfig.valueSplit || ",");
|
|
9349
9428
|
cellValuesCount = cellValues.length;
|
|
@@ -9393,8 +9472,8 @@ var Methods$d = {
|
|
|
9393
9472
|
}, this));
|
|
9394
9473
|
},
|
|
9395
9474
|
// Publish methods 与工具栏对接
|
|
9396
|
-
connect: function connect(
|
|
9397
|
-
var toolbar =
|
|
9475
|
+
connect: function connect(_ref174) {
|
|
9476
|
+
var toolbar = _ref174.toolbar;
|
|
9398
9477
|
this.$toolbar = toolbar;
|
|
9399
9478
|
},
|
|
9400
9479
|
// 检查触发源是否属于目标节点
|
|
@@ -9420,7 +9499,7 @@ var Methods$d = {
|
|
|
9420
9499
|
},
|
|
9421
9500
|
handleDataChange: function handleDataChange() {
|
|
9422
9501
|
if (Array.isArray(this.data)) {
|
|
9423
|
-
!this._isUpdateData && this.loadTableData(this.data
|
|
9502
|
+
!this._isUpdateData && this.loadTableData(this.data);
|
|
9424
9503
|
this._isUpdateData = false;
|
|
9425
9504
|
}
|
|
9426
9505
|
},
|
|
@@ -9453,8 +9532,8 @@ var Methods$d = {
|
|
|
9453
9532
|
},
|
|
9454
9533
|
// 尝试恢复滚动位置,规范了最大滚动位置的取值
|
|
9455
9534
|
attemptRestoreScroll: function attemptRestoreScroll(options) {
|
|
9456
|
-
var
|
|
9457
|
-
var
|
|
9535
|
+
var _this47 = this;
|
|
9536
|
+
var _ref175 = options || this, lastScrollTop = _ref175.lastScrollTop, lastScrollLeft = _ref175.lastScrollLeft;
|
|
9458
9537
|
var scrollXLoad = this.scrollXLoad, scrollYLoad = this.scrollYLoad, elemStore = this.elemStore;
|
|
9459
9538
|
var tableBodyElem = elemStore["main-body-wrapper"];
|
|
9460
9539
|
if ((lastScrollTop || lastScrollLeft) && tableBodyElem) {
|
|
@@ -9464,14 +9543,14 @@ var Methods$d = {
|
|
|
9464
9543
|
lastScrollTop = Math.min(lastScrollTop, maxScrollTop);
|
|
9465
9544
|
lastScrollLeft = Math.min(lastScrollLeft, maxScrollLeft);
|
|
9466
9545
|
fastdom.mutate(function() {
|
|
9467
|
-
|
|
9468
|
-
|
|
9546
|
+
_this47.restoreScollFlag = true;
|
|
9547
|
+
_this47.scrollTo(lastScrollLeft, lastScrollTop);
|
|
9469
9548
|
requestAnimationFrame(function() {
|
|
9470
|
-
var
|
|
9471
|
-
return (
|
|
9549
|
+
var _this47$$refs$tableBo;
|
|
9550
|
+
return (_this47$$refs$tableBo = _this47.$refs.tableBody) == null ? void 0 : _this47$$refs$tableBo.resetStickyWrapperScrollPos();
|
|
9472
9551
|
});
|
|
9473
|
-
scrollXLoad &&
|
|
9474
|
-
scrollYLoad &&
|
|
9552
|
+
scrollXLoad && _this47.triggerScrollXEvent();
|
|
9553
|
+
scrollYLoad && _this47.triggerScrollYEvent({
|
|
9475
9554
|
target: {
|
|
9476
9555
|
scrollTop: lastScrollTop
|
|
9477
9556
|
}
|
|
@@ -9532,9 +9611,9 @@ function __vue2_injectStyles$9(context) {
|
|
|
9532
9611
|
this[o] = __cssModules$9[o];
|
|
9533
9612
|
}
|
|
9534
9613
|
}
|
|
9535
|
-
var ColumnType = /* @__PURE__ */ function() {
|
|
9614
|
+
var ColumnType = /* @__PURE__ */ (function() {
|
|
9536
9615
|
return __component__$9.exports;
|
|
9537
|
-
}();
|
|
9616
|
+
})();
|
|
9538
9617
|
var __vue2_script$8 = defineComponent({
|
|
9539
9618
|
inject: ["$mftable"],
|
|
9540
9619
|
props: _extends({}, $props, {
|
|
@@ -9542,7 +9621,7 @@ var __vue2_script$8 = defineComponent({
|
|
|
9542
9621
|
row: Object
|
|
9543
9622
|
}),
|
|
9544
9623
|
render: function render8() {
|
|
9545
|
-
var
|
|
9624
|
+
var _this48 = this;
|
|
9546
9625
|
var datas = this.datas, row2 = this.row;
|
|
9547
9626
|
var primaryColumn = datas.primaryColumn, contentColumns = datas.contentColumns, genParams2 = datas.genParams, config2 = datas.config, cardView2 = datas.cardView;
|
|
9548
9627
|
var _config$cardConfig = config2.cardConfig, cardConfig = _config$cardConfig === void 0 ? {} : _config$cardConfig;
|
|
@@ -9554,8 +9633,8 @@ var __vue2_script$8 = defineComponent({
|
|
|
9554
9633
|
};
|
|
9555
9634
|
var ons = function ons2() {
|
|
9556
9635
|
return {
|
|
9557
|
-
mouseenter:
|
|
9558
|
-
mouseleave:
|
|
9636
|
+
mouseenter: _this48.handleMouseenter,
|
|
9637
|
+
mouseleave: _this48.handleMouseleave
|
|
9559
9638
|
};
|
|
9560
9639
|
};
|
|
9561
9640
|
if (!primaryColumn || !primaryColumn.renderCell) {
|
|
@@ -9700,9 +9779,9 @@ function __vue2_injectStyles$8(context) {
|
|
|
9700
9779
|
this[o] = __cssModules$8[o];
|
|
9701
9780
|
}
|
|
9702
9781
|
}
|
|
9703
|
-
var ColumnContent = /* @__PURE__ */ function() {
|
|
9782
|
+
var ColumnContent = /* @__PURE__ */ (function() {
|
|
9704
9783
|
return __component__$8.exports;
|
|
9705
|
-
}();
|
|
9784
|
+
})();
|
|
9706
9785
|
var __vue2_script$7 = defineComponent({
|
|
9707
9786
|
props: _extends({}, $props, {
|
|
9708
9787
|
datas: Object,
|
|
@@ -9726,8 +9805,8 @@ var __vue2_script$7 = defineComponent({
|
|
|
9726
9805
|
return typeof hidden === "boolean" && hidden || typeof hidden === "function" && hidden(row2);
|
|
9727
9806
|
};
|
|
9728
9807
|
var handleItemClick = function handleItemClick2(name) {
|
|
9729
|
-
var buttonConfig = visibleButtons.find(function(
|
|
9730
|
-
var buttonName =
|
|
9808
|
+
var buttonConfig = visibleButtons.find(function(_ref176) {
|
|
9809
|
+
var buttonName = _ref176.name;
|
|
9731
9810
|
return buttonName === name;
|
|
9732
9811
|
});
|
|
9733
9812
|
buttonConfig.click(window.event || {}, _extends({
|
|
@@ -9816,9 +9895,9 @@ function __vue2_injectStyles$7(context) {
|
|
|
9816
9895
|
this[o] = __cssModules$7[o];
|
|
9817
9896
|
}
|
|
9818
9897
|
}
|
|
9819
|
-
var ColumnLink = /* @__PURE__ */ function() {
|
|
9898
|
+
var ColumnLink = /* @__PURE__ */ (function() {
|
|
9820
9899
|
return __component__$7.exports;
|
|
9821
|
-
}();
|
|
9900
|
+
})();
|
|
9822
9901
|
var __vue2_script$6 = defineComponent({
|
|
9823
9902
|
props: _extends({}, $props, {
|
|
9824
9903
|
datas: Object,
|
|
@@ -9874,9 +9953,9 @@ function __vue2_injectStyles$6(context) {
|
|
|
9874
9953
|
this[o] = __cssModules$6[o];
|
|
9875
9954
|
}
|
|
9876
9955
|
}
|
|
9877
|
-
var ColumnLayout = /* @__PURE__ */ function() {
|
|
9956
|
+
var ColumnLayout = /* @__PURE__ */ (function() {
|
|
9878
9957
|
return __component__$6.exports;
|
|
9879
|
-
}();
|
|
9958
|
+
})();
|
|
9880
9959
|
var __vue2_script$5 = defineComponent({
|
|
9881
9960
|
components: {
|
|
9882
9961
|
ColumnLayout
|
|
@@ -9946,9 +10025,9 @@ function __vue2_injectStyles$5(context) {
|
|
|
9946
10025
|
this[o] = __cssModules$5[o];
|
|
9947
10026
|
}
|
|
9948
10027
|
}
|
|
9949
|
-
var TableRow = /* @__PURE__ */ function() {
|
|
10028
|
+
var TableRow = /* @__PURE__ */ (function() {
|
|
9950
10029
|
return __component__$5.exports;
|
|
9951
|
-
}();
|
|
10030
|
+
})();
|
|
9952
10031
|
var __vue2_script$4 = defineComponent({
|
|
9953
10032
|
inject: ["$mftable"],
|
|
9954
10033
|
props: _extends({}, $props),
|
|
@@ -9973,9 +10052,9 @@ function __vue2_injectStyles$4(context) {
|
|
|
9973
10052
|
this[o] = __cssModules$4[o];
|
|
9974
10053
|
}
|
|
9975
10054
|
}
|
|
9976
|
-
var ListView = /* @__PURE__ */ function() {
|
|
10055
|
+
var ListView = /* @__PURE__ */ (function() {
|
|
9977
10056
|
return __component__$4.exports;
|
|
9978
|
-
}();
|
|
10057
|
+
})();
|
|
9979
10058
|
var __vue2_script$3 = defineComponent({
|
|
9980
10059
|
inject: ["$mftable"],
|
|
9981
10060
|
props: _extends({}, $props),
|
|
@@ -10000,9 +10079,9 @@ function __vue2_injectStyles$3(context) {
|
|
|
10000
10079
|
this[o] = __cssModules$3[o];
|
|
10001
10080
|
}
|
|
10002
10081
|
}
|
|
10003
|
-
var GanttView = /* @__PURE__ */ function() {
|
|
10082
|
+
var GanttView = /* @__PURE__ */ (function() {
|
|
10004
10083
|
return __component__$3.exports;
|
|
10005
|
-
}();
|
|
10084
|
+
})();
|
|
10006
10085
|
var __vue2_script$2 = defineComponent({
|
|
10007
10086
|
inject: ["$mftable"],
|
|
10008
10087
|
props: _extends({}, $props),
|
|
@@ -10027,9 +10106,9 @@ function __vue2_injectStyles$2(context) {
|
|
|
10027
10106
|
this[o] = __cssModules$2[o];
|
|
10028
10107
|
}
|
|
10029
10108
|
}
|
|
10030
|
-
var CustomView = /* @__PURE__ */ function() {
|
|
10109
|
+
var CustomView = /* @__PURE__ */ (function() {
|
|
10031
10110
|
return __component__$2.exports;
|
|
10032
|
-
}();
|
|
10111
|
+
})();
|
|
10033
10112
|
var __vue2_script$1 = defineComponent({
|
|
10034
10113
|
inject: ["$mftable"],
|
|
10035
10114
|
props: _extends({}, $props),
|
|
@@ -10062,9 +10141,9 @@ function __vue2_injectStyles$1(context) {
|
|
|
10062
10141
|
this[o] = __cssModules$1[o];
|
|
10063
10142
|
}
|
|
10064
10143
|
}
|
|
10065
|
-
var CustomEmpty = /* @__PURE__ */ function() {
|
|
10144
|
+
var CustomEmpty = /* @__PURE__ */ (function() {
|
|
10066
10145
|
return __component__$1.exports;
|
|
10067
|
-
}();
|
|
10146
|
+
})();
|
|
10068
10147
|
var __vue2_script = defineComponent({
|
|
10069
10148
|
components: {
|
|
10070
10149
|
TableRow,
|
|
@@ -10496,9 +10575,9 @@ function __vue2_injectStyles(context) {
|
|
|
10496
10575
|
this[o] = __cssModules[o];
|
|
10497
10576
|
}
|
|
10498
10577
|
}
|
|
10499
|
-
var MfTable = /* @__PURE__ */ function() {
|
|
10578
|
+
var MfTable = /* @__PURE__ */ (function() {
|
|
10500
10579
|
return __component__.exports;
|
|
10501
|
-
}();
|
|
10580
|
+
})();
|
|
10502
10581
|
var themes$1 = GlobalConfig$1.themes, viewConfig$1 = GlobalConfig$1.viewConfig, columnLevelKey$1 = GlobalConfig$1.columnLevelKey, defaultColumnName$1 = GlobalConfig$1.defaultColumnName;
|
|
10503
10582
|
var T_TINY = themes$1.TINY, T_SAAS$1 = themes$1.SAAS;
|
|
10504
10583
|
var V_DEFAULT$1 = viewConfig$1.DEFAULT, V_MF$1 = viewConfig$1.MF;
|
|
@@ -10540,9 +10619,9 @@ function mergeScrollDirStore(scrollDir, scrollDirStore) {
|
|
|
10540
10619
|
});
|
|
10541
10620
|
}
|
|
10542
10621
|
}
|
|
10543
|
-
function loadStatic(
|
|
10544
|
-
if (
|
|
10545
|
-
_vm.loadTableData(
|
|
10622
|
+
function loadStatic(data7, _vm) {
|
|
10623
|
+
if (data7 && data7.length > 0) {
|
|
10624
|
+
_vm.loadTableData(data7, true);
|
|
10546
10625
|
_vm.updateStyle();
|
|
10547
10626
|
}
|
|
10548
10627
|
}
|
|
@@ -10968,7 +11047,8 @@ var Table = defineComponent({
|
|
|
10968
11047
|
id: "",
|
|
10969
11048
|
multi: false,
|
|
10970
11049
|
options: [],
|
|
10971
|
-
visible: false
|
|
11050
|
+
visible: false,
|
|
11051
|
+
searchValue: ""
|
|
10972
11052
|
},
|
|
10973
11053
|
// 所有列已禁用
|
|
10974
11054
|
headerCheckDisabled: false,
|
|
@@ -11154,7 +11234,15 @@ var Table = defineComponent({
|
|
|
11154
11234
|
this.handleSelectionHeader();
|
|
11155
11235
|
},
|
|
11156
11236
|
parentHeight: function parentHeight() {
|
|
11157
|
-
this
|
|
11237
|
+
this.recalculate();
|
|
11238
|
+
},
|
|
11239
|
+
// 选项式监控在vue2可以检测到顶层数组splice项替换/$set项替换
|
|
11240
|
+
// array.splice(index, 1, newItem)
|
|
11241
|
+
// this.$set(array, index, newItem)
|
|
11242
|
+
data: function data5(array1, array2) {
|
|
11243
|
+
if (isVue2 && array1 === array2 && array1.length === array2.length) {
|
|
11244
|
+
this.handleDataChange();
|
|
11245
|
+
}
|
|
11158
11246
|
}
|
|
11159
11247
|
},
|
|
11160
11248
|
created: function created() {
|
|
@@ -11211,13 +11299,13 @@ var Table = defineComponent({
|
|
|
11211
11299
|
cellStatus: /* @__PURE__ */ new Map(),
|
|
11212
11300
|
// 是否具有type selection列
|
|
11213
11301
|
isCheckable: false
|
|
11214
|
-
}), scrollXStore = _Object$assign.scrollXStore, scrollYStore = _Object$assign.scrollYStore, optimizeOpts = _Object$assign.optimizeOpts,
|
|
11302
|
+
}), scrollXStore = _Object$assign.scrollXStore, scrollYStore = _Object$assign.scrollYStore, optimizeOpts = _Object$assign.optimizeOpts, data7 = _Object$assign.data;
|
|
11215
11303
|
var scrollX = optimizeOpts.scrollX, scrollY = optimizeOpts.scrollY;
|
|
11216
11304
|
verifyConfig(this);
|
|
11217
11305
|
mergeScrollDirStore(scrollX, scrollXStore);
|
|
11218
11306
|
mergeScrollDirStore(scrollY, scrollYStore);
|
|
11219
11307
|
mergeTreeConfig(this);
|
|
11220
|
-
loadStatic(
|
|
11308
|
+
loadStatic(data7, this);
|
|
11221
11309
|
bindEvent(this);
|
|
11222
11310
|
this.$grid.connect({
|
|
11223
11311
|
name: "table",
|
|
@@ -11242,6 +11330,8 @@ var Table = defineComponent({
|
|
|
11242
11330
|
var bodyWrapperHeight = hooks.ref();
|
|
11243
11331
|
var bodyWrapperMinHeight = hooks.ref();
|
|
11244
11332
|
var bodyWrapperMaxHeight = hooks.ref();
|
|
11333
|
+
var containerScrollWidth = hooks.ref(0);
|
|
11334
|
+
var containerScrollHeight = hooks.ref(0);
|
|
11245
11335
|
var bodyTableWidth = hooks.ref();
|
|
11246
11336
|
var scrollLoadScrollHeight = hooks.ref();
|
|
11247
11337
|
var columnStore = hooks.ref({
|
|
@@ -11292,8 +11382,8 @@ var Table = defineComponent({
|
|
|
11292
11382
|
return extend(true, {}, GlobalConfig$1.optimization, props.optimization);
|
|
11293
11383
|
});
|
|
11294
11384
|
var rowHeight = hooks.computed(function() {
|
|
11295
|
-
var _optimizeOpts$value, _GlobalConfig$1$rowHe;
|
|
11296
|
-
return ((_optimizeOpts$value = optimizeOpts.value) == null ? void 0 : _optimizeOpts$value.scrollY.rHeight) || ((_GlobalConfig$1$rowHe = GlobalConfig$1.rowHeight[tinyTheme.value]) == null ? void 0 : _GlobalConfig$1$rowHe[vSize3.value || "default"]) || 40;
|
|
11385
|
+
var _optimizeOpts$value, _optimizeOpts$value$s, _GlobalConfig$1$rowHe;
|
|
11386
|
+
return ((_optimizeOpts$value = optimizeOpts.value) == null ? void 0 : (_optimizeOpts$value$s = _optimizeOpts$value.scrollY) == null ? void 0 : _optimizeOpts$value$s.rHeight) || ((_GlobalConfig$1$rowHe = GlobalConfig$1.rowHeight[tinyTheme.value]) == null ? void 0 : _GlobalConfig$1$rowHe[vSize3.value || "default"]) || 40;
|
|
11297
11387
|
});
|
|
11298
11388
|
var headerRowHeight = hooks.computed(function() {
|
|
11299
11389
|
var _GlobalConfig$1$heade;
|
|
@@ -11402,6 +11492,8 @@ var Table = defineComponent({
|
|
|
11402
11492
|
bodyWrapperHeight,
|
|
11403
11493
|
bodyWrapperMinHeight,
|
|
11404
11494
|
bodyWrapperMaxHeight,
|
|
11495
|
+
containerScrollWidth,
|
|
11496
|
+
containerScrollHeight,
|
|
11405
11497
|
bodyTableWidth,
|
|
11406
11498
|
scrollLoadScrollHeight,
|
|
11407
11499
|
columnStore,
|
|
@@ -11423,7 +11515,7 @@ var Table = defineComponent({
|
|
|
11423
11515
|
return h("div", {
|
|
11424
11516
|
class: (_class4 = {
|
|
11425
11517
|
"tiny-grid h-full sm:h-auto !bg-transparent sm:!bg-color-bg-1 after:border-none sm:after:border-solid": true
|
|
11426
|
-
}, _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["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["tiny-grid-fixed__left"] = !horizonScroll.isLeft, _class4["tiny-grid-fixed__right"] = !horizonScroll.isRight, _class4)
|
|
11518
|
+
}, _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["tiny-grid-fixed__left"] = !horizonScroll.isLeft, _class4["tiny-grid-fixed__right"] = !horizonScroll.isRight, _class4)
|
|
11427
11519
|
}, [
|
|
11428
11520
|
// 隐藏列
|
|
11429
11521
|
h("div", {
|
|
@@ -11451,9 +11543,10 @@ var Table = defineComponent({
|
|
|
11451
11543
|
key: "tinyGridResizeBar"
|
|
11452
11544
|
}) : null,
|
|
11453
11545
|
// 加载中
|
|
11454
|
-
h(
|
|
11546
|
+
h(Loading, {
|
|
11455
11547
|
props: {
|
|
11456
|
-
visible: loading
|
|
11548
|
+
visible: loading,
|
|
11549
|
+
loadingComponent
|
|
11457
11550
|
},
|
|
11458
11551
|
class: this.viewCls("gridLoading")
|
|
11459
11552
|
}),
|
|
@@ -11653,8 +11746,8 @@ var Column = defineComponent({
|
|
|
11653
11746
|
default: null
|
|
11654
11747
|
}
|
|
11655
11748
|
},
|
|
11656
|
-
setup: function setup7(props,
|
|
11657
|
-
var slots =
|
|
11749
|
+
setup: function setup7(props, _ref177) {
|
|
11750
|
+
var slots = _ref177.slots;
|
|
11658
11751
|
var reactive = hooks.reactive, inject = hooks.inject, getCurrentInstance = hooks.getCurrentInstance, onUpdated = hooks.onUpdated, watch = hooks.watch, nextTick = hooks.nextTick;
|
|
11659
11752
|
var currentInstance = getCurrentInstance();
|
|
11660
11753
|
var instance = currentInstance.proxy;
|
|
@@ -11708,7 +11801,7 @@ var Column = defineComponent({
|
|
|
11708
11801
|
warn("ui.grid.error.chainCallError");
|
|
11709
11802
|
}
|
|
11710
11803
|
var hasSubColumn = findTree(slotVnode, function(node) {
|
|
11711
|
-
var
|
|
11804
|
+
var _ref178 = node || {}, componentOptions = _ref178.componentOptions, type = _ref178.type;
|
|
11712
11805
|
var componentName = type && type.name || componentOptions && componentOptions.Ctor.extendOptions.name;
|
|
11713
11806
|
return $table.isValidCustomColumn(componentName);
|
|
11714
11807
|
}, null, null);
|
|
@@ -11788,7 +11881,7 @@ var Grid = defineComponent({
|
|
|
11788
11881
|
isMultipleHistory: Boolean,
|
|
11789
11882
|
selectToolbar: [Boolean, Object]
|
|
11790
11883
|
}),
|
|
11791
|
-
data: function
|
|
11884
|
+
data: function data6() {
|
|
11792
11885
|
return {
|
|
11793
11886
|
emitter: emitter(),
|
|
11794
11887
|
fetchOption: null,
|
|
@@ -11827,10 +11920,10 @@ var Grid = defineComponent({
|
|
|
11827
11920
|
return this.proxyOpts.message !== false;
|
|
11828
11921
|
},
|
|
11829
11922
|
tableProps: function tableProps() {
|
|
11830
|
-
var
|
|
11923
|
+
var _this49 = this;
|
|
11831
11924
|
var rest = {};
|
|
11832
11925
|
propKeys.forEach(function(key) {
|
|
11833
|
-
return rest[key] =
|
|
11926
|
+
return rest[key] = _this49[key];
|
|
11834
11927
|
});
|
|
11835
11928
|
return rest;
|
|
11836
11929
|
},
|
|
@@ -11883,10 +11976,10 @@ var Grid = defineComponent({
|
|
|
11883
11976
|
this.toolbar && this.$refs.toolbar && this.$refs.toolbar.loadStorage();
|
|
11884
11977
|
},
|
|
11885
11978
|
viewType: function viewType(value) {
|
|
11886
|
-
var
|
|
11979
|
+
var _this50 = this;
|
|
11887
11980
|
if (value === V_MF) {
|
|
11888
11981
|
this.$nextTick(function() {
|
|
11889
|
-
return
|
|
11982
|
+
return _this50.recalculate();
|
|
11890
11983
|
});
|
|
11891
11984
|
}
|
|
11892
11985
|
}
|
|
@@ -11956,8 +12049,8 @@ var Grid = defineComponent({
|
|
|
11956
12049
|
var tinyTheme = hooks.ref(resolveTheme(props, context));
|
|
11957
12050
|
var tinyMode = hooks.ref(resolveMode(props, context));
|
|
11958
12051
|
var breakpoint = useBreakpoint();
|
|
11959
|
-
var renderless = function renderless2(props2, hooks2,
|
|
11960
|
-
var
|
|
12052
|
+
var renderless = function renderless2(props2, hooks2, _ref179) {
|
|
12053
|
+
var _ref179$designConfig = _ref179.designConfig, designConfig = _ref179$designConfig === void 0 ? null : _ref179$designConfig;
|
|
11961
12054
|
return {
|
|
11962
12055
|
tableListeners,
|
|
11963
12056
|
designConfig,
|
|
@@ -11981,7 +12074,7 @@ var Grid = defineComponent({
|
|
|
11981
12074
|
});
|
|
11982
12075
|
},
|
|
11983
12076
|
render: function render18() {
|
|
11984
|
-
var
|
|
12077
|
+
var _this51 = this;
|
|
11985
12078
|
var fetchOption = this.fetchOption, listeners = this.listeners, loading = this.loading, optimizOpt2 = this.optimizOpt, editConfigOpt2 = this.editConfigOpt, tooltipOpt2 = this.tooltipOpt, pager = this.pager, pagerConfig = this.pagerConfig, remoteFilter = this.remoteFilter, remoteSort = this.remoteSort, selectToolbar = this.selectToolbar;
|
|
11986
12079
|
var seqIndex2 = this.seqIndex, $slots = this.slots, tableCustoms2 = this.tableCustoms, tableData = this.tableData, tableListeners = this.tableListeners, tableLoading = this.tableLoading, tableProps2 = this.tableProps, toolbar = this.toolbar, vSize3 = this.vSize, designConfig = this.designConfig, viewType2 = this.viewType;
|
|
11987
12080
|
var columnAnchor = this.columnAnchor, columnAnchorParams = this.columnAnchorParams, fullScreenClass = this.fullScreenClass;
|
|
@@ -12010,13 +12103,13 @@ var Grid = defineComponent({
|
|
|
12010
12103
|
}
|
|
12011
12104
|
toolbar && !(toolbar.setting && toolbar.setting.storage) && (props.customs = tableCustoms2);
|
|
12012
12105
|
toolbar && (tableOns["update:customs"] = function(value) {
|
|
12013
|
-
return
|
|
12106
|
+
return _this51.tableCustoms = value;
|
|
12014
12107
|
});
|
|
12015
12108
|
tableOns["column-init-ready"] = this.handleColumnInitReady;
|
|
12016
12109
|
var renderedToolbar = function renderedToolbar2() {
|
|
12017
|
-
return
|
|
12110
|
+
return _this51.getRenderedToolbar({
|
|
12018
12111
|
$slots,
|
|
12019
|
-
_vm:
|
|
12112
|
+
_vm: _this51,
|
|
12020
12113
|
loading,
|
|
12021
12114
|
tableLoading,
|
|
12022
12115
|
toolbar
|
|
@@ -12045,12 +12138,12 @@ var Grid = defineComponent({
|
|
|
12045
12138
|
methods: {
|
|
12046
12139
|
// 配置高度减去(表格锚点+工具栏+分页)计算得出表格高度
|
|
12047
12140
|
updateParentHeight: function updateParentHeight2() {
|
|
12048
|
-
var
|
|
12141
|
+
var _this52 = this;
|
|
12049
12142
|
if (!this.tasks.updateParentHeight) {
|
|
12050
12143
|
this.tasks.updateParentHeight = debounce(10, function() {
|
|
12051
|
-
var $el =
|
|
12144
|
+
var $el = _this52.$el, $refs = _this52.$refs;
|
|
12052
12145
|
var tinyTable = $refs.tinyTable, tinyGridColumnAnchor = $refs.tinyGridColumnAnchor;
|
|
12053
|
-
var toolbarVm =
|
|
12146
|
+
var toolbarVm = _this52.getVm("toolbar");
|
|
12054
12147
|
if (tinyTable) {
|
|
12055
12148
|
var columnAnchorHeight = 0;
|
|
12056
12149
|
if (tinyGridColumnAnchor) {
|
|
@@ -12064,8 +12157,8 @@ var Grid = defineComponent({
|
|
|
12064
12157
|
this.tasks.updateParentHeight();
|
|
12065
12158
|
},
|
|
12066
12159
|
// 向缓存添加实例
|
|
12067
|
-
connect: function connect2(
|
|
12068
|
-
var name =
|
|
12160
|
+
connect: function connect2(_ref180) {
|
|
12161
|
+
var name = _ref180.name, vm = _ref180.vm;
|
|
12069
12162
|
if (name && typeof name === "string" && vm) {
|
|
12070
12163
|
this.vmStore[name] = vm;
|
|
12071
12164
|
}
|
|
@@ -12137,8 +12230,8 @@ var Grid = defineComponent({
|
|
|
12137
12230
|
Grid.install = function(Vue) {
|
|
12138
12231
|
Vue.component(Grid.name, Grid);
|
|
12139
12232
|
};
|
|
12140
|
-
function operArrs(
|
|
12141
|
-
var _vm =
|
|
12233
|
+
function operArrs(_ref181) {
|
|
12234
|
+
var _vm = _ref181._vm, editStore = _ref181.editStore, newRecords = _ref181.newRecords, newRecordsCopy = _ref181.newRecordsCopy, nowData = _ref181.nowData, row2 = _ref181.row, tableFullData = _ref181.tableFullData, tableSourceData = _ref181.tableSourceData;
|
|
12142
12235
|
if (row2 === -1) {
|
|
12143
12236
|
Array.prototype.push.apply(nowData, newRecords);
|
|
12144
12237
|
Array.prototype.push.apply(tableFullData, newRecords);
|
|
@@ -12163,38 +12256,38 @@ function operArrs(_ref180) {
|
|
|
12163
12256
|
Array.prototype.push.apply(_vm.temporaryRows, newRecordsCopy);
|
|
12164
12257
|
}
|
|
12165
12258
|
var _setActiveCell = function _setActiveCell2(row2, field) {
|
|
12166
|
-
var
|
|
12259
|
+
var _this53 = this;
|
|
12167
12260
|
var next1 = function next12() {
|
|
12168
12261
|
if (!row2 || !field) {
|
|
12169
|
-
return
|
|
12262
|
+
return _this53.$nextTick();
|
|
12170
12263
|
}
|
|
12171
|
-
var column = find$1(
|
|
12264
|
+
var column = find$1(_this53.visibleColumn, function(column2) {
|
|
12172
12265
|
return column2.property === field;
|
|
12173
12266
|
});
|
|
12174
12267
|
if (!column || !column.editor) {
|
|
12175
|
-
return
|
|
12268
|
+
return _this53.$nextTick();
|
|
12176
12269
|
}
|
|
12177
12270
|
var next2 = function next22(cell) {
|
|
12178
12271
|
if (!cell) {
|
|
12179
12272
|
return;
|
|
12180
12273
|
}
|
|
12181
|
-
var rowIndex =
|
|
12182
|
-
var columnIndex =
|
|
12183
|
-
|
|
12274
|
+
var rowIndex = _this53.getRowIndex(row2);
|
|
12275
|
+
var columnIndex = _this53.getColumnIndex(column);
|
|
12276
|
+
_this53.handleActived({
|
|
12184
12277
|
row: row2,
|
|
12185
12278
|
rowIndex,
|
|
12186
12279
|
column,
|
|
12187
12280
|
columnIndex,
|
|
12188
12281
|
cell,
|
|
12189
|
-
$table:
|
|
12282
|
+
$table: _this53
|
|
12190
12283
|
});
|
|
12191
|
-
|
|
12284
|
+
_this53.lastCallTime = Date.now();
|
|
12192
12285
|
};
|
|
12193
|
-
getCell(
|
|
12286
|
+
getCell(_this53, {
|
|
12194
12287
|
row: row2,
|
|
12195
12288
|
column
|
|
12196
12289
|
}).then(next2);
|
|
12197
|
-
return
|
|
12290
|
+
return _this53.$nextTick();
|
|
12198
12291
|
};
|
|
12199
12292
|
return this.scrollToRow(row2, true).then(next1);
|
|
12200
12293
|
};
|
|
@@ -12204,7 +12297,7 @@ var Methods$c = {
|
|
|
12204
12297
|
},
|
|
12205
12298
|
// 根据位置从指定行添加数据
|
|
12206
12299
|
_insertAt: function _insertAt(records, row2) {
|
|
12207
|
-
var
|
|
12300
|
+
var _this54 = this;
|
|
12208
12301
|
var afterFullData = this.afterFullData, editStore = this.editStore, isAsyncColumn = this.isAsyncColumn, scrollYLoad = this.scrollYLoad, tableFullData = this.tableFullData, _this$tableSourceData = this.tableSourceData, tableSourceData = _this$tableSourceData === void 0 ? [] : _this$tableSourceData, treeConfig = this.treeConfig;
|
|
12209
12302
|
if (treeConfig) {
|
|
12210
12303
|
throw new Error(error("ui.grid.error.treeInsert"));
|
|
@@ -12222,7 +12315,7 @@ var Methods$c = {
|
|
|
12222
12315
|
}
|
|
12223
12316
|
var nowData = afterFullData;
|
|
12224
12317
|
var newRecords = records.map(function(record) {
|
|
12225
|
-
return hooks.reactive(
|
|
12318
|
+
return hooks.reactive(_this54.defineField(_extends({}, record)));
|
|
12226
12319
|
});
|
|
12227
12320
|
var newRecordsCopy = clone(newRecords, true);
|
|
12228
12321
|
operArrs({
|
|
@@ -12247,7 +12340,7 @@ var Methods$c = {
|
|
|
12247
12340
|
rows: newRecords
|
|
12248
12341
|
};
|
|
12249
12342
|
return this.$nextTick().then(function() {
|
|
12250
|
-
|
|
12343
|
+
_this54.recalculate();
|
|
12251
12344
|
return res;
|
|
12252
12345
|
});
|
|
12253
12346
|
},
|
|
@@ -12257,7 +12350,7 @@ var Methods$c = {
|
|
|
12257
12350
|
* 如果传 rows 则删除多行
|
|
12258
12351
|
*/
|
|
12259
12352
|
_remove: function _remove(rows) {
|
|
12260
|
-
var
|
|
12353
|
+
var _this55 = this;
|
|
12261
12354
|
var afterFullData = this.afterFullData, scrollYLoad = this.scrollYLoad, _this$selectConfig3 = this.selectConfig, selectConfig = _this$selectConfig3 === void 0 ? {} : _this$selectConfig3;
|
|
12262
12355
|
var selection = this.selection, tableFullData = this.tableFullData, treeConfig = this.treeConfig, _this$tableSourceData2 = this.tableSourceData, tableSourceData = _this$tableSourceData2 === void 0 ? [] : _this$tableSourceData2;
|
|
12263
12356
|
var _this$editStore = this.editStore, insertList = _this$editStore.insertList, removeList = _this$editStore.removeList;
|
|
@@ -12301,9 +12394,9 @@ var Methods$c = {
|
|
|
12301
12394
|
}
|
|
12302
12395
|
remove(tableSourceData, function(row3) {
|
|
12303
12396
|
return find$1(insertList, function(r) {
|
|
12304
|
-
return getRowid(
|
|
12397
|
+
return getRowid(_this55, r) === getRowid(_this55, row3);
|
|
12305
12398
|
}) && find$1(rows, function(r) {
|
|
12306
|
-
return getRowid(
|
|
12399
|
+
return getRowid(_this55, r) === getRowid(_this55, row3);
|
|
12307
12400
|
});
|
|
12308
12401
|
});
|
|
12309
12402
|
remove(insertList, function(row3) {
|
|
@@ -12321,7 +12414,7 @@ var Methods$c = {
|
|
|
12321
12414
|
rows: rest
|
|
12322
12415
|
};
|
|
12323
12416
|
return this.$nextTick().then(function() {
|
|
12324
|
-
|
|
12417
|
+
_this55.recalculate();
|
|
12325
12418
|
return res;
|
|
12326
12419
|
});
|
|
12327
12420
|
},
|
|
@@ -12329,10 +12422,10 @@ var Methods$c = {
|
|
|
12329
12422
|
* 删除选中数据
|
|
12330
12423
|
*/
|
|
12331
12424
|
_removeSelecteds: function _removeSelecteds() {
|
|
12332
|
-
var
|
|
12425
|
+
var _this56 = this;
|
|
12333
12426
|
var selectRecords = this.getSelectRecords(true);
|
|
12334
12427
|
var callback = function callback2(params) {
|
|
12335
|
-
|
|
12428
|
+
_this56.clearSelection();
|
|
12336
12429
|
return params;
|
|
12337
12430
|
};
|
|
12338
12431
|
return this.remove(selectRecords).then(callback);
|
|
@@ -12400,10 +12493,10 @@ var Methods$c = {
|
|
|
12400
12493
|
* 只精准匹配row的更改。如果是树表格,子节点更改状态不会影响父节点的更新状态
|
|
12401
12494
|
*/
|
|
12402
12495
|
_getUpdateRecords: function _getUpdateRecords() {
|
|
12403
|
-
var
|
|
12496
|
+
var _this57 = this;
|
|
12404
12497
|
var tableFullData = this.tableFullData, treeConfig = this.treeConfig;
|
|
12405
12498
|
var handler6 = function handler7(row2) {
|
|
12406
|
-
return !
|
|
12499
|
+
return !_this57.isTemporaryRow(row2) && _this57.hasRowChange(row2);
|
|
12407
12500
|
};
|
|
12408
12501
|
var updateRecords = treeConfig ? filterTree(tableFullData, handler6, treeConfig) : tableFullData.filter(handler6);
|
|
12409
12502
|
return updateRecords;
|
|
@@ -12412,13 +12505,13 @@ var Methods$c = {
|
|
|
12412
12505
|
* 处理激活编辑
|
|
12413
12506
|
*/
|
|
12414
12507
|
handleActived: function handleActived(params, event) {
|
|
12415
|
-
var
|
|
12508
|
+
var _this58 = this;
|
|
12416
12509
|
return _asyncToGenerator(/* @__PURE__ */ _regenerator().m(function _callee() {
|
|
12417
12510
|
var editConfig, editStore, tableColumn2, cell, column, row2, editor, actived, isActiveCell, type, canActive, args;
|
|
12418
12511
|
return _regenerator().w(function(_context) {
|
|
12419
12512
|
while (1) switch (_context.n) {
|
|
12420
12513
|
case 0:
|
|
12421
|
-
editConfig =
|
|
12514
|
+
editConfig = _this58.editConfig, editStore = _this58.editStore, tableColumn2 = _this58.tableColumn;
|
|
12422
12515
|
cell = params.cell, column = params.column, row2 = params.row;
|
|
12423
12516
|
editor = column.editor;
|
|
12424
12517
|
actived = editStore.actived;
|
|
@@ -12441,7 +12534,7 @@ var Methods$c = {
|
|
|
12441
12534
|
case 1:
|
|
12442
12535
|
canActive = _context.v;
|
|
12443
12536
|
args = {
|
|
12444
|
-
_vm:
|
|
12537
|
+
_vm: _this58,
|
|
12445
12538
|
actived,
|
|
12446
12539
|
canActive,
|
|
12447
12540
|
cell,
|
|
@@ -12457,14 +12550,14 @@ var Methods$c = {
|
|
|
12457
12550
|
});
|
|
12458
12551
|
type = handleActivedDoActive(args);
|
|
12459
12552
|
handleActivedClearActive({
|
|
12460
|
-
_vm:
|
|
12553
|
+
_vm: _this58,
|
|
12461
12554
|
canActive,
|
|
12462
12555
|
event
|
|
12463
12556
|
});
|
|
12464
|
-
emitEvent(
|
|
12557
|
+
emitEvent(_this58, type, [params, event]);
|
|
12465
12558
|
case 2:
|
|
12466
12559
|
handleActivedTryActive({
|
|
12467
|
-
_vm:
|
|
12560
|
+
_vm: _this58,
|
|
12468
12561
|
actived,
|
|
12469
12562
|
cell,
|
|
12470
12563
|
column,
|
|
@@ -12474,7 +12567,7 @@ var Methods$c = {
|
|
|
12474
12567
|
params,
|
|
12475
12568
|
row: row2
|
|
12476
12569
|
});
|
|
12477
|
-
return _context.a(2,
|
|
12570
|
+
return _context.a(2, _this58.$nextTick());
|
|
12478
12571
|
}
|
|
12479
12572
|
}, _callee);
|
|
12480
12573
|
}))();
|
|
@@ -12505,14 +12598,14 @@ var Methods$c = {
|
|
|
12505
12598
|
* 清除已激活的编辑
|
|
12506
12599
|
*/
|
|
12507
12600
|
_clearActived: function _clearActived(event) {
|
|
12508
|
-
var
|
|
12601
|
+
var _this59 = this;
|
|
12509
12602
|
var _this$editConfig2 = this.editConfig, editConfig = _this$editConfig2 === void 0 ? {} : _this$editConfig2, editStore = this.editStore, tableColumn2 = this.tableColumn;
|
|
12510
12603
|
var actived = editStore.actived;
|
|
12511
12604
|
var args = actived.args, column = actived.column, row2 = actived.row;
|
|
12512
12605
|
var isActived = row2 || column;
|
|
12513
12606
|
if (isActived && editConfig.mode === "row") {
|
|
12514
12607
|
tableColumn2.forEach(function(column22) {
|
|
12515
|
-
return
|
|
12608
|
+
return _this59._setColumnModel(row2, column22);
|
|
12516
12609
|
});
|
|
12517
12610
|
}
|
|
12518
12611
|
if (isActived && editConfig.mode !== "row") {
|
|
@@ -12523,7 +12616,7 @@ var Methods$c = {
|
|
|
12523
12616
|
this.updateRowStatus(actived.row);
|
|
12524
12617
|
this.updateFooter();
|
|
12525
12618
|
var row22 = args.row, column2 = args.column;
|
|
12526
|
-
var
|
|
12619
|
+
var _ref182 = column2 || {}, editor = _ref182.editor;
|
|
12527
12620
|
if ((editor == null ? void 0 : editor.component) === "input" && (editor == null ? void 0 : (_editor$attrs = editor.attrs) == null ? void 0 : _editor$attrs.type) === "number") {
|
|
12528
12621
|
row22[column2.property] = +row22[column2.property];
|
|
12529
12622
|
}
|
|
@@ -12592,7 +12685,7 @@ var Methods$c = {
|
|
|
12592
12685
|
* 只对trigger为dblclick有效,选中单元格
|
|
12593
12686
|
*/
|
|
12594
12687
|
_setSelectCell: function _setSelectCell(row2, field) {
|
|
12595
|
-
var
|
|
12688
|
+
var _this60 = this;
|
|
12596
12689
|
var editConfig = this.editConfig, tableData = this.tableData, visibleColumn = this.visibleColumn;
|
|
12597
12690
|
if (!row2 || !field || editConfig.trigger === "manual") {
|
|
12598
12691
|
return this.$nextTick();
|
|
@@ -12613,7 +12706,7 @@ var Methods$c = {
|
|
|
12613
12706
|
columnIndex,
|
|
12614
12707
|
cell
|
|
12615
12708
|
};
|
|
12616
|
-
|
|
12709
|
+
_this60.handleSelected(params, {});
|
|
12617
12710
|
};
|
|
12618
12711
|
getCell(this, {
|
|
12619
12712
|
row: row2,
|
|
@@ -12641,37 +12734,37 @@ var Methods$c = {
|
|
|
12641
12734
|
* 处理选中源
|
|
12642
12735
|
*/
|
|
12643
12736
|
handleSelected: function handleSelected(params, event, noDebounce) {
|
|
12644
|
-
var
|
|
12737
|
+
var _this61 = this;
|
|
12645
12738
|
var editConfig = this.editConfig, editStore = this.editStore, elemStore = this.elemStore, _this$mouseConfig3 = this.mouseConfig, mouseConfig = _this$mouseConfig3 === void 0 ? {} : _this$mouseConfig3;
|
|
12646
12739
|
var actived = editStore.actived, selected = editStore.selected;
|
|
12647
|
-
var
|
|
12740
|
+
var _ref183 = params || {}, cell = _ref183.cell, column = _ref183.column, row2 = _ref183.row;
|
|
12648
12741
|
var selectMethod = function selectMethod2() {
|
|
12649
12742
|
var _cell$parentNode;
|
|
12650
12743
|
if (selected.row === row2 && selected.column === column || actived.row === row2 && (editConfig.mode !== "cell" || actived.column === column)) {
|
|
12651
|
-
return
|
|
12744
|
+
return _this61.$nextTick();
|
|
12652
12745
|
}
|
|
12653
|
-
if (
|
|
12654
|
-
|
|
12655
|
-
|
|
12656
|
-
|
|
12657
|
-
|
|
12746
|
+
if (_this61.keyboardConfig || _this61.mouseConfig) {
|
|
12747
|
+
_this61.clearChecked(event);
|
|
12748
|
+
_this61.clearIndexChecked();
|
|
12749
|
+
_this61.clearHeaderChecked();
|
|
12750
|
+
_this61.clearSelected(event);
|
|
12658
12751
|
}
|
|
12659
|
-
|
|
12752
|
+
_this61.clearActived(event);
|
|
12660
12753
|
selected.args = params;
|
|
12661
12754
|
selected.row = row2;
|
|
12662
12755
|
selected.column = column;
|
|
12663
|
-
|
|
12756
|
+
_this61.updateSelectedCls();
|
|
12664
12757
|
if (!mouseConfig.checked) {
|
|
12665
|
-
return
|
|
12758
|
+
return _this61.$nextTick();
|
|
12666
12759
|
}
|
|
12667
12760
|
var headerElem = elemStore["main-body-headerList"];
|
|
12668
|
-
|
|
12761
|
+
_this61.handleChecked([[cell]]);
|
|
12669
12762
|
if (!headerElem) {
|
|
12670
|
-
return
|
|
12763
|
+
return _this61.$nextTick();
|
|
12671
12764
|
}
|
|
12672
|
-
|
|
12673
|
-
|
|
12674
|
-
return
|
|
12765
|
+
_this61.handleHeaderChecked([[headerElem == null ? void 0 : headerElem.querySelector("." + (column == null ? void 0 : column.id))]]);
|
|
12766
|
+
_this61.handleIndexChecked([[cell == null ? void 0 : (_cell$parentNode = cell.parentNode) == null ? void 0 : _cell$parentNode.querySelector(".col__index")]]);
|
|
12767
|
+
return _this61.$nextTick();
|
|
12675
12768
|
};
|
|
12676
12769
|
selectMethod = noDebounce ? selectMethod : debounce(20, selectMethod);
|
|
12677
12770
|
return selectMethod();
|
|
@@ -12825,7 +12918,7 @@ function handleCellMousedownEvent(args1) {
|
|
|
12825
12918
|
var $el = args1.$el, _vm = args1._vm, bodyList = args1.bodyList, cell = args1.cell, cellFirstElementChild = args1.cellFirstElementChild;
|
|
12826
12919
|
var cellLastElementChild = args1.cellLastElementChild, headStart = args1.headStart, headerList = args1.headerList, isIndex = args1.isIndex, startCellNode = args1.startCellNode;
|
|
12827
12920
|
var _vm$mouseConfig2 = _vm.mouseConfig, mouseConfig = _vm$mouseConfig2 === void 0 ? {} : _vm$mouseConfig2;
|
|
12828
|
-
var
|
|
12921
|
+
var _ref184 = mouseConfig || {}, _ref184$updateInterva = _ref184.updateInterval, updateInterval = _ref184$updateInterva === void 0 ? 10 : _ref184$updateInterva;
|
|
12829
12922
|
var oldMousemove = document.onmousemove;
|
|
12830
12923
|
var oldMouseup = document.onmouseup;
|
|
12831
12924
|
var updateEvent = function updateEvent2(event) {
|
|
@@ -12864,8 +12957,8 @@ function onCellMousedownSelectEditable(args) {
|
|
|
12864
12957
|
_vm.handleSelected(params, event);
|
|
12865
12958
|
}
|
|
12866
12959
|
}
|
|
12867
|
-
function onCellMousedownSelect(
|
|
12868
|
-
var _vm =
|
|
12960
|
+
function onCellMousedownSelect(_ref185) {
|
|
12961
|
+
var _vm = _ref185._vm, editConfig = _ref185.editConfig, event = _ref185.event, mouseConfig = _ref185.mouseConfig, params = _ref185.params;
|
|
12869
12962
|
if (!editConfig && mouseConfig.selected) {
|
|
12870
12963
|
_vm.handleSelected(params, event);
|
|
12871
12964
|
}
|
|
@@ -12884,8 +12977,8 @@ function onCellMousedownIndexColumn(args) {
|
|
|
12884
12977
|
_vm.handleIndexChecked(getRowNodes(bodyList, getCellNodeIndex(firstCell), getCellNodeIndex(cell)));
|
|
12885
12978
|
}
|
|
12886
12979
|
}
|
|
12887
|
-
function onCellMousedownNotIndexColumn(
|
|
12888
|
-
var _vm =
|
|
12980
|
+
function onCellMousedownNotIndexColumn(_ref186) {
|
|
12981
|
+
var _vm = _ref186._vm, cell = _ref186.cell, column = _ref186.column, event = _ref186.event, headerList = _ref186.headerList, isIndex = _ref186.isIndex, params = _ref186.params;
|
|
12889
12982
|
if (!isIndex) {
|
|
12890
12983
|
var firstCell = cell.parentNode.firstElementChild;
|
|
12891
12984
|
_vm.handleSelected(params, event);
|
|
@@ -12893,8 +12986,8 @@ function onCellMousedownNotIndexColumn(_ref185) {
|
|
|
12893
12986
|
_vm.handleIndexChecked([[firstCell]]);
|
|
12894
12987
|
}
|
|
12895
12988
|
}
|
|
12896
|
-
function handleHeaderCellMousedownEvent(
|
|
12897
|
-
var $el =
|
|
12989
|
+
function handleHeaderCellMousedownEvent(_ref187) {
|
|
12990
|
+
var $el = _ref187.$el, _vm = _ref187._vm, bodyList = _ref187.bodyList, cell = _ref187.cell, headerList = _ref187.headerList, startCell = _ref187.startCell;
|
|
12898
12991
|
var oldMousemove = document.onmousemove;
|
|
12899
12992
|
var oldMouseup = document.onmouseup;
|
|
12900
12993
|
var updateEvent = function updateEvent2(event) {
|
|
@@ -12927,8 +13020,8 @@ var removeCellClass = function removeCellClass2(bodyRef, clazz) {
|
|
|
12927
13020
|
return removeClass(elem, clazz);
|
|
12928
13021
|
});
|
|
12929
13022
|
};
|
|
12930
|
-
var getCellIndex = function getCellIndex2(
|
|
12931
|
-
var cell =
|
|
13023
|
+
var getCellIndex = function getCellIndex2(_ref188) {
|
|
13024
|
+
var cell = _ref188.cell, bodyList = _ref188.bodyList;
|
|
12932
13025
|
var trElem = cell.parentNode;
|
|
12933
13026
|
var cIndex = arrayIndexOf(trElem.children, cell);
|
|
12934
13027
|
var rIndex = arrayIndexOf(bodyList, trElem);
|
|
@@ -12937,8 +13030,8 @@ var getCellIndex = function getCellIndex2(_ref187) {
|
|
|
12937
13030
|
cIndex
|
|
12938
13031
|
};
|
|
12939
13032
|
};
|
|
12940
|
-
var getModify = function getModify2(
|
|
12941
|
-
var offsetTop =
|
|
13033
|
+
var getModify = function getModify2(_ref189) {
|
|
13034
|
+
var offsetTop = _ref189.offsetTop, offsetLeft = _ref189.offsetLeft, cWidth = _ref189.cWidth, cHeight = _ref189.cHeight;
|
|
12942
13035
|
var modifyDomStyle = function modifyDomStyle2(dom, styleOptions) {
|
|
12943
13036
|
return dom && Object.assign(dom.style, styleOptions);
|
|
12944
13037
|
};
|
|
@@ -12965,8 +13058,8 @@ var getModify = function getModify2(_ref188) {
|
|
|
12965
13058
|
});
|
|
12966
13059
|
};
|
|
12967
13060
|
};
|
|
12968
|
-
var writeClipboardText = function writeClipboardText2(
|
|
12969
|
-
var $table =
|
|
13061
|
+
var writeClipboardText = function writeClipboardText2(_ref190) {
|
|
13062
|
+
var $table = _ref190.$table, columns2 = _ref190.columns, rows = _ref190.rows, rowNodes = _ref190.rowNodes;
|
|
12970
13063
|
var _$table$keyboardConfi = $table.keyboardConfig, keyboardConfig = _$table$keyboardConfi === void 0 ? {} : _$table$keyboardConfi;
|
|
12971
13064
|
var _keyboardConfig$clipb = keyboardConfig.clipboard, clipboard = _keyboardConfig$clipb === void 0 ? {} : _keyboardConfig$clipb;
|
|
12972
13065
|
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;
|
|
@@ -13013,7 +13106,7 @@ var Methods$b = {
|
|
|
13013
13106
|
var params = _extends({}, args);
|
|
13014
13107
|
var columnIndex = visibleColumn.indexOf(params.column);
|
|
13015
13108
|
var rowIndex = tableData.indexOf(params.row);
|
|
13016
|
-
var
|
|
13109
|
+
var _ref191 = {}, targetColumn = _ref191.targetColumn, targetColumnIndex = _ref191.targetColumnIndex, targetRow = _ref191.targetRow, targetRowIndex = _ref191.targetRowIndex;
|
|
13017
13110
|
event.preventDefault();
|
|
13018
13111
|
var checkColumn = function checkColumn2(column) {
|
|
13019
13112
|
return !hasIndexColumn2(column) && (edit ? column.editor : true);
|
|
@@ -13076,7 +13169,7 @@ var Methods$b = {
|
|
|
13076
13169
|
},
|
|
13077
13170
|
// 当前行方向键移动处理
|
|
13078
13171
|
moveCurrentRow: function moveCurrentRow(isUpArrow, isDwArrow, event) {
|
|
13079
|
-
var
|
|
13172
|
+
var _this62 = this;
|
|
13080
13173
|
var afterFullData = this.afterFullData, currentRow = this.currentRow, treeConfig = this.treeConfig;
|
|
13081
13174
|
var targetRow;
|
|
13082
13175
|
event.preventDefault();
|
|
@@ -13099,17 +13192,17 @@ var Methods$b = {
|
|
|
13099
13192
|
}
|
|
13100
13193
|
if (targetRow) {
|
|
13101
13194
|
this.scrollToRow(targetRow).then(function() {
|
|
13102
|
-
return
|
|
13103
|
-
$table:
|
|
13195
|
+
return _this62.triggerCurrentRowEvent(event, {
|
|
13196
|
+
$table: _this62,
|
|
13104
13197
|
row: targetRow
|
|
13105
13198
|
});
|
|
13106
13199
|
});
|
|
13107
13200
|
}
|
|
13108
13201
|
},
|
|
13109
13202
|
// 可编辑方向键移动处理
|
|
13110
|
-
moveSelected: function moveSelected(
|
|
13111
|
-
var
|
|
13112
|
-
var args =
|
|
13203
|
+
moveSelected: function moveSelected(_ref192) {
|
|
13204
|
+
var _this63 = this;
|
|
13205
|
+
var args = _ref192.args, isLeftArrow = _ref192.isLeftArrow, isUpArrow = _ref192.isUpArrow, isRightArrow = _ref192.isRightArrow, isDownArrow = _ref192.isDownArrow, event = _ref192.event;
|
|
13113
13206
|
var hasIndexColumn2 = this.hasIndexColumn, visibleColumn = this.tableColumn, tableData = this.tableFullData;
|
|
13114
13207
|
var params = _extends({}, args);
|
|
13115
13208
|
var column = params.column;
|
|
@@ -13138,8 +13231,8 @@ var Methods$b = {
|
|
|
13138
13231
|
}
|
|
13139
13232
|
getCell(this, params).then(function(resCell) {
|
|
13140
13233
|
params.cell = resCell;
|
|
13141
|
-
|
|
13142
|
-
|
|
13234
|
+
_this63.handleSelected(params, event, true);
|
|
13235
|
+
_this63.scrollToRow(params.row, params.column, false, {
|
|
13143
13236
|
isLeftArrow,
|
|
13144
13237
|
isRightArrow,
|
|
13145
13238
|
from: column
|
|
@@ -13148,7 +13241,7 @@ var Methods$b = {
|
|
|
13148
13241
|
},
|
|
13149
13242
|
// 表头按下事件
|
|
13150
13243
|
triggerHeaderCellMousedownEvent: function triggerHeaderCellMousedownEvent(event, params) {
|
|
13151
|
-
var
|
|
13244
|
+
var _this64 = this;
|
|
13152
13245
|
var $el = this.$el, elemStore = this.elemStore, _this$mouseConfig4 = this.mouseConfig, mouseConfig = _this$mouseConfig4 === void 0 ? {} : _this$mouseConfig4, tableData = this.tableData;
|
|
13153
13246
|
var headerList = elemStore["main-body-headerList"].children;
|
|
13154
13247
|
var bodyList = elemStore["main-body-list"].children;
|
|
@@ -13192,10 +13285,10 @@ var Methods$b = {
|
|
|
13192
13285
|
params.row = tableData[0];
|
|
13193
13286
|
getCell(this, params).then(function(cellRes) {
|
|
13194
13287
|
params.cell = cellRes;
|
|
13195
|
-
|
|
13288
|
+
_this64.handleSelected(params, event);
|
|
13196
13289
|
var rowNodes = getRowNodes(bodyList, getCellNodeIndex(firstCell), getCellNodeIndex(lastTr.querySelector(".col__index")));
|
|
13197
|
-
|
|
13198
|
-
|
|
13290
|
+
_this64.handleIndexChecked(rowNodes);
|
|
13291
|
+
_this64.handleChecked(getRowNodes(bodyList, getCellNodeIndex(startCell), getCellNodeIndex(lastCell)));
|
|
13199
13292
|
});
|
|
13200
13293
|
this.closeMenu();
|
|
13201
13294
|
},
|
|
@@ -13329,9 +13422,9 @@ var Methods$b = {
|
|
|
13329
13422
|
return this.$nextTick();
|
|
13330
13423
|
},
|
|
13331
13424
|
_getMouseCheckeds: function _getMouseCheckeds() {
|
|
13332
|
-
var
|
|
13425
|
+
var _this65 = this;
|
|
13333
13426
|
var _this$editStore$check = this.editStore.checked.rowNodes, rowNodes = _this$editStore$check === void 0 ? [] : _this$editStore$check;
|
|
13334
|
-
var
|
|
13427
|
+
var _ref193 = {}, _ref193$rows = _ref193.rows, rows = _ref193$rows === void 0 ? [] : _ref193$rows, _ref193$columns = _ref193.columns, columns2 = _ref193$columns === void 0 ? [] : _ref193$columns;
|
|
13335
13428
|
var res = {
|
|
13336
13429
|
rows,
|
|
13337
13430
|
columns: columns2,
|
|
@@ -13339,10 +13432,10 @@ var Methods$b = {
|
|
|
13339
13432
|
};
|
|
13340
13433
|
if (rowNodes && rowNodes.length) {
|
|
13341
13434
|
res.rows = rowNodes.map(function(arr) {
|
|
13342
|
-
return
|
|
13435
|
+
return _this65.getRowNode(arr[0].parentNode).item;
|
|
13343
13436
|
});
|
|
13344
13437
|
res.columns = rowNodes[0].map(function(col) {
|
|
13345
|
-
return
|
|
13438
|
+
return _this65.getColumnNode(col).item;
|
|
13346
13439
|
});
|
|
13347
13440
|
}
|
|
13348
13441
|
return res;
|
|
@@ -13360,7 +13453,7 @@ var Methods$b = {
|
|
|
13360
13453
|
if (!mouseConfig || !mouseConfig.checked) {
|
|
13361
13454
|
return;
|
|
13362
13455
|
}
|
|
13363
|
-
var
|
|
13456
|
+
var _ref194 = {}, cHeight = _ref194.cHeight, cWidth = _ref194.cWidth, offsetLeft = _ref194.offsetLeft, offsetTop = _ref194.offsetTop;
|
|
13364
13457
|
cWidth = cHeight = -2;
|
|
13365
13458
|
offsetTop = offsetLeft = 0;
|
|
13366
13459
|
this.clearChecked();
|
|
@@ -13395,7 +13488,7 @@ var Methods$b = {
|
|
|
13395
13488
|
this.editStore.checked.rowNodes = rowNodes;
|
|
13396
13489
|
},
|
|
13397
13490
|
handleAllChecked: function handleAllChecked(event) {
|
|
13398
|
-
var
|
|
13491
|
+
var _this66 = this;
|
|
13399
13492
|
var elemStore = this.elemStore, _this$mouseConfig6 = this.mouseConfig, mouseConfig = _this$mouseConfig6 === void 0 ? {} : _this$mouseConfig6, tableData = this.tableData, visibleColumn = this.visibleColumn;
|
|
13400
13493
|
if (!mouseConfig.checked) {
|
|
13401
13494
|
return;
|
|
@@ -13423,10 +13516,10 @@ var Methods$b = {
|
|
|
13423
13516
|
params.columnIndex = this.getColumnIndex(params.column);
|
|
13424
13517
|
getCell(this, params).then(function(resCell) {
|
|
13425
13518
|
params.cell = resCell;
|
|
13426
|
-
|
|
13427
|
-
|
|
13428
|
-
|
|
13429
|
-
|
|
13519
|
+
_this66.handleSelected(params, event, true);
|
|
13520
|
+
_this66.handleHeaderChecked(getRowNodes(headerList, getCellNodeIndex(cell.nextElementSibling), getCellNodeIndex(cell.parentNode.lastElementChild)));
|
|
13521
|
+
_this66.handleIndexChecked(getRowNodes(bodyList, getCellNodeIndex(firstCell), getCellNodeIndex(lastTrElem.querySelector(selectorColumnId))));
|
|
13522
|
+
_this66.handleChecked(getRowNodes(bodyList, getCellNodeIndex(firstCell.nextElementSibling), getCellNodeIndex(lastTrElem.lastElementChild)));
|
|
13430
13523
|
});
|
|
13431
13524
|
},
|
|
13432
13525
|
handleIndexChecked: function handleIndexChecked(rowNodes) {
|
|
@@ -13489,7 +13582,7 @@ var Methods$b = {
|
|
|
13489
13582
|
var editStore = this.editStore, tableColumn2 = this.tableColumn, tableData = this.tableData;
|
|
13490
13583
|
var copyed = editStore.copyed;
|
|
13491
13584
|
var rowNodes = editStore.checked.rowNodes;
|
|
13492
|
-
var
|
|
13585
|
+
var _ref195 = {}, cHeight = _ref195.cHeight, cWidth = _ref195.cWidth, offsetLeft = _ref195.offsetLeft, offsetTop = _ref195.offsetTop, _ref195$rows = _ref195.rows, rows = _ref195$rows === void 0 ? [] : _ref195$rows, _ref195$columns = _ref195.columns, columns2 = _ref195$columns === void 0 ? [] : _ref195$columns;
|
|
13493
13586
|
cWidth = cHeight = -3;
|
|
13494
13587
|
offsetTop = offsetLeft = 0;
|
|
13495
13588
|
this.clearCopyed();
|
|
@@ -13581,7 +13674,8 @@ var Methods$b = {
|
|
|
13581
13674
|
var equalOrContain = function equalOrContain2(elm, target) {
|
|
13582
13675
|
return elm && (elm === target || elm.contains(target));
|
|
13583
13676
|
};
|
|
13584
|
-
|
|
13677
|
+
var actualTarget = getActualTarget(event);
|
|
13678
|
+
if (!equalOrContain($grid.$el, actualTarget) && !equalOrContain(tableWrapper, actualTarget) && !equalOrContain(tooltip && tooltip.state.popperElm, actualTarget) && !equalOrContain(validTip && validTip.state.popperElm, actualTarget)) {
|
|
13585
13679
|
if (autoClearMouseChecked) {
|
|
13586
13680
|
this.clearChecked();
|
|
13587
13681
|
this.clearSelected();
|
|
@@ -13611,13 +13705,13 @@ function adjustParams(rows, cb, vaildDatas) {
|
|
|
13611
13705
|
vaildDatas
|
|
13612
13706
|
};
|
|
13613
13707
|
}
|
|
13614
|
-
var columnHandler = function columnHandler2(
|
|
13615
|
-
var _vm =
|
|
13708
|
+
var columnHandler = function columnHandler2(_ref196) {
|
|
13709
|
+
var _vm = _ref196._vm, colValidPromiseArr = _ref196.colValidPromiseArr, editRules = _ref196.editRules, isAll = _ref196.isAll, row2 = _ref196.row, validRest = _ref196.validRest;
|
|
13616
13710
|
return function(column, columnIndex) {
|
|
13617
13711
|
if (has(editRules, column.property)) {
|
|
13618
13712
|
colValidPromiseArr.push(new Promise(function(resolve, reject) {
|
|
13619
|
-
_vm.validCellRules("all", row2, column).then(resolve).catch(function(
|
|
13620
|
-
var rule =
|
|
13713
|
+
_vm.validCellRules("all", row2, column).then(resolve).catch(function(_ref197) {
|
|
13714
|
+
var rule = _ref197.rule, rules = _ref197.rules;
|
|
13621
13715
|
var rowIndex = _vm.getRowIndex(row2);
|
|
13622
13716
|
var rest = {
|
|
13623
13717
|
rule,
|
|
@@ -13641,8 +13735,8 @@ var columnHandler = function columnHandler2(_ref195) {
|
|
|
13641
13735
|
}
|
|
13642
13736
|
};
|
|
13643
13737
|
};
|
|
13644
|
-
function validTree(
|
|
13645
|
-
var treeConfig =
|
|
13738
|
+
function validTree(_ref198) {
|
|
13739
|
+
var treeConfig = _ref198.treeConfig, handleVaild = _ref198.handleVaild, hasTreeExpand2 = _ref198.hasTreeExpand, vaildDatas = _ref198.vaildDatas, treeOpts = _ref198.treeOpts;
|
|
13646
13740
|
if (treeConfig.validHidden === false) {
|
|
13647
13741
|
var _recurValid = function recurValid(row2) {
|
|
13648
13742
|
var children = row2[treeConfig.children || "children"];
|
|
@@ -13656,8 +13750,8 @@ function validTree(_ref197) {
|
|
|
13656
13750
|
eachTree(vaildDatas, handleVaild, treeOpts);
|
|
13657
13751
|
}
|
|
13658
13752
|
}
|
|
13659
|
-
var realValid = function realValid2(
|
|
13660
|
-
var _vm =
|
|
13753
|
+
var realValid = function realValid2(_ref199) {
|
|
13754
|
+
var _vm = _ref199._vm, editRules = _ref199.editRules, isAll = _ref199.isAll, validRest = _ref199.validRest, treeConfig = _ref199.treeConfig, hasTreeExpand2 = _ref199.hasTreeExpand, vaildDatas = _ref199.vaildDatas, treeOpts = _ref199.treeOpts;
|
|
13661
13755
|
var rowValids = [];
|
|
13662
13756
|
var columns2 = _vm.getColumns();
|
|
13663
13757
|
var handleVaild = function handleVaild2(row2) {
|
|
@@ -13685,7 +13779,7 @@ var realValid = function realValid2(_ref198) {
|
|
|
13685
13779
|
}
|
|
13686
13780
|
return rowValids;
|
|
13687
13781
|
};
|
|
13688
|
-
var Rule = /* @__PURE__ */ function() {
|
|
13782
|
+
var Rule = /* @__PURE__ */ (function() {
|
|
13689
13783
|
function Rule2(rule) {
|
|
13690
13784
|
Object.assign(this, {
|
|
13691
13785
|
$options: rule,
|
|
@@ -13705,12 +13799,12 @@ var Rule = /* @__PURE__ */ function() {
|
|
|
13705
13799
|
return getFuncText(this.$options.message);
|
|
13706
13800
|
}
|
|
13707
13801
|
}]);
|
|
13708
|
-
}();
|
|
13802
|
+
})();
|
|
13709
13803
|
var onRejected = function onRejected2(opt, _this) {
|
|
13710
13804
|
var isAll = opt.isAll, validRest = opt.validRest, cb = opt.cb, afterFullData = opt.afterFullData, treeConfig = opt.treeConfig;
|
|
13711
13805
|
return function(params) {
|
|
13712
|
-
var
|
|
13713
|
-
var args = isAll ? validRest : (
|
|
13806
|
+
var _ref200;
|
|
13807
|
+
var args = isAll ? validRest : (_ref200 = {}, _ref200[params.column.property] = params, _ref200);
|
|
13714
13808
|
var funcFinish = function funcFinish2(args2, reject, resolve) {
|
|
13715
13809
|
return function() {
|
|
13716
13810
|
opt.status = false;
|
|
@@ -13766,21 +13860,21 @@ var Methods$a = {
|
|
|
13766
13860
|
},
|
|
13767
13861
|
// 聚焦到校验通过的单元格并弹出校验错误提示
|
|
13768
13862
|
handleValidError: function handleValidError(params) {
|
|
13769
|
-
var
|
|
13863
|
+
var _this67 = this;
|
|
13770
13864
|
var event = {
|
|
13771
13865
|
type: "valid-error",
|
|
13772
13866
|
trigger: "call"
|
|
13773
13867
|
};
|
|
13774
13868
|
this.handleActived(params, event).then(function() {
|
|
13775
|
-
return
|
|
13869
|
+
return _this67.showValidTooltip(params);
|
|
13776
13870
|
});
|
|
13777
13871
|
},
|
|
13778
13872
|
validatePromise: function validatePromise(row2, column, columnIndex, isAll, validRest) {
|
|
13779
|
-
var
|
|
13780
|
-
function onrejected(
|
|
13781
|
-
var _vm =
|
|
13782
|
-
return function(
|
|
13783
|
-
var rule =
|
|
13873
|
+
var _this68 = this;
|
|
13874
|
+
function onrejected(_ref202) {
|
|
13875
|
+
var _vm = _ref202._vm, reject = _ref202.reject, resolve = _ref202.resolve;
|
|
13876
|
+
return function(_ref203) {
|
|
13877
|
+
var rule = _ref203.rule, rules = _ref203.rules;
|
|
13784
13878
|
var rest = {
|
|
13785
13879
|
$table: _vm,
|
|
13786
13880
|
column,
|
|
@@ -13799,8 +13893,8 @@ var Methods$a = {
|
|
|
13799
13893
|
};
|
|
13800
13894
|
}
|
|
13801
13895
|
return new Promise(function(resolve, reject) {
|
|
13802
|
-
|
|
13803
|
-
_vm:
|
|
13896
|
+
_this68.validCellRules("all", row2, column).then(resolve).catch(onrejected({
|
|
13897
|
+
_vm: _this68,
|
|
13804
13898
|
reject,
|
|
13805
13899
|
resolve
|
|
13806
13900
|
}));
|
|
@@ -13816,7 +13910,7 @@ var Methods$a = {
|
|
|
13816
13910
|
*/
|
|
13817
13911
|
beginValidate: function beginValidate(rows, callback, isAll) {
|
|
13818
13912
|
var afterFullData = this.afterFullData, editRules = this.editRules, hasTreeExpand2 = this.hasTreeExpand, treeConfig = this.treeConfig, treeOpts = this.treeOpts;
|
|
13819
|
-
var
|
|
13913
|
+
var _ref204 = {}, _ref204$status = _ref204.status, status = _ref204$status === void 0 ? true : _ref204$status, _ref204$validRest = _ref204.validRest, validRest = _ref204$validRest === void 0 ? {} : _ref204$validRest;
|
|
13820
13914
|
var _adjustParams = adjustParams(rows, callback, afterFullData), vaildDatas = _adjustParams.vaildDatas, cb = _adjustParams.cb;
|
|
13821
13915
|
var opt = {
|
|
13822
13916
|
isAll,
|
|
@@ -13851,12 +13945,11 @@ var Methods$a = {
|
|
|
13851
13945
|
return Promise.reject(validRest[ruleKeys[0]][0]);
|
|
13852
13946
|
}
|
|
13853
13947
|
cb && cb(opt.status);
|
|
13854
|
-
return opt.status;
|
|
13855
13948
|
};
|
|
13856
13949
|
return Promise.all(rowValids).then(onFulfilled).catch(onRejected(opt, this));
|
|
13857
13950
|
},
|
|
13858
|
-
hasCellRules: function hasCellRules(type, row2,
|
|
13859
|
-
var property =
|
|
13951
|
+
hasCellRules: function hasCellRules(type, row2, _ref205) {
|
|
13952
|
+
var property = _ref205.property;
|
|
13860
13953
|
if (!property || !this.editRules) {
|
|
13861
13954
|
return false;
|
|
13862
13955
|
}
|
|
@@ -13886,10 +13979,10 @@ var Methods$a = {
|
|
|
13886
13979
|
* @param { any } defaultValue 需要校验的默认值
|
|
13887
13980
|
*/
|
|
13888
13981
|
validCellRules: function validCellRules(type, row2, column, defaultValue) {
|
|
13889
|
-
var
|
|
13982
|
+
var _this69 = this;
|
|
13890
13983
|
var editRules = this.editRules, rowId = this.rowId;
|
|
13891
13984
|
var property = column.property;
|
|
13892
|
-
var
|
|
13985
|
+
var _ref206 = {}, _ref206$descriptor = _ref206.descriptor, descriptor = _ref206$descriptor === void 0 ? {} : _ref206$descriptor, _ref206$model = _ref206.model, model = _ref206$model === void 0 ? {} : _ref206$model;
|
|
13893
13986
|
if (property && editRules) {
|
|
13894
13987
|
var rules = get(editRules, property);
|
|
13895
13988
|
var cellValue = isUndefined(defaultValue) ? get(row2, property) : defaultValue;
|
|
@@ -13914,8 +14007,8 @@ var Methods$a = {
|
|
|
13914
14007
|
column
|
|
13915
14008
|
}
|
|
13916
14009
|
};
|
|
13917
|
-
var onRejected3 = function onRejected32(
|
|
13918
|
-
var fields =
|
|
14010
|
+
var onRejected3 = function onRejected32(_ref207) {
|
|
14011
|
+
var fields = _ref207.fields;
|
|
13919
14012
|
var cellErrors = Object.keys(fields).map(function(prop) {
|
|
13920
14013
|
var rules2 = _descriptor[prop];
|
|
13921
14014
|
_descriptor[prop] = !rules2.message ? Object.assign(rules2, {
|
|
@@ -13931,11 +14024,11 @@ var Methods$a = {
|
|
|
13931
14024
|
validator.validate(model, validArgs).then(resolve).catch(onRejected3);
|
|
13932
14025
|
};
|
|
13933
14026
|
var onFulfilled = function onFulfilled2() {
|
|
13934
|
-
|
|
14027
|
+
_this69.validatedMap[column.id + "-" + row2[rowId]] = false;
|
|
13935
14028
|
return Promise.resolve();
|
|
13936
14029
|
};
|
|
13937
14030
|
var onRejected22 = function onRejected23(errors) {
|
|
13938
|
-
|
|
14031
|
+
_this69.validatedMap[column.id + "-" + row2[rowId]] = true;
|
|
13939
14032
|
return Promise.reject(errors);
|
|
13940
14033
|
};
|
|
13941
14034
|
return new Promise(executor).then(onFulfilled).catch(onRejected22);
|
|
@@ -13952,9 +14045,16 @@ var Methods$a = {
|
|
|
13952
14045
|
this.clostValidTooltip(void 0);
|
|
13953
14046
|
return this.$nextTick();
|
|
13954
14047
|
},
|
|
14048
|
+
clearValidateMap: function clearValidateMap() {
|
|
14049
|
+
if (this.validatedMap) {
|
|
14050
|
+
for (var key in this.validatedMap) {
|
|
14051
|
+
this.validatedMap[key] = false;
|
|
14052
|
+
}
|
|
14053
|
+
}
|
|
14054
|
+
},
|
|
13955
14055
|
// 触发校验
|
|
13956
14056
|
triggerValidate: function triggerValidate(type) {
|
|
13957
|
-
var
|
|
14057
|
+
var _this70 = this;
|
|
13958
14058
|
var editConfig = this.editConfig, editRules = this.editRules, editStore = this.editStore, validStore = this.validStore;
|
|
13959
14059
|
var actived = editStore.actived;
|
|
13960
14060
|
if (!actived.row || !editRules) {
|
|
@@ -13965,10 +14065,10 @@ var Methods$a = {
|
|
|
13965
14065
|
return Promise.resolve();
|
|
13966
14066
|
}
|
|
13967
14067
|
var onfulfilled = function onfulfilled2() {
|
|
13968
|
-
editConfig.mode === "row" && validStore.visible && validStore.row === row2 && validStore.column === column &&
|
|
14068
|
+
editConfig.mode === "row" && validStore.visible && validStore.row === row2 && validStore.column === column && _this70.clearValidate();
|
|
13969
14069
|
};
|
|
13970
|
-
var onrejected = function onrejected2(
|
|
13971
|
-
var rule =
|
|
14070
|
+
var onrejected = function onrejected2(_ref208) {
|
|
14071
|
+
var rule = _ref208.rule;
|
|
13972
14072
|
if (rule.trigger && type !== rule.trigger) {
|
|
13973
14073
|
return Promise.resolve();
|
|
13974
14074
|
}
|
|
@@ -13978,14 +14078,14 @@ var Methods$a = {
|
|
|
13978
14078
|
row: row2,
|
|
13979
14079
|
rule
|
|
13980
14080
|
};
|
|
13981
|
-
|
|
14081
|
+
_this70.showValidTooltip(rest);
|
|
13982
14082
|
return Promise.reject(rest);
|
|
13983
14083
|
};
|
|
13984
14084
|
return this.validCellRules(type, row2, column).then(onfulfilled).catch(onrejected);
|
|
13985
14085
|
},
|
|
13986
14086
|
// 弹出校验错误提示
|
|
13987
14087
|
showValidTooltip: function showValidTooltip(params) {
|
|
13988
|
-
var
|
|
14088
|
+
var _this71 = this;
|
|
13989
14089
|
var $refs = this.$refs, height2 = this.height, tableData = this.tableData, validOpts2 = this.validOpts;
|
|
13990
14090
|
var cell = params.cell, column = params.column, row2 = params.row, rule = params.rule;
|
|
13991
14091
|
var content = rule.message;
|
|
@@ -13993,7 +14093,7 @@ var Methods$a = {
|
|
|
13993
14093
|
var isMessageTooltip = validOpts2.isMessageTooltip, isMessageDefault = validOpts2.isMessageDefault, isMessageInline = validOpts2.isMessageInline;
|
|
13994
14094
|
var showMsg = isMessageTooltip || isMessageDefault && !height2 && tableData.length < 2;
|
|
13995
14095
|
this.$nextTick(function() {
|
|
13996
|
-
Object.assign(
|
|
14096
|
+
Object.assign(_this71.validStore, {
|
|
13997
14097
|
row: row2,
|
|
13998
14098
|
column,
|
|
13999
14099
|
rule,
|
|
@@ -14001,19 +14101,19 @@ var Methods$a = {
|
|
|
14001
14101
|
visible: true
|
|
14002
14102
|
});
|
|
14003
14103
|
if (validTip && showMsg) {
|
|
14004
|
-
|
|
14005
|
-
|
|
14104
|
+
_this71.clostValidTooltip();
|
|
14105
|
+
_this71.validTipContent = content;
|
|
14006
14106
|
validTip.state.referenceElm = cell;
|
|
14007
14107
|
validTip.$refs.popper && (validTip.$refs.popper.style.display = "none");
|
|
14008
14108
|
validTip.doDestroy();
|
|
14009
14109
|
validTip.setExpectedState(true);
|
|
14010
|
-
|
|
14110
|
+
_this71.activateTooltipValid(validTip);
|
|
14011
14111
|
} else if (isMessageInline) {
|
|
14012
|
-
|
|
14013
|
-
return
|
|
14112
|
+
_this71.$nextTick(function() {
|
|
14113
|
+
return _this71.recalculate();
|
|
14014
14114
|
});
|
|
14015
14115
|
}
|
|
14016
|
-
emitEvent(
|
|
14116
|
+
emitEvent(_this71, "valid-error", [params]);
|
|
14017
14117
|
});
|
|
14018
14118
|
},
|
|
14019
14119
|
// 关闭 validTip
|
|
@@ -14034,12 +14134,12 @@ var Validator = {
|
|
|
14034
14134
|
};
|
|
14035
14135
|
var Methods$9 = {
|
|
14036
14136
|
bindResize: function bindResize() {
|
|
14037
|
-
var
|
|
14137
|
+
var _this72 = this;
|
|
14038
14138
|
var parentElem = this.getParentElem();
|
|
14039
14139
|
if ((parentElem == null ? void 0 : parentElem.nodeType) === Node.ELEMENT_NODE) {
|
|
14040
14140
|
(this.$resize = new Resize$1(function() {
|
|
14041
|
-
|
|
14042
|
-
|
|
14141
|
+
_this72.updateParentHeight();
|
|
14142
|
+
_this72.recalculate();
|
|
14043
14143
|
}, GlobalConfig$1.resizeInterval)).observe(parentElem);
|
|
14044
14144
|
}
|
|
14045
14145
|
},
|
|
@@ -14062,7 +14162,7 @@ var Methods$8 = {
|
|
|
14062
14162
|
initFetchOption: function initFetchOption() {
|
|
14063
14163
|
var _this$fetchData = this.fetchData, fetchData = _this$fetchData === void 0 ? {} : _this$fetchData, _this$dataset = this.dataset, dataset = _this$dataset === void 0 ? {} : _this$dataset;
|
|
14064
14164
|
if (fetchData.api || dataset.source || dataset.value || dataset.api) {
|
|
14065
|
-
var
|
|
14165
|
+
var _ref209 = fetchData || dataset.source || dataset.api || {}, loading = _ref209.loading, fields = _ref209.fields, api = _ref209.api, reloadConfig = _ref209.reloadConfig;
|
|
14066
14166
|
var isReloadFilter = false;
|
|
14067
14167
|
var isReloadScroll = false;
|
|
14068
14168
|
if (reloadConfig) {
|
|
@@ -14083,7 +14183,7 @@ var Methods$8 = {
|
|
|
14083
14183
|
但为避免破坏性变更,暂保留
|
|
14084
14184
|
*/
|
|
14085
14185
|
handleFetch: function handleFetch(code, sortArg) {
|
|
14086
|
-
var
|
|
14186
|
+
var _this73 = this;
|
|
14087
14187
|
var pager = this.pager, sortData = this.sortData, filterData = this.filterData, pagerConfig = this.pagerConfig, fetchOption = this.fetchOption, fetchData = this.fetchData, dataset = this.dataset;
|
|
14088
14188
|
var _fetchData$reloadConf = fetchData.reloadConfig, reloadConfig = _fetchData$reloadConf === void 0 ? {} : _fetchData$reloadConf;
|
|
14089
14189
|
var _reloadConfig$scroll = reloadConfig.scroll, scroll = _reloadConfig$scroll === void 0 ? false : _reloadConfig$scroll;
|
|
@@ -14100,7 +14200,7 @@ var Methods$8 = {
|
|
|
14100
14200
|
error("ui.grid.error.notQuery");
|
|
14101
14201
|
return this.$nextTick();
|
|
14102
14202
|
}
|
|
14103
|
-
var
|
|
14203
|
+
var _ref210 = fetchData || dataset.source || dataset.api || {}, args = _ref210.args, loading = _ref210.loading;
|
|
14104
14204
|
var field = sortData.field, order = sortData.order, prop = sortData.prop, property = sortData.property;
|
|
14105
14205
|
var sortByData = {
|
|
14106
14206
|
field,
|
|
@@ -14144,7 +14244,7 @@ var Methods$8 = {
|
|
|
14144
14244
|
}, params);
|
|
14145
14245
|
}
|
|
14146
14246
|
return search.then(this.loadFetchData).catch(function(error2) {
|
|
14147
|
-
|
|
14247
|
+
_this73.tableLoading = false;
|
|
14148
14248
|
throw error2;
|
|
14149
14249
|
});
|
|
14150
14250
|
},
|
|
@@ -14166,8 +14266,8 @@ var Methods$8 = {
|
|
|
14166
14266
|
if (pagerConfig && !Array.isArray(rest)) {
|
|
14167
14267
|
var _rest$result;
|
|
14168
14268
|
var total = getObj(rest, fields.total || "page.total") || (rest == null ? void 0 : (_rest$result = rest.result) == null ? void 0 : _rest$result.length) || 0;
|
|
14169
|
-
var
|
|
14170
|
-
this.tableData =
|
|
14269
|
+
var data7 = getObj(rest, fields.result || fields.data || "result") || [];
|
|
14270
|
+
this.tableData = data7;
|
|
14171
14271
|
pagerConfig.total = total;
|
|
14172
14272
|
var setTotal = pagerSlot && pagerSlot.componentInstance.setTotal;
|
|
14173
14273
|
setTotal && setTotal(total);
|
|
@@ -14208,8 +14308,8 @@ var Methods$7 = {
|
|
|
14208
14308
|
}
|
|
14209
14309
|
},
|
|
14210
14310
|
// 表格内置分页渲染器
|
|
14211
|
-
renderPager: function renderPager(
|
|
14212
|
-
var $slots =
|
|
14311
|
+
renderPager: function renderPager(_ref211) {
|
|
14312
|
+
var $slots = _ref211.$slots, _vm = _ref211._vm, loading = _ref211.loading, pager = _ref211.pager, pagerConfig = _ref211.pagerConfig, tableLoading = _ref211.tableLoading, vSize3 = _ref211.vSize;
|
|
14213
14313
|
var res = null;
|
|
14214
14314
|
var fetchData = _vm.fetchData;
|
|
14215
14315
|
if ($slots.pager) {
|
|
@@ -14236,19 +14336,19 @@ var Methods$7 = {
|
|
|
14236
14336
|
return res;
|
|
14237
14337
|
},
|
|
14238
14338
|
pageChangeEvent: function pageChangeEvent(params) {
|
|
14239
|
-
var
|
|
14339
|
+
var _this74 = this;
|
|
14240
14340
|
this.tablePageLoading = true;
|
|
14241
14341
|
if (!this.tasks.updatePage) {
|
|
14242
14342
|
this.tasks.updatePage = debounce(200, function() {
|
|
14243
14343
|
var eventParams = _extends({
|
|
14244
|
-
$grid:
|
|
14344
|
+
$grid: _this74
|
|
14245
14345
|
}, params);
|
|
14246
|
-
var toolbarVm =
|
|
14247
|
-
emitEvent(
|
|
14248
|
-
|
|
14249
|
-
|
|
14250
|
-
|
|
14251
|
-
|
|
14346
|
+
var toolbarVm = _this74.getVm("toolbar");
|
|
14347
|
+
emitEvent(_this74, "page-change", eventParams);
|
|
14348
|
+
_this74.emitter.emit("page-change", eventParams);
|
|
14349
|
+
_this74.handleFetch("query").then(function() {
|
|
14350
|
+
_this74.realTimeTablePage = _extends({}, _this74.tablePage);
|
|
14351
|
+
_this74.tablePageLoading = false;
|
|
14252
14352
|
});
|
|
14253
14353
|
if (toolbarVm) {
|
|
14254
14354
|
toolbarVm.orderSetting();
|
|
@@ -14270,7 +14370,7 @@ var Methods$7 = {
|
|
|
14270
14370
|
}
|
|
14271
14371
|
},
|
|
14272
14372
|
beforePageChangeHandler: function beforePageChangeHandler(params) {
|
|
14273
|
-
var
|
|
14373
|
+
var _this75 = this;
|
|
14274
14374
|
if (!this.showSaveMsg) {
|
|
14275
14375
|
var eventParams = extend(false, {
|
|
14276
14376
|
$grid: this
|
|
@@ -14285,8 +14385,8 @@ var Methods$7 = {
|
|
|
14285
14385
|
var next = function next2(res) {
|
|
14286
14386
|
if (res === "confirm") {
|
|
14287
14387
|
rollback && rollback();
|
|
14288
|
-
emitEvent(
|
|
14289
|
-
|
|
14388
|
+
emitEvent(_this75, "cancel-page-change", _this75);
|
|
14389
|
+
_this75.emitter.emit("cancel-page-change", _this75);
|
|
14290
14390
|
} else {
|
|
14291
14391
|
callback && callback();
|
|
14292
14392
|
}
|
|
@@ -14303,8 +14403,8 @@ var Pager = {
|
|
|
14303
14403
|
Object.assign(host.methods, Methods$7);
|
|
14304
14404
|
}
|
|
14305
14405
|
};
|
|
14306
|
-
function setBodyRecords(
|
|
14307
|
-
var body =
|
|
14406
|
+
function setBodyRecords(_ref212) {
|
|
14407
|
+
var body = _ref212.body, insertRecords = _ref212.insertRecords, pendingRecords = _ref212.pendingRecords;
|
|
14308
14408
|
if (insertRecords.length) {
|
|
14309
14409
|
body.pendingRecords = pendingRecords.filter(function(row2) {
|
|
14310
14410
|
return !insertRecords.includes(row2);
|
|
@@ -14319,8 +14419,8 @@ function setBodyRecords(_ref211) {
|
|
|
14319
14419
|
function canInvokeSaveDataApi(body, removeRecords, updateRecords) {
|
|
14320
14420
|
return body.insertRecords.length || removeRecords.length || updateRecords.length || body.pendingRecords.length;
|
|
14321
14421
|
}
|
|
14322
|
-
function doRemoveOrShowMsg(
|
|
14323
|
-
var _vm =
|
|
14422
|
+
function doRemoveOrShowMsg(_ref213) {
|
|
14423
|
+
var _vm = _ref213._vm, canInvoke = _ref213.canInvoke, code = _ref213.code, isMsg2 = _ref213.isMsg, pendingRecords = _ref213.pendingRecords, resolve = _ref213.resolve, valid = _ref213.valid;
|
|
14324
14424
|
if (valid && !canInvoke) {
|
|
14325
14425
|
if (isMsg2) {
|
|
14326
14426
|
if (pendingRecords.length) {
|
|
@@ -14336,8 +14436,8 @@ function doRemoveOrShowMsg(_ref212) {
|
|
|
14336
14436
|
resolve();
|
|
14337
14437
|
}
|
|
14338
14438
|
}
|
|
14339
|
-
function invokeSaveDataApi(
|
|
14340
|
-
var _vm =
|
|
14439
|
+
function invokeSaveDataApi(_ref214) {
|
|
14440
|
+
var _vm = _ref214._vm, args = _ref214.args, body = _ref214.body, code = _ref214.code, removeRecords = _ref214.removeRecords, resolve = _ref214.resolve, saveData = _ref214.saveData, updateRecords = _ref214.updateRecords, valid = _ref214.valid;
|
|
14341
14441
|
var canInvoke = false;
|
|
14342
14442
|
if (valid) {
|
|
14343
14443
|
canInvoke = canInvokeSaveDataApi(body, removeRecords, updateRecords);
|
|
@@ -14364,9 +14464,9 @@ function invokeSaveDataApi(_ref213) {
|
|
|
14364
14464
|
}
|
|
14365
14465
|
var Methods$6 = {
|
|
14366
14466
|
// 表格工具栏渲染器
|
|
14367
|
-
getRenderedToolbar: function getRenderedToolbar(
|
|
14368
|
-
var $slots =
|
|
14369
|
-
return _vm.renderedToolbar = function() {
|
|
14467
|
+
getRenderedToolbar: function getRenderedToolbar(_ref215) {
|
|
14468
|
+
var $slots = _ref215.$slots, _vm = _ref215._vm, loading = _ref215.loading, tableLoading = _ref215.tableLoading, toolbar = _ref215.toolbar;
|
|
14469
|
+
return _vm.renderedToolbar = (function() {
|
|
14370
14470
|
var res = null;
|
|
14371
14471
|
if ($slots.toolbar) {
|
|
14372
14472
|
res = $slots.toolbar();
|
|
@@ -14381,10 +14481,10 @@ var Methods$6 = {
|
|
|
14381
14481
|
});
|
|
14382
14482
|
}
|
|
14383
14483
|
return res;
|
|
14384
|
-
}();
|
|
14484
|
+
})();
|
|
14385
14485
|
},
|
|
14386
14486
|
handleSave: function handleSave(code, args) {
|
|
14387
|
-
var
|
|
14487
|
+
var _this76 = this;
|
|
14388
14488
|
var saveData = this.saveData, isMsg2 = this.isMsg;
|
|
14389
14489
|
if (!saveData) {
|
|
14390
14490
|
error("ui.grid.error.notSave");
|
|
@@ -14402,7 +14502,7 @@ var Methods$6 = {
|
|
|
14402
14502
|
return;
|
|
14403
14503
|
}
|
|
14404
14504
|
var canInvoke = invokeSaveDataApi({
|
|
14405
|
-
_vm:
|
|
14505
|
+
_vm: _this76,
|
|
14406
14506
|
args,
|
|
14407
14507
|
body,
|
|
14408
14508
|
code,
|
|
@@ -14413,7 +14513,7 @@ var Methods$6 = {
|
|
|
14413
14513
|
valid
|
|
14414
14514
|
});
|
|
14415
14515
|
doRemoveOrShowMsg({
|
|
14416
|
-
_vm:
|
|
14516
|
+
_vm: _this76,
|
|
14417
14517
|
canInvoke,
|
|
14418
14518
|
code,
|
|
14419
14519
|
isMsg: isMsg2,
|
|
@@ -14429,11 +14529,11 @@ var Methods$6 = {
|
|
|
14429
14529
|
pendingRecords
|
|
14430
14530
|
});
|
|
14431
14531
|
return new Promise(function(resolve) {
|
|
14432
|
-
|
|
14532
|
+
_this76.validate(validRows, getCallback(resolve));
|
|
14433
14533
|
});
|
|
14434
14534
|
},
|
|
14435
14535
|
handleDelete: function handleDelete(code, args) {
|
|
14436
|
-
var
|
|
14536
|
+
var _this77 = this;
|
|
14437
14537
|
var deleteData = this.deleteData, isMsg2 = this.isMsg;
|
|
14438
14538
|
if (!deleteData) {
|
|
14439
14539
|
error("ui.grid.error.notDelete");
|
|
@@ -14441,7 +14541,7 @@ var Methods$6 = {
|
|
|
14441
14541
|
}
|
|
14442
14542
|
var selecteds = this.getSelectRecords(true);
|
|
14443
14543
|
var afterRemove = function afterRemove2() {
|
|
14444
|
-
var removeds =
|
|
14544
|
+
var removeds = _this77.getRemoveRecords();
|
|
14445
14545
|
if (!removeds.length && isMsg2 && !selecteds.length) {
|
|
14446
14546
|
Modal.message({
|
|
14447
14547
|
id: code,
|
|
@@ -14451,34 +14551,34 @@ var Methods$6 = {
|
|
|
14451
14551
|
}
|
|
14452
14552
|
if (removeds.length) {
|
|
14453
14553
|
var apiArgs = [{
|
|
14454
|
-
$grid:
|
|
14554
|
+
$grid: _this77,
|
|
14455
14555
|
changeRecords: {
|
|
14456
14556
|
removeRecords: removeds
|
|
14457
14557
|
}
|
|
14458
14558
|
}].concat(args);
|
|
14459
14559
|
var stopLoading = function stopLoading2() {
|
|
14460
|
-
|
|
14560
|
+
_this77.tableLoading = false;
|
|
14461
14561
|
};
|
|
14462
|
-
|
|
14463
|
-
return deleteData.api.apply(
|
|
14464
|
-
return
|
|
14562
|
+
_this77.tableLoading = true;
|
|
14563
|
+
return deleteData.api.apply(_this77, apiArgs).then(stopLoading).catch(stopLoading).then(function() {
|
|
14564
|
+
return _this77.commitProxy("reload");
|
|
14465
14565
|
});
|
|
14466
14566
|
}
|
|
14467
14567
|
};
|
|
14468
14568
|
this.remove(selecteds).then(afterRemove);
|
|
14469
14569
|
},
|
|
14470
|
-
handleFullScreen: function handleFullScreen(
|
|
14471
|
-
var
|
|
14472
|
-
var show2 =
|
|
14570
|
+
handleFullScreen: function handleFullScreen(_ref216) {
|
|
14571
|
+
var _this78 = this;
|
|
14572
|
+
var show2 = _ref216[0];
|
|
14473
14573
|
this.fullScreenClass = show2 ? "tiny-fullscreen-full" : "";
|
|
14474
14574
|
this.$nextTick(function() {
|
|
14475
|
-
|
|
14476
|
-
emitEvent(
|
|
14477
|
-
|
|
14575
|
+
_this78.recalculate();
|
|
14576
|
+
emitEvent(_this78, "fullscreen", show2);
|
|
14577
|
+
_this78.emitter.emit("fullscreen", show2);
|
|
14478
14578
|
});
|
|
14479
14579
|
},
|
|
14480
14580
|
commitProxy: function commitProxy(code) {
|
|
14481
|
-
var
|
|
14581
|
+
var _this79 = this;
|
|
14482
14582
|
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
14483
14583
|
args[_key2 - 1] = arguments[_key2];
|
|
14484
14584
|
}
|
|
@@ -14486,19 +14586,19 @@ var Methods$6 = {
|
|
|
14486
14586
|
if (code === "insert") {
|
|
14487
14587
|
this.insert();
|
|
14488
14588
|
} else if (code === "insert_actived") {
|
|
14489
|
-
this.insert().then(function(
|
|
14490
|
-
var row2 =
|
|
14491
|
-
return
|
|
14589
|
+
this.insert().then(function(_ref217) {
|
|
14590
|
+
var row2 = _ref217.row;
|
|
14591
|
+
return _this79.setActiveRow(row2);
|
|
14492
14592
|
});
|
|
14493
14593
|
} else if (code === "mark_cancel") {
|
|
14494
14594
|
this.triggerPendingEvent(code);
|
|
14495
14595
|
} else if (code === "delete_selection") {
|
|
14496
14596
|
this.handleDeleteRow(code, "ui.grid.deleteSelectRecord", function() {
|
|
14497
|
-
return
|
|
14597
|
+
return _this79.commitProxy(["delete"].concat(args));
|
|
14498
14598
|
});
|
|
14499
14599
|
} else if (code === "remove_selection") {
|
|
14500
14600
|
this.handleDeleteRow(code, "ui.grid.removeSelectRecord", function() {
|
|
14501
|
-
return
|
|
14601
|
+
return _this79.removeSelecteds();
|
|
14502
14602
|
});
|
|
14503
14603
|
} else if (code === "export") {
|
|
14504
14604
|
this.exportCsv();
|
|
@@ -14574,11 +14674,11 @@ var Methods$6 = {
|
|
|
14574
14674
|
});
|
|
14575
14675
|
}
|
|
14576
14676
|
if (selecteds.length) {
|
|
14577
|
-
var
|
|
14578
|
-
selecteds.forEach(function(
|
|
14579
|
-
var selectedPending = pendings.includes(
|
|
14677
|
+
var _ref218 = {}, _ref218$plus = _ref218.plus, plus = _ref218$plus === void 0 ? [] : _ref218$plus, _ref218$minus = _ref218.minus, minus = _ref218$minus === void 0 ? [] : _ref218$minus, tmp = _ref218.tmp;
|
|
14678
|
+
selecteds.forEach(function(data7) {
|
|
14679
|
+
var selectedPending = pendings.includes(data7);
|
|
14580
14680
|
tmp = selectedPending ? minus : plus;
|
|
14581
|
-
tmp.push(
|
|
14681
|
+
tmp.push(data7);
|
|
14582
14682
|
});
|
|
14583
14683
|
tmp = minus.length ? pendings.filter(function(item) {
|
|
14584
14684
|
return !~minus.indexOf(item);
|
|
@@ -14597,8 +14697,8 @@ var Toolbar = {
|
|
|
14597
14697
|
};
|
|
14598
14698
|
var Methods$5 = {
|
|
14599
14699
|
renderColumnAnchor: function renderColumnAnchor(params, _vm) {
|
|
14600
|
-
var
|
|
14601
|
-
} :
|
|
14700
|
+
var _ref219 = params || {}, _ref219$anchors = _ref219.anchors, anchors = _ref219$anchors === void 0 ? [] : _ref219$anchors, _ref219$action = _ref219.action, action = _ref219$action === void 0 ? function() {
|
|
14701
|
+
} : _ref219$action;
|
|
14602
14702
|
var viewType2 = _vm.viewType;
|
|
14603
14703
|
return h("div", {
|
|
14604
14704
|
class: ["tiny-grid__column-anchor", _vm.viewCls("columnAnchor")],
|
|
@@ -14633,8 +14733,8 @@ var Methods$5 = {
|
|
|
14633
14733
|
}, [iconVnode, spanVnode]);
|
|
14634
14734
|
}));
|
|
14635
14735
|
},
|
|
14636
|
-
buildColumnAnchor: function buildColumnAnchor(
|
|
14637
|
-
var property =
|
|
14736
|
+
buildColumnAnchor: function buildColumnAnchor(_ref220) {
|
|
14737
|
+
var property = _ref220.property, label = _ref220.label, anchors = _ref220.anchors, activeAnchor = _ref220.activeAnchor;
|
|
14638
14738
|
var visibleColumn = this.getColumns();
|
|
14639
14739
|
var column = visibleColumn.find(function(col) {
|
|
14640
14740
|
return !col.type && col.property === property;
|
|
@@ -14668,7 +14768,7 @@ var Methods$5 = {
|
|
|
14668
14768
|
}
|
|
14669
14769
|
},
|
|
14670
14770
|
buildColumnAnchorParams: function buildColumnAnchorParams() {
|
|
14671
|
-
var
|
|
14771
|
+
var _this80 = this;
|
|
14672
14772
|
var columnAnchor = this.columnAnchor;
|
|
14673
14773
|
var anchors = [];
|
|
14674
14774
|
var activeAnchor = {
|
|
@@ -14678,19 +14778,19 @@ var Methods$5 = {
|
|
|
14678
14778
|
if (Array.isArray(columnAnchor) && columnAnchor.length) {
|
|
14679
14779
|
columnAnchor.forEach(function(item) {
|
|
14680
14780
|
if (typeof item === "string") {
|
|
14681
|
-
|
|
14781
|
+
_this80.buildColumnAnchor({
|
|
14682
14782
|
property: item,
|
|
14683
14783
|
anchors
|
|
14684
14784
|
});
|
|
14685
14785
|
} else if (Array.isArray(item)) {
|
|
14686
|
-
if (item.length > 1)
|
|
14786
|
+
if (item.length > 1) _this80.buildColumnAnchor({
|
|
14687
14787
|
property: item[0],
|
|
14688
14788
|
label: item[1],
|
|
14689
14789
|
anchors
|
|
14690
14790
|
});
|
|
14691
14791
|
} else if (item && typeof item === "object") {
|
|
14692
14792
|
var field = item.field, other = _objectWithoutPropertiesLoose(item, _excluded2);
|
|
14693
|
-
|
|
14793
|
+
_this80.buildColumnAnchor({
|
|
14694
14794
|
property: field,
|
|
14695
14795
|
label: other,
|
|
14696
14796
|
anchors,
|
|
@@ -14706,27 +14806,27 @@ var Methods$5 = {
|
|
|
14706
14806
|
anchors,
|
|
14707
14807
|
activeAnchor,
|
|
14708
14808
|
action: function action(field, e) {
|
|
14709
|
-
return
|
|
14809
|
+
return _this80.anchorAction({
|
|
14710
14810
|
field,
|
|
14711
14811
|
anchors,
|
|
14712
|
-
_vm:
|
|
14812
|
+
_vm: _this80,
|
|
14713
14813
|
e
|
|
14714
14814
|
});
|
|
14715
14815
|
}
|
|
14716
14816
|
};
|
|
14717
14817
|
this._delayActivateAnchor = function() {
|
|
14718
|
-
|
|
14818
|
+
_this80._delayActivateAnchor = void 0;
|
|
14719
14819
|
setTimeout(function() {
|
|
14720
|
-
return
|
|
14820
|
+
return _this80.anchorAction({
|
|
14721
14821
|
field: activeAnchor.field,
|
|
14722
14822
|
anchors,
|
|
14723
|
-
_vm:
|
|
14823
|
+
_vm: _this80
|
|
14724
14824
|
});
|
|
14725
14825
|
}, activeAnchor.delay);
|
|
14726
14826
|
};
|
|
14727
14827
|
},
|
|
14728
|
-
anchorAction: function anchorAction(
|
|
14729
|
-
var field =
|
|
14828
|
+
anchorAction: function anchorAction(_ref221) {
|
|
14829
|
+
var field = _ref221.field, anchors = _ref221.anchors, _vm = _ref221._vm;
|
|
14730
14830
|
var fromAnchor = anchors.find(function(anchor) {
|
|
14731
14831
|
return anchor.active;
|
|
14732
14832
|
});
|
|
@@ -14772,8 +14872,8 @@ var ColumnAnchor = {
|
|
|
14772
14872
|
Object.assign(host.methods, Methods$5);
|
|
14773
14873
|
}
|
|
14774
14874
|
};
|
|
14775
|
-
var createHandlerOnEnd = function createHandlerOnEnd2(
|
|
14776
|
-
var _vm =
|
|
14875
|
+
var createHandlerOnEnd = function createHandlerOnEnd2(_ref222) {
|
|
14876
|
+
var _vm = _ref222._vm, refresh = _ref222.refresh;
|
|
14777
14877
|
return function(event) {
|
|
14778
14878
|
var insertRecords = _vm.getInsertRecords();
|
|
14779
14879
|
if (insertRecords.length) {
|
|
@@ -14819,7 +14919,7 @@ var createHandlerOnEnd = function createHandlerOnEnd2(_ref221) {
|
|
|
14819
14919
|
_vm.tableFullData = [].concat(tableTreeData);
|
|
14820
14920
|
}
|
|
14821
14921
|
_vm.$emit("row-drop-end", event, _vm, _vm.scrollYLoad ? tableTreeData : _vm.tableFullData);
|
|
14822
|
-
refresh && _vm.data &&
|
|
14922
|
+
refresh && _vm.data && _vm.refreshData(_vm.data);
|
|
14823
14923
|
};
|
|
14824
14924
|
};
|
|
14825
14925
|
var getSortColumns = function getSortColumns2(columns2) {
|
|
@@ -14841,15 +14941,15 @@ var getSortColumns = function getSortColumns2(columns2) {
|
|
|
14841
14941
|
var Methods$4 = {
|
|
14842
14942
|
// 处理列拖拽
|
|
14843
14943
|
columnDrop: function columnDrop(headerEl) {
|
|
14844
|
-
var
|
|
14845
|
-
var
|
|
14944
|
+
var _this81 = this;
|
|
14945
|
+
var _ref223 = this.dropConfig || {}, plugin = _ref223.plugin, onBeforeMove = _ref223.onBeforeMove, filter2 = _ref223.filter;
|
|
14846
14946
|
var columnDropContainer = headerEl.querySelector(".tiny-grid-header__row");
|
|
14847
14947
|
var columnDropOptions = _extends({}, this.dropConfig, {
|
|
14848
14948
|
handle: ".tiny-grid-header__column:not(.col__fixed)",
|
|
14849
14949
|
filter: filter2,
|
|
14850
14950
|
onEnd: function onEnd(event) {
|
|
14851
14951
|
var item = event.item, newIndex = event.newIndex, oldIndex = event.oldIndex;
|
|
14852
|
-
var
|
|
14952
|
+
var _this81$getTableColum = _this81.getTableColumn(), fullColumn = _this81$getTableColum.fullColumn, tableColumn2 = _this81$getTableColum.tableColumn;
|
|
14853
14953
|
var sortVisibleCols = getSortColumns(tableColumn2);
|
|
14854
14954
|
var targetThElem = item;
|
|
14855
14955
|
var wrapperElem = targetThElem.parentNode;
|
|
@@ -14870,21 +14970,21 @@ var Methods$4 = {
|
|
|
14870
14970
|
status: "error"
|
|
14871
14971
|
});
|
|
14872
14972
|
}
|
|
14873
|
-
var oldColumnIndex =
|
|
14874
|
-
var newColumnIndex =
|
|
14973
|
+
var oldColumnIndex = _this81.getColumnIndex(sortVisibleCols[oldIndex]);
|
|
14974
|
+
var newColumnIndex = _this81.getColumnIndex(sortVisibleCols[newIndex]);
|
|
14875
14975
|
var currCol = fullColumn.splice(oldColumnIndex, 1)[0];
|
|
14876
14976
|
fullColumn.splice(newColumnIndex, 0, currCol);
|
|
14877
|
-
|
|
14878
|
-
|
|
14879
|
-
var toolbarVm =
|
|
14880
|
-
|
|
14977
|
+
_this81.loadColumn(fullColumn);
|
|
14978
|
+
_this81.$emit("column-drop-end", event, _this81);
|
|
14979
|
+
var toolbarVm = _this81.getVm("toolbar");
|
|
14980
|
+
_this81.isDragHeaderSorting && toolbarVm && toolbarVm.updateSetting();
|
|
14881
14981
|
},
|
|
14882
14982
|
onStart: function onStart(event) {
|
|
14883
|
-
|
|
14983
|
+
_this81.$emit("column-drop-start", event, _this81);
|
|
14884
14984
|
},
|
|
14885
14985
|
onMove: function onMove(event) {
|
|
14886
|
-
var cancel = typeof onBeforeMove === "function" ? onBeforeMove("column", null, event,
|
|
14887
|
-
|
|
14986
|
+
var cancel = typeof onBeforeMove === "function" ? onBeforeMove("column", null, event, _this81) : true;
|
|
14987
|
+
_this81.$emit("column-drop-move", event, _this81);
|
|
14888
14988
|
return cancel === void 0 || cancel;
|
|
14889
14989
|
}
|
|
14890
14990
|
});
|
|
@@ -14892,7 +14992,7 @@ var Methods$4 = {
|
|
|
14892
14992
|
},
|
|
14893
14993
|
// 处理行拖拽
|
|
14894
14994
|
rowDrop: function rowDrop(bodyEl) {
|
|
14895
|
-
var
|
|
14995
|
+
var _this82 = this;
|
|
14896
14996
|
var _this$dropConfig = this.dropConfig, plugin = _this$dropConfig.plugin, onBeforeMove = _this$dropConfig.onBeforeMove, filter2 = _this$dropConfig.filter, _this$dropConfig$refr = _this$dropConfig.refresh, refresh = _this$dropConfig$refr === void 0 ? true : _this$dropConfig$refr, rowHandle = _this$dropConfig.rowHandle, trigger = _this$dropConfig.trigger;
|
|
14897
14997
|
var rowDropContainer = bodyEl.querySelector(".tiny-grid__body tbody");
|
|
14898
14998
|
var handle = trigger || ".tiny-grid-body__row";
|
|
@@ -14907,15 +15007,15 @@ var Methods$4 = {
|
|
|
14907
15007
|
refresh
|
|
14908
15008
|
}),
|
|
14909
15009
|
onStart: function onStart(event) {
|
|
14910
|
-
|
|
15010
|
+
_this82.$emit("row-drop-start", event, _this82);
|
|
14911
15011
|
},
|
|
14912
15012
|
onMove: function onMove(event) {
|
|
14913
|
-
var insertRecords =
|
|
15013
|
+
var insertRecords = _this82.getInsertRecords();
|
|
14914
15014
|
if (insertRecords.length) return false;
|
|
14915
15015
|
var dragged = event.dragged;
|
|
14916
|
-
var selfRow =
|
|
14917
|
-
var cancel = typeof onBeforeMove === "function" ? onBeforeMove("row", selfRow, event,
|
|
14918
|
-
|
|
15016
|
+
var selfRow = _this82.getRowNode(dragged).item;
|
|
15017
|
+
var cancel = typeof onBeforeMove === "function" ? onBeforeMove("row", selfRow, event, _this82) : true;
|
|
15018
|
+
_this82.$emit("row-drop-move", event, _this82);
|
|
14919
15019
|
return cancel === void 0 || cancel;
|
|
14920
15020
|
}
|
|
14921
15021
|
});
|
|
@@ -14935,8 +15035,8 @@ var Sort = {
|
|
|
14935
15035
|
Object.assign(host.methods, Methods$3);
|
|
14936
15036
|
}
|
|
14937
15037
|
};
|
|
14938
|
-
function createTooltipRange(
|
|
14939
|
-
var _vm =
|
|
15038
|
+
function createTooltipRange(_ref224) {
|
|
15039
|
+
var _vm = _ref224._vm, cell = _ref224.cell, column = _ref224.column, isHeader = _ref224.isHeader;
|
|
14940
15040
|
var range = document.createRange();
|
|
14941
15041
|
var rangeEnd;
|
|
14942
15042
|
range.setStart(cell, 0);
|
|
@@ -14954,8 +15054,8 @@ function createTooltipRange(_ref223) {
|
|
|
14954
15054
|
range.setEnd(cell, rangeEnd);
|
|
14955
15055
|
return range;
|
|
14956
15056
|
}
|
|
14957
|
-
function processContentMethod(
|
|
14958
|
-
var _vm =
|
|
15057
|
+
function processContentMethod(_ref225) {
|
|
15058
|
+
var _vm = _ref225._vm, column = _ref225.column, content = _ref225.content, contentMethod = _ref225.contentMethod, event = _ref225.event, isHeader = _ref225.isHeader, row2 = _ref225.row, showTip = _ref225.showTip;
|
|
14959
15059
|
if (contentMethod) {
|
|
14960
15060
|
_vm.tooltipContent = contentMethod({
|
|
14961
15061
|
event,
|
|
@@ -15107,15 +15207,15 @@ var Tooltip = {
|
|
|
15107
15207
|
Object.assign(host.methods, Methods$2);
|
|
15108
15208
|
}
|
|
15109
15209
|
};
|
|
15110
|
-
function onHalfSelectionProperty(
|
|
15111
|
-
var checkStrictly =
|
|
15210
|
+
function onHalfSelectionProperty(_ref226) {
|
|
15211
|
+
var checkStrictly = _ref226.checkStrictly, property = _ref226.property, row2 = _ref226.row, treeConfig = _ref226.treeConfig, treeIndeterminates = _ref226.treeIndeterminates, value = _ref226.value;
|
|
15112
15212
|
if (property && treeConfig && !checkStrictly && value === -1) {
|
|
15113
15213
|
treeIndeterminates.push(row2);
|
|
15114
15214
|
set(row2, property, false);
|
|
15115
15215
|
}
|
|
15116
15216
|
}
|
|
15117
|
-
function onFullSelectionProperty(
|
|
15118
|
-
var checkMethod =
|
|
15217
|
+
function onFullSelectionProperty(_ref227) {
|
|
15218
|
+
var checkMethod = _ref227.checkMethod, checkStrictly = _ref227.checkStrictly, property = _ref227.property, row2 = _ref227.row, treeConfig = _ref227.treeConfig, treeIndeterminates = _ref227.treeIndeterminates, value = _ref227.value;
|
|
15119
15219
|
if (property && treeConfig && !checkStrictly && value !== -1) {
|
|
15120
15220
|
eachTree([row2], function(item, $rowIndex) {
|
|
15121
15221
|
if (row2 === item || !checkMethod || checkMethod({
|
|
@@ -15130,8 +15230,8 @@ function onFullSelectionProperty(_ref226) {
|
|
|
15130
15230
|
}, treeConfig);
|
|
15131
15231
|
}
|
|
15132
15232
|
}
|
|
15133
|
-
function getVItemsOnParentSlctProp(
|
|
15134
|
-
var checkMethod =
|
|
15233
|
+
function getVItemsOnParentSlctProp(_ref228) {
|
|
15234
|
+
var checkMethod = _ref228.checkMethod, matchObj = _ref228.matchObj;
|
|
15135
15235
|
var tinyItems;
|
|
15136
15236
|
if (checkMethod) {
|
|
15137
15237
|
tinyItems = matchObj.items.filter(function(item, $rowIndex) {
|
|
@@ -15145,8 +15245,8 @@ function getVItemsOnParentSlctProp(_ref227) {
|
|
|
15145
15245
|
}
|
|
15146
15246
|
return tinyItems;
|
|
15147
15247
|
}
|
|
15148
|
-
function getParentStatusOnParentSlctProp(
|
|
15149
|
-
var indeterminatesItem =
|
|
15248
|
+
function getParentStatusOnParentSlctProp(_ref229) {
|
|
15249
|
+
var indeterminatesItem = _ref229.indeterminatesItem, matchObj = _ref229.matchObj, property = _ref229.property, vItems = _ref229.vItems, value = _ref229.value;
|
|
15150
15250
|
var parentStatus;
|
|
15151
15251
|
if (indeterminatesItem) {
|
|
15152
15252
|
parentStatus = -1;
|
|
@@ -15161,8 +15261,8 @@ function getParentStatusOnParentSlctProp(_ref228) {
|
|
|
15161
15261
|
}
|
|
15162
15262
|
return parentStatus;
|
|
15163
15263
|
}
|
|
15164
|
-
function onHalfSelection(
|
|
15165
|
-
var checkStrictly =
|
|
15264
|
+
function onHalfSelection(_ref230) {
|
|
15265
|
+
var checkStrictly = _ref230.checkStrictly, property = _ref230.property, row2 = _ref230.row, selection = _ref230.selection, treeConfig = _ref230.treeConfig, treeIndeterminates = _ref230.treeIndeterminates, value = _ref230.value;
|
|
15166
15266
|
if (!property && treeConfig && !checkStrictly && value === -1) {
|
|
15167
15267
|
treeIndeterminates.push(row2);
|
|
15168
15268
|
remove(selection, function(item) {
|
|
@@ -15173,8 +15273,8 @@ function onHalfSelection(_ref229) {
|
|
|
15173
15273
|
var addSelection = function addSelection2(selection, item) {
|
|
15174
15274
|
return !selection.includes(item) && selection.push(item);
|
|
15175
15275
|
};
|
|
15176
|
-
function onFullSelection(
|
|
15177
|
-
var checkMethod =
|
|
15276
|
+
function onFullSelection(_ref231) {
|
|
15277
|
+
var checkMethod = _ref231.checkMethod, checkStrictly = _ref231.checkStrictly, property = _ref231.property, row2 = _ref231.row, selection = _ref231.selection, treeConfig = _ref231.treeConfig, treeIndeterminates = _ref231.treeIndeterminates, value = _ref231.value;
|
|
15178
15278
|
if (!property && treeConfig && !checkStrictly && value !== -1) {
|
|
15179
15279
|
eachTree([row2], function(item, $rowIndex) {
|
|
15180
15280
|
if (row2 === item || !checkMethod || checkMethod({
|
|
@@ -15195,8 +15295,8 @@ function onFullSelection(_ref230) {
|
|
|
15195
15295
|
}, treeConfig);
|
|
15196
15296
|
}
|
|
15197
15297
|
}
|
|
15198
|
-
function getParentStatusOnParentSelection(
|
|
15199
|
-
var indeterminatesItem =
|
|
15298
|
+
function getParentStatusOnParentSelection(_ref232) {
|
|
15299
|
+
var indeterminatesItem = _ref232.indeterminatesItem, matchObj = _ref232.matchObj, selection = _ref232.selection, vItems = _ref232.vItems, value = _ref232.value;
|
|
15200
15300
|
var parentStatus;
|
|
15201
15301
|
if (indeterminatesItem) {
|
|
15202
15302
|
parentStatus = -1;
|
|
@@ -15209,8 +15309,8 @@ function getParentStatusOnParentSelection(_ref231) {
|
|
|
15209
15309
|
}
|
|
15210
15310
|
return parentStatus;
|
|
15211
15311
|
}
|
|
15212
|
-
function hasCheckField(
|
|
15213
|
-
var row2 =
|
|
15312
|
+
function hasCheckField(_ref233, value, _vm) {
|
|
15313
|
+
var row2 = _ref233.row;
|
|
15214
15314
|
var tableFullData = _vm.tableFullData, _vm$selectConfig = _vm.selectConfig, selectConfig = _vm$selectConfig === void 0 ? {} : _vm$selectConfig, treeConfig = _vm.treeConfig, treeIndeterminates = _vm.treeIndeterminates;
|
|
15215
15315
|
var property = selectConfig.checkField, checkStrictly = selectConfig.checkStrictly, checkMethod = selectConfig.checkMethod;
|
|
15216
15316
|
onHalfSelectionProperty({
|
|
@@ -15258,8 +15358,8 @@ function hasCheckField(_ref232, value, _vm) {
|
|
|
15258
15358
|
set(row2, property, value);
|
|
15259
15359
|
}
|
|
15260
15360
|
}
|
|
15261
|
-
function onSelectTreeCheckStrictly(
|
|
15262
|
-
var row2 =
|
|
15361
|
+
function onSelectTreeCheckStrictly(_ref234, value, _vm) {
|
|
15362
|
+
var row2 = _ref234.row;
|
|
15263
15363
|
var selection = _vm.selection, tableFullData = _vm.tableFullData, _vm$selectConfig2 = _vm.selectConfig, selectConfig = _vm$selectConfig2 === void 0 ? {} : _vm$selectConfig2, treeConfig = _vm.treeConfig, treeIndeterminates = _vm.treeIndeterminates;
|
|
15264
15364
|
var property = selectConfig.checkField, checkStrictly = selectConfig.checkStrictly, checkMethod = selectConfig.checkMethod;
|
|
15265
15365
|
onHalfSelection({
|
|
@@ -15303,8 +15403,8 @@ function onSelectTreeCheckStrictly(_ref233, value, _vm) {
|
|
|
15303
15403
|
}
|
|
15304
15404
|
}
|
|
15305
15405
|
}
|
|
15306
|
-
function onSelectOther(
|
|
15307
|
-
var row2 =
|
|
15406
|
+
function onSelectOther(_ref235, value, _vm) {
|
|
15407
|
+
var row2 = _ref235.row;
|
|
15308
15408
|
var selection = _vm.selection, _vm$selectConfig3 = _vm.selectConfig, selectConfig = _vm$selectConfig3 === void 0 ? {} : _vm$selectConfig3, treeConfig = _vm.treeConfig;
|
|
15309
15409
|
var property = selectConfig.checkField, checkStrictly = selectConfig.checkStrictly;
|
|
15310
15410
|
if (!property && !(treeConfig && !checkStrictly)) {
|
|
@@ -15317,8 +15417,8 @@ function onSelectOther(_ref234, value, _vm) {
|
|
|
15317
15417
|
}
|
|
15318
15418
|
}
|
|
15319
15419
|
}
|
|
15320
|
-
function hasNoCheckField(
|
|
15321
|
-
var row2 =
|
|
15420
|
+
function hasNoCheckField(_ref236, value, _vm) {
|
|
15421
|
+
var row2 = _ref236.row;
|
|
15322
15422
|
onSelectTreeCheckStrictly({
|
|
15323
15423
|
row: row2
|
|
15324
15424
|
}, value, _vm);
|
|
@@ -15326,8 +15426,8 @@ function hasNoCheckField(_ref235, value, _vm) {
|
|
|
15326
15426
|
row: row2
|
|
15327
15427
|
}, value, _vm);
|
|
15328
15428
|
}
|
|
15329
|
-
function pushSelectRow(
|
|
15330
|
-
var afterFullData =
|
|
15429
|
+
function pushSelectRow(_ref237) {
|
|
15430
|
+
var afterFullData = _ref237.afterFullData, checkMethod = _ref237.checkMethod, checkStrictly = _ref237.checkStrictly; _ref237.property; var selectRows = _ref237.selectRows, selection = _ref237.selection, treeConfig = _ref237.treeConfig, value = _ref237.value;
|
|
15331
15431
|
if (!checkStrictly && value) {
|
|
15332
15432
|
eachTree(afterFullData, function(row2, $rowIndex) {
|
|
15333
15433
|
if (!checkMethod || checkMethod({
|
|
@@ -15349,8 +15449,8 @@ function pushSelectRow(_ref236) {
|
|
|
15349
15449
|
}, treeConfig);
|
|
15350
15450
|
}
|
|
15351
15451
|
}
|
|
15352
|
-
function hasCheckFieldNoStrictly(
|
|
15353
|
-
var afterFullData =
|
|
15452
|
+
function hasCheckFieldNoStrictly(_ref238) {
|
|
15453
|
+
var afterFullData = _ref238.afterFullData, checkMethod = _ref238.checkMethod, checkStrictly = _ref238.checkStrictly, property = _ref238.property, selection = _ref238.selection, treeConfig = _ref238.treeConfig, value = _ref238.value;
|
|
15354
15454
|
if (!checkStrictly && property) {
|
|
15355
15455
|
var indexKey = (treeConfig ? "$" : "") + "rowIndex";
|
|
15356
15456
|
var setValFn = function setValFn2(row2, rowIndex) {
|
|
@@ -15376,8 +15476,8 @@ function hasCheckFieldNoStrictly(_ref237) {
|
|
|
15376
15476
|
}
|
|
15377
15477
|
}
|
|
15378
15478
|
}
|
|
15379
|
-
function filterSelectRow(
|
|
15380
|
-
var afterFullData =
|
|
15479
|
+
function filterSelectRow(_ref239) {
|
|
15480
|
+
var afterFullData = _ref239.afterFullData, checkMethod = _ref239.checkMethod, checkStrictly = _ref239.checkStrictly, selectRows = _ref239.selectRows, selection = _ref239.selection, value = _ref239.value;
|
|
15381
15481
|
if (!checkStrictly && value && checkMethod) {
|
|
15382
15482
|
selectRows = afterFullData.filter(function(row2, rowIndex) {
|
|
15383
15483
|
return selection.includes(row2) || checkMethod({
|
|
@@ -15399,8 +15499,8 @@ function filterSelectRow(_ref238) {
|
|
|
15399
15499
|
}
|
|
15400
15500
|
return selectRows;
|
|
15401
15501
|
}
|
|
15402
|
-
function hasNoCheckFieldNoStrictly(
|
|
15403
|
-
var afterFullData =
|
|
15502
|
+
function hasNoCheckFieldNoStrictly(_ref240) {
|
|
15503
|
+
var afterFullData = _ref240.afterFullData, checkMethod = _ref240.checkMethod, checkStrictly = _ref240.checkStrictly, property = _ref240.property, selection = _ref240.selection, treeConfig = _ref240.treeConfig, value = _ref240.value;
|
|
15404
15504
|
var selectRows = [];
|
|
15405
15505
|
if (treeConfig) {
|
|
15406
15506
|
pushSelectRow({
|
|
@@ -15425,8 +15525,8 @@ function hasNoCheckFieldNoStrictly(_ref239) {
|
|
|
15425
15525
|
}
|
|
15426
15526
|
return selectRows;
|
|
15427
15527
|
}
|
|
15428
|
-
function setSelectionNoStrictly(
|
|
15429
|
-
var _vm =
|
|
15528
|
+
function setSelectionNoStrictly(_ref241) {
|
|
15529
|
+
var _vm = _ref241._vm, checkStrictly = _ref241.checkStrictly, reserve = _ref241.reserve, selectRows = _ref241.selectRows, selection = _ref241.selection, value = _ref241.value, afterFullData = _ref241.afterFullData;
|
|
15430
15530
|
if (!checkStrictly) {
|
|
15431
15531
|
if (reserve) {
|
|
15432
15532
|
var unCheckedRows = afterFullData.filter(function(row2) {
|
|
@@ -15446,7 +15546,7 @@ var Methods$1 = {
|
|
|
15446
15546
|
// 处理默认勾选
|
|
15447
15547
|
handleSelectionDefChecked: function handleSelectionDefChecked() {
|
|
15448
15548
|
var fullDataRowIdData = this.fullDataRowIdData;
|
|
15449
|
-
var
|
|
15549
|
+
var _ref242 = this.selectConfig || {}, checkAll = _ref242.checkAll, checkRowKeys = _ref242.checkRowKeys;
|
|
15450
15550
|
if (checkAll) {
|
|
15451
15551
|
this.setAllSelection(true);
|
|
15452
15552
|
return;
|
|
@@ -15466,13 +15566,13 @@ var Methods$1 = {
|
|
|
15466
15566
|
}
|
|
15467
15567
|
},
|
|
15468
15568
|
setSelection: function setSelection(rows, value) {
|
|
15469
|
-
var
|
|
15569
|
+
var _this83 = this;
|
|
15470
15570
|
if (rows) {
|
|
15471
15571
|
if (!isArray(rows)) {
|
|
15472
15572
|
rows = [rows];
|
|
15473
15573
|
}
|
|
15474
15574
|
rows.forEach(function(row2) {
|
|
15475
|
-
return
|
|
15575
|
+
return _this83.handleSelectRow({
|
|
15476
15576
|
row: row2
|
|
15477
15577
|
}, !!value);
|
|
15478
15578
|
});
|
|
@@ -15480,8 +15580,8 @@ var Methods$1 = {
|
|
|
15480
15580
|
return this.$nextTick();
|
|
15481
15581
|
},
|
|
15482
15582
|
// 多选,行选中事件。value:选中true、不选false、不确定-1
|
|
15483
|
-
handleSelectRow: function handleSelectRow(
|
|
15484
|
-
var row2 =
|
|
15583
|
+
handleSelectRow: function handleSelectRow(_ref243, value) {
|
|
15584
|
+
var row2 = _ref243.row;
|
|
15485
15585
|
hasCheckField({
|
|
15486
15586
|
row: row2
|
|
15487
15587
|
}, value, this);
|
|
@@ -15492,7 +15592,7 @@ var Methods$1 = {
|
|
|
15492
15592
|
},
|
|
15493
15593
|
handleToggleCheckRowEvent: function handleToggleCheckRowEvent(params, event) {
|
|
15494
15594
|
var selection = this.selection;
|
|
15495
|
-
var
|
|
15595
|
+
var _ref244 = this.selectConfig || {}, checkField = _ref244.checkField;
|
|
15496
15596
|
var row2 = params.row;
|
|
15497
15597
|
var value = checkField ? !get(row2, checkField) : !~selection.indexOf(row2);
|
|
15498
15598
|
if (event) {
|
|
@@ -15560,8 +15660,8 @@ var Methods$1 = {
|
|
|
15560
15660
|
// 根据表格选中状态,给头部复现框赋值状态(全选,半选,未选)
|
|
15561
15661
|
checkSelectionStatus: function checkSelectionStatus() {
|
|
15562
15662
|
var afterFullData = this.afterFullData, selection = this.selection, treeIndeterminates = this.treeIndeterminates;
|
|
15563
|
-
var
|
|
15564
|
-
var
|
|
15663
|
+
var _ref245 = this.selectConfig || {}, checkField = _ref245.checkField, checkMethod = _ref245.checkMethod;
|
|
15664
|
+
var _ref246 = {}, everyHandler = _ref246.everyHandler, someHandler = _ref246.someHandler;
|
|
15565
15665
|
if (checkField) {
|
|
15566
15666
|
everyHandler = checkMethod ? function(row2, rowIndex) {
|
|
15567
15667
|
return !checkMethod({
|
|
@@ -15610,7 +15710,7 @@ var Methods$1 = {
|
|
|
15610
15710
|
// 保留选中状态
|
|
15611
15711
|
reserveCheckSelection: function reserveCheckSelection() {
|
|
15612
15712
|
var fullDataRowIdData = this.fullDataRowIdData, selection = this.selection;
|
|
15613
|
-
var
|
|
15713
|
+
var _ref247 = this.selectConfig || {}, reserve = _ref247.reserve;
|
|
15614
15714
|
var rowkey = getRowkey(this);
|
|
15615
15715
|
if (reserve && selection.length) {
|
|
15616
15716
|
this.selection = selection.map(function(row2) {
|
|
@@ -15638,7 +15738,7 @@ var Methods$1 = {
|
|
|
15638
15738
|
},
|
|
15639
15739
|
clearSelection: function clearSelection() {
|
|
15640
15740
|
var tableFullData = this.tableFullData, treeConfig = this.treeConfig;
|
|
15641
|
-
var
|
|
15741
|
+
var _ref248 = this.selectConfig || {}, checkField = _ref248.checkField;
|
|
15642
15742
|
if (checkField) {
|
|
15643
15743
|
treeConfig ? eachTree(tableFullData, function(item) {
|
|
15644
15744
|
return set(item, checkField, false);
|
|
@@ -15764,9 +15864,9 @@ var Checkbox = {
|
|
|
15764
15864
|
};
|
|
15765
15865
|
var Methods = {
|
|
15766
15866
|
// 展开树节点事件
|
|
15767
|
-
triggerTreeExpandEvent: function triggerTreeExpandEvent(event,
|
|
15768
|
-
var
|
|
15769
|
-
var row2 =
|
|
15867
|
+
triggerTreeExpandEvent: function triggerTreeExpandEvent(event, _ref249) {
|
|
15868
|
+
var _this84 = this;
|
|
15869
|
+
var row2 = _ref249.row;
|
|
15770
15870
|
var currentColumn = this.currentColumn, currentRow = this.currentRow;
|
|
15771
15871
|
var rest = this.toggleTreeExpansion(row2);
|
|
15772
15872
|
var eventParams = {
|
|
@@ -15777,9 +15877,9 @@ var Methods = {
|
|
|
15777
15877
|
emitEvent(this, "toggle-tree-change", [eventParams, event]);
|
|
15778
15878
|
this.$nextTick(function() {
|
|
15779
15879
|
if (currentRow) {
|
|
15780
|
-
|
|
15880
|
+
_this84.setCurrentRow(currentRow);
|
|
15781
15881
|
} else if (currentColumn) {
|
|
15782
|
-
|
|
15882
|
+
_this84.setCurrentColumn(currentColumn);
|
|
15783
15883
|
}
|
|
15784
15884
|
});
|
|
15785
15885
|
return rest;
|
|
@@ -15790,7 +15890,7 @@ var Methods = {
|
|
|
15790
15890
|
},
|
|
15791
15891
|
// 处理默认展开树节点
|
|
15792
15892
|
handleDefaultTreeExpand: function handleDefaultTreeExpand() {
|
|
15793
|
-
var
|
|
15893
|
+
var _this85 = this;
|
|
15794
15894
|
var tableFullData = this.tableFullData, treeConfig = this.treeConfig;
|
|
15795
15895
|
if (!treeConfig) return;
|
|
15796
15896
|
var children = treeConfig.children, expandAll = treeConfig.expandAll, rowids = treeConfig.expandRowKeys;
|
|
@@ -15803,7 +15903,7 @@ var Methods = {
|
|
|
15803
15903
|
filterTree(tableFullData, function(row2) {
|
|
15804
15904
|
return isNonEmptyArr(row2[children]) && treeExpandeds.push(row2);
|
|
15805
15905
|
}, treeConfig);
|
|
15806
|
-
|
|
15906
|
+
_this85.treeExpandeds = treeExpandeds;
|
|
15807
15907
|
};
|
|
15808
15908
|
var doExpandRows = function doExpandRows2() {
|
|
15809
15909
|
rowids.forEach(function(rowid2) {
|
|
@@ -15812,7 +15912,7 @@ var Methods = {
|
|
|
15812
15912
|
}, treeConfig);
|
|
15813
15913
|
matchObj && isNonEmptyArr(matchObj.item[children]) && treeExpandeds.push(matchObj.item);
|
|
15814
15914
|
});
|
|
15815
|
-
|
|
15915
|
+
_this85.treeExpandeds = treeExpandeds;
|
|
15816
15916
|
};
|
|
15817
15917
|
expandAll ? doExpandAll() : rowids ? doExpandRows() : "";
|
|
15818
15918
|
graphFullData(this);
|
|
@@ -15877,12 +15977,12 @@ var Methods = {
|
|
|
15877
15977
|
return ~this.treeExpandeds.indexOf(row2);
|
|
15878
15978
|
},
|
|
15879
15979
|
clearTreeExpand: function clearTreeExpand() {
|
|
15880
|
-
var
|
|
15980
|
+
var _this86 = this;
|
|
15881
15981
|
var hasExpand = this.treeExpandeds.length;
|
|
15882
15982
|
this.treeExpandeds = [];
|
|
15883
15983
|
graphFullData(this);
|
|
15884
15984
|
return this.handleTableData().then(function() {
|
|
15885
|
-
return hasExpand ?
|
|
15985
|
+
return hasExpand ? _this86.recalculate() : 0;
|
|
15886
15986
|
});
|
|
15887
15987
|
},
|
|
15888
15988
|
getTreeExpandeds: function getTreeExpandeds() {
|