vxe-table 4.23.14 → 4.23.15

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.
@@ -1,4 +1,4 @@
1
- import { PropType } from 'vue';
1
+ import { PropType, VNode } from 'vue';
2
2
  import type { VxeTableDefines } from '../../../types';
3
3
  declare const _default: import("vue").DefineComponent<{
4
4
  tableData: PropType<any[]>;
@@ -9,7 +9,7 @@ declare const _default: import("vue").DefineComponent<{
9
9
  type: PropType<"right" | "left" | "">;
10
10
  default: null;
11
11
  };
12
- }, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
12
+ }, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
13
13
  [key: string]: any;
14
14
  }>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
15
15
  tableData: PropType<any[]>;
@@ -316,7 +316,12 @@ var header_default = (
316
316
  const flCompConf = (0, import_utils.isEnableConf)(filterRender) && filterRender.name ? rendererOpts[filterRender.name] || renderer.get(filterRender.name) : null;
317
317
  const rtFloatingFilter = flCompConf ? flCompConf.renderTableFloatingFilter : null;
318
318
  const fixedHiddenColumn = overflowX && (fixedType ? column.fixed !== fixedType : !!column.fixed);
319
- const isPadding = import_xe_utils.default.isBoolean(headerCellOpts.padding) ? headerCellOpts.padding : cellOpts.padding;
319
+ const cellPadding = (0, import_utils.getDefaultConfig)(headerCellOpts.padding, cellOpts.padding);
320
+ const isAllCellPadding = cellPadding === true;
321
+ const isCellPaddingTop = cellPadding ? isAllCellPadding || cellPadding.top !== false : false;
322
+ const isCellPaddingBottom = cellPadding ? isAllCellPadding || cellPadding.bottom !== false : false;
323
+ const isCellPaddingLeft = cellPadding ? isAllCellPadding || cellPadding.left !== false : false;
324
+ const isCellPaddingRight = cellPadding ? isAllCellPadding || cellPadding.right !== false : false;
320
325
  const headOverflow = import_xe_utils.default.eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
321
326
  const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : "") || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : "") || allAlign;
322
327
  const showEllipsis = headOverflow === "ellipsis";
@@ -371,8 +376,13 @@ var header_default = (
371
376
  "col--fixed": column.fixed,
372
377
  "col--ellipsis": hasEllipsis,
373
378
  "fixed--width": !isAutoCellWidth,
374
- "is--padding": isPadding,
379
+ "is--pg-top": isCellPaddingTop,
380
+ "is--pg-bottom": isCellPaddingBottom,
381
+ "is--pg-left": isCellPaddingLeft,
382
+ "is--pg-right": isCellPaddingRight,
375
383
  "is--sortable": column.sortable,
384
+ "col--filter": !!filters,
385
+ "is--filter-active": hasFilter,
376
386
  "col--current": currColFlag && currentCol === column
377
387
  }
378
388
  ],
@@ -413,28 +423,33 @@ var header_default = (
413
423
  const { fixedType } = props;
414
424
  const { headerRowClassName, headerRowStyle } = tableProps;
415
425
  const floatingFilterOpts = computeFloatingFilterOpts.value;
416
- const rowVNs = headerGroups.map((cols, _rowIndex) => {
426
+ const isFFEnabled = floatingFilterOpts.enabled;
427
+ const isFFTop = floatingFilterOpts.position === "top";
428
+ const rowVNs = [];
429
+ if (isFFEnabled && isFFTop) {
430
+ rowVNs.push(
431
+ (0, import_vue.h)("tr", {
432
+ key: "fft",
433
+ class: ["vxe-header--row is--floating-filters", "" + (floatingFilterOpts.rowClassName || "")]
434
+ }, renderFilterRows(isOptimizeMode, renderColumnList))
435
+ );
436
+ }
437
+ headerGroups.forEach((cols, _rowIndex) => {
417
438
  const params = { $table: $xeTable, rowIndex: _rowIndex, _rowIndex, $rowIndex: _rowIndex, fixed: fixedType, type: renderType };
418
- return (0, import_vue.h)(
419
- "tr",
420
- {
439
+ rowVNs.push(
440
+ (0, import_vue.h)("tr", {
421
441
  key: _rowIndex,
422
442
  class: ["vxe-header--row", headerRowClassName ? import_xe_utils.default.isFunction(headerRowClassName) ? headerRowClassName(params) : headerRowClassName : ""],
423
443
  style: headerRowStyle ? import_xe_utils.default.isFunction(headerRowStyle) ? headerRowStyle(params) : headerRowStyle : null
424
- },
425
- renderRows(isGroup, isOptimizeMode, headerGroups, _rowIndex, cols)
444
+ }, renderRows(isGroup, isOptimizeMode, headerGroups, _rowIndex, cols))
426
445
  );
427
446
  });
428
- if (floatingFilterOpts.enabled) {
447
+ if (isFFEnabled && !isFFTop) {
429
448
  rowVNs.push(
430
- (0, import_vue.h)(
431
- "tr",
432
- {
433
- key: "ff",
434
- class: ["vxe-header--row is--floating-filters", "" + (floatingFilterOpts.rowClassName || "")]
435
- },
436
- renderFilterRows(isOptimizeMode, renderColumnList)
437
- )
449
+ (0, import_vue.h)("tr", {
450
+ key: "ffb",
451
+ class: ["vxe-header--row is--floating-filters", "" + (floatingFilterOpts.rowClassName || "")]
452
+ }, renderFilterRows(isOptimizeMode, renderColumnList))
438
453
  );
439
454
  }
440
455
  return rowVNs;
package/lib/ui/index.js CHANGED
@@ -33,7 +33,7 @@ __export(ui_exports, {
33
33
  module.exports = __toCommonJS(ui_exports);
34
34
  var import_core = require("@vxe-ui/core");
35
35
  var import_utils = require("./src/utils");
36
- const version = "4.23.14";
36
+ const version = "4.23.15";
37
37
  import_core.VxeUI.version = version;
38
38
  import_core.VxeUI.tableVersion = version;
39
39
  import_core.VxeUI.setConfig({
@@ -200,7 +200,8 @@ import_core.VxeUI.setConfig({
200
200
  maxHeight: 320
201
201
  },
202
202
  floatingFilterConfig: {
203
- // enabled: false
203
+ // enabled: false,
204
+ padding: true
204
205
  },
205
206
  aggregateConfig: {
206
207
  padding: true,
package/lib/ui/src/log.js CHANGED
@@ -25,7 +25,7 @@ __export(log_exports, {
25
25
  module.exports = __toCommonJS(log_exports);
26
26
  var import_core = require("@vxe-ui/core");
27
27
  const { log } = import_core.VxeUI;
28
- const tableVersion = `table v${"4.23.14"}`;
28
+ const tableVersion = `table v${"4.23.15"}`;
29
29
  function createComponentLog(name) {
30
30
  const uiVersion = import_core.VxeUI.uiVersion ? `ui v${import_core.VxeUI.uiVersion}` : "";
31
31
  const ganttVersion = import_core.VxeUI.ganttVersion ? `gantt v${import_core.VxeUI.ganttVersion}` : "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxe-table",
3
- "version": "4.23.14",
3
+ "version": "4.23.15",
4
4
  "description": "A PC-end table component based on Vxe UI, supporting copy-paste, data pivot table, and high-performance virtual list table solution.",
5
5
  "scripts": {
6
6
  "update": "npm install --legacy-peer-deps",
@@ -75,7 +75,7 @@
75
75
  "typescript": "~5.9.3",
76
76
  "vue": "3.4.27",
77
77
  "vue-router": "~4.5.1",
78
- "vxe-pc-ui": "4.20.36"
78
+ "vxe-pc-ui": "4.20.37"
79
79
  },
80
80
  "allowScripts": {
81
81
  "esbuild": true,
@@ -1,4 +1,4 @@
1
- import { h, ref, Ref, PropType, inject, nextTick, watch, onMounted, onUnmounted } from 'vue'
1
+ import { h, ref, Ref, PropType, inject, nextTick, watch, onMounted, onUnmounted, VNode } from 'vue'
2
2
  import { defineVxeComponent } from '../../ui/src/comp'
3
3
  import XEUtils from 'xe-utils'
4
4
  import { VxeUI } from '@vxe-ui/core'
@@ -313,8 +313,15 @@ export default /* define-vxe-component start */ defineVxeComponent({
313
313
  const flCompConf = isEnableConf(filterRender) && filterRender.name ? rendererOpts[filterRender.name] || renderer.get(filterRender.name) : null
314
314
  const rtFloatingFilter = flCompConf ? flCompConf.renderTableFloatingFilter : null
315
315
  const fixedHiddenColumn = overflowX && (fixedType ? column.fixed !== fixedType : !!column.fixed)
316
- const isPadding = XEUtils.isBoolean(headerCellOpts.padding) ? headerCellOpts.padding : cellOpts.padding
316
+
317
+ const cellPadding = getDefaultConfig(headerCellOpts.padding, cellOpts.padding)
318
+ const isAllCellPadding = cellPadding === true
319
+ const isCellPaddingTop = cellPadding ? isAllCellPadding || cellPadding.top !== false : false
320
+ const isCellPaddingBottom = cellPadding ? isAllCellPadding || cellPadding.bottom !== false : false
321
+ const isCellPaddingLeft = cellPadding ? isAllCellPadding || cellPadding.left !== false : false
322
+ const isCellPaddingRight = cellPadding ? isAllCellPadding || cellPadding.right !== false : false
317
323
  const headOverflow = XEUtils.eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow
324
+
318
325
  const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign
319
326
  const showEllipsis = headOverflow === 'ellipsis'
320
327
  const showTitle = headOverflow === 'title'
@@ -373,8 +380,13 @@ export default /* define-vxe-component start */ defineVxeComponent({
373
380
  'col--fixed': column.fixed,
374
381
  'col--ellipsis': hasEllipsis,
375
382
  'fixed--width': !isAutoCellWidth,
376
- 'is--padding': isPadding,
383
+ 'is--pg-top': isCellPaddingTop,
384
+ 'is--pg-bottom': isCellPaddingBottom,
385
+ 'is--pg-left': isCellPaddingLeft,
386
+ 'is--pg-right': isCellPaddingRight,
377
387
  'is--sortable': column.sortable,
388
+ 'col--filter': !!filters,
389
+ 'is--filter-active': hasFilter,
378
390
  'col--current': currColFlag && currentCol === column
379
391
  }
380
392
  ],
@@ -419,29 +431,36 @@ export default /* define-vxe-component start */ defineVxeComponent({
419
431
 
420
432
  const { headerRowClassName, headerRowStyle } = tableProps
421
433
  const floatingFilterOpts = computeFloatingFilterOpts.value
422
- const rowVNs = headerGroups.map((cols, _rowIndex) => {
434
+ const isFFEnabled = floatingFilterOpts.enabled
435
+ const isFFTop = floatingFilterOpts.position === 'top'
436
+ const rowVNs: VNode[] = []
437
+
438
+ if (isFFEnabled && isFFTop) {
439
+ rowVNs.push(
440
+ h('tr', {
441
+ key: 'fft',
442
+ class: ['vxe-header--row is--floating-filters', '' + (floatingFilterOpts.rowClassName || '')]
443
+ }, renderFilterRows(isOptimizeMode, renderColumnList))
444
+ )
445
+ }
446
+
447
+ headerGroups.forEach((cols, _rowIndex) => {
423
448
  const params = { $table: $xeTable, rowIndex: _rowIndex, _rowIndex, $rowIndex: _rowIndex, fixed: fixedType, type: renderType }
424
- return h(
425
- 'tr',
426
- {
449
+ rowVNs.push(
450
+ h('tr', {
427
451
  key: _rowIndex,
428
452
  class: ['vxe-header--row', headerRowClassName ? (XEUtils.isFunction(headerRowClassName) ? headerRowClassName(params) : headerRowClassName) : ''],
429
453
  style: headerRowStyle ? (XEUtils.isFunction(headerRowStyle) ? headerRowStyle(params) : headerRowStyle) : null
430
- },
431
- renderRows(isGroup, isOptimizeMode, headerGroups, _rowIndex, cols)
454
+ }, renderRows(isGroup, isOptimizeMode, headerGroups, _rowIndex, cols))
432
455
  )
433
456
  })
434
457
 
435
- if (floatingFilterOpts.enabled) {
458
+ if (isFFEnabled && !isFFTop) {
436
459
  rowVNs.push(
437
- h(
438
- 'tr',
439
- {
440
- key: 'ff',
441
- class: ['vxe-header--row is--floating-filters', '' + (floatingFilterOpts.rowClassName || '')]
442
- },
443
- renderFilterRows(isOptimizeMode, renderColumnList)
444
- )
460
+ h('tr', {
461
+ key: 'ffb',
462
+ class: ['vxe-header--row is--floating-filters', '' + (floatingFilterOpts.rowClassName || '')]
463
+ }, renderFilterRows(isOptimizeMode, renderColumnList))
445
464
  )
446
465
  }
447
466
 
@@ -173,7 +173,8 @@ VxeUI.setConfig({
173
173
  maxHeight: 320
174
174
  },
175
175
  floatingFilterConfig: {
176
- // enabled: false
176
+ // enabled: false,
177
+ padding: true
177
178
  },
178
179
  aggregateConfig: {
179
180
  padding: true,