vxe-table 4.10.6-beta.30 → 4.10.6-beta.31

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.
@@ -7721,10 +7721,13 @@ export default defineComponent({
7721
7721
  */
7722
7722
  triggerSortEvent(evnt, column, order) {
7723
7723
  const sortOpts = computeSortOpts.value;
7724
+ const { multiple, allowClear } = sortOpts;
7724
7725
  const { field, sortable } = column;
7725
7726
  if (sortable) {
7726
7727
  if (!order || column.order === order) {
7727
- tableMethods.clearSort(sortOpts.multiple ? column : null);
7728
+ if (allowClear) {
7729
+ tableMethods.clearSort(multiple ? column : null);
7730
+ }
7728
7731
  }
7729
7732
  else {
7730
7733
  tableMethods.sort({ field, order });
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 = "4.10.6-beta.30";
3
+ export const version = "4.10.6-beta.31";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
@@ -113,6 +113,8 @@ VxeUI.setConfig({
113
113
  // orders: ['asc', 'desc', null],
114
114
  // sortMethod: null,
115
115
  showIcon: true,
116
+ allowClear: true,
117
+ allowBtn: true,
116
118
  iconLayout: 'vertical'
117
119
  },
118
120
  filterConfig: {
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${"4.10.6-beta.30"}`;
3
+ const version = `table v${"4.10.6-beta.31"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
package/lib/index.umd.js CHANGED
@@ -3138,7 +3138,7 @@ function eqEmptyValue(cellValue) {
3138
3138
  ;// ./packages/ui/index.ts
3139
3139
 
3140
3140
 
3141
- const version = "4.10.6-beta.29";
3141
+ const version = "4.10.6-beta.31";
3142
3142
  core_.VxeUI.version = version;
3143
3143
  core_.VxeUI.tableVersion = version;
3144
3144
  core_.VxeUI.setConfig({
@@ -3251,6 +3251,8 @@ core_.VxeUI.setConfig({
3251
3251
  // orders: ['asc', 'desc', null],
3252
3252
  // sortMethod: null,
3253
3253
  showIcon: true,
3254
+ allowClear: true,
3255
+ allowBtn: true,
3254
3256
  iconLayout: 'vertical'
3255
3257
  },
3256
3258
  filterConfig: {
@@ -3581,7 +3583,7 @@ var esnext_iterator_some = __webpack_require__(7550);
3581
3583
  const {
3582
3584
  log: log_log
3583
3585
  } = core_.VxeUI;
3584
- const log_version = `table v${"4.10.6-beta.29"}`;
3586
+ const log_version = `table v${"4.10.6-beta.31"}`;
3585
3587
  const warnLog = log_log.create('warn', log_version);
3586
3588
  const errLog = log_log.create('error', log_version);
3587
3589
  ;// ./packages/table/src/columnInfo.ts
@@ -5686,6 +5688,7 @@ const Cell = {
5686
5688
  const sortOpts = computeSortOpts.value;
5687
5689
  const {
5688
5690
  showIcon,
5691
+ allowBtn,
5689
5692
  iconLayout,
5690
5693
  iconAsc,
5691
5694
  iconDesc,
@@ -5702,19 +5705,19 @@ const Cell = {
5702
5705
  'sort--active': order === 'asc'
5703
5706
  }],
5704
5707
  title: cell_getI18n('vxe.table.sortAsc'),
5705
- onClick(evnt) {
5708
+ onClick: allowBtn ? evnt => {
5706
5709
  evnt.stopPropagation();
5707
5710
  $table.triggerSortEvent(evnt, column, 'asc');
5708
- }
5711
+ } : undefined
5709
5712
  }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
5710
5713
  class: ['vxe-sort--desc-btn', iconDesc || cell_getIcon().TABLE_SORT_DESC, {
5711
5714
  'sort--active': order === 'desc'
5712
5715
  }],
5713
5716
  title: cell_getI18n('vxe.table.sortDesc'),
5714
- onClick(evnt) {
5717
+ onClick: allowBtn ? evnt => {
5715
5718
  evnt.stopPropagation();
5716
5719
  $table.triggerSortEvent(evnt, column, 'desc');
5717
- }
5720
+ } : undefined
5718
5721
  })])];
5719
5722
  }
5720
5723
  return [];
@@ -7996,12 +7999,18 @@ const {
7996
7999
  type: Boolean,
7997
8000
  default: () => props_getConfig().table.highlightHoverRow
7998
8001
  },
7999
- // (即将废弃)是否要高亮当前选中列
8002
+ /**
8003
+ * (即将废弃)是否要高亮当前选中列
8004
+ * @deprecated
8005
+ */
8000
8006
  highlightCurrentColumn: {
8001
8007
  type: Boolean,
8002
8008
  default: () => props_getConfig().table.highlightCurrentColumn
8003
8009
  },
8004
- // (即将废弃)鼠标移到列是否要高亮显示
8010
+ /**
8011
+ * (即将废弃)鼠标移到列是否要高亮显示
8012
+ * @deprecated
8013
+ */
8005
8014
  highlightHoverColumn: {
8006
8015
  type: Boolean,
8007
8016
  default: () => props_getConfig().table.highlightHoverColumn
@@ -19212,13 +19221,19 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
19212
19221
  */
19213
19222
  triggerSortEvent(evnt, column, order) {
19214
19223
  const sortOpts = computeSortOpts.value;
19224
+ const {
19225
+ multiple,
19226
+ allowClear
19227
+ } = sortOpts;
19215
19228
  const {
19216
19229
  field,
19217
19230
  sortable
19218
19231
  } = column;
19219
19232
  if (sortable) {
19220
19233
  if (!order || column.order === order) {
19221
- tableMethods.clearSort(sortOpts.multiple ? column : null);
19234
+ if (allowClear) {
19235
+ tableMethods.clearSort(multiple ? column : null);
19236
+ }
19222
19237
  } else {
19223
19238
  tableMethods.sort({
19224
19239
  field,