@opentinyvue/vue-grid 2.21.0 → 2.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 CHANGED
@@ -1,36 +1,22 @@
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/vue-renderless/common/object';
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, iconChevronRight, iconChevronDown, iconMarkOn } 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
- import { toDate, getDateWithNewTimezone, format, toDateStr } from '@opentinyvue/vue-renderless/common/date';
14
- import { log } from '@opentinyvue/vue-renderless/common';
15
10
  import { toNumber, findTree, find as find$1, isEqual as isEqual$1, arrayEach as arrayEach$1 } from '@opentinyvue/vue-renderless/grid/static';
16
11
  import { AutoTip } from '@opentinyvue/vue-directive';
17
12
  import Button from '@opentinyvue/vue-button';
18
- import PopperJS from '@opentinyvue/vue-renderless/common/deps/popper';
19
- import PopupManager from '@opentinyvue/vue-renderless/common/deps/popup-manager';
20
- import debounce from '@opentinyvue/vue-renderless/common/deps/debounce';
21
- import { getDataset } from '@opentinyvue/vue-renderless/common/dataset';
22
13
  import Loading$1 from '@opentinyvue/vue-loading';
23
- import { fastdom } from '@opentinyvue/vue-renderless/common/deps/fastdom';
24
14
  import Dropdown from '@opentinyvue/vue-dropdown';
25
15
  import DropdownMenu from '@opentinyvue/vue-dropdown-menu';
26
16
  import DropdownItem from '@opentinyvue/vue-dropdown-item';
27
- import browser, { isBrowser } from '@opentinyvue/vue-renderless/common/browser';
28
17
  import Exception from '@opentinyvue/vue-exception';
29
18
  import Tag from '@opentinyvue/vue-tag';
30
- import { callInterceptor } from '@opentinyvue/vue-renderless/common/function';
31
19
  import Methods$g from '@opentinyvue/vue-renderless/grid/plugins/export';
32
- import throttle from '@opentinyvue/vue-renderless/common/deps/throttle';
33
- import Validator$1 from '@opentinyvue/vue-renderless/common/validate';
34
20
  import Resize$1 from '@opentinyvue/vue-renderless/grid/plugins/resize';
35
21
  import Modal$1 from '@opentinyvue/vue-modal';
36
22
  import Pager$1 from '@opentinyvue/vue-pager';
@@ -420,7 +406,7 @@ function _objectWithoutPropertiesLoose(r, e) {
420
406
  if (null == r) return {};
421
407
  var t2 = {};
422
408
  for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
423
- if (e.includes(n)) continue;
409
+ if (-1 !== e.indexOf(n)) continue;
424
410
  t2[n] = r[n];
425
411
  }
426
412
  return t2;
@@ -507,7 +493,7 @@ var GlobalConfig$1 = {
507
493
  menu: {},
508
494
  tooltip: {
509
495
  trigger: "hover",
510
- theme: "dark"
496
+ effect: "light"
511
497
  },
512
498
  pager: {},
513
499
  toolbar: {
@@ -1879,18 +1865,16 @@ var outLog = function outLog2(type) {
1879
1865
  if (detail) {
1880
1866
  msg += ": " + detail;
1881
1867
  }
1882
- log(msg, type);
1868
+ logger[type](msg);
1883
1869
  return msg;
1884
1870
  };
1885
1871
  };
1886
1872
  var warn = outLog("warn");
1887
1873
  var error = outLog("error");
1888
1874
  var DateFormat = {
1889
- FULLDATETIME: "yyyy-MM-dd hh:mm:ss.SSS",
1890
1875
  LONGDATETIME: "yyyy-MM-dd hh:mm:ss",
1891
1876
  DATETIME: "yyyy-MM-dd hh:mm",
1892
1877
  DATE: "yyyy-MM-dd",
1893
- FULLTIME: "hh:mm:ss.SSS",
1894
1878
  LONGTIME: "hh:mm:ss",
1895
1879
  TIME: "hh:mm",
1896
1880
  YEARMONTH: "yyyy-MM"
@@ -1919,7 +1903,7 @@ var dateFormat = function dateFormat2(value, formatString) {
1919
1903
  }
1920
1904
  var currentTimezone = 0 - (/* @__PURE__ */ new Date()).getTimezoneOffset() / 60;
1921
1905
  var newDate = getDateWithNewTimezone(isDate(value) ? value : new Date(toDate(value)), currentTimezone, userFormat.timezone || 8);
1922
- return format(newDate, userFormat.dateFormat);
1906
+ return formatDateByPattern(newDate, userFormat.dateFormat);
1923
1907
  }
1924
1908
  return toDateStr(value, userFormat.dateFormat, userFormat.timezone);
1925
1909
  };
@@ -2630,6 +2614,7 @@ var generateFixedClassName = function generateFixedClassName2(_ref38) {
2630
2614
  var isOperateMouse = function isOperateMouse2($table) {
2631
2615
  return $table._isResize || $table.lastScrollTime && Date.now() < $table.lastScrollTime + $table.optimizeOpts.delayHover;
2632
2616
  };
2617
+ var renderRowFlag = false;
2633
2618
  var classMap = {
2634
2619
  colEdit: "col__edit",
2635
2620
  colIndex: "col__index",
@@ -3173,6 +3158,15 @@ function renderRow(args) {
3173
3158
  if (isNotRenderRow) {
3174
3159
  return;
3175
3160
  }
3161
+ var key = rowid2;
3162
+ if (row2._isDraging) {
3163
+ _vm.$nextTick(function() {
3164
+ delete row2._isDraging;
3165
+ });
3166
+ if (renderRowFlag) {
3167
+ key = "" + rowid2 + rowKey;
3168
+ }
3169
+ }
3176
3170
  rows.push(h2("tr", {
3177
3171
  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({
3178
3172
  $table,
@@ -3186,7 +3180,7 @@ function renderRow(args) {
3186
3180
  attrs: {
3187
3181
  "data-rowid": rowid2
3188
3182
  },
3189
- key: rowKey || treeConfig ? rowid2 : $rowIndex,
3183
+ key,
3190
3184
  on: trOn
3191
3185
  }, tableColumn3.map(function(column, $columnIndex) {
3192
3186
  var columnIndex = $table.getColumnIndex(column);
@@ -3403,6 +3397,7 @@ function renderRows(_ref59) {
3403
3397
  });
3404
3398
  renderRowTree(args, renderRows);
3405
3399
  });
3400
+ renderRowFlag = !renderRowFlag;
3406
3401
  return rows;
3407
3402
  }
3408
3403
  function renderDefEmpty(h2) {
@@ -3414,11 +3409,12 @@ function renderDefEmpty(h2) {
3414
3409
  }
3415
3410
  var syncHeaderAndFooterScroll = function syncHeaderAndFooterScroll2(_ref61) {
3416
3411
  var bodyElem = _ref61.bodyElem, footerElem = _ref61.footerElem, headerElem = _ref61.headerElem, isX = _ref61.isX;
3412
+ var scrollLeft = bodyElem.scrollLeft;
3417
3413
  if (isX && headerElem) {
3418
- headerElem.scrollLeft = bodyElem.scrollLeft;
3414
+ headerElem.scrollLeft = scrollLeft;
3419
3415
  }
3420
3416
  if (isX && footerElem) {
3421
- footerElem.scrollLeft = bodyElem.scrollLeft;
3417
+ footerElem.scrollLeft = scrollLeft;
3422
3418
  }
3423
3419
  };
3424
3420
  function doScrollLoad(_ref62) {
@@ -3527,8 +3523,6 @@ var Body = defineComponent({
3527
3523
  elemStore[keyPrefix + "xSpace"] = $refs.xSpace;
3528
3524
  elemStore[keyPrefix + "ySpace"] = $refs.ySpace;
3529
3525
  elemStore[keyPrefix + "emptyBlock"] = $refs.emptyBlock;
3530
- $el.onscroll = this.scrollEvent;
3531
- $el._onscroll = this.scrollEvent;
3532
3526
  if (dropConfig) {
3533
3527
  var plugin = dropConfig.plugin, _dropConfig$row = dropConfig.row, row2 = _dropConfig$row === void 0 ? true : _dropConfig$row;
3534
3528
  plugin && row2 && (this.rowSortable = $table.rowDrop(this.$el));
@@ -3561,7 +3555,10 @@ var Body = defineComponent({
3561
3555
  var isCenterCls = isCenterEmpty ? "is__center" : "";
3562
3556
  return h("div", {
3563
3557
  ref: "body",
3564
- class: ["tiny-grid__body-wrapper", "body__wrapper", (_ref68 = {}, _ref68[classMap.isScrollload] = scrollLoad, _ref68)]
3558
+ class: ["tiny-grid__body-wrapper", "body__wrapper", (_ref68 = {}, _ref68[classMap.isScrollload] = scrollLoad, _ref68)],
3559
+ on: {
3560
+ scroll: this.scrollEvent
3561
+ }
3565
3562
  }, [
3566
3563
  // 表格主体内容x轴方向虚拟滚动条占位元素
3567
3564
  h("div", {
@@ -4159,7 +4156,7 @@ var Panel$1 = defineComponent({
4159
4156
  if (simpleFilter.isDatetime) {
4160
4157
  var _simpleFilter$datetim, _simpleFilter$datetim2, _simpleFilter$datetim3, _simpleFilter$datetim4, _simpleFilter$datetim5, _simpleFilter$datetim6;
4161
4158
  var DatePickComponents = simpleFilter != null && (_simpleFilter$datetim = simpleFilter.datetimeConfig) != null && _simpleFilter$datetim.component ? hooks.toRaw(simpleFilter.datetimeConfig.component) : null;
4162
- var _format = simpleFilter == null ? void 0 : (_simpleFilter$datetim2 = simpleFilter.datetimeConfig) == null ? void 0 : _simpleFilter$datetim2.format;
4159
+ var format = simpleFilter == null ? void 0 : (_simpleFilter$datetim2 = simpleFilter.datetimeConfig) == null ? void 0 : _simpleFilter$datetim2.format;
4163
4160
  var valueFormat = simpleFilter == null ? void 0 : (_simpleFilter$datetim3 = simpleFilter.datetimeConfig) == null ? void 0 : _simpleFilter$datetim3.valueFormat;
4164
4161
  var type = simpleFilter == null ? void 0 : (_simpleFilter$datetim4 = simpleFilter.datetimeConfig) == null ? void 0 : _simpleFilter$datetim4.type;
4165
4162
  var max = simpleFilter == null ? void 0 : (_simpleFilter$datetim5 = simpleFilter.datetimeConfig) == null ? void 0 : _simpleFilter$datetim5.max;
@@ -4179,7 +4176,7 @@ var Panel$1 = defineComponent({
4179
4176
  "class": "tiny-grid__filter-date-item"
4180
4177
  }, [h2("span", [this.i18n("ui.grid.filter.startDate")]), h2(DatePickComponents, {
4181
4178
  "attrs": {
4182
- "format": _format,
4179
+ "format": format,
4183
4180
  "type": type,
4184
4181
  "value-format": valueFormat,
4185
4182
  "picker-options": pickerOptions
@@ -4202,7 +4199,7 @@ var Panel$1 = defineComponent({
4202
4199
  "class": "tiny-grid__filter-date-item"
4203
4200
  }, [h2("span", [this.i18n("ui.grid.filter.endDate")]), h2(DatePickComponents, {
4204
4201
  "attrs": {
4205
- "format": _format,
4202
+ "format": format,
4206
4203
  "type": type,
4207
4204
  "value-format": valueFormat,
4208
4205
  "picker-options": pickerOptions
@@ -5465,12 +5462,12 @@ function processRenderer(_ref92) {
5465
5462
  return result;
5466
5463
  }
5467
5464
  function processAsyncColumn(_ref93) {
5468
- var $table = _ref93.$table, column = _ref93.column, format2 = _ref93.format, h2 = _ref93.h, params = _ref93.params, row2 = _ref93.row;
5465
+ var $table = _ref93.$table, column = _ref93.column, format = _ref93.format, h2 = _ref93.h, params = _ref93.params, row2 = _ref93.row;
5469
5466
  var result = {
5470
5467
  flag: false,
5471
5468
  vnodes: null
5472
5469
  };
5473
- var _ref94 = format2.async || {}, fetch = _ref94.fetch, loadingText = _ref94.loadingText;
5470
+ var _ref94 = format.async || {}, fetch = _ref94.fetch, loadingText = _ref94.loadingText;
5474
5471
  if ($table.isAsyncColumn && row2[insertedField] !== true && typeof fetch === "function") {
5475
5472
  var cellText = row2[$table.getAsyncColumnName(column.property)];
5476
5473
  var loadingRender = loadingText || "loading ...";
@@ -5678,7 +5675,7 @@ var Cell = {
5678
5675
  renderCell: function renderCell(h2, params) {
5679
5676
  var $table = params.$table, row2 = params.row, column = params.column;
5680
5677
  var slots = column.slots, renderer = column.renderer;
5681
- var format2 = column.format || {};
5678
+ var format = column.format || {};
5682
5679
  if (slots && slots.default) {
5683
5680
  return slots.default(params, h2);
5684
5681
  }
@@ -5695,7 +5692,7 @@ var Cell = {
5695
5692
  result = processAsyncColumn({
5696
5693
  $table,
5697
5694
  column,
5698
- format: format2,
5695
+ format,
5699
5696
  h: h2,
5700
5697
  params,
5701
5698
  row: row2
@@ -6338,13 +6335,17 @@ function getTableWidth(_ref116) {
6338
6335
  };
6339
6336
  }
6340
6337
  function layoutFooter(_ref117) {
6341
- 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;
6338
+ 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;
6342
6339
  var tWidth = tableWidth;
6343
6340
  var ret = getTableWidth({
6344
6341
  scrollXLoad,
6345
6342
  tWidth,
6346
6343
  tableColumn: tableColumn3
6347
6344
  });
6345
+ var spaceElem = elemStore["main-footer-x-space"];
6346
+ if (spaceElem) {
6347
+ spaceElem.style.width = tableWidth + "px";
6348
+ }
6348
6349
  tableColumn3 = ret.tableColumn;
6349
6350
  tWidth = ret.tWidth;
6350
6351
  if (wrapperElem && fixedWrapperElem) {
@@ -6519,6 +6520,7 @@ function handleLayout(params) {
6519
6520
  tableColumn3 = ret.tableColumn;
6520
6521
  } else if (layout === "footer") {
6521
6522
  tableColumn3 = layoutFooter({
6523
+ elemStore,
6522
6524
  customHeight,
6523
6525
  fixedWrapperElem,
6524
6526
  footerHeight,
@@ -6687,8 +6689,8 @@ function onScrollXLoad(_ref134) {
6687
6689
  function mapFetchColumnPromise(_ref135) {
6688
6690
  var _vm = _ref135._vm, fetchColumns = _ref135.fetchColumns, tableColumn3 = _ref135.tableColumn;
6689
6691
  return fetchColumns.map(function(_ref136) {
6690
- var format2 = _ref136.format, columnValues = _ref136.columnValues;
6691
- return format2.async.fetch({
6692
+ var format = _ref136.format, columnValues = _ref136.columnValues;
6693
+ return format.async.fetch({
6692
6694
  columns: tableColumn3,
6693
6695
  columnValues,
6694
6696
  $table: _vm
@@ -6743,7 +6745,7 @@ function handleResolveColumnComplete(_ref139) {
6743
6745
  });
6744
6746
  }
6745
6747
  }
6746
- var isWebkit = browser["-webkit"];
6748
+ var isWebkit = browserInfo["-webkit"];
6747
6749
  function computeScrollYLoad(_ref140) {
6748
6750
  var _vm = _ref140._vm, scrollLoad = _ref140.scrollLoad, scrollY = _ref140.scrollY, scrollYLoad = _ref140.scrollYLoad, scrollYStore = _ref140.scrollYStore, tableBodyElem = _ref140.tableBodyElem;
6749
6751
  if (scrollYLoad || scrollLoad) {
@@ -6999,8 +7001,8 @@ var handleAllColumnPromises = function handleAllColumnPromises2(opt, ctx) {
6999
7001
  var renderCount = 0;
7000
7002
  var columnCount = 0;
7001
7003
  var columnData = [];
7002
- var _fetchColumns$i = fetchColumns[i], _fetchColumns$i$forma = _fetchColumns$i.format, format2 = _fetchColumns$i$forma === void 0 ? {} : _fetchColumns$i$forma, property = _fetchColumns$i.property;
7003
- var _ref149 = format2.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;
7004
+ var _fetchColumns$i = fetchColumns[i], _fetchColumns$i$forma = _fetchColumns$i.format, format = _fetchColumns$i$forma === void 0 ? {} : _fetchColumns$i$forma, property = _fetchColumns$i.property;
7005
+ 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;
7004
7006
  columnValues = isArray(item) ? item : get(item, fields.data || "values");
7005
7007
  columnCount = columnValues.length;
7006
7008
  preprocessDataObjectFormat({
@@ -7035,7 +7037,7 @@ var handleAllColumnPromises = function handleAllColumnPromises2(opt, ctx) {
7035
7037
  break;
7036
7038
  }
7037
7039
  }
7038
- format2.data = columnData;
7040
+ format.data = columnData;
7039
7041
  handleResolveColumnComplete({
7040
7042
  _vm: ctx,
7041
7043
  columnData,
@@ -9259,7 +9261,10 @@ var Methods$d = {
9259
9261
  scrollXStore.lastStartIndex = ret.lastStartIndex;
9260
9262
  _this44.tableColumn = ret.tableColumn;
9261
9263
  _this44.visibleColumnChanged = ret.visibleColumnChanged;
9262
- _this44.$nextTick(_this44.updateStyle);
9264
+ _this44.$nextTick(function() {
9265
+ _this44.updateFooter();
9266
+ _this44.updateStyle();
9267
+ });
9263
9268
  });
9264
9269
  },
9265
9270
  // 更新横向 X 可视渲染上下剩余空间大小
@@ -12162,7 +12167,7 @@ var Table = defineComponent({
12162
12167
  relationKey: columnLevelKey$1 + "-" + id3.value,
12163
12168
  childrenKey: "childColumns",
12164
12169
  relationContainer: function relationContainer() {
12165
- return isBrowser ? $table.$el.querySelector("." + hiddenContainerClass) : null;
12170
+ return !isServer ? $table.$el.querySelector("." + hiddenContainerClass) : null;
12166
12171
  },
12167
12172
  onChange: function onChange() {
12168
12173
  var collectKey = $table.computeCollectKey();
@@ -12791,6 +12796,7 @@ var Grid = defineComponent({
12791
12796
  optimization: optimizOpt,
12792
12797
  startIndex: seqIndex2
12793
12798
  });
12799
+ props.tooltipConfig = Object.assign({}, GlobalConfig$1.tooltip || {}, (designConfig == null ? void 0 : designConfig.tooltip) || {}, props.tooltipConfig || {});
12794
12800
  if ((designConfig == null ? void 0 : designConfig.stripe) !== void 0 && !props.stripe) {
12795
12801
  props.stripe = designConfig == null ? void 0 : designConfig.stripe;
12796
12802
  }
@@ -13402,7 +13408,7 @@ var Methods$c = {
13402
13408
  inputElem.selectionStart = inputElem.selectionEnd;
13403
13409
  inputElem.type = type;
13404
13410
  inputElem[autoselect ? "select" : "focus"]();
13405
- if (browser.name !== "ie") {
13411
+ if (browserInfo.name !== "ie") {
13406
13412
  return;
13407
13413
  }
13408
13414
  var textRange = inputElem.createTextRange();
@@ -13808,10 +13814,10 @@ var writeClipboardText = function writeClipboardText2(_ref216) {
13808
13814
  var getCellValue2 = function getCellValue22(column, row2) {
13809
13815
  var cellValue = "";
13810
13816
  if (isAsyncColumn) {
13811
- var _format2 = column.format || {};
13812
- if (_format2.async === true && _format2.type === "enum") {
13817
+ var format = column.format || {};
13818
+ if (format.async === true && format.type === "enum") {
13813
13819
  cellValue = Formatter.enum.call(column, row2[column.property]);
13814
- } else if (_format2.async && typeof _format2.async.fetch === "function") {
13820
+ } else if (format.async && typeof format.async.fetch === "function") {
13815
13821
  cellValue = row2[$table.getAsyncColumnName(column.property)];
13816
13822
  } else {
13817
13823
  cellValue = row2[column.property];
@@ -14406,7 +14412,6 @@ var Methods$b = {
14406
14412
  var bodyList = elemStore["main-body-list"].children;
14407
14413
  var _getCellIndex = getCellIndex({
14408
14414
  cell,
14409
- elemStore,
14410
14415
  bodyList
14411
14416
  }), rIndex = _getCellIndex.rIndex, cIndex = _getCellIndex.cIndex;
14412
14417
  var maxIndex = bodyList.length - 1;
@@ -14699,6 +14704,7 @@ var Methods$a = {
14699
14704
  return Promise.reject(validRest[ruleKeys[0]][0]);
14700
14705
  }
14701
14706
  cb && cb(opt.status);
14707
+ return opt.status;
14702
14708
  };
14703
14709
  return Promise.all(rowValids).then(onFulfilled).catch(onRejected(opt, this));
14704
14710
  },
@@ -15655,12 +15661,14 @@ var createHandlerOnEnd = function createHandlerOnEnd2(_ref249) {
15655
15661
  children: (_vm.treeConfig || {}).children || "children"
15656
15662
  };
15657
15663
  var targetTrElem = event.item;
15658
- var wrapperElem = targetTrElem.parentNode, prevTrElem = targetTrElem.previousElementSibling;
15664
+ var wrapperElem = targetTrElem.parentNode, prevEl = targetTrElem.previousElementSibling, nextEl = targetTrElem.nextElementSibling;
15665
+ var prevTrElem = prevEl && prevEl.classList.contains("tiny-grid-body__row") ? prevEl : prevEl && prevEl.previousElementSibling;
15659
15666
  var tableTreeData = _vm.data || _vm.tableData;
15660
15667
  var selfRow = _vm.getRowNode(targetTrElem).item;
15661
15668
  var selfNode = findTree$1(tableTreeData, function(row2) {
15662
15669
  return row2 === selfRow;
15663
15670
  }, options);
15671
+ selfRow._isDraging = true;
15664
15672
  var isScrollYLoad = _vm.scrollYLoad;
15665
15673
  if (!isScrollYLoad) {
15666
15674
  if (prevTrElem) {
@@ -15685,7 +15693,7 @@ var createHandlerOnEnd = function createHandlerOnEnd2(_ref249) {
15685
15693
  prevNode.items.splice(prevNode.index + (selfNode.index < prevNode.index ? 0 : 1), 0, currRow);
15686
15694
  prevNode.items = [].concat(prevNode.items);
15687
15695
  }
15688
- } else {
15696
+ } else if (nextEl && nextEl.classList.contains("tiny-grid-body__row")) {
15689
15697
  var _currRow = selfNode.items.splice(selfNode.index, 1)[0];
15690
15698
  tableTreeData.unshift(_currRow);
15691
15699
  _vm.tableFullData = [].concat(tableTreeData);
@@ -15886,7 +15894,7 @@ var Methods$2 = {
15886
15894
  }
15887
15895
  var tooltip = this.$refs.tooltip;
15888
15896
  var wrapperElem = cell;
15889
- var content = cell.innerText.trim() || cell.textContent.trim();
15897
+ var content = cell.innerText.trim();
15890
15898
  var contentMethod = this.tooltipConfig.contentMethod;
15891
15899
  var range = createTooltipRange({
15892
15900
  _vm: this,
@@ -15896,7 +15904,10 @@ var Methods$2 = {
15896
15904
  });
15897
15905
  var rangeWidth = range.getBoundingClientRect().width;
15898
15906
  var padding = (parseInt(getStyle(cell, "paddingLeft"), 10) || 0) + (parseInt(getStyle(cell, "paddingRight"), 10) || 0);
15899
- var isOverflow = rangeWidth + padding > cell.offsetWidth || wrapperElem.scrollWidth > wrapperElem.clientWidth;
15907
+ var isOverflow = (
15908
+ // 浏览器缩放情况下,会存在细微的像素无法,因此设置0.1像素作为误差量
15909
+ rangeWidth + padding > cell.getBoundingClientRect().width + 0.1 || wrapperElem.scrollWidth > wrapperElem.clientWidth
15910
+ );
15900
15911
  if ((contentMethod || content) && (showTip || isOverflow)) {
15901
15912
  Object.assign(this.tooltipStore, {
15902
15913
  row: row2,
@@ -16295,10 +16306,8 @@ function hasNoCheckFieldNoStrictly(_ref267) {
16295
16306
  afterFullData,
16296
16307
  checkMethod,
16297
16308
  checkStrictly,
16298
- property,
16299
16309
  selectRows,
16300
16310
  selection,
16301
- treeConfig,
16302
16311
  value
16303
16312
  });
16304
16313
  }
@@ -16766,7 +16775,7 @@ var Tree = {
16766
16775
  Object.assign(host.methods, Methods);
16767
16776
  }
16768
16777
  };
16769
- var version = "2.21.0";
16778
+ var version = "2.22.0";
16770
16779
  var plugins = [Panel, Edit, Export, Keyboard, Validator, Resize, Panel$1, FetchData, Pager, Toolbar, ColumnAnchor, Dragger, Sort, Tooltip, Checkbox, Tree];
16771
16780
  Grid$1.setup({
16772
16781
  i18n: t
package/package.json CHANGED
@@ -1,28 +1,29 @@
1
1
  {
2
2
  "name": "@opentinyvue/vue-grid",
3
3
  "type": "module",
4
- "version": "2.21.0",
4
+ "version": "2.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": "~2.21.0",
12
- "@opentinyvue/vue-directive": "~2.21.0",
13
- "@opentinyvue/vue-dropdown": "~2.21.0",
14
- "@opentinyvue/vue-dropdown-item": "~2.21.0",
15
- "@opentinyvue/vue-dropdown-menu": "~2.21.0",
16
- "@opentinyvue/vue-exception": "~2.21.0",
17
- "@opentinyvue/vue-icon": "~2.21.0",
18
- "@opentinyvue/vue-loading": "~2.21.0",
19
- "@opentinyvue/vue-locale": "~2.21.0",
20
- "@opentinyvue/vue-modal": "~2.21.0",
21
- "@opentinyvue/vue-pager": "~2.21.0",
22
- "@opentinyvue/vue-renderless": "~3.21.0",
23
- "@opentinyvue/vue-tag": "~2.21.0",
24
- "@opentinyvue/vue-theme": "~3.21.0",
25
- "@opentinyvue/vue-tooltip": "~2.21.0"
11
+ "@opentinyvue/vue-common": "~2.22.0",
12
+ "@opentinyvue/vue-directive": "~2.22.0",
13
+ "@opentinyvue/vue-dropdown": "~2.22.0",
14
+ "@opentinyvue/vue-dropdown-item": "~2.22.0",
15
+ "@opentinyvue/vue-dropdown-menu": "~2.22.0",
16
+ "@opentinyvue/vue-exception": "~2.22.0",
17
+ "@opentinyvue/vue-icon": "~2.22.0",
18
+ "@opentinyvue/vue-loading": "~2.22.0",
19
+ "@opentinyvue/vue-locale": "~2.22.0",
20
+ "@opentinyvue/vue-modal": "~2.22.0",
21
+ "@opentinyvue/vue-pager": "~2.22.0",
22
+ "@opentinyvue/vue-renderless": "~3.22.0",
23
+ "@opentinyvue/vue-tag": "~2.22.0",
24
+ "@opentinyvue/vue-theme": "~3.22.0",
25
+ "@opentinyvue/vue-tooltip": "~2.22.0",
26
+ "@opentinyvue/utils": "~2.22.0"
26
27
  },
27
28
  "types": "index.d.ts",
28
29
  "scripts": {
package/src/config.d.ts CHANGED
@@ -62,7 +62,7 @@ declare const GlobalConfig: {
62
62
  menu: {};
63
63
  tooltip: {
64
64
  trigger: string;
65
- theme: string;
65
+ effect: string;
66
66
  };
67
67
  pager: {};
68
68
  toolbar: {