vxe-table 4.23.0-beta.1 → 4.23.0-beta.2

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 (52) hide show
  1. package/README.md +2 -2
  2. package/dist/all.esm.js +499 -87
  3. package/dist/style.css +1 -1
  4. package/dist/style.min.css +1 -1
  5. package/es/index.css +1 -1
  6. package/es/index.min.css +1 -1
  7. package/es/style.css +1 -1
  8. package/es/style.min.css +1 -1
  9. package/es/table/src/props.js +6 -2
  10. package/es/table/src/scrollbar.js +54 -0
  11. package/es/table/src/table.js +427 -81
  12. package/es/table/src/util.js +11 -2
  13. package/es/table/style.css +30 -0
  14. package/es/table/style.min.css +1 -1
  15. package/es/ui/index.js +1 -1
  16. package/es/ui/src/log.js +1 -1
  17. package/es/vxe-table/style.css +30 -0
  18. package/es/vxe-table/style.min.css +1 -1
  19. package/lib/index.css +1 -1
  20. package/lib/index.min.css +1 -1
  21. package/lib/index.umd.js +106 -28
  22. package/lib/index.umd.min.js +1 -1
  23. package/lib/style.css +1 -1
  24. package/lib/style.min.css +1 -1
  25. package/lib/table/src/props.js +6 -2
  26. package/lib/table/src/props.min.js +1 -1
  27. package/lib/table/src/scrollbar.js +63 -0
  28. package/lib/table/src/scrollbar.min.js +1 -0
  29. package/lib/table/src/table.js +32 -22
  30. package/lib/table/src/table.min.js +1 -1
  31. package/lib/table/src/util.js +11 -2
  32. package/lib/table/src/util.min.js +1 -1
  33. package/lib/table/style/style.css +30 -0
  34. package/lib/table/style/style.min.css +1 -1
  35. package/lib/ui/index.js +1 -1
  36. package/lib/ui/index.min.js +1 -1
  37. package/lib/ui/src/log.js +1 -1
  38. package/lib/ui/src/log.min.js +1 -1
  39. package/lib/vxe-table/style/style.css +30 -0
  40. package/lib/vxe-table/style/style.min.css +1 -1
  41. package/package.json +2 -2
  42. package/packages/table/src/props.ts +6 -2
  43. package/packages/table/src/scrollbar.ts +57 -0
  44. package/packages/table/src/table.ts +459 -83
  45. package/packages/table/src/util.ts +15 -2
  46. package/styles/components/table.scss +65 -0
  47. /package/es/{iconfont.1791954193706.ttf → iconfont.1792035024476.ttf} +0 -0
  48. /package/es/{iconfont.1791954193706.woff → iconfont.1792035024476.woff} +0 -0
  49. /package/es/{iconfont.1791954193706.woff2 → iconfont.1792035024476.woff2} +0 -0
  50. /package/lib/{iconfont.1791954193706.ttf → iconfont.1792035024476.ttf} +0 -0
  51. /package/lib/{iconfont.1791954193706.woff → iconfont.1792035024476.woff} +0 -0
  52. /package/lib/{iconfont.1791954193706.woff2 → iconfont.1792035024476.woff2} +0 -0
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.tableProps = void 0;
7
7
  var _ui = require("../../ui");
8
+ var _utils = require("../../ui/src/utils");
8
9
  const {
9
10
  getConfig
10
11
  } = _ui.VxeUI;
@@ -84,7 +85,10 @@ const tableProps = exports.tableProps = {
84
85
  type: Boolean,
85
86
  default: () => getConfig().table.highlightCurrentRow
86
87
  },
87
- // (即将废弃)鼠标移到行是否要高亮显示
88
+ /**
89
+ * (即将废弃)鼠标移到行是否要高亮显示
90
+ * @deprecated
91
+ */
88
92
  highlightHoverRow: {
89
93
  type: Boolean,
90
94
  default: () => getConfig().table.highlightHoverRow
@@ -309,7 +313,7 @@ const tableProps = exports.tableProps = {
309
313
  virtualYConfig: Object,
310
314
  useScrollbar: {
311
315
  type: Boolean,
312
- default: () => getConfig().table.useScrollbar
316
+ default: () => (0, _utils.getDefaultConfig)(getConfig().table.useScrollbar, getConfig().useScrollbar)
313
317
  },
314
318
  // 滚动条配置项
315
319
  scrollbarConfig: Object,
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.tableProps=void 0;var _ui=require("../../ui");let getConfig=_ui.VxeUI.getConfig,tableProps=exports.tableProps={id:[String,Function],data:Array,height:[Number,String],minHeight:{type:[Number,String],default:()=>null},maxHeight:[Number,String],resizable:{type:Boolean,default:()=>getConfig().table.resizable},stripe:{type:Boolean,default:()=>getConfig().table.stripe},border:{type:[Boolean,String],default:()=>getConfig().table.border},padding:{type:Boolean,default:null},round:{type:Boolean,default:()=>getConfig().table.round},size:{type:String,default:()=>getConfig().table.size||getConfig().size},fit:{type:Boolean,default:()=>getConfig().table.fit},loading:Boolean,align:{type:String,default:()=>getConfig().table.align},headerAlign:{type:String,default:()=>getConfig().table.headerAlign},footerAlign:{type:String,default:()=>getConfig().table.footerAlign},showHeader:{type:Boolean,default:()=>getConfig().table.showHeader},highlightCurrentRow:{type:Boolean,default:()=>getConfig().table.highlightCurrentRow},highlightHoverRow:{type:Boolean,default:()=>getConfig().table.highlightHoverRow},highlightCurrentColumn:{type:Boolean,default:()=>getConfig().table.highlightCurrentColumn},highlightHoverColumn:{type:Boolean,default:()=>getConfig().table.highlightHoverColumn},highlightCell:Boolean,showFooter:Boolean,footerData:Array,footerMethod:Function,rowClassName:[String,Function],cellClassName:[String,Function],headerRowClassName:[String,Function],headerCellClassName:[String,Function],footerRowClassName:[String,Function],footerCellClassName:[String,Function],cellStyle:[Object,Function],headerCellStyle:[Object,Function],footerCellStyle:[Object,Function],rowStyle:[Object,Function],headerRowStyle:[Object,Function],footerRowStyle:[Object,Function],showCustomHeader:{type:Boolean,default:()=>getConfig().table.showCustomHeader},mergeHeaderCells:Array,mergeCells:Array,mergeFooterCells:Array,mergeFooterItems:Array,spanMethod:Function,footerSpanMethod:Function,showOverflow:{type:[Boolean,String],default:()=>getConfig().table.showOverflow},showHeaderOverflow:{type:[Boolean,String],default:()=>getConfig().table.showHeaderOverflow},showFooterOverflow:{type:[Boolean,String],default:()=>getConfig().table.showFooterOverflow},columnKey:Boolean,rowKey:Boolean,rowId:{type:String,default:()=>getConfig().table.rowId},zIndex:Number,emptyText:{type:String,default:()=>getConfig().table.emptyText},keepSource:{type:Boolean,default:()=>getConfig().table.keepSource},autoResize:{type:Boolean,default:()=>getConfig().table.autoResize},syncResize:[Boolean,String,Number],resizeConfig:Object,columnConfig:Object,currentColumnConfig:Object,cellConfig:Object,headerCellConfig:Object,footerCellConfig:Object,rowConfig:Object,aggregateConfig:Object,aggregateAccuracyConfig:Object,rowGroupConfig:Object,currentRowConfig:Object,dragConfig:Object,rowDragConfig:Object,columnDragConfig:Object,resizableConfig:Object,seqConfig:Object,sortConfig:Object,filterConfig:Object,floatingFilterConfig:Object,radioConfig:Object,checkboxConfig:Object,tooltipConfig:Object,headerTooltipConfig:Object,footerTooltipConfig:Object,exportConfig:Object,importConfig:Object,printConfig:Object,expandConfig:Object,treeConfig:Object,menuConfig:Object,mouseConfig:Object,areaConfig:Object,keyboardConfig:Object,clipConfig:Object,fnrConfig:Object,editConfig:Object,editDirtyConfig:Object,validConfig:Object,editRules:Object,loadingConfig:Object,emptyRender:Object,customConfig:Object,scrollX:Object,scrollY:Object,virtualXConfig:Object,virtualYConfig:Object,useScrollbar:{type:Boolean,default:()=>getConfig().table.useScrollbar},scrollbarConfig:Object,undoRedoHistoryConfig:Object,animat:{type:Boolean,default:()=>getConfig().table.animat},delayHover:{type:Number,default:()=>getConfig().table.delayHover},rendererConfig:Object,params:Object};
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.tableProps=void 0;var _ui=require("../../ui"),_utils=require("../../ui/src/utils");let getConfig=_ui.VxeUI.getConfig,tableProps=exports.tableProps={id:[String,Function],data:Array,height:[Number,String],minHeight:{type:[Number,String],default:()=>null},maxHeight:[Number,String],resizable:{type:Boolean,default:()=>getConfig().table.resizable},stripe:{type:Boolean,default:()=>getConfig().table.stripe},border:{type:[Boolean,String],default:()=>getConfig().table.border},padding:{type:Boolean,default:null},round:{type:Boolean,default:()=>getConfig().table.round},size:{type:String,default:()=>getConfig().table.size||getConfig().size},fit:{type:Boolean,default:()=>getConfig().table.fit},loading:Boolean,align:{type:String,default:()=>getConfig().table.align},headerAlign:{type:String,default:()=>getConfig().table.headerAlign},footerAlign:{type:String,default:()=>getConfig().table.footerAlign},showHeader:{type:Boolean,default:()=>getConfig().table.showHeader},highlightCurrentRow:{type:Boolean,default:()=>getConfig().table.highlightCurrentRow},highlightHoverRow:{type:Boolean,default:()=>getConfig().table.highlightHoverRow},highlightCurrentColumn:{type:Boolean,default:()=>getConfig().table.highlightCurrentColumn},highlightHoverColumn:{type:Boolean,default:()=>getConfig().table.highlightHoverColumn},highlightCell:Boolean,showFooter:Boolean,footerData:Array,footerMethod:Function,rowClassName:[String,Function],cellClassName:[String,Function],headerRowClassName:[String,Function],headerCellClassName:[String,Function],footerRowClassName:[String,Function],footerCellClassName:[String,Function],cellStyle:[Object,Function],headerCellStyle:[Object,Function],footerCellStyle:[Object,Function],rowStyle:[Object,Function],headerRowStyle:[Object,Function],footerRowStyle:[Object,Function],showCustomHeader:{type:Boolean,default:()=>getConfig().table.showCustomHeader},mergeHeaderCells:Array,mergeCells:Array,mergeFooterCells:Array,mergeFooterItems:Array,spanMethod:Function,footerSpanMethod:Function,showOverflow:{type:[Boolean,String],default:()=>getConfig().table.showOverflow},showHeaderOverflow:{type:[Boolean,String],default:()=>getConfig().table.showHeaderOverflow},showFooterOverflow:{type:[Boolean,String],default:()=>getConfig().table.showFooterOverflow},columnKey:Boolean,rowKey:Boolean,rowId:{type:String,default:()=>getConfig().table.rowId},zIndex:Number,emptyText:{type:String,default:()=>getConfig().table.emptyText},keepSource:{type:Boolean,default:()=>getConfig().table.keepSource},autoResize:{type:Boolean,default:()=>getConfig().table.autoResize},syncResize:[Boolean,String,Number],resizeConfig:Object,columnConfig:Object,currentColumnConfig:Object,cellConfig:Object,headerCellConfig:Object,footerCellConfig:Object,rowConfig:Object,aggregateConfig:Object,aggregateAccuracyConfig:Object,rowGroupConfig:Object,currentRowConfig:Object,dragConfig:Object,rowDragConfig:Object,columnDragConfig:Object,resizableConfig:Object,seqConfig:Object,sortConfig:Object,filterConfig:Object,floatingFilterConfig:Object,radioConfig:Object,checkboxConfig:Object,tooltipConfig:Object,headerTooltipConfig:Object,footerTooltipConfig:Object,exportConfig:Object,importConfig:Object,printConfig:Object,expandConfig:Object,treeConfig:Object,menuConfig:Object,mouseConfig:Object,areaConfig:Object,keyboardConfig:Object,clipConfig:Object,fnrConfig:Object,editConfig:Object,editDirtyConfig:Object,validConfig:Object,editRules:Object,loadingConfig:Object,emptyRender:Object,customConfig:Object,scrollX:Object,scrollY:Object,virtualXConfig:Object,virtualYConfig:Object,useScrollbar:{type:Boolean,default:()=>(0,_utils.getDefaultConfig)(getConfig().table.useScrollbar,getConfig().useScrollbar)},scrollbarConfig:Object,undoRedoHistoryConfig:Object,animat:{type:Boolean,default:()=>getConfig().table.animat},delayHover:{type:Number,default:()=>getConfig().table.delayHover},rendererConfig:Object,params:Object};
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getScrollFromClick = getScrollFromClick;
7
+ exports.getScrollFromDrag = getScrollFromDrag;
8
+ exports.getThumbOffsetSize = getThumbOffsetSize;
9
+ exports.getThumbSize = getThumbSize;
10
+ /**
11
+ * 计算滚动条滑块的长度
12
+ */
13
+ function getThumbSize(viewportSize, contentSize, trackSize) {
14
+ if (contentSize <= viewportSize) {
15
+ return 0;
16
+ }
17
+ const ratio = viewportSize / contentSize;
18
+ const ideal = trackSize * ratio;
19
+ return Math.max(20, Math.min(ideal, trackSize));
20
+ }
21
+ /**
22
+ * 计算滚动条滑块的偏移位置
23
+ */
24
+ function getThumbOffsetSize(offsetSize, viewportSize, contentSize, trackSize, thumbSize) {
25
+ const maxScroll = contentSize - viewportSize;
26
+ if (maxScroll <= 0) {
27
+ return 0;
28
+ }
29
+ const maxThumbOffset = trackSize - thumbSize;
30
+ if (maxThumbOffset <= 0) {
31
+ return 0;
32
+ }
33
+ const clamped = Math.min(Math.max(offsetSize, 0), maxScroll);
34
+ const ratio = clamped / maxScroll;
35
+ return ratio * maxThumbOffset;
36
+ }
37
+ /**
38
+ * 根据点击轨道的位置,计算滑块的偏移位置
39
+ */
40
+ function getScrollFromClick(clickPosition, viewportSize, contentSize, trackSize, thumbSize) {
41
+ const maxThumbOffset = trackSize - thumbSize;
42
+ const maxScroll = contentSize - viewportSize;
43
+ if (maxScroll <= 0 || maxThumbOffset <= 0) {
44
+ return 0;
45
+ }
46
+ let thumbOffset = clickPosition - thumbSize / 2;
47
+ thumbOffset = Math.min(Math.max(thumbOffset, 0), maxThumbOffset);
48
+ const scrollOffset = thumbOffset / maxThumbOffset * maxScroll;
49
+ return scrollOffset;
50
+ }
51
+ /**
52
+ * 拖拽 thumb 时,根据鼠标位置计算滑块的偏移位置
53
+ */
54
+ function getScrollFromDrag(pointerPosition, dragOffset, viewportSize, contentSize, trackSize, thumbSize) {
55
+ const maxScroll = contentSize - viewportSize;
56
+ const maxThumbOffset = trackSize - thumbSize;
57
+ if (maxScroll <= 0 || maxThumbOffset <= 0) {
58
+ return 0;
59
+ }
60
+ let thumbOffset = pointerPosition - dragOffset;
61
+ thumbOffset = Math.min(Math.max(thumbOffset, 0), maxThumbOffset);
62
+ return thumbOffset / maxThumbOffset * maxScroll;
63
+ }
@@ -0,0 +1 @@
1
+ function getThumbSize(t,e,r){return e<=t?0:Math.max(20,Math.min(r*(t/e),r))}function getThumbOffsetSize(t,e,r,o,m){r-=e;return r<=0||(e=o-m)<=0?0:Math.min(Math.max(t,0),r)/r*e}function getScrollFromClick(t,e,r,o,m){o-=m,r-=e;return r<=0||o<=0?0:(e=t-m/2,(e=Math.min(Math.max(e,0),o))/o*r)}function getScrollFromDrag(t,e,r,o,m,i){o-=r,r=m-i;return o<=0||r<=0?0:(m=t-e,(m=Math.min(Math.max(m,0),r))/r*o)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getScrollFromClick=getScrollFromClick,exports.getScrollFromDrag=getScrollFromDrag,exports.getThumbOffsetSize=getThumbOffsetSize,exports.getThumbSize=getThumbSize;