vxe-table 3.8.2 → 3.8.3-beta.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.
Files changed (74) hide show
  1. package/lib/checkbox/src/group.js +7 -2
  2. package/lib/checkbox/src/group.min.js +1 -1
  3. package/lib/custom/src/mixin.js +3 -1
  4. package/lib/custom/src/mixin.min.js +1 -1
  5. package/lib/custom/src/panel.js +198 -45
  6. package/lib/custom/src/panel.min.js +1 -1
  7. package/lib/custom/style/style.css +327 -80
  8. package/lib/custom/style/style.min.css +1 -1
  9. package/lib/icon/style/style.css +1 -1
  10. package/lib/icon/style/style.min.css +1 -1
  11. package/lib/index.css +1 -1
  12. package/lib/index.umd.js +308 -89
  13. package/lib/index.umd.min.js +1 -1
  14. package/lib/locale/lang/en-US.js +18 -7
  15. package/lib/locale/lang/en-US.min.js +1 -1
  16. package/lib/locale/lang/en-US.umd.js +18 -7
  17. package/lib/locale/lang/es-ES.js +18 -7
  18. package/lib/locale/lang/es-ES.min.js +1 -1
  19. package/lib/locale/lang/es-ES.umd.js +18 -7
  20. package/lib/locale/lang/ja-JP.js +18 -6
  21. package/lib/locale/lang/ja-JP.min.js +1 -1
  22. package/lib/locale/lang/ja-JP.umd.js +18 -6
  23. package/lib/locale/lang/pt-BR.js +18 -7
  24. package/lib/locale/lang/pt-BR.min.js +1 -1
  25. package/lib/locale/lang/pt-BR.umd.js +18 -7
  26. package/lib/locale/lang/zh-CN.js +18 -7
  27. package/lib/locale/lang/zh-CN.min.js +1 -1
  28. package/lib/locale/lang/zh-CN.umd.js +18 -7
  29. package/lib/locale/lang/zh-HK.min.js +1 -1
  30. package/lib/locale/lang/zh-HK.umd.js +18 -7
  31. package/lib/locale/lang/zh-MO.min.js +1 -1
  32. package/lib/locale/lang/zh-MO.umd.js +18 -7
  33. package/lib/locale/lang/zh-TC.js +18 -7
  34. package/lib/locale/lang/zh-TC.min.js +1 -1
  35. package/lib/locale/lang/zh-TC.umd.js +18 -7
  36. package/lib/locale/lang/zh-TW.min.js +1 -1
  37. package/lib/locale/lang/zh-TW.umd.js +18 -7
  38. package/lib/radio/src/group.js +7 -2
  39. package/lib/radio/src/group.min.js +1 -1
  40. package/lib/style.css +1 -1
  41. package/lib/style.min.css +1 -1
  42. package/lib/table/src/columnInfo.js +10 -1
  43. package/lib/table/src/columnInfo.min.js +1 -1
  44. package/lib/table/src/methods.js +56 -33
  45. package/lib/table/src/methods.min.js +1 -1
  46. package/lib/table/src/table.js +3 -2
  47. package/lib/table/src/table.min.js +1 -1
  48. package/lib/tools/log.js +1 -1
  49. package/lib/tools/log.min.js +1 -1
  50. package/lib/v-x-e-table/index.js +1 -1
  51. package/lib/v-x-e-table/index.min.js +1 -1
  52. package/lib/vxe-table-custom-module/style/style.css +327 -80
  53. package/lib/vxe-table-custom-module/style/style.min.css +1 -1
  54. package/package.json +1 -1
  55. package/packages/checkbox/src/group.js +6 -2
  56. package/packages/custom/src/mixin.js +2 -1
  57. package/packages/custom/src/panel.js +214 -52
  58. package/packages/locale/lang/en-US.js +18 -7
  59. package/packages/locale/lang/es-ES.js +18 -7
  60. package/packages/locale/lang/ja-JP.js +18 -6
  61. package/packages/locale/lang/pt-BR.js +18 -7
  62. package/packages/locale/lang/zh-CN.js +18 -7
  63. package/packages/locale/lang/zh-TC.js +18 -7
  64. package/packages/radio/src/group.js +6 -2
  65. package/packages/table/src/columnInfo.js +9 -3
  66. package/packages/table/src/methods.js +51 -33
  67. package/packages/table/src/table.js +3 -2
  68. package/styles/custom.scss +192 -86
  69. /package/lib/icon/style/{iconfont.1714101947757.ttf → iconfont.1714276918127.ttf} +0 -0
  70. /package/lib/icon/style/{iconfont.1714101947757.woff → iconfont.1714276918127.woff} +0 -0
  71. /package/lib/icon/style/{iconfont.1714101947757.woff2 → iconfont.1714276918127.woff2} +0 -0
  72. /package/lib/{iconfont.1714101947757.ttf → iconfont.1714276918127.ttf} +0 -0
  73. /package/lib/{iconfont.1714101947757.woff → iconfont.1714276918127.woff} +0 -0
  74. /package/lib/{iconfont.1714101947757.woff2 → iconfont.1714276918127.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -11346,7 +11346,7 @@ var es_array_concat = __webpack_require__(8706);
11346
11346
 
11347
11347
 
11348
11348
  function getLog(message, params) {
11349
- return "[vxe-table v".concat("3.8.2", "] ").concat(conf.i18n(message, params));
11349
+ return "[vxe-table v".concat("3.8.3-beta.0", "] ").concat(conf.i18n(message, params));
11350
11350
  }
11351
11351
  function outLog(type) {
11352
11352
  return function (message, params) {
@@ -13067,7 +13067,7 @@ var setup = config;
13067
13067
  var globalStore = {};
13068
13068
  var VXETable = {
13069
13069
  v: v,
13070
- version: "3.8.2",
13070
+ version: "3.8.3-beta.0",
13071
13071
  reg: reg,
13072
13072
  use: use,
13073
13073
  setup: setup,
@@ -13110,6 +13110,7 @@ var es_string_fixed = __webpack_require__(4298);
13110
13110
 
13111
13111
 
13112
13112
 
13113
+
13113
13114
  var ColumnInfo = /*#__PURE__*/function () {
13114
13115
  /* eslint-disable @typescript-eslint/no-use-before-define */
13115
13116
  function ColumnInfo($xetable, _vm) {
@@ -13183,9 +13184,18 @@ var ColumnInfo = /*#__PURE__*/function () {
13183
13184
  level: 1,
13184
13185
  rowSpan: 1,
13185
13186
  colSpan: 1,
13187
+ // 数据排序
13186
13188
  order: null,
13189
+ // 用于记录排序类型,升序和倒序
13187
13190
  sortTime: 0,
13188
- customOrder: 0,
13191
+ // 用于多列的先后顺序
13192
+
13193
+ // 列排序
13194
+ sortNumber: 0,
13195
+ // 用于记录自定义列顺序
13196
+ renderSortNumber: 0,
13197
+ // 用于记录自定义列顺序
13198
+
13189
13199
  renderWidth: 0,
13190
13200
  renderHeight: 0,
13191
13201
  resizeWidth: 0,
@@ -16553,7 +16563,7 @@ var debounceScrollYDuration = browse.msie ? 80 : 20;
16553
16563
  var resizableStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_WIDTH';
16554
16564
  var visibleStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_VISIBLE';
16555
16565
  var fixedStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_FIXED';
16556
- var orderStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_ORDER';
16566
+ var sortStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_SORT';
16557
16567
 
16558
16568
  /**
16559
16569
  * 生成行的唯一主键
@@ -17131,7 +17141,7 @@ var Methods = {
17131
17141
  this.collectColumn = collectColumn;
17132
17142
  var tableFullColumn = methods_getColumnList(collectColumn);
17133
17143
  this.tableFullColumn = tableFullColumn;
17134
- this.cacheColumnMap();
17144
+ this.cacheColumnMap(true);
17135
17145
  this.restoreCustomStorage();
17136
17146
  this.parseColumns().then(function () {
17137
17147
  if (_this9.scrollXLoad) {
@@ -17307,7 +17317,7 @@ var Methods = {
17307
17317
  * 更新数据列的 Map
17308
17318
  * 牺牲数据组装的耗时,用来换取使用过程中的流畅
17309
17319
  */
17310
- cacheColumnMap: function cacheColumnMap() {
17320
+ cacheColumnMap: function cacheColumnMap(isInit) {
17311
17321
  var _this13 = this;
17312
17322
  var tableFullColumn = this.tableFullColumn,
17313
17323
  collectColumn = this.collectColumn,
@@ -17368,6 +17378,9 @@ var Methods = {
17368
17378
  if (fullColumnIdData[colid]) {
17369
17379
  errLog('vxe.error.colRepet', ['colId', colid]);
17370
17380
  }
17381
+ if (isInit) {
17382
+ column.sortNumber = index;
17383
+ }
17371
17384
  fullColumnIdData[colid] = rest;
17372
17385
  fullColumnMap.set(column, rest);
17373
17386
  };
@@ -18298,7 +18311,8 @@ var Methods = {
18298
18311
  var opts = Object.assign({
18299
18312
  visible: true,
18300
18313
  resizable: options === true,
18301
- fixed: options === true
18314
+ fixed: options === true,
18315
+ sort: options === true
18302
18316
  }, options);
18303
18317
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, function (column) {
18304
18318
  if (opts.resizable) {
@@ -18307,6 +18321,9 @@ var Methods = {
18307
18321
  if (opts.fixed) {
18308
18322
  column.fixed = column.defaultFixed;
18309
18323
  }
18324
+ if (opts.sort) {
18325
+ column.renderSortNumber = column.sortNumber;
18326
+ }
18310
18327
  if (!checkMethod || checkMethod({
18311
18328
  column: column
18312
18329
  })) {
@@ -18324,7 +18341,7 @@ var Methods = {
18324
18341
  handleCustom: function handleCustom() {
18325
18342
  this.saveCustomVisible();
18326
18343
  this.analyColumnWidth();
18327
- return this.refreshColumn();
18344
+ return this.refreshColumn(true);
18328
18345
  },
18329
18346
  /**
18330
18347
  * 还原自定义列操作状态
@@ -18335,12 +18352,13 @@ var Methods = {
18335
18352
  customConfig = this.customConfig,
18336
18353
  customOpts = this.customOpts;
18337
18354
  var storage = customOpts.storage;
18338
- var isAllStorage = customOpts.storage === true;
18339
- var isCustomResizable = isAllStorage || storage && storage.resizable;
18340
- var isCustomVisible = isAllStorage || storage && storage.visible;
18341
- var isCustomFixed = storage === true || storage && storage.fixed;
18342
- var isCustomOrder = storage === true || storage && storage.order;
18343
- if (customConfig && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomOrder)) {
18355
+ var isAllStorage = storage === true;
18356
+ var storageOpts = isAllStorage ? {} : Object.assign({}, storage || {});
18357
+ var isCustomResizable = isAllStorage || storageOpts.resizable;
18358
+ var isCustomVisible = isAllStorage || storageOpts.visible;
18359
+ var isCustomFixed = isAllStorage || storageOpts.fixed;
18360
+ var isCustomSort = isAllStorage || storageOpts.sort;
18361
+ if (customConfig && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
18344
18362
  var customMap = {};
18345
18363
  if (!id) {
18346
18364
  errLog('vxe.error.reqProp', ['id']);
@@ -18379,18 +18397,23 @@ var Methods = {
18379
18397
  }
18380
18398
  }
18381
18399
  // 自定义顺序
18382
- if (isCustomOrder) {
18383
- var columnOrderStorage = getCustomStorageMap(orderStorageKey)[id];
18384
- if (columnOrderStorage) {
18385
- // const colOrderSeqs = columnOrderStorage.split(',')
18386
- // colOrderSeqs.forEach((orderConf) => {
18387
- // const [colKey, order] = orderConf.split('|')
18388
- // if (customMap[colKey]) {
18389
- // customMap[colKey].order = order
18390
- // } else {
18391
- // customMap[colKey] = { order }
18392
- // }
18393
- // })
18400
+ if (isCustomSort) {
18401
+ var columnSortStorage = getCustomStorageMap(sortStorageKey)[id];
18402
+ if (columnSortStorage) {
18403
+ var colOrderSeqs = columnSortStorage.split(',');
18404
+ colOrderSeqs.forEach(function (orderConf) {
18405
+ var _orderConf$split = orderConf.split('|'),
18406
+ _orderConf$split2 = _slicedToArray(_orderConf$split, 2),
18407
+ colKey = _orderConf$split2[0],
18408
+ sortNumber = _orderConf$split2[1];
18409
+ if (customMap[colKey]) {
18410
+ customMap[colKey].sortNumber = sortNumber;
18411
+ } else {
18412
+ customMap[colKey] = {
18413
+ sortNumber: sortNumber
18414
+ };
18415
+ }
18416
+ });
18394
18417
  }
18395
18418
  }
18396
18419
  if (isCustomVisible) {
@@ -18432,7 +18455,7 @@ var Methods = {
18432
18455
  var visible = _ref5.visible,
18433
18456
  resizeWidth = _ref5.resizeWidth,
18434
18457
  fixed = _ref5.fixed,
18435
- order = _ref5.order;
18458
+ sortNumber = _ref5.sortNumber;
18436
18459
  var column = keyMap[field];
18437
18460
  if (column) {
18438
18461
  if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(resizeWidth)) {
@@ -18444,8 +18467,8 @@ var Methods = {
18444
18467
  if (fixed) {
18445
18468
  column.fixed = fixed;
18446
18469
  }
18447
- if (order) {
18448
- column.colSeq = order;
18470
+ if (sortNumber) {
18471
+ column.colSeq = Number(sortNumber);
18449
18472
  }
18450
18473
  }
18451
18474
  });
@@ -18457,8 +18480,9 @@ var Methods = {
18457
18480
  customConfig = this.customConfig,
18458
18481
  customOpts = this.customOpts;
18459
18482
  var storage = customOpts.storage;
18460
- var isAllStorage = customOpts.storage === true;
18461
- var isCustomFixed = isAllStorage || storage && storage.fixed;
18483
+ var isAllStorage = storage === true;
18484
+ var storageOpts = isAllStorage ? {} : Object.assign({}, storage || {});
18485
+ var isCustomFixed = isAllStorage || storageOpts.fixed;
18462
18486
  if (customConfig && isCustomFixed) {
18463
18487
  var columnFixedStorageMap = getCustomStorageMap(fixedStorageKey);
18464
18488
  var colFixeds = [];
@@ -18485,8 +18509,9 @@ var Methods = {
18485
18509
  customOpts = this.customOpts;
18486
18510
  var checkMethod = customOpts.checkMethod,
18487
18511
  storage = customOpts.storage;
18488
- var isAllStorage = customOpts.storage === true;
18489
- var isCustomVisible = isAllStorage || storage && storage.visible;
18512
+ var isAllStorage = storage === true;
18513
+ var storageOpts = isAllStorage ? {} : Object.assign({}, storage || {});
18514
+ var isCustomVisible = isAllStorage || storageOpts.visible;
18490
18515
  if (customConfig && isCustomVisible) {
18491
18516
  var columnVisibleStorageMap = getCustomStorageMap(visibleStorageKey);
18492
18517
  var colHides = [];
@@ -18522,8 +18547,9 @@ var Methods = {
18522
18547
  customConfig = this.customConfig,
18523
18548
  customOpts = this.customOpts;
18524
18549
  var storage = customOpts.storage;
18525
- var isAllStorage = customOpts.storage === true;
18526
- var isResizable = isAllStorage || storage && storage.resizable;
18550
+ var isAllStorage = storage === true;
18551
+ var storageOpts = isAllStorage ? {} : Object.assign({}, storage || {});
18552
+ var isResizable = isAllStorage || storageOpts.resizable;
18527
18553
  if (customConfig && isResizable) {
18528
18554
  var columnWidthStorageMap = getCustomStorageMap(resizableStorageKey);
18529
18555
  var columnWidthStorage;
@@ -18555,8 +18581,15 @@ var Methods = {
18555
18581
  /**
18556
18582
  * 刷新列配置
18557
18583
  */
18558
- refreshColumn: function refreshColumn() {
18584
+ refreshColumn: function refreshColumn(resiveOrder) {
18559
18585
  var _this21 = this;
18586
+ if (resiveOrder) {
18587
+ var columnList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(this.collectColumn, 'renderSortNumber');
18588
+ this.collectColumn = columnList;
18589
+ var tableFullColumn = methods_getColumnList(columnList);
18590
+ this.tableFullColumn = tableFullColumn;
18591
+ this.cacheColumnMap();
18592
+ }
18560
18593
  return this.parseColumns().then(function () {
18561
18594
  return _this21.refreshScroll();
18562
18595
  }).then(function () {
@@ -23221,6 +23254,7 @@ function handleUupdateResize(_vm) {
23221
23254
  export: false,
23222
23255
  custom: false
23223
23256
  },
23257
+ customColumnList: [],
23224
23258
  // 刷新列标识,当列筛选被改变时,触发表格刷新数据
23225
23259
  upDataFlag: 0,
23226
23260
  // 刷新列标识,当列的特定属性被改变时,触发表格刷新列
@@ -23494,9 +23528,9 @@ function handleUupdateResize(_vm) {
23494
23528
  return Object.assign({}, conf.table.customConfig, this.customConfig);
23495
23529
  },
23496
23530
  fixedColumnSize: function fixedColumnSize() {
23497
- var tableFullColumn = this.tableFullColumn;
23531
+ var collectColumn = this.collectColumn;
23498
23532
  var fixedSize = 0;
23499
- tableFullColumn.forEach(function (column) {
23533
+ collectColumn.forEach(function (column) {
23500
23534
  if (column.fixed) {
23501
23535
  fixedSize++;
23502
23536
  }
@@ -34318,14 +34352,17 @@ var Validator = VxeTableValidatorModule;
34318
34352
  /* harmony default export */ var validator = ((/* unused pure expression or super */ null && (VxeTableValidatorModule)));
34319
34353
  ;// CONCATENATED MODULE: ./packages/custom/src/mixin.js
34320
34354
 
34355
+
34321
34356
  /* harmony default export */ var custom_src_mixin = ({
34322
34357
  methods: {
34323
34358
  _openCustom: function _openCustom() {
34324
34359
  var _this = this;
34325
34360
  var initStore = this.initStore,
34326
- customStore = this.customStore;
34361
+ customStore = this.customStore,
34362
+ collectColumn = this.collectColumn;
34327
34363
  customStore.visible = true;
34328
34364
  initStore.custom = true;
34365
+ this.customColumnList = collectColumn.slice(0);
34329
34366
  this.checkCustomStatus();
34330
34367
  this.calcMaxHeight();
34331
34368
  return this.$nextTick().then(function () {
@@ -34422,11 +34459,31 @@ var Validator = VxeTableValidatorModule;
34422
34459
 
34423
34460
 
34424
34461
 
34462
+
34463
+
34464
+ var panel_formatText = utils.formatText;
34465
+ var panel_addClass = dom.addClass,
34466
+ panel_removeClass = dom.removeClass;
34467
+ function updateDropHint(_vm, evnt) {
34468
+ var $refs = _vm.$refs;
34469
+ var dragHintEl = $refs.dragHintElemRef;
34470
+ var bodyEl = $refs.bodyElemRef;
34471
+ if (!bodyEl) {
34472
+ return;
34473
+ }
34474
+ if (dragHintEl) {
34475
+ var warpperEl = bodyEl.parentNode;
34476
+ var warpperRect = warpperEl.getBoundingClientRect();
34477
+ dragHintEl.style.display = 'block';
34478
+ dragHintEl.style.top = "".concat(Math.min(warpperEl.clientHeight - warpperEl.scrollTop - dragHintEl.clientHeight, evnt.clientY - warpperRect.y), "px");
34479
+ dragHintEl.style.left = "".concat(Math.min(warpperEl.clientWidth - warpperEl.scrollLeft - dragHintEl.clientWidth - 16, evnt.clientX - warpperRect.x), "px");
34480
+ }
34481
+ }
34425
34482
  function renderSimplePanel(h, _vm) {
34426
34483
  var $xetable = _vm.$xetable,
34427
34484
  customStore = _vm.customStore;
34428
34485
  var customOpts = $xetable.customOpts,
34429
- collectColumn = $xetable.collectColumn,
34486
+ customColumnList = $xetable.customColumnList,
34430
34487
  isMaxFixedColumn = $xetable.isMaxFixedColumn;
34431
34488
  var maxHeight = customStore.maxHeight;
34432
34489
  var checkMethod = customOpts.checkMethod,
@@ -34436,18 +34493,18 @@ function renderSimplePanel(h, _vm) {
34436
34493
  var customWrapperOns = {};
34437
34494
  // hover 触发
34438
34495
  if (trigger === 'hover') {
34439
- customWrapperOns.onMouseenter = _vm.handleWrapperMouseenterEvent;
34440
- customWrapperOns.onMouseleave = _vm.handleWrapperMouseleaveEvent;
34496
+ customWrapperOns.mouseenter = _vm.handleWrapperMouseenterEvent;
34497
+ customWrapperOns.mouseleave = _vm.handleWrapperMouseleaveEvent;
34441
34498
  }
34442
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, function (column, index, items, path, parent) {
34499
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, function (column, index, items, path, parent) {
34443
34500
  var isVisible = visibleMethod ? visibleMethod({
34444
34501
  column: column
34445
34502
  }) : true;
34446
34503
  if (isVisible) {
34447
34504
  var isChecked = column.visible;
34448
34505
  var isIndeterminate = column.halfVisible;
34449
- var colTitle = utils.formatText(column.getTitle(), 1);
34450
34506
  var isColGroup = column.children && column.children.length;
34507
+ var colTitle = panel_formatText(column.getTitle(), 1);
34451
34508
  var isDisabled = checkMethod ? !checkMethod({
34452
34509
  column: column
34453
34510
  }) : false;
@@ -34457,14 +34514,12 @@ function renderSimplePanel(h, _vm) {
34457
34514
  'is--group': isColGroup
34458
34515
  }]
34459
34516
  }, [h('div', {
34517
+ title: colTitle,
34460
34518
  class: ['vxe-table-custom--checkbox-option', {
34461
34519
  'is--checked': isChecked,
34462
34520
  'is--indeterminate': isIndeterminate,
34463
34521
  'is--disabled': isDisabled
34464
34522
  }],
34465
- attrs: {
34466
- title: colTitle
34467
- },
34468
34523
  on: {
34469
34524
  click: function click() {
34470
34525
  if (!isDisabled) {
@@ -34533,12 +34588,13 @@ function renderSimplePanel(h, _vm) {
34533
34588
  class: ['vxe-checkbox--icon', isAllIndeterminate ? conf.icon.TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? conf.icon.TABLE_CHECKBOX_CHECKED : conf.icon.TABLE_CHECKBOX_UNCHECKED]
34534
34589
  }), h('span', {
34535
34590
  class: 'vxe-checkbox--label'
34536
- }, conf.i18n('vxe.toolbar.customAll'))])])]), h('ul', _objectSpread2({
34591
+ }, conf.i18n('vxe.toolbar.customAll'))])])]), h('ul', {
34537
34592
  class: 'vxe-table-custom--body',
34538
34593
  style: maxHeight ? {
34539
34594
  maxHeight: "".concat(maxHeight, "px")
34540
- } : {}
34541
- }, customWrapperOns), colVNs), customOpts.showFooter ? h('div', {
34595
+ } : {},
34596
+ on: customWrapperOns
34597
+ }, colVNs), customOpts.showFooter ? h('div', {
34542
34598
  class: 'vxe-table-custom--footer'
34543
34599
  }, [h('button', {
34544
34600
  class: 'btn--reset',
@@ -34552,41 +34608,59 @@ function renderSimplePanel(h, _vm) {
34552
34608
  }
34553
34609
  }, customOpts.confirmButtonText || conf.i18n('vxe.toolbar.customConfirm'))]) : null]);
34554
34610
  }
34555
- var renderPopupPanel = function renderPopupPanel(h, _vm) {
34611
+ function renderPopupPanel(h, _vm) {
34556
34612
  var $xetable = _vm.$xetable,
34557
34613
  customStore = _vm.customStore;
34558
34614
  var customOpts = $xetable.customOpts,
34559
- collectColumn = $xetable.collectColumn,
34615
+ customColumnList = $xetable.customColumnList,
34560
34616
  isMaxFixedColumn = $xetable.isMaxFixedColumn;
34561
34617
  var checkMethod = customOpts.checkMethod,
34562
34618
  visibleMethod = customOpts.visibleMethod;
34563
34619
  var trVNs = [];
34564
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, function (column, index, items, path, parent) {
34620
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, function (column, index, items, path, parent) {
34565
34621
  var isVisible = visibleMethod ? visibleMethod({
34566
34622
  column: column
34567
34623
  }) : true;
34568
34624
  if (isVisible) {
34569
34625
  var isChecked = column.visible;
34570
34626
  var isIndeterminate = column.halfVisible;
34571
- var colTitle = utils.formatText(column.getTitle(), 1);
34627
+ var colTitle = panel_formatText(column.getTitle(), 1);
34572
34628
  var isColGroup = column.children && column.children.length;
34573
34629
  var isDisabled = checkMethod ? !checkMethod({
34574
34630
  column: column
34575
34631
  }) : false;
34576
34632
  trVNs.push(h('tr', {
34577
34633
  key: column.id,
34578
- class: ["vxe-table-custom-popup--row-level".concat(column.level), {
34634
+ class: ["vxe-table-custom-popup--row level--".concat(column.level), {
34579
34635
  'is--group': isColGroup
34580
- }]
34636
+ }],
34637
+ attrs: {
34638
+ colid: column.id
34639
+ },
34640
+ on: {
34641
+ dragstart: _vm.sortDragstartEvent,
34642
+ dragend: _vm.sortDragendEvent,
34643
+ dragover: _vm.sortDragoverEvent
34644
+ }
34581
34645
  }, [h('td', {
34582
- class: 'vxe-table-custom-popup--column-name'
34646
+ class: 'vxe-table-custom-popup--column-item col--sort'
34647
+ }, [column.level === 1 ? h('span', {
34648
+ class: 'vxe-table-custom-popup--column-sort-btn',
34649
+ on: {
34650
+ mousedown: _vm.sortMousedownEvent,
34651
+ mouseup: _vm.sortMouseupEvent
34652
+ }
34653
+ }, [h('i', {
34654
+ class: 'vxe-icon-sort'
34655
+ })]) : null]), h('td', {
34656
+ class: 'vxe-table-custom-popup--column-item col--name'
34583
34657
  }, [h('div', {
34584
34658
  class: 'vxe-table-custom-popup--name',
34585
34659
  attrs: {
34586
34660
  title: colTitle
34587
34661
  }
34588
34662
  }, colTitle)]), h('td', {
34589
- class: 'vxe-table-custom-popup--column-visiblw'
34663
+ class: 'vxe-table-custom-popup--column-item col--visible'
34590
34664
  }, [h('div', {
34591
34665
  class: ['vxe-table-custom--checkbox-option', {
34592
34666
  'is--checked': isChecked,
@@ -34603,22 +34677,23 @@ var renderPopupPanel = function renderPopupPanel(h, _vm) {
34603
34677
  }, [h('span', {
34604
34678
  class: ['vxe-checkbox--icon', isIndeterminate ? conf.icon.TABLE_CHECKBOX_INDETERMINATE : isChecked ? conf.icon.TABLE_CHECKBOX_CHECKED : conf.icon.TABLE_CHECKBOX_UNCHECKED]
34605
34679
  })])]), h('td', {
34606
- class: 'vxe-table-custom-popup--column-fixed'
34680
+ class: 'vxe-table-custom-popup--column-item col--fixed'
34607
34681
  }, [!parent && customOpts.allowFixed ? h('vxe-radio-group', {
34608
34682
  props: {
34609
34683
  value: column.fixed || '',
34610
- disabled: isMaxFixedColumn,
34611
34684
  type: 'button',
34612
34685
  size: 'mini',
34613
34686
  options: [{
34614
- label: '左侧',
34615
- value: 'left'
34687
+ label: conf.i18n('vxe.custom.setting.fixedLeft'),
34688
+ value: 'left',
34689
+ disabled: isMaxFixedColumn
34616
34690
  }, {
34617
- label: '不固定',
34691
+ label: conf.i18n('vxe.custom.setting.fixedUnset'),
34618
34692
  value: ''
34619
34693
  }, {
34620
- label: '右侧',
34621
- value: 'right'
34694
+ label: conf.i18n('vxe.custom.setting.fixedRight'),
34695
+ value: 'right',
34696
+ disabled: isMaxFixedColumn
34622
34697
  }]
34623
34698
  },
34624
34699
  on: {
@@ -34635,15 +34710,19 @@ var renderPopupPanel = function renderPopupPanel(h, _vm) {
34635
34710
  return h('vxe-modal', {
34636
34711
  key: 'popup',
34637
34712
  props: {
34638
- className: 'vxe-table-custom-popup-warpper vxe-table--ignore-clear',
34639
34713
  value: customStore.visible,
34640
34714
  title: conf.i18n('vxe.custom.cstmTitle'),
34641
- width: 700,
34642
- maxHeight: 500,
34715
+ className: 'vxe-table-custom-popup-warpper vxe-table--ignore-clear',
34716
+ width: '40vw',
34717
+ minWidth: 500,
34718
+ height: '50vh',
34719
+ minHeight: 300,
34643
34720
  mask: true,
34644
34721
  lockView: true,
34645
34722
  showFooter: true,
34646
- escClosable: true
34723
+ resize: true,
34724
+ escClosable: true,
34725
+ destroyOnClose: true
34647
34726
  },
34648
34727
  on: {
34649
34728
  input: function input(value) {
@@ -34653,8 +34732,15 @@ var renderPopupPanel = function renderPopupPanel(h, _vm) {
34653
34732
  scopedSlots: {
34654
34733
  default: function _default() {
34655
34734
  return h('div', {
34735
+ ref: 'bodyElemRef',
34656
34736
  class: 'vxe-table-custom-popup--body'
34657
- }, [h('table', {}, [h('colgroup', {}, [h('col'), h('col', {
34737
+ }, [h('div', {
34738
+ class: 'vxe-table-custom-popup--table-warpper'
34739
+ }, [h('table', {}, [h('colgroup', {}, [h('col', {
34740
+ style: {
34741
+ width: '60px'
34742
+ }
34743
+ }), h('col'), h('col', {
34658
34744
  style: {
34659
34745
  width: '80px'
34660
34746
  }
@@ -34662,7 +34748,16 @@ var renderPopupPanel = function renderPopupPanel(h, _vm) {
34662
34748
  style: {
34663
34749
  width: '200px'
34664
34750
  }
34665
- })]), h('thead', {}, [h('tr', {}, [h('th', {}, '标题'), h('th', {}, '是否显示'), h('th', {}, '是否固定')])]), h('tbody', {}, trVNs)])]);
34751
+ })]), h('thead', {}, [h('tr', {}, [h('th', {}, conf.i18n('vxe.custom.setting.colSort')), h('th', {}, conf.i18n('vxe.custom.setting.colTitle')), h('th', {}, conf.i18n('vxe.custom.setting.colVisible')), h('th', {}, conf.i18n('vxe.custom.setting.colFixed'))])]), h('transition-group', {
34752
+ class: 'vxe-table-custom--body',
34753
+ props: {
34754
+ tag: 'tbody',
34755
+ name: 'vxe-table-custom--flip'
34756
+ }
34757
+ }, trVNs)])]), h('div', {
34758
+ ref: 'dragHintElemRef',
34759
+ class: 'vxe-table-custom-popup--drag-hint'
34760
+ }, conf.i18n('vxe.custom.cstmDragTarget', [_vm.dragColumn ? _vm.dragColumn.getTitle() : '']))]);
34666
34761
  },
34667
34762
  footer: function footer() {
34668
34763
  return h('div', {
@@ -34693,7 +34788,7 @@ var renderPopupPanel = function renderPopupPanel(h, _vm) {
34693
34788
  }
34694
34789
  }
34695
34790
  });
34696
- };
34791
+ }
34697
34792
  /* harmony default export */ var custom_src_panel = ({
34698
34793
  name: 'VxeTableCustomPanel',
34699
34794
  props: {
@@ -34709,6 +34804,11 @@ var renderPopupPanel = function renderPopupPanel(h, _vm) {
34709
34804
  default: null
34710
34805
  }
34711
34806
  },
34807
+ data: function data() {
34808
+ return {
34809
+ dragColumn: null
34810
+ };
34811
+ },
34712
34812
  computed: {},
34713
34813
  render: function render(h) {
34714
34814
  var $xetable = this.$xetable;
@@ -34756,8 +34856,8 @@ var renderPopupPanel = function renderPopupPanel(h, _vm) {
34756
34856
  },
34757
34857
  handleOptionCheck: function handleOptionCheck(column) {
34758
34858
  var $xetable = this.$xetable;
34759
- var collectColumn = $xetable.collectColumn;
34760
- var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(collectColumn, function (item) {
34859
+ var customColumnList = $xetable.customColumnList;
34860
+ var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(customColumnList, function (item) {
34761
34861
  return item === column;
34762
34862
  });
34763
34863
  if (matchObj && matchObj.parent) {
@@ -34807,12 +34907,12 @@ var renderPopupPanel = function renderPopupPanel(h, _vm) {
34807
34907
  },
34808
34908
  allCustomEvent: function allCustomEvent() {
34809
34909
  var $xetable = this.$xetable,
34810
- customStore = this.customStore,
34811
- collectColumn = this.collectColumn,
34812
- customOpts = this.customOpts;
34910
+ customStore = this.customStore;
34911
+ var customOpts = $xetable.customOpts,
34912
+ customColumnList = $xetable.customColumnList;
34813
34913
  var checkMethod = customOpts.checkMethod;
34814
34914
  var isAll = !customStore.isAll;
34815
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, function (column) {
34915
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, function (column) {
34816
34916
  if (!checkMethod || checkMethod({
34817
34917
  column: column
34818
34918
  })) {
@@ -34822,6 +34922,103 @@ var renderPopupPanel = function renderPopupPanel(h, _vm) {
34822
34922
  });
34823
34923
  customStore.isAll = isAll;
34824
34924
  $xetable.checkCustomStatus();
34925
+ },
34926
+ sortMousedownEvent: function sortMousedownEvent(evnt) {
34927
+ var $xetable = this.$xetable;
34928
+ var btnEl = evnt.currentTarget;
34929
+ var tdEl = btnEl.parentNode;
34930
+ var trEl = tdEl.parentNode;
34931
+ var colid = trEl.getAttribute('colid');
34932
+ var column = $xetable.getColumnById(colid);
34933
+ trEl.draggable = true;
34934
+ this.dragColumn = column;
34935
+ panel_addClass(trEl, 'active--drag-origin');
34936
+ },
34937
+ sortMouseupEvent: function sortMouseupEvent(evnt) {
34938
+ var btnEl = evnt.currentTarget;
34939
+ var tdEl = btnEl.parentNode;
34940
+ var trEl = tdEl.parentNode;
34941
+ var dragHintEl = this.$refs.dragHintElemRef;
34942
+ trEl.draggable = false;
34943
+ this.dragColumn = null;
34944
+ panel_removeClass(trEl, 'active--drag-origin');
34945
+ if (dragHintEl) {
34946
+ dragHintEl.style.display = '';
34947
+ }
34948
+ },
34949
+ sortDragstartEvent: function sortDragstartEvent(evnt) {
34950
+ var img = new Image();
34951
+ if (evnt.dataTransfer) {
34952
+ evnt.dataTransfer.setDragImage(img, 0, 0);
34953
+ }
34954
+ },
34955
+ sortDragendEvent: function sortDragendEvent(evnt) {
34956
+ var $xetable = this.$xetable,
34957
+ prevDropTrEl = this.prevDropTrEl;
34958
+ var customColumnList = $xetable.customColumnList;
34959
+ var trEl = evnt.currentTarget;
34960
+ var dragHintEl = this.$refs.dragHintElemRef;
34961
+ if (prevDropTrEl) {
34962
+ // 判断是否有拖动
34963
+ if (prevDropTrEl !== trEl) {
34964
+ var dragOffset = prevDropTrEl.getAttribute('dragoffset');
34965
+ var colid = trEl.getAttribute('colid');
34966
+ var column = $xetable.getColumnById(colid);
34967
+ if (!column) {
34968
+ return;
34969
+ }
34970
+ var cIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(customColumnList, function (item) {
34971
+ return item.id === column.id;
34972
+ });
34973
+ var targetColid = prevDropTrEl.getAttribute('colid');
34974
+ var targetColumn = $xetable.getColumnById(targetColid);
34975
+ if (!targetColumn) {
34976
+ return;
34977
+ }
34978
+ // 移出源位置
34979
+ customColumnList.splice(cIndex, 1);
34980
+ var tcIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(customColumnList, function (item) {
34981
+ return item.id === targetColumn.id;
34982
+ });
34983
+ // 插新位置
34984
+ customColumnList.splice(tcIndex + (dragOffset === 'bottom' ? 1 : 0), 0, column);
34985
+ }
34986
+ prevDropTrEl.draggable = false;
34987
+ prevDropTrEl.removeAttribute('dragoffset');
34988
+ panel_removeClass(prevDropTrEl, 'active--drag-target');
34989
+ }
34990
+ this.dragColumn = null;
34991
+ trEl.draggable = false;
34992
+ trEl.removeAttribute('dragoffset');
34993
+ if (dragHintEl) {
34994
+ dragHintEl.style.display = '';
34995
+ }
34996
+ panel_removeClass(trEl, 'active--drag-target');
34997
+ panel_removeClass(trEl, 'active--drag-origin');
34998
+ // 更新顺序
34999
+ customColumnList.forEach(function (column, index) {
35000
+ column.renderSortNumber = index;
35001
+ });
35002
+ },
35003
+ sortDragoverEvent: function sortDragoverEvent(evnt) {
35004
+ var $xetable = this.$xetable,
35005
+ prevDropTrEl = this.prevDropTrEl;
35006
+ var trEl = evnt.currentTarget;
35007
+ if (prevDropTrEl !== trEl) {
35008
+ panel_removeClass(prevDropTrEl, 'active--drag-target');
35009
+ }
35010
+ var colid = trEl.getAttribute('colid');
35011
+ var column = $xetable.getColumnById(colid);
35012
+ // 是否移入有效元行
35013
+ if (column && column.level === 1) {
35014
+ evnt.preventDefault();
35015
+ var offsetY = evnt.clientY - trEl.getBoundingClientRect().y;
35016
+ var dragOffset = offsetY < trEl.clientHeight / 2 ? 'top' : 'bottom';
35017
+ panel_addClass(trEl, 'active--drag-target');
35018
+ trEl.setAttribute('dragoffset', dragOffset);
35019
+ this.prevDropTrEl = trEl;
35020
+ }
35021
+ updateDropHint(this, evnt);
34825
35022
  }
34826
35023
  }
34827
35024
  });
@@ -37391,6 +37588,7 @@ var Checkbox = VxeCheckbox;
37391
37588
 
37392
37589
 
37393
37590
 
37591
+
37394
37592
  /* harmony default export */ var src_group = ({
37395
37593
  name: 'VxeCheckboxGroup',
37396
37594
  props: {
@@ -37439,13 +37637,17 @@ var Checkbox = VxeCheckbox;
37439
37637
  },
37440
37638
  valueField: function valueField() {
37441
37639
  return this.propsOpts.value || 'value';
37640
+ },
37641
+ disabledField: function disabledField() {
37642
+ return this.propsOpts.disabled || 'disabled';
37442
37643
  }
37443
37644
  },
37444
37645
  render: function render(h) {
37445
37646
  var $scopedSlots = this.$scopedSlots,
37446
37647
  options = this.options,
37447
37648
  valueField = this.valueField,
37448
- labelField = this.labelField;
37649
+ labelField = this.labelField,
37650
+ disabledField = this.disabledField;
37449
37651
  var defaultSlot = $scopedSlots.default;
37450
37652
  return h('div', {
37451
37653
  class: 'vxe-checkbox-group'
@@ -37453,7 +37655,8 @@ var Checkbox = VxeCheckbox;
37453
37655
  return h('vxe-checkbox', {
37454
37656
  props: {
37455
37657
  label: item[valueField],
37456
- content: item[labelField]
37658
+ content: item[labelField],
37659
+ disabled: item[disabledField]
37457
37660
  }
37458
37661
  });
37459
37662
  }) : []);
@@ -37553,6 +37756,9 @@ var Radio = VxeRadio;
37553
37756
  },
37554
37757
  valueField: function valueField() {
37555
37758
  return this.propsOpts.value || 'value';
37759
+ },
37760
+ disabledField: function disabledField() {
37761
+ return this.propsOpts.disabled || 'disabled';
37556
37762
  }
37557
37763
  },
37558
37764
  data: function data() {
@@ -37565,7 +37771,8 @@ var Radio = VxeRadio;
37565
37771
  options = this.options,
37566
37772
  type = this.type,
37567
37773
  valueField = this.valueField,
37568
- labelField = this.labelField;
37774
+ labelField = this.labelField,
37775
+ disabledField = this.disabledField;
37569
37776
  var defaultSlot = $scopedSlots.default;
37570
37777
  var btnComp = type === 'button' ? 'vxe-radio-button' : 'vxe-radio';
37571
37778
  return h('div', {
@@ -37574,7 +37781,8 @@ var Radio = VxeRadio;
37574
37781
  return h(btnComp, {
37575
37782
  props: {
37576
37783
  label: item[valueField],
37577
- content: item[labelField]
37784
+ content: item[labelField],
37785
+ disabled: item[disabledField]
37578
37786
  }
37579
37787
  });
37580
37788
  }) : []);
@@ -41339,7 +41547,7 @@ var Pulldown = VxePulldown;
41339
41547
  text: '加载中...'
41340
41548
  },
41341
41549
  error: {
41342
- groupFixed: '如果使用分组表头,固定列必须按组设置',
41550
+ groupFixed: '如果使用分组表头,冻结列必须按组设置',
41343
41551
  groupMouseRange: '分组表头与 "{0}" 不能同时使用,这可能会出现错误',
41344
41552
  groupTag: '分组列头应该使用 "{0}" 而不是 "{1}",这可能会出现错误',
41345
41553
  scrollErrProp: '启用虚拟滚动后不支持该参数 "{0}"',
@@ -41392,7 +41600,7 @@ var Pulldown = VxePulldown;
41392
41600
  customAll: '全部',
41393
41601
  customConfirm: '确认',
41394
41602
  customRestore: '重置',
41395
- maxFixedCol: '最大固定列的数量不能超过 {0} 个'
41603
+ maxFixedCol: '最大冻结列的数量不能超过 {0} 个'
41396
41604
  },
41397
41605
  grid: {
41398
41606
  selectOneRecord: '请至少选择一条记录!',
@@ -41427,7 +41635,7 @@ var Pulldown = VxePulldown;
41427
41635
  endPageTitle: '末页'
41428
41636
  },
41429
41637
  alert: {
41430
- title: '消息提示'
41638
+ title: '系统提示'
41431
41639
  },
41432
41640
  button: {
41433
41641
  confirm: '确认',
@@ -41440,7 +41648,18 @@ var Pulldown = VxePulldown;
41440
41648
  cstmTitle: '列设置',
41441
41649
  cstmRestore: '恢复默认',
41442
41650
  cstmCancel: '取消',
41443
- cstmConfirm: '确定'
41651
+ cstmConfirm: '确定',
41652
+ cstmConfirmRestore: '请确认是否恢复成默认列配置?',
41653
+ cstmDragTarget: '移动目标:{0}',
41654
+ setting: {
41655
+ colSort: '排序',
41656
+ colTitle: '标题',
41657
+ colVisible: '是否显示',
41658
+ colFixed: '冻结列',
41659
+ fixedLeft: '左侧',
41660
+ fixedUnset: '不设置',
41661
+ fixedRight: '右侧'
41662
+ }
41444
41663
  },
41445
41664
  import: {
41446
41665
  modes: {
@@ -41519,9 +41738,9 @@ var Pulldown = VxePulldown;
41519
41738
  customAll: '全部',
41520
41739
  customConfirm: '确认',
41521
41740
  customRestore: '重置',
41522
- fixedLeft: '固定在左侧',
41523
- fixedRight: '固定在右侧',
41524
- cancelfixed: '取消固定'
41741
+ fixedLeft: '冻结在左侧',
41742
+ fixedRight: '冻结在右侧',
41743
+ cancelfixed: '取消冻结列'
41525
41744
  },
41526
41745
  input: {
41527
41746
  date: {