vxe-table 3.6.14-beta.3 → 3.6.14-beta.5

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.
Files changed (37) hide show
  1. package/README.md +0 -1
  2. package/lib/button/style/style.css +3 -3
  3. package/lib/button/style/style.min.css +1 -1
  4. package/lib/icon/style/style.css +1 -1
  5. package/lib/icon/style/style.min.css +1 -1
  6. package/lib/index.css +1 -1
  7. package/lib/index.umd.js +163 -68
  8. package/lib/index.umd.min.js +1 -1
  9. package/lib/pager/style/style.css +1 -0
  10. package/lib/pager/style/style.min.css +1 -1
  11. package/lib/style.css +1 -1
  12. package/lib/style.min.css +1 -1
  13. package/lib/table/src/cell.js +1 -1
  14. package/lib/table/src/cell.min.js +1 -1
  15. package/lib/table/src/columnInfo.js +1 -0
  16. package/lib/table/src/columnInfo.min.js +1 -1
  17. package/lib/table/src/methods.js +111 -14
  18. package/lib/table/src/methods.min.js +1 -1
  19. package/lib/tools/log.js +1 -1
  20. package/lib/tools/log.min.js +1 -1
  21. package/lib/v-x-e-table/index.js +1 -1
  22. package/lib/v-x-e-table/index.min.js +1 -1
  23. package/package.json +2 -2
  24. package/packages/table/src/cell.js +1 -1
  25. package/packages/table/src/columnInfo.js +1 -0
  26. package/packages/table/src/methods.js +96 -13
  27. package/styles/button.scss +2 -2
  28. package/styles/cssvar.scss +257 -0
  29. package/styles/modules.scss +1 -0
  30. package/styles/pager.scss +1 -0
  31. package/types/table.d.ts +70 -3
  32. /package/lib/icon/style/{iconfont.1684812658650.ttf → iconfont.1687133906170.ttf} +0 -0
  33. /package/lib/icon/style/{iconfont.1684812658650.woff → iconfont.1687133906170.woff} +0 -0
  34. /package/lib/icon/style/{iconfont.1684812658650.woff2 → iconfont.1687133906170.woff2} +0 -0
  35. /package/lib/{iconfont.1684812658650.ttf → iconfont.1687133906170.ttf} +0 -0
  36. /package/lib/{iconfont.1684812658650.woff → iconfont.1687133906170.woff} +0 -0
  37. /package/lib/{iconfont.1684812658650.woff2 → iconfont.1687133906170.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -11033,7 +11033,7 @@ var es_array_concat = __webpack_require__(2222);
11033
11033
 
11034
11034
 
11035
11035
  function getLog(message, params) {
11036
- return "[vxe-table v".concat("3.6.14-beta.2", "] ").concat(conf.i18n(message, params));
11036
+ return "[vxe-table v".concat("3.6.14-beta.5", "] ").concat(conf.i18n(message, params));
11037
11037
  }
11038
11038
  function outLog(type) {
11039
11039
  return function (message, params) {
@@ -12220,7 +12220,7 @@ function _t(key, args) {
12220
12220
  var v = 'v3';
12221
12221
  var VXETable = {
12222
12222
  v: v,
12223
- version: "3.6.14-beta.2",
12223
+ version: "3.6.14-beta.5",
12224
12224
  reg: reg,
12225
12225
  use: use,
12226
12226
  setup: setup,
@@ -12409,6 +12409,7 @@ var ColumnInfo = /*#__PURE__*/function () {
12409
12409
  // 内部属性(一旦被使用,将导致不可升级版本)
12410
12410
  halfVisible: false,
12411
12411
  defaultVisible: visible,
12412
+ defaultFixed: _vm.fixed,
12412
12413
  checked: false,
12413
12414
  halfChecked: false,
12414
12415
  disabled: false,
@@ -14490,6 +14491,58 @@ if (browse.isDoc) {
14490
14491
  trailing: false
14491
14492
  }), false);
14492
14493
  }
14494
+ ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
14495
+
14496
+ function _arrayWithHoles(arr) {
14497
+ if (Array.isArray(arr)) return arr;
14498
+ }
14499
+ ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
14500
+
14501
+
14502
+
14503
+
14504
+
14505
+
14506
+
14507
+
14508
+ function _iterableToArrayLimit(arr, i) {
14509
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
14510
+ if (_i == null) return;
14511
+ var _arr = [];
14512
+ var _n = true;
14513
+ var _d = false;
14514
+ var _s, _e;
14515
+ try {
14516
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
14517
+ _arr.push(_s.value);
14518
+ if (i && _arr.length === i) break;
14519
+ }
14520
+ } catch (err) {
14521
+ _d = true;
14522
+ _e = err;
14523
+ } finally {
14524
+ try {
14525
+ if (!_n && _i["return"] != null) _i["return"]();
14526
+ } finally {
14527
+ if (_d) throw _e;
14528
+ }
14529
+ }
14530
+ return _arr;
14531
+ }
14532
+ ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
14533
+
14534
+
14535
+ function _nonIterableRest() {
14536
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
14537
+ }
14538
+ ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
14539
+
14540
+
14541
+
14542
+
14543
+ function _slicedToArray(arr, i) {
14544
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
14545
+ }
14493
14546
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.parse-int.js
14494
14547
  var es_parse_int = __webpack_require__(1058);
14495
14548
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.reduce.js
@@ -14574,7 +14627,7 @@ function renderTitleContent(h, params, content) {
14574
14627
  }) : h('span', {
14575
14628
  "class": 'vxe-cell--title',
14576
14629
  on: ons
14577
- }, content)];
14630
+ }, getSlotVNs(content))];
14578
14631
  }
14579
14632
  function getFooterContent(h, params) {
14580
14633
  var $table = params.$table,
@@ -15363,6 +15416,7 @@ var Cell = {
15363
15416
 
15364
15417
 
15365
15418
 
15419
+
15366
15420
 
15367
15421
 
15368
15422
  var setCellValue = utils.setCellValue,
@@ -15378,6 +15432,8 @@ var isWebkit = browse["-webkit"] && !browse.edge;
15378
15432
  var debounceScrollYDuration = browse.msie ? 80 : 20;
15379
15433
  var resizableStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_WIDTH';
15380
15434
  var visibleStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_VISIBLE';
15435
+ var fixedStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_FIXED';
15436
+ var orderStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_ORDER';
15381
15437
 
15382
15438
  /**
15383
15439
  * 生成行的唯一主键
@@ -16981,25 +17037,55 @@ var Methods = {
16981
17037
  this.handleDefaultSort();
16982
17038
  }
16983
17039
  },
17040
+ /**
17041
+ * 设置为固定列
17042
+ */
17043
+ setColumnFixed: function setColumnFixed(fieldOrColumn, fixed) {
17044
+ var column = handleFieldOrColumn(this, fieldOrColumn);
17045
+ if (column && column.fixed !== fixed) {
17046
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([column], function (column) {
17047
+ column.fixed = fixed;
17048
+ });
17049
+ this.saveCustomFixed();
17050
+ return this.refreshColumn();
17051
+ }
17052
+ return this.$nextTick();
17053
+ },
17054
+ /**
17055
+ * 取消指定固定列
17056
+ */
17057
+ clearColumnFixed: function clearColumnFixed(fieldOrColumn) {
17058
+ var column = handleFieldOrColumn(this, fieldOrColumn);
17059
+ if (column && column.fixed) {
17060
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([column], function (column) {
17061
+ column.fixed = null;
17062
+ });
17063
+ this.saveCustomFixed();
17064
+ return this.refreshColumn();
17065
+ }
17066
+ return this.$nextTick();
17067
+ },
16984
17068
  /**
16985
17069
  * 隐藏指定列
16986
17070
  */
16987
17071
  hideColumn: function hideColumn(fieldOrColumn) {
16988
17072
  var column = handleFieldOrColumn(this, fieldOrColumn);
16989
- if (column) {
17073
+ if (column && column.visible) {
16990
17074
  column.visible = false;
17075
+ return this.handleCustom();
16991
17076
  }
16992
- return this.handleCustom();
17077
+ return this.$nextTick();
16993
17078
  },
16994
17079
  /**
16995
17080
  * 显示指定列
16996
17081
  */
16997
17082
  showColumn: function showColumn(fieldOrColumn) {
16998
17083
  var column = handleFieldOrColumn(this, fieldOrColumn);
16999
- if (column) {
17084
+ if (column & !column.visible) {
17000
17085
  column.visible = true;
17086
+ return this.handleCustom();
17001
17087
  }
17002
- return this.handleCustom();
17088
+ return this.$nextTick();
17003
17089
  },
17004
17090
  setColumnWidth: function setColumnWidth(fieldOrColumn, width) {
17005
17091
  var column = handleFieldOrColumn(this, fieldOrColumn);
@@ -17065,15 +17151,17 @@ var Methods = {
17065
17151
  customOpts = this.customOpts;
17066
17152
  var storage = customOpts.storage;
17067
17153
  var isAllStorage = customOpts.storage === true;
17068
- var isResizable = isAllStorage || storage && storage.resizable;
17069
- var isVisible = isAllStorage || storage && storage.visible;
17070
- if (customConfig && (isResizable || isVisible)) {
17154
+ var isCustomResizable = isAllStorage || storage && storage.resizable;
17155
+ var isCustomVisible = isAllStorage || storage && storage.visible;
17156
+ var isCustomFixed = storage === true || storage && storage.fixed;
17157
+ var isCustomOrder = storage === true || storage && storage.order;
17158
+ if (customConfig && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomOrder)) {
17071
17159
  var customMap = {};
17072
17160
  if (!id) {
17073
17161
  errLog('vxe.error.reqProp', ['id']);
17074
17162
  return;
17075
17163
  }
17076
- if (isResizable) {
17164
+ if (isCustomResizable) {
17077
17165
  var columnWidthStorage = getCustomStorageMap(resizableStorageKey)[id];
17078
17166
  if (columnWidthStorage) {
17079
17167
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(columnWidthStorage, function (resizeWidth, field) {
@@ -17084,7 +17172,35 @@ var Methods = {
17084
17172
  });
17085
17173
  }
17086
17174
  }
17087
- if (isVisible) {
17175
+ // 自定义固定列
17176
+ if (isCustomFixed) {
17177
+ var columnFixedStorage = getCustomStorageMap(fixedStorageKey)[id];
17178
+ if (columnFixedStorage) {
17179
+ var colFixeds = columnFixedStorage.split(',');
17180
+ colFixeds.forEach(function (fixConf) {
17181
+ var _fixConf$split = fixConf.split('|'),
17182
+ _fixConf$split2 = _slicedToArray(_fixConf$split, 2),
17183
+ field = _fixConf$split2[0],
17184
+ fixed = _fixConf$split2[1];
17185
+ if (customMap[field]) {
17186
+ customMap[field].fixed = fixed;
17187
+ } else {
17188
+ customMap[field] = {
17189
+ field: field,
17190
+ fixed: fixed
17191
+ };
17192
+ }
17193
+ });
17194
+ }
17195
+ }
17196
+ // 自定义顺序
17197
+ if (isCustomOrder) {
17198
+ var columnOrderStorage = getCustomStorageMap(orderStorageKey)[id];
17199
+ if (columnOrderStorage) {
17200
+ // 开发中...
17201
+ }
17202
+ }
17203
+ if (isCustomVisible) {
17088
17204
  var columnVisibleStorage = getCustomStorageMap(visibleStorageKey)[id];
17089
17205
  if (columnVisibleStorage) {
17090
17206
  var colVisibles = columnVisibleStorage.split('|');
@@ -17121,7 +17237,8 @@ var Methods = {
17121
17237
  });
17122
17238
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(customMap, function (_ref5, field) {
17123
17239
  var visible = _ref5.visible,
17124
- resizeWidth = _ref5.resizeWidth;
17240
+ resizeWidth = _ref5.resizeWidth,
17241
+ fixed = _ref5.fixed;
17125
17242
  var column = keyMap[field];
17126
17243
  if (column) {
17127
17244
  if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(resizeWidth)) {
@@ -17130,10 +17247,40 @@ var Methods = {
17130
17247
  if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(visible)) {
17131
17248
  column.visible = visible;
17132
17249
  }
17250
+ if (fixed) {
17251
+ column.fixed = fixed;
17252
+ }
17133
17253
  }
17134
17254
  });
17135
17255
  }
17136
17256
  },
17257
+ saveCustomFixed: function saveCustomFixed() {
17258
+ var id = this.id,
17259
+ collectColumn = this.collectColumn,
17260
+ customConfig = this.customConfig,
17261
+ customOpts = this.customOpts;
17262
+ var storage = customOpts.storage;
17263
+ var isAllStorage = customOpts.storage === true;
17264
+ var isCustomFixed = isAllStorage || storage && storage.fixed;
17265
+ if (customConfig && isCustomFixed) {
17266
+ var columnFixedStorageMap = getCustomStorageMap(fixedStorageKey);
17267
+ var colFixeds = [];
17268
+ if (!id) {
17269
+ errLog('vxe.error.reqProp', ['id']);
17270
+ return;
17271
+ }
17272
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, function (column) {
17273
+ if (column.fixed && column.fixed !== column.defaultFixed) {
17274
+ var colKey = column.getKey();
17275
+ if (colKey) {
17276
+ colFixeds.push("".concat(colKey, "|").concat(column.fixed));
17277
+ }
17278
+ }
17279
+ });
17280
+ columnFixedStorageMap[id] = colFixeds.join(',') || undefined;
17281
+ localStorage.setItem(fixedStorageKey, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toJSONString(columnFixedStorageMap));
17282
+ }
17283
+ },
17137
17284
  saveCustomVisible: function saveCustomVisible() {
17138
17285
  var id = this.id,
17139
17286
  collectColumn = this.collectColumn,
@@ -17142,8 +17289,8 @@ var Methods = {
17142
17289
  var checkMethod = customOpts.checkMethod,
17143
17290
  storage = customOpts.storage;
17144
17291
  var isAllStorage = customOpts.storage === true;
17145
- var isVisible = isAllStorage || storage && storage.visible;
17146
- if (customConfig && isVisible) {
17292
+ var isCustomVisible = isAllStorage || storage && storage.visible;
17293
+ if (customConfig && isCustomVisible) {
17147
17294
  var columnVisibleStorageMap = getCustomStorageMap(visibleStorageKey);
17148
17295
  var colHides = [];
17149
17296
  var colShows = [];
@@ -17663,7 +17810,7 @@ var Methods = {
17663
17810
  var emptyBlockElem = elemStore["".concat(name, "-").concat(layout, "-emptyBlock")];
17664
17811
  if (methods_isNodeElement(wrapperElem)) {
17665
17812
  if (customMaxHeight) {
17666
- wrapperElem.style.maxHeight = "".concat(fixedType ? customMaxHeight - headerHeight - (showFooter ? 0 : scrollbarHeight) : customMaxHeight - headerHeight, "px");
17813
+ wrapperElem.style.maxHeight = "".concat(fixedType ? customMaxHeight - headerHeight - (showFooter ? 0 : scrollbarHeight) : customMaxHeight - headerHeight - footerHeight, "px");
17667
17814
  } else {
17668
17815
  if (customHeight > 0) {
17669
17816
  wrapperElem.style.height = "".concat(fixedType ? (customHeight > 0 ? customHeight - headerHeight - footerHeight : tableHeight) - (showFooter ? 0 : scrollbarHeight) : customHeight - headerHeight - footerHeight, "px");
@@ -24143,58 +24290,6 @@ var Edit = {
24143
24290
  }
24144
24291
  };
24145
24292
  /* harmony default export */ const edit = ((/* unused pure expression or super */ null && (Edit)));
24146
- ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
24147
-
24148
- function _arrayWithHoles(arr) {
24149
- if (Array.isArray(arr)) return arr;
24150
- }
24151
- ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
24152
-
24153
-
24154
-
24155
-
24156
-
24157
-
24158
-
24159
-
24160
- function _iterableToArrayLimit(arr, i) {
24161
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
24162
- if (_i == null) return;
24163
- var _arr = [];
24164
- var _n = true;
24165
- var _d = false;
24166
- var _s, _e;
24167
- try {
24168
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
24169
- _arr.push(_s.value);
24170
- if (i && _arr.length === i) break;
24171
- }
24172
- } catch (err) {
24173
- _d = true;
24174
- _e = err;
24175
- } finally {
24176
- try {
24177
- if (!_n && _i["return"] != null) _i["return"]();
24178
- } finally {
24179
- if (_d) throw _e;
24180
- }
24181
- }
24182
- return _arr;
24183
- }
24184
- ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
24185
-
24186
-
24187
- function _nonIterableRest() {
24188
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
24189
- }
24190
- ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
24191
-
24192
-
24193
-
24194
-
24195
- function _slicedToArray(arr, i) {
24196
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
24197
- }
24198
24293
  ;// CONCATENATED MODULE: ./packages/modal/src/modal.js
24199
24294
 
24200
24295