vxe-table 3.13.23 → 3.13.25

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.
@@ -551,7 +551,8 @@ export const Cell = {
551
551
  const headerSlot = slots ? slots.header : null;
552
552
  const titleSlot = slots ? slots.title : null;
553
553
  const checkboxOpts = $table.computeCheckboxOpts;
554
- const headerTitle = column.getTitle();
554
+ const { checkStrictly, showHeader, headerTitle } = checkboxOpts;
555
+ const colTitle = column.getTitle();
555
556
  const ons = {};
556
557
  if (!isHidden) {
557
558
  ons.click = (evnt) => {
@@ -564,11 +565,11 @@ export const Cell = {
564
565
  if (headerSlot) {
565
566
  return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, $table.callSlot(headerSlot, checkboxParams, h)));
566
567
  }
567
- if (checkboxOpts.checkStrictly ? !checkboxOpts.showHeader : checkboxOpts.showHeader === false) {
568
+ if (checkStrictly ? !showHeader : showHeader === false) {
568
569
  return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, [
569
570
  h('span', {
570
571
  class: 'vxe-checkbox--label'
571
- }, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : headerTitle)
572
+ }, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : colTitle)
572
573
  ]));
573
574
  }
574
575
  return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, [
@@ -579,18 +580,18 @@ export const Cell = {
579
580
  'is--indeterminate': isAllCheckboxIndeterminate
580
581
  }],
581
582
  attrs: {
582
- title: getI18n('vxe.table.allTitle')
583
+ title: XEUtils.eqNull(headerTitle) ? getI18n('vxe.table.allTitle') : `${headerTitle || ''}`
583
584
  },
584
585
  on: ons
585
586
  }, [
586
587
  h('span', {
587
588
  class: ['vxe-checkbox--icon', isAllCheckboxIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllCheckboxSelected ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
588
589
  })
589
- ].concat(titleSlot || headerTitle
590
+ ].concat(titleSlot || colTitle
590
591
  ? [
591
592
  h('span', {
592
593
  class: 'vxe-checkbox--label'
593
- }, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : headerTitle)
594
+ }, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : colTitle)
594
595
  ]
595
596
  : []))
596
597
  ]));
@@ -820,7 +821,7 @@ export const Cell = {
820
821
  renderSortIcon(h, params) {
821
822
  const { $table, column } = params;
822
823
  const sortOpts = $table.computeSortOpts;
823
- const { showIcon, allowBtn, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts;
824
+ const { showIcon, allowBtn, ascTitle, descTitle, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts;
824
825
  if (showIcon && (!iconVisibleMethod || iconVisibleMethod(params))) {
825
826
  return [
826
827
  h('span', {
@@ -831,7 +832,7 @@ export const Cell = {
831
832
  'sort--active': column.order === 'asc'
832
833
  }],
833
834
  attrs: {
834
- title: getI18n('vxe.table.sortAsc')
835
+ title: XEUtils.eqNull(ascTitle) ? getI18n('vxe.table.sortAsc') : `${ascTitle || ''}`
835
836
  },
836
837
  on: allowBtn
837
838
  ? {
@@ -847,7 +848,7 @@ export const Cell = {
847
848
  'sort--active': column.order === 'desc'
848
849
  }],
849
850
  attrs: {
850
- title: getI18n('vxe.table.sortDesc')
851
+ title: XEUtils.eqNull(descTitle) ? getI18n('vxe.table.sortDesc') : `${descTitle || ''}`
851
852
  },
852
853
  on: allowBtn
853
854
  ? {
@@ -200,7 +200,7 @@ function cacheColumnMap($xeTable) {
200
200
  }
201
201
  else {
202
202
  if ((storage && !type) || (columnOpts.drag && (isCrossDrag || isSelfToChildDrag))) {
203
- errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field`]);
203
+ errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field=?`]);
204
204
  }
205
205
  }
206
206
  if (!hasFixed && fixed) {
@@ -3960,8 +3960,19 @@ const Methods = {
3960
3960
  }
3961
3961
  },
3962
3962
  getCustomStoreData() {
3963
- const { id, customOpts, collectColumn } = this;
3964
- const { checkMethod } = customOpts;
3963
+ const $xeTable = this;
3964
+ const props = $xeTable;
3965
+ const internalData = $xeTable;
3966
+ const { id } = props;
3967
+ const customOpts = $xeTable.computeCustomOpts;
3968
+ const { collectColumn } = internalData;
3969
+ const { storage, checkMethod } = customOpts;
3970
+ const isAllCustom = storage === true;
3971
+ const storageOpts = isAllCustom ? {} : Object.assign({}, storage || {});
3972
+ const isCustomResizable = isAllCustom || storageOpts.resizable;
3973
+ const isCustomVisible = isAllCustom || storageOpts.visible;
3974
+ const isCustomFixed = isAllCustom || storageOpts.fixed;
3975
+ const isCustomSort = isAllCustom || storageOpts.sort;
3965
3976
  const resizableData = {};
3966
3977
  const sortData = {};
3967
3978
  const visibleData = {};
@@ -3978,47 +3989,37 @@ const Methods = {
3978
3989
  }
3979
3990
  let hasResizable = 0;
3980
3991
  let hasSort = 0;
3981
- let hasFixedt = 0;
3992
+ let hasFixed = 0;
3982
3993
  let hasVisible = 0;
3983
3994
  XEUtils.eachTree(collectColumn, (column, index, items, path, parentColumn) => {
3995
+ const colKey = column.getKey();
3996
+ if (!colKey) {
3997
+ errLog('vxe.error.reqProp', [`${column.getTitle() || column.type || ''} -> column.field=?`]);
3998
+ return;
3999
+ }
3984
4000
  // 只支持一级
3985
4001
  if (!parentColumn) {
3986
- collectColumn.forEach((column) => {
3987
- const colKey = column.getKey();
3988
- if (colKey) {
3989
- hasSort = 1;
3990
- sortData[colKey] = column.renderSortNumber;
3991
- }
3992
- });
3993
- if (column.fixed !== column.defaultFixed) {
3994
- const colKey = column.getKey();
3995
- if (colKey) {
3996
- hasFixedt = 1;
3997
- fixedData[colKey] = column.fixed;
3998
- }
4002
+ if (isCustomSort) {
4003
+ hasSort = 1;
4004
+ sortData[colKey] = column.renderSortNumber;
3999
4005
  }
4000
- }
4001
- if (column.resizeWidth) {
4002
- const colKey = column.getKey();
4003
- if (colKey) {
4004
- hasResizable = 1;
4005
- resizableData[colKey] = column.renderWidth;
4006
+ if (isCustomFixed && column.fixed !== column.defaultFixed) {
4007
+ hasFixed = 1;
4008
+ fixedData[colKey] = column.fixed;
4006
4009
  }
4007
4010
  }
4008
- if (!checkMethod || checkMethod({ column })) {
4011
+ if (isCustomResizable && column.resizeWidth) {
4012
+ hasResizable = 1;
4013
+ resizableData[colKey] = column.renderWidth;
4014
+ }
4015
+ if (isCustomVisible && (!checkMethod || checkMethod({ column }))) {
4009
4016
  if (!column.visible && column.defaultVisible) {
4010
- const colKey = column.getKey();
4011
- if (colKey) {
4012
- hasVisible = 1;
4013
- visibleData[colKey] = false;
4014
- }
4017
+ hasVisible = 1;
4018
+ visibleData[colKey] = false;
4015
4019
  }
4016
4020
  else if (column.visible && !column.defaultVisible) {
4017
- const colKey = column.getKey();
4018
- if (colKey) {
4019
- hasVisible = 1;
4020
- visibleData[colKey] = true;
4021
- }
4021
+ hasVisible = 1;
4022
+ visibleData[colKey] = true;
4022
4023
  }
4023
4024
  }
4024
4025
  });
@@ -4028,7 +4029,7 @@ const Methods = {
4028
4029
  if (hasSort) {
4029
4030
  storeData.sortData = sortData;
4030
4031
  }
4031
- if (hasFixedt) {
4032
+ if (hasFixed) {
4032
4033
  storeData.fixedData = fixedData;
4033
4034
  }
4034
4035
  if (hasVisible) {
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "3.13.23";
3
+ export const version = "3.13.25";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
package/es/ui/src/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const version = `table v${"3.13.23"}`;
3
+ const version = `table v${"3.13.25"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
package/lib/index.umd.js CHANGED
@@ -3201,7 +3201,7 @@ function getClass(property, params) {
3201
3201
  ;// ./packages/ui/index.ts
3202
3202
 
3203
3203
 
3204
- const version = "3.13.23";
3204
+ const version = "3.13.25";
3205
3205
  core_.VxeUI.version = version;
3206
3206
  core_.VxeUI.tableVersion = version;
3207
3207
  core_.VxeUI.setConfig({
@@ -3828,7 +3828,7 @@ var es_iterator_map = __webpack_require__(1701);
3828
3828
  const {
3829
3829
  log: log_log
3830
3830
  } = core_.VxeUI;
3831
- const log_version = `table v${"3.13.23"}`;
3831
+ const log_version = `table v${"3.13.25"}`;
3832
3832
  const warnLog = log_log.create('warn', log_version);
3833
3833
  const errLog = log_log.create('error', log_version);
3834
3834
  ;// ./packages/table/src/columnInfo.ts
@@ -5276,7 +5276,12 @@ const Cell = {
5276
5276
  const headerSlot = slots ? slots.header : null;
5277
5277
  const titleSlot = slots ? slots.title : null;
5278
5278
  const checkboxOpts = $table.computeCheckboxOpts;
5279
- const headerTitle = column.getTitle();
5279
+ const {
5280
+ checkStrictly,
5281
+ showHeader,
5282
+ headerTitle
5283
+ } = checkboxOpts;
5284
+ const colTitle = column.getTitle();
5280
5285
  const ons = {};
5281
5286
  if (!isHidden) {
5282
5287
  ons.click = evnt => {
@@ -5294,10 +5299,10 @@ const Cell = {
5294
5299
  if (headerSlot) {
5295
5300
  return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, $table.callSlot(headerSlot, checkboxParams, h)));
5296
5301
  }
5297
- if (checkboxOpts.checkStrictly ? !checkboxOpts.showHeader : checkboxOpts.showHeader === false) {
5302
+ if (checkStrictly ? !showHeader : showHeader === false) {
5298
5303
  return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, [h('span', {
5299
5304
  class: 'vxe-checkbox--label'
5300
- }, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : headerTitle)]));
5305
+ }, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : colTitle)]));
5301
5306
  }
5302
5307
  return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, [h('span', {
5303
5308
  class: ['vxe-cell--checkbox', {
@@ -5306,14 +5311,14 @@ const Cell = {
5306
5311
  'is--indeterminate': isAllCheckboxIndeterminate
5307
5312
  }],
5308
5313
  attrs: {
5309
- title: cell_getI18n('vxe.table.allTitle')
5314
+ title: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(headerTitle) ? cell_getI18n('vxe.table.allTitle') : `${headerTitle || ''}`
5310
5315
  },
5311
5316
  on: ons
5312
5317
  }, [h('span', {
5313
5318
  class: ['vxe-checkbox--icon', isAllCheckboxIndeterminate ? cell_getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllCheckboxSelected ? cell_getIcon().TABLE_CHECKBOX_CHECKED : cell_getIcon().TABLE_CHECKBOX_UNCHECKED]
5314
- })].concat(titleSlot || headerTitle ? [h('span', {
5319
+ })].concat(titleSlot || colTitle ? [h('span', {
5315
5320
  class: 'vxe-checkbox--label'
5316
- }, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : headerTitle)] : []))]));
5321
+ }, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : colTitle)] : []))]));
5317
5322
  },
5318
5323
  renderCheckboxCell(h, params) {
5319
5324
  const {
@@ -5612,6 +5617,8 @@ const Cell = {
5612
5617
  const {
5613
5618
  showIcon,
5614
5619
  allowBtn,
5620
+ ascTitle,
5621
+ descTitle,
5615
5622
  iconLayout,
5616
5623
  iconAsc,
5617
5624
  iconDesc,
@@ -5625,7 +5632,7 @@ const Cell = {
5625
5632
  'sort--active': column.order === 'asc'
5626
5633
  }],
5627
5634
  attrs: {
5628
- title: cell_getI18n('vxe.table.sortAsc')
5635
+ title: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(ascTitle) ? cell_getI18n('vxe.table.sortAsc') : `${ascTitle || ''}`
5629
5636
  },
5630
5637
  on: allowBtn ? {
5631
5638
  click(evnt) {
@@ -5638,7 +5645,7 @@ const Cell = {
5638
5645
  'sort--active': column.order === 'desc'
5639
5646
  }],
5640
5647
  attrs: {
5641
- title: cell_getI18n('vxe.table.sortDesc')
5648
+ title: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(descTitle) ? cell_getI18n('vxe.table.sortDesc') : `${descTitle || ''}`
5642
5649
  },
5643
5650
  on: allowBtn ? {
5644
5651
  click(evnt) {
@@ -6358,7 +6365,7 @@ function cacheColumnMap($xeTable) {
6358
6365
  fullColumnFieldData[field] = rest;
6359
6366
  } else {
6360
6367
  if (storage && !type || columnOpts.drag && (isCrossDrag || isSelfToChildDrag)) {
6361
- errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field`]);
6368
+ errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field=?`]);
6362
6369
  }
6363
6370
  }
6364
6371
  if (!hasFixed && fixed) {
@@ -10712,14 +10719,26 @@ const Methods = {
10712
10719
  }
10713
10720
  },
10714
10721
  getCustomStoreData() {
10722
+ const $xeTable = this;
10723
+ const props = $xeTable;
10724
+ const internalData = $xeTable;
10725
+ const {
10726
+ id
10727
+ } = props;
10728
+ const customOpts = $xeTable.computeCustomOpts;
10715
10729
  const {
10716
- id,
10717
- customOpts,
10718
10730
  collectColumn
10719
- } = this;
10731
+ } = internalData;
10720
10732
  const {
10733
+ storage,
10721
10734
  checkMethod
10722
10735
  } = customOpts;
10736
+ const isAllCustom = storage === true;
10737
+ const storageOpts = isAllCustom ? {} : Object.assign({}, storage || {});
10738
+ const isCustomResizable = isAllCustom || storageOpts.resizable;
10739
+ const isCustomVisible = isAllCustom || storageOpts.visible;
10740
+ const isCustomFixed = isAllCustom || storageOpts.fixed;
10741
+ const isCustomSort = isAllCustom || storageOpts.sort;
10723
10742
  const resizableData = {};
10724
10743
  const sortData = {};
10725
10744
  const visibleData = {};
@@ -10736,48 +10755,38 @@ const Methods = {
10736
10755
  }
10737
10756
  let hasResizable = 0;
10738
10757
  let hasSort = 0;
10739
- let hasFixedt = 0;
10758
+ let hasFixed = 0;
10740
10759
  let hasVisible = 0;
10741
10760
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parentColumn) => {
10761
+ const colKey = column.getKey();
10762
+ if (!colKey) {
10763
+ errLog('vxe.error.reqProp', [`${column.getTitle() || column.type || ''} -> column.field=?`]);
10764
+ return;
10765
+ }
10742
10766
  // 只支持一级
10743
10767
  if (!parentColumn) {
10744
- collectColumn.forEach(column => {
10745
- const colKey = column.getKey();
10746
- if (colKey) {
10747
- hasSort = 1;
10748
- sortData[colKey] = column.renderSortNumber;
10749
- }
10750
- });
10751
- if (column.fixed !== column.defaultFixed) {
10752
- const colKey = column.getKey();
10753
- if (colKey) {
10754
- hasFixedt = 1;
10755
- fixedData[colKey] = column.fixed;
10756
- }
10768
+ if (isCustomSort) {
10769
+ hasSort = 1;
10770
+ sortData[colKey] = column.renderSortNumber;
10757
10771
  }
10758
- }
10759
- if (column.resizeWidth) {
10760
- const colKey = column.getKey();
10761
- if (colKey) {
10762
- hasResizable = 1;
10763
- resizableData[colKey] = column.renderWidth;
10772
+ if (isCustomFixed && column.fixed !== column.defaultFixed) {
10773
+ hasFixed = 1;
10774
+ fixedData[colKey] = column.fixed;
10764
10775
  }
10765
10776
  }
10766
- if (!checkMethod || checkMethod({
10777
+ if (isCustomResizable && column.resizeWidth) {
10778
+ hasResizable = 1;
10779
+ resizableData[colKey] = column.renderWidth;
10780
+ }
10781
+ if (isCustomVisible && (!checkMethod || checkMethod({
10767
10782
  column
10768
- })) {
10783
+ }))) {
10769
10784
  if (!column.visible && column.defaultVisible) {
10770
- const colKey = column.getKey();
10771
- if (colKey) {
10772
- hasVisible = 1;
10773
- visibleData[colKey] = false;
10774
- }
10785
+ hasVisible = 1;
10786
+ visibleData[colKey] = false;
10775
10787
  } else if (column.visible && !column.defaultVisible) {
10776
- const colKey = column.getKey();
10777
- if (colKey) {
10778
- hasVisible = 1;
10779
- visibleData[colKey] = true;
10780
- }
10788
+ hasVisible = 1;
10789
+ visibleData[colKey] = true;
10781
10790
  }
10782
10791
  }
10783
10792
  });
@@ -10787,7 +10796,7 @@ const Methods = {
10787
10796
  if (hasSort) {
10788
10797
  storeData.sortData = sortData;
10789
10798
  }
10790
- if (hasFixedt) {
10799
+ if (hasFixed) {
10791
10800
  storeData.fixedData = fixedData;
10792
10801
  }
10793
10802
  if (hasVisible) {