@opentinyvue/vue-grid 3.21.0 → 3.22.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 +64 -55
- package/package.json +17 -16
- package/src/column/src/column.d.ts +1 -1
- package/src/config.d.ts +1 -1
- package/src/loading/src/loading.d.ts +1 -1
- package/src/table/src/table.d.ts +1 -1
package/lib/index.js
CHANGED
|
@@ -1,37 +1,23 @@
|
|
|
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 { extend, getObj } from '@opentinyvue/
|
|
4
|
+
import { addClass, isNull, debounce, PopupManager, PopperJS, extend, browserInfo, isObject, isEmptyObject, isServer, removeClass, getDataset, random, isDisplayNone, toDecimal, fastdom, logger, tryToCurrency, tryToDecimal, tryToInt, toFileSize, truncate, toRate, isNumber as isNumber$1, toBoolValue, toDate, getDateWithNewTimezone, isDate, formatDateByPattern, toDateStr, on, Validator as Validator$1, getObj, getStyle, preventDefault, off, throttle, callInterceptor, hasClass } from '@opentinyvue/utils';
|
|
5
5
|
import { iconError, iconSortTriangleDescending, iconSortTriangleAscending, iconSortTriangle, iconUnfilter, iconEdit, iconConmentRefresh, iconMinscreen, iconFullscreen, iconSetting, iconRadio, iconRadioselected, iconSearch, iconCheckedSur, iconCheck, iconHalfselect, iconArrowBottom, IconEllipsis, iconClose, iconYes, iconExpand, iconPutAway, iconEllipsis, iconMarkOn, iconChevronRight, iconChevronDown } from '@opentinyvue/vue-icon';
|
|
6
6
|
import { $prefix, defineComponent, h, hooks, $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, clear, destructuring, clone, mapTree, eachTree, findTree as findTree$1, has, isUndefined, find, isEqual, filterTree, arrayEach, isNumber, sum, template, assign, objectMap, sortBy, isString, remove, toStringJSON, toArray, arrayIndexOf } from '@opentinyvue/vue-renderless/grid/static/';
|
|
8
8
|
import { emitEvent, getFuncText, getDomNode, getRowid, getEventTargetNode, isScale, hasChildrenList, getListeners, setColumnFormat, updateCellTitle, getFilters, getColumnConfig, formatText, setCellValue, getColumnList, rowToVisible, colToVisible, getCell, assemColumn, getRowkey, GlobalEvent, getCellValue, getClass, isPx, getRowNodes, getCellNodeIndex } from '@opentinyvue/vue-renderless/grid/utils';
|
|
9
9
|
import Tooltip$1 from '@opentinyvue/vue-tooltip';
|
|
10
|
-
import { isNull, isObject, isEmptyObject, isNumber as isNumber$1, isDate } from '@opentinyvue/vue-renderless/common/type';
|
|
11
|
-
import { addClass, removeClass, isDisplayNone, on, getStyle, preventDefault, off, hasClass } from '@opentinyvue/vue-renderless/common/deps/dom';
|
|
12
|
-
import { random, toDecimal, tryToCurrency, tryToDecimal, tryToInt, toFileSize, truncate, toRate, toBoolValue } from '@opentinyvue/vue-renderless/common/string';
|
|
13
10
|
import { createVNode, isVNode, mergeProps, createTextVNode, resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, createCommentVNode, normalizeStyle, createElementVNode, Fragment, renderList } from 'vue';
|
|
14
|
-
import { toDate, getDateWithNewTimezone, format, toDateStr } from '@opentinyvue/vue-renderless/common/date';
|
|
15
|
-
import { log } from '@opentinyvue/vue-renderless/common';
|
|
16
11
|
import { toNumber, findTree, find as find$1, isEqual as isEqual$1, arrayEach as arrayEach$1 } from '@opentinyvue/vue-renderless/grid/static';
|
|
17
12
|
import { AutoTip } from '@opentinyvue/vue-directive';
|
|
18
13
|
import Button from '@opentinyvue/vue-button';
|
|
19
|
-
import PopperJS from '@opentinyvue/vue-renderless/common/deps/popper';
|
|
20
|
-
import PopupManager from '@opentinyvue/vue-renderless/common/deps/popup-manager';
|
|
21
|
-
import debounce from '@opentinyvue/vue-renderless/common/deps/debounce';
|
|
22
|
-
import { getDataset } from '@opentinyvue/vue-renderless/common/dataset';
|
|
23
14
|
import Loading$1 from '@opentinyvue/vue-loading';
|
|
24
|
-
import { fastdom } from '@opentinyvue/vue-renderless/common/deps/fastdom';
|
|
25
15
|
import Dropdown from '@opentinyvue/vue-dropdown';
|
|
26
16
|
import DropdownMenu from '@opentinyvue/vue-dropdown-menu';
|
|
27
17
|
import DropdownItem from '@opentinyvue/vue-dropdown-item';
|
|
28
|
-
import browser, { isBrowser } from '@opentinyvue/vue-renderless/common/browser';
|
|
29
18
|
import Exception from '@opentinyvue/vue-exception';
|
|
30
19
|
import Tag from '@opentinyvue/vue-tag';
|
|
31
|
-
import { callInterceptor } from '@opentinyvue/vue-renderless/common/function';
|
|
32
20
|
import Methods$g from '@opentinyvue/vue-renderless/grid/plugins/export';
|
|
33
|
-
import throttle from '@opentinyvue/vue-renderless/common/deps/throttle';
|
|
34
|
-
import Validator$1 from '@opentinyvue/vue-renderless/common/validate';
|
|
35
21
|
import Resize$1 from '@opentinyvue/vue-renderless/grid/plugins/resize';
|
|
36
22
|
import Modal$1 from '@opentinyvue/vue-modal';
|
|
37
23
|
import Pager$1 from '@opentinyvue/vue-pager';
|
|
@@ -382,7 +368,7 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
382
368
|
if (null == r) return {};
|
|
383
369
|
var t2 = {};
|
|
384
370
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
385
|
-
if (e.
|
|
371
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
386
372
|
t2[n] = r[n];
|
|
387
373
|
}
|
|
388
374
|
return t2;
|
|
@@ -469,7 +455,7 @@ var GlobalConfig$1 = {
|
|
|
469
455
|
menu: {},
|
|
470
456
|
tooltip: {
|
|
471
457
|
trigger: "hover",
|
|
472
|
-
|
|
458
|
+
effect: "light"
|
|
473
459
|
},
|
|
474
460
|
pager: {},
|
|
475
461
|
toolbar: {
|
|
@@ -1841,18 +1827,16 @@ var outLog = function outLog2(type) {
|
|
|
1841
1827
|
if (detail) {
|
|
1842
1828
|
msg += ": " + detail;
|
|
1843
1829
|
}
|
|
1844
|
-
|
|
1830
|
+
logger[type](msg);
|
|
1845
1831
|
return msg;
|
|
1846
1832
|
};
|
|
1847
1833
|
};
|
|
1848
1834
|
var warn = outLog("warn");
|
|
1849
1835
|
var error = outLog("error");
|
|
1850
1836
|
var DateFormat = {
|
|
1851
|
-
FULLDATETIME: "yyyy-MM-dd hh:mm:ss.SSS",
|
|
1852
1837
|
LONGDATETIME: "yyyy-MM-dd hh:mm:ss",
|
|
1853
1838
|
DATETIME: "yyyy-MM-dd hh:mm",
|
|
1854
1839
|
DATE: "yyyy-MM-dd",
|
|
1855
|
-
FULLTIME: "hh:mm:ss.SSS",
|
|
1856
1840
|
LONGTIME: "hh:mm:ss",
|
|
1857
1841
|
TIME: "hh:mm",
|
|
1858
1842
|
YEARMONTH: "yyyy-MM"
|
|
@@ -1881,7 +1865,7 @@ var dateFormat = function dateFormat2(value, formatString) {
|
|
|
1881
1865
|
}
|
|
1882
1866
|
var currentTimezone = 0 - (/* @__PURE__ */ new Date()).getTimezoneOffset() / 60;
|
|
1883
1867
|
var newDate = getDateWithNewTimezone(isDate(value) ? value : new Date(toDate(value)), currentTimezone, userFormat.timezone || 8);
|
|
1884
|
-
return
|
|
1868
|
+
return formatDateByPattern(newDate, userFormat.dateFormat);
|
|
1885
1869
|
}
|
|
1886
1870
|
return toDateStr(value, userFormat.dateFormat, userFormat.timezone);
|
|
1887
1871
|
};
|
|
@@ -2592,6 +2576,7 @@ var generateFixedClassName = function generateFixedClassName2(_ref38) {
|
|
|
2592
2576
|
var isOperateMouse = function isOperateMouse2($table) {
|
|
2593
2577
|
return $table._isResize || $table.lastScrollTime && Date.now() < $table.lastScrollTime + $table.optimizeOpts.delayHover;
|
|
2594
2578
|
};
|
|
2579
|
+
var renderRowFlag = false;
|
|
2595
2580
|
var classMap = {
|
|
2596
2581
|
colEdit: "col__edit",
|
|
2597
2582
|
colIndex: "col__index",
|
|
@@ -3127,6 +3112,15 @@ function renderRow(args) {
|
|
|
3127
3112
|
if (isNotRenderRow) {
|
|
3128
3113
|
return;
|
|
3129
3114
|
}
|
|
3115
|
+
var key = rowid2;
|
|
3116
|
+
if (row2._isDraging) {
|
|
3117
|
+
_vm.$nextTick(function() {
|
|
3118
|
+
delete row2._isDraging;
|
|
3119
|
+
});
|
|
3120
|
+
if (renderRowFlag) {
|
|
3121
|
+
key = "" + rowid2 + rowKey;
|
|
3122
|
+
}
|
|
3123
|
+
}
|
|
3130
3124
|
rows.push(h2("tr", {
|
|
3131
3125
|
class: ["tiny-grid-body__row", (_ref57 = {}, _ref57["row__level-" + rowLevel] = treeConfig, _ref57[classMap.rowNew] = editStore.insertList.includes(row2), _ref57[classMap.rowSelected] = selection.includes(row2), _ref57[classMap.rowRadio] = selectRow === row2, _ref57[classMap.rowActived] = rowActived, _ref57), rowClassName ? isFunction(rowClassName) ? rowClassName({
|
|
3132
3126
|
$table,
|
|
@@ -3140,7 +3134,7 @@ function renderRow(args) {
|
|
|
3140
3134
|
attrs: {
|
|
3141
3135
|
"data-rowid": rowid2
|
|
3142
3136
|
},
|
|
3143
|
-
key
|
|
3137
|
+
key,
|
|
3144
3138
|
on: trOn
|
|
3145
3139
|
}, tableColumn3.map(function(column, $columnIndex) {
|
|
3146
3140
|
var columnIndex = $table.getColumnIndex(column);
|
|
@@ -3357,6 +3351,7 @@ function renderRows(_ref59) {
|
|
|
3357
3351
|
});
|
|
3358
3352
|
renderRowTree(args, renderRows);
|
|
3359
3353
|
});
|
|
3354
|
+
renderRowFlag = !renderRowFlag;
|
|
3360
3355
|
return rows;
|
|
3361
3356
|
}
|
|
3362
3357
|
function renderDefEmpty(h2) {
|
|
@@ -3368,11 +3363,12 @@ function renderDefEmpty(h2) {
|
|
|
3368
3363
|
}
|
|
3369
3364
|
var syncHeaderAndFooterScroll = function syncHeaderAndFooterScroll2(_ref61) {
|
|
3370
3365
|
var bodyElem = _ref61.bodyElem, footerElem = _ref61.footerElem, headerElem = _ref61.headerElem, isX = _ref61.isX;
|
|
3366
|
+
var scrollLeft = bodyElem.scrollLeft;
|
|
3371
3367
|
if (isX && headerElem) {
|
|
3372
|
-
headerElem.scrollLeft =
|
|
3368
|
+
headerElem.scrollLeft = scrollLeft;
|
|
3373
3369
|
}
|
|
3374
3370
|
if (isX && footerElem) {
|
|
3375
|
-
footerElem.scrollLeft =
|
|
3371
|
+
footerElem.scrollLeft = scrollLeft;
|
|
3376
3372
|
}
|
|
3377
3373
|
};
|
|
3378
3374
|
function doScrollLoad(_ref62) {
|
|
@@ -3481,8 +3477,6 @@ var Body = /* @__PURE__ */ defineComponent({
|
|
|
3481
3477
|
elemStore[keyPrefix + "xSpace"] = $refs.xSpace;
|
|
3482
3478
|
elemStore[keyPrefix + "ySpace"] = $refs.ySpace;
|
|
3483
3479
|
elemStore[keyPrefix + "emptyBlock"] = $refs.emptyBlock;
|
|
3484
|
-
$el.onscroll = this.scrollEvent;
|
|
3485
|
-
$el._onscroll = this.scrollEvent;
|
|
3486
3480
|
if (dropConfig) {
|
|
3487
3481
|
var plugin = dropConfig.plugin, _dropConfig$row = dropConfig.row, row2 = _dropConfig$row === void 0 ? true : _dropConfig$row;
|
|
3488
3482
|
plugin && row2 && (this.rowSortable = $table.rowDrop(this.$el));
|
|
@@ -3515,7 +3509,10 @@ var Body = /* @__PURE__ */ defineComponent({
|
|
|
3515
3509
|
var isCenterCls = isCenterEmpty ? "is__center" : "";
|
|
3516
3510
|
return h("div", {
|
|
3517
3511
|
ref: "body",
|
|
3518
|
-
class: ["tiny-grid__body-wrapper", "body__wrapper", (_ref68 = {}, _ref68[classMap.isScrollload] = scrollLoad, _ref68)]
|
|
3512
|
+
class: ["tiny-grid__body-wrapper", "body__wrapper", (_ref68 = {}, _ref68[classMap.isScrollload] = scrollLoad, _ref68)],
|
|
3513
|
+
on: {
|
|
3514
|
+
scroll: this.scrollEvent
|
|
3515
|
+
}
|
|
3519
3516
|
}, [
|
|
3520
3517
|
// 表格主体内容x轴方向虚拟滚动条占位元素
|
|
3521
3518
|
h("div", {
|
|
@@ -4099,7 +4096,7 @@ var Panel$1 = /* @__PURE__ */ defineComponent({
|
|
|
4099
4096
|
var _simpleFilter$datetim, _simpleFilter$datetim2, _simpleFilter$datetim3, _simpleFilter$datetim4, _simpleFilter$datetim5, _simpleFilter$datetim6;
|
|
4100
4097
|
var _slot6, _slot7;
|
|
4101
4098
|
var DatePickComponents = simpleFilter != null && (_simpleFilter$datetim = simpleFilter.datetimeConfig) != null && _simpleFilter$datetim.component ? hooks.toRaw(simpleFilter.datetimeConfig.component) : null;
|
|
4102
|
-
var
|
|
4099
|
+
var format = simpleFilter == null ? void 0 : (_simpleFilter$datetim2 = simpleFilter.datetimeConfig) == null ? void 0 : _simpleFilter$datetim2.format;
|
|
4103
4100
|
var valueFormat = simpleFilter == null ? void 0 : (_simpleFilter$datetim3 = simpleFilter.datetimeConfig) == null ? void 0 : _simpleFilter$datetim3.valueFormat;
|
|
4104
4101
|
var type = simpleFilter == null ? void 0 : (_simpleFilter$datetim4 = simpleFilter.datetimeConfig) == null ? void 0 : _simpleFilter$datetim4.type;
|
|
4105
4102
|
var max = simpleFilter == null ? void 0 : (_simpleFilter$datetim5 = simpleFilter.datetimeConfig) == null ? void 0 : _simpleFilter$datetim5.max;
|
|
@@ -4118,7 +4115,7 @@ var Panel$1 = /* @__PURE__ */ defineComponent({
|
|
|
4118
4115
|
}, [createVNode("li", {
|
|
4119
4116
|
"class": "tiny-grid__filter-date-item"
|
|
4120
4117
|
}, [createVNode("span", null, [this.i18n("ui.grid.filter.startDate")]), createVNode(DatePickComponents, {
|
|
4121
|
-
"format":
|
|
4118
|
+
"format": format,
|
|
4122
4119
|
"type": type,
|
|
4123
4120
|
"value-format": valueFormat,
|
|
4124
4121
|
"picker-options": pickerOptions,
|
|
@@ -4135,7 +4132,7 @@ var Panel$1 = /* @__PURE__ */ defineComponent({
|
|
|
4135
4132
|
}, null)]), createVNode("li", {
|
|
4136
4133
|
"class": "tiny-grid__filter-date-item"
|
|
4137
4134
|
}, [createVNode("span", null, [this.i18n("ui.grid.filter.endDate")]), createVNode(DatePickComponents, {
|
|
4138
|
-
"format":
|
|
4135
|
+
"format": format,
|
|
4139
4136
|
"type": type,
|
|
4140
4137
|
"value-format": valueFormat,
|
|
4141
4138
|
"picker-options": pickerOptions,
|
|
@@ -5388,12 +5385,12 @@ function processRenderer(_ref92) {
|
|
|
5388
5385
|
return result;
|
|
5389
5386
|
}
|
|
5390
5387
|
function processAsyncColumn(_ref93) {
|
|
5391
|
-
var $table = _ref93.$table, column = _ref93.column,
|
|
5388
|
+
var $table = _ref93.$table, column = _ref93.column, format = _ref93.format, h2 = _ref93.h, params = _ref93.params, row2 = _ref93.row;
|
|
5392
5389
|
var result = {
|
|
5393
5390
|
flag: false,
|
|
5394
5391
|
vnodes: null
|
|
5395
5392
|
};
|
|
5396
|
-
var _ref94 =
|
|
5393
|
+
var _ref94 = format.async || {}, fetch = _ref94.fetch, loadingText = _ref94.loadingText;
|
|
5397
5394
|
if ($table.isAsyncColumn && row2[insertedField] !== true && typeof fetch === "function") {
|
|
5398
5395
|
var cellText = row2[$table.getAsyncColumnName(column.property)];
|
|
5399
5396
|
var loadingRender = loadingText || "loading ...";
|
|
@@ -5601,7 +5598,7 @@ var Cell = {
|
|
|
5601
5598
|
renderCell: function renderCell(h2, params) {
|
|
5602
5599
|
var $table = params.$table, row2 = params.row, column = params.column;
|
|
5603
5600
|
var slots = column.slots, renderer = column.renderer;
|
|
5604
|
-
var
|
|
5601
|
+
var format = column.format || {};
|
|
5605
5602
|
if (slots && slots.default) {
|
|
5606
5603
|
return slots.default(params, h2);
|
|
5607
5604
|
}
|
|
@@ -5618,7 +5615,7 @@ var Cell = {
|
|
|
5618
5615
|
result = processAsyncColumn({
|
|
5619
5616
|
$table,
|
|
5620
5617
|
column,
|
|
5621
|
-
format
|
|
5618
|
+
format,
|
|
5622
5619
|
h: h2,
|
|
5623
5620
|
params,
|
|
5624
5621
|
row: row2
|
|
@@ -6261,13 +6258,17 @@ function getTableWidth(_ref116) {
|
|
|
6261
6258
|
};
|
|
6262
6259
|
}
|
|
6263
6260
|
function layoutFooter(_ref117) {
|
|
6264
|
-
var customHeight = _ref117.customHeight, footerHeight = _ref117.footerHeight, headerHeight = _ref117.headerHeight, scrollXLoad = _ref117.scrollXLoad, scrollbarWidth = _ref117.scrollbarWidth, tableElem = _ref117.tableElem, scrollbarHeight = _ref117.scrollbarHeight, tableColumn3 = _ref117.tableColumn, tableHeight = _ref117.tableHeight, tableWidth = _ref117.tableWidth, wrapperElem = _ref117.wrapperElem, fixedWrapperElem = _ref117.fixedWrapperElem;
|
|
6261
|
+
var elemStore = _ref117.elemStore, customHeight = _ref117.customHeight, footerHeight = _ref117.footerHeight, headerHeight = _ref117.headerHeight, scrollXLoad = _ref117.scrollXLoad, scrollbarWidth = _ref117.scrollbarWidth, tableElem = _ref117.tableElem, scrollbarHeight = _ref117.scrollbarHeight, tableColumn3 = _ref117.tableColumn, tableHeight = _ref117.tableHeight, tableWidth = _ref117.tableWidth, wrapperElem = _ref117.wrapperElem, fixedWrapperElem = _ref117.fixedWrapperElem;
|
|
6265
6262
|
var tWidth = tableWidth;
|
|
6266
6263
|
var ret = getTableWidth({
|
|
6267
6264
|
scrollXLoad,
|
|
6268
6265
|
tWidth,
|
|
6269
6266
|
tableColumn: tableColumn3
|
|
6270
6267
|
});
|
|
6268
|
+
var spaceElem = elemStore["main-footer-x-space"];
|
|
6269
|
+
if (spaceElem) {
|
|
6270
|
+
spaceElem.style.width = tableWidth + "px";
|
|
6271
|
+
}
|
|
6271
6272
|
tableColumn3 = ret.tableColumn;
|
|
6272
6273
|
tWidth = ret.tWidth;
|
|
6273
6274
|
if (wrapperElem && fixedWrapperElem) {
|
|
@@ -6442,6 +6443,7 @@ function handleLayout(params) {
|
|
|
6442
6443
|
tableColumn3 = ret.tableColumn;
|
|
6443
6444
|
} else if (layout === "footer") {
|
|
6444
6445
|
tableColumn3 = layoutFooter({
|
|
6446
|
+
elemStore,
|
|
6445
6447
|
customHeight,
|
|
6446
6448
|
fixedWrapperElem,
|
|
6447
6449
|
footerHeight,
|
|
@@ -6610,8 +6612,8 @@ function onScrollXLoad(_ref134) {
|
|
|
6610
6612
|
function mapFetchColumnPromise(_ref135) {
|
|
6611
6613
|
var _vm = _ref135._vm, fetchColumns = _ref135.fetchColumns, tableColumn3 = _ref135.tableColumn;
|
|
6612
6614
|
return fetchColumns.map(function(_ref136) {
|
|
6613
|
-
var
|
|
6614
|
-
return
|
|
6615
|
+
var format = _ref136.format, columnValues = _ref136.columnValues;
|
|
6616
|
+
return format.async.fetch({
|
|
6615
6617
|
columns: tableColumn3,
|
|
6616
6618
|
columnValues,
|
|
6617
6619
|
$table: _vm
|
|
@@ -6666,7 +6668,7 @@ function handleResolveColumnComplete(_ref139) {
|
|
|
6666
6668
|
});
|
|
6667
6669
|
}
|
|
6668
6670
|
}
|
|
6669
|
-
var isWebkit =
|
|
6671
|
+
var isWebkit = browserInfo["-webkit"];
|
|
6670
6672
|
function computeScrollYLoad(_ref140) {
|
|
6671
6673
|
var _vm = _ref140._vm, scrollLoad = _ref140.scrollLoad, scrollY = _ref140.scrollY, scrollYLoad = _ref140.scrollYLoad, scrollYStore = _ref140.scrollYStore, tableBodyElem = _ref140.tableBodyElem;
|
|
6672
6674
|
if (scrollYLoad || scrollLoad) {
|
|
@@ -6922,8 +6924,8 @@ var handleAllColumnPromises = function handleAllColumnPromises2(opt, ctx) {
|
|
|
6922
6924
|
var renderCount = 0;
|
|
6923
6925
|
var columnCount = 0;
|
|
6924
6926
|
var columnData = [];
|
|
6925
|
-
var _fetchColumns$i = fetchColumns[i], _fetchColumns$i$forma = _fetchColumns$i.format,
|
|
6926
|
-
var _ref149 =
|
|
6927
|
+
var _fetchColumns$i = fetchColumns[i], _fetchColumns$i$forma = _fetchColumns$i.format, format = _fetchColumns$i$forma === void 0 ? {} : _fetchColumns$i$forma, property = _fetchColumns$i.property;
|
|
6928
|
+
var _ref149 = format.async || {}, _ref149$splitConfig = _ref149.splitConfig, splitConfig = _ref149$splitConfig === void 0 ? {} : _ref149$splitConfig, _ref149$fields = _ref149.fields, fields = _ref149$fields === void 0 ? {} : _ref149$fields, complete = _ref149.complete;
|
|
6927
6929
|
columnValues = isArray(item) ? item : get(item, fields.data || "values");
|
|
6928
6930
|
columnCount = columnValues.length;
|
|
6929
6931
|
preprocessDataObjectFormat({
|
|
@@ -6958,7 +6960,7 @@ var handleAllColumnPromises = function handleAllColumnPromises2(opt, ctx) {
|
|
|
6958
6960
|
break;
|
|
6959
6961
|
}
|
|
6960
6962
|
}
|
|
6961
|
-
|
|
6963
|
+
format.data = columnData;
|
|
6962
6964
|
handleResolveColumnComplete({
|
|
6963
6965
|
_vm: ctx,
|
|
6964
6966
|
columnData,
|
|
@@ -9182,7 +9184,10 @@ var Methods$d = {
|
|
|
9182
9184
|
scrollXStore.lastStartIndex = ret.lastStartIndex;
|
|
9183
9185
|
_this43.tableColumn = ret.tableColumn;
|
|
9184
9186
|
_this43.visibleColumnChanged = ret.visibleColumnChanged;
|
|
9185
|
-
_this43.$nextTick(
|
|
9187
|
+
_this43.$nextTick(function() {
|
|
9188
|
+
_this43.updateFooter();
|
|
9189
|
+
_this43.updateStyle();
|
|
9190
|
+
});
|
|
9186
9191
|
});
|
|
9187
9192
|
},
|
|
9188
9193
|
// 更新横向 X 可视渲染上下剩余空间大小
|
|
@@ -11997,7 +12002,7 @@ var Table = defineComponent({
|
|
|
11997
12002
|
relationKey: columnLevelKey$1 + "-" + id3.value,
|
|
11998
12003
|
childrenKey: "childColumns",
|
|
11999
12004
|
relationContainer: function relationContainer() {
|
|
12000
|
-
return
|
|
12005
|
+
return !isServer ? $table.$el.querySelector("." + hiddenContainerClass) : null;
|
|
12001
12006
|
},
|
|
12002
12007
|
onChange: function onChange() {
|
|
12003
12008
|
var collectKey = $table.computeCollectKey();
|
|
@@ -12626,6 +12631,7 @@ var Grid = defineComponent({
|
|
|
12626
12631
|
optimization: optimizOpt,
|
|
12627
12632
|
startIndex: seqIndex2
|
|
12628
12633
|
});
|
|
12634
|
+
props.tooltipConfig = Object.assign({}, GlobalConfig$1.tooltip || {}, (designConfig == null ? void 0 : designConfig.tooltip) || {}, props.tooltipConfig || {});
|
|
12629
12635
|
if ((designConfig == null ? void 0 : designConfig.stripe) !== void 0 && !props.stripe) {
|
|
12630
12636
|
props.stripe = designConfig == null ? void 0 : designConfig.stripe;
|
|
12631
12637
|
}
|
|
@@ -13237,7 +13243,7 @@ var Methods$c = {
|
|
|
13237
13243
|
inputElem.selectionStart = inputElem.selectionEnd;
|
|
13238
13244
|
inputElem.type = type;
|
|
13239
13245
|
inputElem[autoselect ? "select" : "focus"]();
|
|
13240
|
-
if (
|
|
13246
|
+
if (browserInfo.name !== "ie") {
|
|
13241
13247
|
return;
|
|
13242
13248
|
}
|
|
13243
13249
|
var textRange = inputElem.createTextRange();
|
|
@@ -13643,10 +13649,10 @@ var writeClipboardText = function writeClipboardText2(_ref216) {
|
|
|
13643
13649
|
var getCellValue2 = function getCellValue22(column, row2) {
|
|
13644
13650
|
var cellValue = "";
|
|
13645
13651
|
if (isAsyncColumn) {
|
|
13646
|
-
var
|
|
13647
|
-
if (
|
|
13652
|
+
var format = column.format || {};
|
|
13653
|
+
if (format.async === true && format.type === "enum") {
|
|
13648
13654
|
cellValue = Formatter.enum.call(column, row2[column.property]);
|
|
13649
|
-
} else if (
|
|
13655
|
+
} else if (format.async && typeof format.async.fetch === "function") {
|
|
13650
13656
|
cellValue = row2[$table.getAsyncColumnName(column.property)];
|
|
13651
13657
|
} else {
|
|
13652
13658
|
cellValue = row2[column.property];
|
|
@@ -14241,7 +14247,6 @@ var Methods$b = {
|
|
|
14241
14247
|
var bodyList = elemStore["main-body-list"].children;
|
|
14242
14248
|
var _getCellIndex = getCellIndex({
|
|
14243
14249
|
cell,
|
|
14244
|
-
elemStore,
|
|
14245
14250
|
bodyList
|
|
14246
14251
|
}), rIndex = _getCellIndex.rIndex, cIndex = _getCellIndex.cIndex;
|
|
14247
14252
|
var maxIndex = bodyList.length - 1;
|
|
@@ -14534,6 +14539,7 @@ var Methods$a = {
|
|
|
14534
14539
|
return Promise.reject(validRest[ruleKeys[0]][0]);
|
|
14535
14540
|
}
|
|
14536
14541
|
cb && cb(opt.status);
|
|
14542
|
+
return opt.status;
|
|
14537
14543
|
};
|
|
14538
14544
|
return Promise.all(rowValids).then(onFulfilled).catch(onRejected(opt, this));
|
|
14539
14545
|
},
|
|
@@ -15490,12 +15496,14 @@ var createHandlerOnEnd = function createHandlerOnEnd2(_ref249) {
|
|
|
15490
15496
|
children: (_vm.treeConfig || {}).children || "children"
|
|
15491
15497
|
};
|
|
15492
15498
|
var targetTrElem = event.item;
|
|
15493
|
-
var wrapperElem = targetTrElem.parentNode,
|
|
15499
|
+
var wrapperElem = targetTrElem.parentNode, prevEl = targetTrElem.previousElementSibling, nextEl = targetTrElem.nextElementSibling;
|
|
15500
|
+
var prevTrElem = prevEl && prevEl.classList.contains("tiny-grid-body__row") ? prevEl : prevEl && prevEl.previousElementSibling;
|
|
15494
15501
|
var tableTreeData = _vm.data || _vm.tableData;
|
|
15495
15502
|
var selfRow = _vm.getRowNode(targetTrElem).item;
|
|
15496
15503
|
var selfNode = findTree$1(tableTreeData, function(row2) {
|
|
15497
15504
|
return row2 === selfRow;
|
|
15498
15505
|
}, options);
|
|
15506
|
+
selfRow._isDraging = true;
|
|
15499
15507
|
var isScrollYLoad = _vm.scrollYLoad;
|
|
15500
15508
|
if (!isScrollYLoad) {
|
|
15501
15509
|
if (prevTrElem) {
|
|
@@ -15520,7 +15528,7 @@ var createHandlerOnEnd = function createHandlerOnEnd2(_ref249) {
|
|
|
15520
15528
|
prevNode.items.splice(prevNode.index + (selfNode.index < prevNode.index ? 0 : 1), 0, currRow);
|
|
15521
15529
|
prevNode.items = [].concat(prevNode.items);
|
|
15522
15530
|
}
|
|
15523
|
-
} else {
|
|
15531
|
+
} else if (nextEl && nextEl.classList.contains("tiny-grid-body__row")) {
|
|
15524
15532
|
var _currRow = selfNode.items.splice(selfNode.index, 1)[0];
|
|
15525
15533
|
tableTreeData.unshift(_currRow);
|
|
15526
15534
|
_vm.tableFullData = [].concat(tableTreeData);
|
|
@@ -15721,7 +15729,7 @@ var Methods$2 = {
|
|
|
15721
15729
|
}
|
|
15722
15730
|
var tooltip = this.$refs.tooltip;
|
|
15723
15731
|
var wrapperElem = cell;
|
|
15724
|
-
var content = cell.innerText.trim()
|
|
15732
|
+
var content = cell.innerText.trim();
|
|
15725
15733
|
var contentMethod = this.tooltipConfig.contentMethod;
|
|
15726
15734
|
var range = createTooltipRange({
|
|
15727
15735
|
_vm: this,
|
|
@@ -15731,7 +15739,10 @@ var Methods$2 = {
|
|
|
15731
15739
|
});
|
|
15732
15740
|
var rangeWidth = range.getBoundingClientRect().width;
|
|
15733
15741
|
var padding = (parseInt(getStyle(cell, "paddingLeft"), 10) || 0) + (parseInt(getStyle(cell, "paddingRight"), 10) || 0);
|
|
15734
|
-
var isOverflow =
|
|
15742
|
+
var isOverflow = (
|
|
15743
|
+
// 浏览器缩放情况下,会存在细微的像素无法,因此设置0.1像素作为误差量
|
|
15744
|
+
rangeWidth + padding > cell.getBoundingClientRect().width + 0.1 || wrapperElem.scrollWidth > wrapperElem.clientWidth
|
|
15745
|
+
);
|
|
15735
15746
|
if ((contentMethod || content) && (showTip || isOverflow)) {
|
|
15736
15747
|
Object.assign(this.tooltipStore, {
|
|
15737
15748
|
row: row2,
|
|
@@ -16130,10 +16141,8 @@ function hasNoCheckFieldNoStrictly(_ref267) {
|
|
|
16130
16141
|
afterFullData,
|
|
16131
16142
|
checkMethod,
|
|
16132
16143
|
checkStrictly,
|
|
16133
|
-
property,
|
|
16134
16144
|
selectRows,
|
|
16135
16145
|
selection,
|
|
16136
|
-
treeConfig,
|
|
16137
16146
|
value
|
|
16138
16147
|
});
|
|
16139
16148
|
}
|
|
@@ -16601,7 +16610,7 @@ var Tree = {
|
|
|
16601
16610
|
Object.assign(host.methods, Methods);
|
|
16602
16611
|
}
|
|
16603
16612
|
};
|
|
16604
|
-
var version = "3.
|
|
16613
|
+
var version = "3.22.0";
|
|
16605
16614
|
var plugins = [Panel, Edit, Export, Keyboard, Validator, Resize, Panel$1, FetchData, Pager, Toolbar, ColumnAnchor, Dragger, Sort, Tooltip, Checkbox, Tree];
|
|
16606
16615
|
Grid$1.setup({
|
|
16607
16616
|
i18n: t
|
package/package.json
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentinyvue/vue-grid",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.22.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"main": "./lib/index.js",
|
|
9
9
|
"module": "./lib/index.js",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@opentinyvue/vue-common": "~3.
|
|
12
|
-
"@opentinyvue/vue-directive": "~3.
|
|
13
|
-
"@opentinyvue/vue-dropdown": "~3.
|
|
14
|
-
"@opentinyvue/vue-dropdown-item": "~3.
|
|
15
|
-
"@opentinyvue/vue-dropdown-menu": "~3.
|
|
16
|
-
"@opentinyvue/vue-exception": "~3.
|
|
17
|
-
"@opentinyvue/vue-icon": "~3.
|
|
18
|
-
"@opentinyvue/vue-loading": "~3.
|
|
19
|
-
"@opentinyvue/vue-locale": "~3.
|
|
20
|
-
"@opentinyvue/vue-modal": "~3.
|
|
21
|
-
"@opentinyvue/vue-pager": "~3.
|
|
22
|
-
"@opentinyvue/vue-renderless": "~3.
|
|
23
|
-
"@opentinyvue/vue-tag": "~3.
|
|
24
|
-
"@opentinyvue/vue-theme": "~3.
|
|
25
|
-
"@opentinyvue/vue-tooltip": "~3.
|
|
11
|
+
"@opentinyvue/vue-common": "~3.22.0",
|
|
12
|
+
"@opentinyvue/vue-directive": "~3.22.0",
|
|
13
|
+
"@opentinyvue/vue-dropdown": "~3.22.0",
|
|
14
|
+
"@opentinyvue/vue-dropdown-item": "~3.22.0",
|
|
15
|
+
"@opentinyvue/vue-dropdown-menu": "~3.22.0",
|
|
16
|
+
"@opentinyvue/vue-exception": "~3.22.0",
|
|
17
|
+
"@opentinyvue/vue-icon": "~3.22.0",
|
|
18
|
+
"@opentinyvue/vue-loading": "~3.22.0",
|
|
19
|
+
"@opentinyvue/vue-locale": "~3.22.0",
|
|
20
|
+
"@opentinyvue/vue-modal": "~3.22.0",
|
|
21
|
+
"@opentinyvue/vue-pager": "~3.22.0",
|
|
22
|
+
"@opentinyvue/vue-renderless": "~3.22.0",
|
|
23
|
+
"@opentinyvue/vue-tag": "~3.22.0",
|
|
24
|
+
"@opentinyvue/vue-theme": "~3.22.0",
|
|
25
|
+
"@opentinyvue/vue-tooltip": "~3.22.0",
|
|
26
|
+
"@opentinyvue/utils": "~3.22.0"
|
|
26
27
|
},
|
|
27
28
|
"types": "index.d.ts",
|
|
28
29
|
"scripts": {
|
|
@@ -212,9 +212,9 @@ declare const _default: hooks.DefineComponent<{
|
|
|
212
212
|
tiny_theme: StringConstructor;
|
|
213
213
|
tiny_chart_theme: ObjectConstructor;
|
|
214
214
|
}>>, {
|
|
215
|
+
required: boolean;
|
|
215
216
|
tiny_mode_root: boolean;
|
|
216
217
|
showIcon: boolean;
|
|
217
|
-
required: boolean;
|
|
218
218
|
group: boolean;
|
|
219
219
|
showTip: boolean;
|
|
220
220
|
formatConfig: Record<string, any>;
|
package/src/config.d.ts
CHANGED
package/src/table/src/table.d.ts
CHANGED