vxe-pc-ui 4.20.6 → 4.20.7

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 (64) hide show
  1. package/dist/all.esm.js +5135 -5080
  2. package/dist/style.css +1 -1
  3. package/dist/style.min.css +1 -1
  4. package/es/icon/style.css +1 -1
  5. package/es/scrollbar/src/scrollbar.js +20 -3
  6. package/es/scrollbar/style.css +11 -0
  7. package/es/scrollbar/style.min.css +1 -1
  8. package/es/style.css +1 -1
  9. package/es/style.min.css +1 -1
  10. package/es/tabs/src/tabs.js +5 -3
  11. package/es/tooltip/src/tooltip.js +45 -8
  12. package/es/tooltip/style.css +2 -1
  13. package/es/tooltip/style.min.css +1 -1
  14. package/es/ui/index.js +1 -1
  15. package/es/ui/src/log.js +1 -1
  16. package/es/vxe-scrollbar/style.css +11 -0
  17. package/es/vxe-scrollbar/style.min.css +1 -1
  18. package/es/vxe-tooltip/style.css +2 -1
  19. package/es/vxe-tooltip/style.min.css +1 -1
  20. package/lib/icon/style/style.css +1 -1
  21. package/lib/icon/style/style.min.css +1 -1
  22. package/lib/index.umd.js +4617 -4339
  23. package/lib/index.umd.min.js +1 -1
  24. package/lib/scrollbar/src/scrollbar.js +22 -3
  25. package/lib/scrollbar/src/scrollbar.min.js +1 -1
  26. package/lib/scrollbar/style/style.css +11 -0
  27. package/lib/scrollbar/style/style.min.css +1 -1
  28. package/lib/style.css +1 -1
  29. package/lib/style.min.css +1 -1
  30. package/lib/tabs/src/tabs.js +45 -33
  31. package/lib/tabs/src/tabs.min.js +1 -1
  32. package/lib/tooltip/src/tooltip.js +79 -29
  33. package/lib/tooltip/src/tooltip.min.js +1 -1
  34. package/lib/tooltip/style/style.css +2 -1
  35. package/lib/tooltip/style/style.min.css +1 -1
  36. package/lib/ui/index.js +1 -1
  37. package/lib/ui/index.min.js +1 -1
  38. package/lib/ui/src/log.js +1 -1
  39. package/lib/ui/src/log.min.js +1 -1
  40. package/lib/vxe-scrollbar/style/style.css +11 -0
  41. package/lib/vxe-scrollbar/style/style.min.css +1 -1
  42. package/lib/vxe-tooltip/style/style.css +2 -1
  43. package/lib/vxe-tooltip/style/style.min.css +1 -1
  44. package/package.json +2 -2
  45. package/packages/scrollbar/src/scrollbar.ts +20 -2
  46. package/packages/tabs/src/tabs.ts +6 -3
  47. package/packages/tooltip/src/tooltip.ts +47 -9
  48. package/styles/components/scrollbar.scss +15 -1
  49. package/styles/components/tooltip.scss +2 -1
  50. package/types/components/scrollbar.d.ts +19 -1
  51. package/types/components/table.d.ts +1 -0
  52. package/types/components/tooltip.d.ts +21 -0
  53. /package/es/icon/{iconfont.1792054434227.ttf → iconfont.1792080138286.ttf} +0 -0
  54. /package/es/icon/{iconfont.1792054434227.woff → iconfont.1792080138286.woff} +0 -0
  55. /package/es/icon/{iconfont.1792054434227.woff2 → iconfont.1792080138286.woff2} +0 -0
  56. /package/es/{iconfont.1792054434227.ttf → iconfont.1792080138286.ttf} +0 -0
  57. /package/es/{iconfont.1792054434227.woff → iconfont.1792080138286.woff} +0 -0
  58. /package/es/{iconfont.1792054434227.woff2 → iconfont.1792080138286.woff2} +0 -0
  59. /package/lib/icon/style/{iconfont.1792054434227.ttf → iconfont.1792080138286.ttf} +0 -0
  60. /package/lib/icon/style/{iconfont.1792054434227.woff → iconfont.1792080138286.woff} +0 -0
  61. /package/lib/icon/style/{iconfont.1792054434227.woff2 → iconfont.1792080138286.woff2} +0 -0
  62. /package/lib/{iconfont.1792054434227.ttf → iconfont.1792080138286.ttf} +0 -0
  63. /package/lib/{iconfont.1792054434227.woff → iconfont.1792080138286.woff} +0 -0
  64. /package/lib/{iconfont.1792054434227.woff2 → iconfont.1792080138286.woff2} +0 -0
@@ -49,6 +49,10 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
49
49
  props: {
50
50
  id: [String, Number],
51
51
  viewId: [String, Number],
52
+ theme: {
53
+ type: String,
54
+ default: () => getConfig().scrollbar.theme
55
+ },
52
56
  width: [String, Number],
53
57
  height: [String, Number],
54
58
  minWidth: [String, Number],
@@ -82,6 +86,10 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
82
86
  type: Object,
83
87
  default: () => getConfig().scrollbar.viewAttrs
84
88
  },
89
+ viewStyle: {
90
+ type: Object,
91
+ default: () => getConfig().scrollbar.viewStyle
92
+ },
85
93
  viewClassName: {
86
94
  type: String,
87
95
  default: () => getConfig().scrollbar.viewClassName
@@ -187,6 +195,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
187
195
  const computeWrapperClss = (0, _vue.computed)(() => {
188
196
  const {
189
197
  native,
198
+ theme,
190
199
  className,
191
200
  padding
192
201
  } = props;
@@ -200,7 +209,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
200
209
  const yVisible = computeYVisible.value;
201
210
  const xAutoHide = computeXAutoHide.value;
202
211
  const yAutoHide = computeYAutoHide.value;
203
- return domUtils.buildClass(['vxe-scrollbar', `ov-x--${xVisible === false ? 'hidden' : 'visible'}`, `ov-y--${yVisible === false ? 'hidden' : 'visible'}`, `sx-pos--${xToTop ? 'top' : 'bottom'}`, `sy-pos--${yToLeft ? 'left' : 'right'}`, native ? 'is--native' : 'is--virtual', className], {
212
+ return domUtils.buildClass(['vxe-scrollbar', theme ? `theme--${theme}` : '', `ov-x--${xVisible === false ? 'hidden' : 'visible'}`, `ov-y--${yVisible === false ? 'hidden' : 'visible'}`, `sx-pos--${xToTop ? 'top' : 'bottom'}`, `sy-pos--${yToLeft ? 'left' : 'right'}`, native ? 'is--native' : 'is--virtual', className], {
204
213
  'is--padding': padding,
205
214
  'ov-x--auto-hide': xAutoHide,
206
215
  'ov-y--auto-hide': yAutoHide,
@@ -254,6 +263,14 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
254
263
  };
255
264
  const scrollbarMethods = {
256
265
  dispatchEvent,
266
+ getViewElem() {
267
+ const viewEl = refViewElem.value;
268
+ return viewEl || null;
269
+ },
270
+ getViewInnerElem() {
271
+ const viewInnerEl = refViewInnerElem.value;
272
+ return viewInnerEl || null;
273
+ },
257
274
  scrollTo(left, top) {
258
275
  const viewEl = refViewElem.value;
259
276
  if (viewEl) {
@@ -579,7 +596,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
579
596
  native,
580
597
  loading,
581
598
  viewId,
582
- viewAttrs
599
+ viewAttrs,
600
+ viewStyle
583
601
  } = props;
584
602
  const wrapperStyle = computeWrapperStyle.value;
585
603
  const wrapperClss = computeWrapperClss.value;
@@ -597,7 +615,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
597
615
  ref: refViewElem,
598
616
  class: viewClss,
599
617
  onScroll: scrollEvent,
600
- id: viewId || null
618
+ id: viewId || null,
619
+ style: viewStyle
601
620
  }, viewAttrs), [(0, _vue.h)('div', {
602
621
  key: 'vi',
603
622
  ref: refViewInnerElem,
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_dom=require("../../ui/src/dom"),_utils=require("../../ui/src/utils"),_loading=_interopRequireDefault(require("../../loading"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let{getConfig,createEvent,domUtils,scrollbarUtils,globalResize,globalEvents,renderEmptyElement}=_ui.VxeUI,{getThumbOffsetSize,getThumbSize,getScrollFromClick,getScrollFromDrag}=scrollbarUtils;function createReactData(){return{yThumbHeight:0,xThumbWidth:0}}function createInternalData(){return{thumbDragOffset:0,yThumbTop:0,xThumbLeft:0,lastScrollTop:0,lastScrollLeft:0}}var _default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeScrollbar",props:{id:[String,Number],viewId:[String,Number],width:[String,Number],height:[String,Number],minWidth:[String,Number],minHeight:[String,Number],maxWidth:[String,Number],maxHeight:[String,Number],loading:Boolean,native:{type:Boolean,default:()=>getConfig().scrollbar.native},padding:{type:Boolean,default:()=>getConfig().scrollbar.padding},autoHide:{type:Boolean,default:()=>getConfig().scrollbar.autoHide},visible:{type:Boolean,default:()=>getConfig().scrollbar.visible},xConfig:Object,yConfig:Object,className:{type:String,default:()=>getConfig().scrollbar.className},viewAttrs:{type:Object,default:()=>getConfig().scrollbar.viewAttrs},viewClassName:{type:String,default:()=>getConfig().scrollbar.viewClassName},viewInnerClassName:{type:String,default:()=>getConfig().scrollbar.viewInnerClassName},autoResize:{type:Boolean,default:()=>getConfig().scrollbar.autoResize},syncResize:[Boolean,String,Number]},emits:["scroll","scroll-boundary"],setup(h,e){let{emit:i,slots:g}=e;var t=_xeUtils.default.uniqueId();let d=(0,_vue.ref)(),m=(0,_vue.ref)(),f=(0,_vue.ref)(),b=(0,_vue.ref)(),p=(0,_vue.ref)(),_=(0,_vue.ref)(),T=(0,_vue.ref)(),x=(0,_vue.reactive)(createReactData()),C=createInternalData(),y=(0,_vue.computed)(()=>{var{width:e,height:t,minWidth:l,minHeight:i,maxWidth:r,maxHeight:a}=h,o=c.value,u=s.value,n={};return e&&(n.width=(0,_dom.toCssUnit)(e)),t&&(n.height=(0,_dom.toCssUnit)(t)),l&&(n.minWidth=(0,_dom.toCssUnit)(l)),i&&(n.minHeight=(0,_dom.toCssUnit)(i)),r&&(n.maxWidth=(0,_dom.toCssUnit)(r)),a&&(n.maxHeight=(0,_dom.toCssUnit)(a)),(o||u)&&(n["--vxe-ui-scrollbar-y-width"]=(0,_dom.toCssUnit)(o||u),n["--vxe-ui-scrollbar-x-height"]=(0,_dom.toCssUnit)(u||o)),n}),s=(0,_vue.computed)(()=>R.value.height),c=(0,_vue.computed)(()=>U.value.width),H=(0,_vue.computed)(()=>{var e=h.visible,t=R.value;return(0,_utils.getDefaultConfig)(t.visible,e)}),w=(0,_vue.computed)(()=>{var e=h.visible,t=U.value;return(0,_utils.getDefaultConfig)(t.visible,e)}),v=(0,_vue.computed)(()=>{var e=h.autoHide,t=R.value;return(0,_utils.getDefaultConfig)(t.autoHide,e)}),S=(0,_vue.computed)(()=>{var e=h.autoHide,t=U.value;return(0,_utils.getDefaultConfig)(t.autoHide,e)}),W=(0,_vue.computed)(()=>{var{native:e,className:t,padding:l}=h,{yThumbHeight:i,xThumbWidth:r}=x,a=z.value,o=L.value,u=H.value,n=w.value,s=v.value,c=S.value;return domUtils.buildClass(["vxe-scrollbar","ov-x--"+(!1===u?"hidden":"visible"),"ov-y--"+(!1===n?"hidden":"visible"),"sx-pos--"+(a?"top":"bottom"),"sy-pos--"+(o?"left":"right"),e?"is--native":"is--virtual",t],{"is--padding":l,"ov-x--auto-hide":s,"ov-y--auto-hide":c,"overflow-y":i,"overflow-x":r})}),D=(0,_vue.computed)(()=>{var e=h.viewClassName;return domUtils.buildClass(["vxe-scrollbar--view",e])}),N=(0,_vue.computed)(()=>{var e=h.viewInnerClassName;return domUtils.buildClass(["vxe-scrollbar--view-inner",e])}),R=(0,_vue.computed)(()=>Object.assign({},getConfig().scrollbar.xConfig,h.xConfig)),U=(0,_vue.computed)(()=>Object.assign({},getConfig().scrollbar.yConfig,h.yConfig)),z=(0,_vue.computed)(()=>"top"===R.value.position),L=(0,_vue.computed)(()=>"left"===U.value.position),l={refElem:d},r={},O={xID:t,props:h,context:e,reactData:x,internalData:C,getRefMaps:()=>l,getComputeMaps:()=>r},E=(e,t,l)=>{i(e,createEvent(l,{$scrollbar:O},t))};t={dispatchEvent:E,scrollTo(e,t){var l=m.value;l&&(_xeUtils.default.isNumber(e)?l.scrollTo(e,t||0):l.scrollTo(e))},scrollIntoView(){var e=m.value;e&&e.scrollIntoView()},setScrollTop(e){var t=m.value;t&&(t.scrollTop=e)},setScrollLeft(e){var t=m.value;t&&(t.scrollLeft=e)},getScrollTop(){var e=m.value;return e?e.scrollTop:0},getScrollLeft(){var e=m.value;return e?e.scrollLeft:0},clearScroll(){var e=m.value;e&&(e.scrollTop=0,e.scrollLeft=0)},recalculate(){return a(),I(),(0,_vue.nextTick)()}};let a=()=>{var e,t,l=m.value;l&&l.clientHeight&&(t=(t=b.value)?getThumbSize(l.clientWidth,l.scrollWidth,t.clientWidth):0,(e=_.value)&&(e.style.width=t+"px"),x.xThumbWidth=t,t=(e=p.value)?getThumbSize(l.clientHeight,l.scrollHeight,e.clientHeight):0,(l=T.value)&&(l.style.height=t+"px"),x.yThumbHeight=t)},I=()=>{var e,t,l,i,r=m.value;r&&r.clientHeight&&({xThumbWidth:t,yThumbHeight:e}=x,i=b.value,l=_.value,i=i&&t?getThumbOffsetSize(r.scrollLeft,r.clientWidth,r.scrollWidth,i.clientWidth,t):0,C.xThumbLeft=i,l&&t&&(l.style.width=t+"px",l.style.transform=`translateX(${i}px)`),t=p.value,l=T.value,i=t&&e?getThumbOffsetSize(r.scrollTop,r.clientHeight,r.scrollHeight,t.clientHeight,e):0,C.yThumbTop=i,l)&&e&&(l.style.height=e+"px",l.style.transform=`translateY(${i}px)`)},P=e=>{var{xThumbWidth:t,yThumbHeight:l}=x,{lastScrollTop:i,lastScrollLeft:r}=C,a=R.value,o=U.value,{scrollTop:u,scrollLeft:n,clientWidth:s,clientHeight:c,scrollHeight:v,scrollWidth:h}=e.currentTarget;let g="",d=!1,m=!1,f=!1,b=!1;i!==u&&(o=_xeUtils.default.toNumber(o.threshold)||1,i<u?(g="bottom",0<l&&v-o<=u+c&&(m=!0)):(g="top",0<l&&u<=o&&(d=!0))),r!==n&&(i=_xeUtils.default.toNumber(a.threshold)||1,r<n?(g="right",0<t&&h-i<=n+s&&(b=!0)):(g="left",0<t&&n<=i&&(f=!0))),I(),C.lastScrollTop=u,C.lastScrollLeft=n,(m||d||b||f)&&E("scroll-boundary",{direction:g,isTop:d,isBottom:m,isLeft:f,isRight:b,scrollTop:u,scrollLeft:n,clientWidth:s,clientHeight:c,scrollHeight:v,scrollWidth:h},e),E("scroll",{direction:g,isTop:0<l&&u<=0,isBottom:0<l&&v<=u+c,isLeft:0<t&&n<=0,isRight:0<t&&h<=n+s,scrollTop:u,scrollLeft:n,clientWidth:s,clientHeight:c,scrollHeight:v,scrollWidth:h},e)},k=e=>{var t,l,i,r=e.currentTarget;r===e.target&&(t=m.value)&&(l=x.xThumbWidth,i=r.getBoundingClientRect(),t.scrollTo({left:getScrollFromClick(e.clientX-i.left,t.clientWidth,t.scrollWidth,r.clientWidth,l),behavior:"auto"}))},q=e=>{var t,l,i,r=e.currentTarget;r===e.target&&(t=m.value)&&(l=x.yThumbHeight,i=r.getBoundingClientRect(),t.scrollTo({top:getScrollFromClick(e.clientY-i.top,t.clientHeight,t.scrollHeight,r.clientHeight,l),behavior:"auto"}))},j=e=>{var t,l,i=e.currentTarget,r=(C.isThumbDrag=!0,i.setPointerCapture(e.pointerId),m.value);r&&(t=x.xThumbWidth,l=(i=i.parentElement).getBoundingClientRect(),e=e.clientX-l.left,l=getThumbOffsetSize(r.scrollLeft,r.clientWidth,r.scrollWidth,i.clientWidth,t),C.thumbDragOffset=e-l)},V=t=>{let e=t.currentTarget;if(e.hasPointerCapture(t.pointerId)){var{isThumbDrag:l,thumbDragOffset:i}=C;if(l){l=m.value;if(l){var r=x.xThumbWidth;let e=t.currentTarget;var a=e.parentElement,o=a.getBoundingClientRect();l.scrollLeft=getScrollFromDrag(t.clientX-o.left,i,l.clientWidth,l.scrollWidth,a.clientWidth,r)}}}},B=e=>{e.currentTarget.releasePointerCapture(e.pointerId),C.isThumbDrag=!1},F=e=>{var t,l,i=e.currentTarget,r=(C.isThumbDrag=!0,i.setPointerCapture(e.pointerId),m.value);r&&(t=x.yThumbHeight,l=(i=i.parentElement).getBoundingClientRect(),e=e.clientY-l.top,l=getThumbOffsetSize(r.scrollTop,r.clientHeight,r.scrollHeight,i.clientHeight,t),C.thumbDragOffset=e-l)},M=t=>{let e=t.currentTarget;if(e.hasPointerCapture(t.pointerId)){var{isThumbDrag:l,thumbDragOffset:i}=C;if(l){l=m.value;if(l){var r=x.yThumbHeight;let e=t.currentTarget;var a=e.parentElement,o=a.getBoundingClientRect();l.scrollTop=getScrollFromDrag(t.clientY-o.top,i,l.clientHeight,l.scrollHeight,a.clientHeight,r)}}}};Object.assign(O,t,{});let o=(0,_vue.ref)(0);return(0,_vue.watch)(()=>h.height,()=>{o.value++}),(0,_vue.watch)(()=>h.width,()=>{o.value++}),(0,_vue.watch)(()=>h.minHeight,()=>{o.value++}),(0,_vue.watch)(()=>h.minWidth,()=>{o.value++}),(0,_vue.watch)(()=>h.maxHeight,()=>{o.value++}),(0,_vue.watch)(()=>h.maxWidth,()=>{o.value++}),(0,_vue.watch)(()=>h.native,()=>{o.value++}),(0,_vue.watch)(()=>h.syncResize,()=>{o.value++}),(0,_vue.watch)(c,()=>{o.value++}),(0,_vue.watch)(s,()=>{o.value++}),(0,_vue.watch)(H,()=>{(0,_vue.nextTick)(()=>{o.value++})}),(0,_vue.watch)(w,()=>{(0,_vue.nextTick)(()=>{o.value++})}),(0,_vue.watch)(o,()=>{O.recalculate().then(()=>{O.recalculate()})}),(0,_vue.onMounted)(()=>{var e=h.autoResize,t=m.value,l=f.value;e&&(e=globalResize.create(()=>{h.autoResize&&o.value++}),t&&e.observe(t),l&&e.observe(l),C.resizeObserver=e),o.value++,globalEvents.on(O,"resize",()=>{o.value++})}),(0,_vue.onBeforeUnmount)(()=>{var e=C.resizeObserver;e&&e.disconnect(),globalEvents.off(O,"resize")}),O.renderVN=()=>{var{id:e,native:t,loading:l,viewId:i,viewAttrs:r}=h,a=y.value,o=W.value,u=D.value,n=N.value,s=H.value,c=w.value,v=g.default;return(0,_vue.h)("div",{ref:d,id:e||null,class:o,style:a},[(0,_vue.h)("div",Object.assign({ref:m,class:u,onScroll:P,id:i||null},r),[(0,_vue.h)("div",{key:"vi",ref:f,class:n},v?v({}):[])]),t||!1===s?renderEmptyElement(O):(0,_vue.h)("div",{ref:b,class:"vxe-scrollbar--track-x",onClick:k},[(0,_vue.h)("div",{ref:_,class:"vxe-scrollbar--thumb-x",onPointerdown:j,onPointermove:V,onPointerup:B,onPointercancel:B,onLostpointercapture:B})]),t||!1===c?renderEmptyElement(O):(0,_vue.h)("div",{ref:p,class:"vxe-scrollbar--track-y",onClick:q},[(0,_vue.h)("div",{ref:T,class:"vxe-scrollbar--thumb-y",onPointerdown:F,onPointermove:M,onPointerup:B,onPointercancel:B,onLostpointercapture:B})]),(0,_vue.h)(_loading.default,{class:"vxe-scrollbar--loading",modelValue:l})])},O},render(){return this.renderVN()}});
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_comp=require("../../ui/src/comp"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_dom=require("../../ui/src/dom"),_utils=require("../../ui/src/utils"),_loading=_interopRequireDefault(require("../../loading"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let{getConfig,createEvent,domUtils,scrollbarUtils,globalResize,globalEvents,renderEmptyElement}=_ui.VxeUI,{getThumbOffsetSize,getThumbSize,getScrollFromClick,getScrollFromDrag}=scrollbarUtils;function createReactData(){return{yThumbHeight:0,xThumbWidth:0}}function createInternalData(){return{thumbDragOffset:0,yThumbTop:0,xThumbLeft:0,lastScrollTop:0,lastScrollLeft:0}}var _default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeScrollbar",props:{id:[String,Number],viewId:[String,Number],theme:{type:String,default:()=>getConfig().scrollbar.theme},width:[String,Number],height:[String,Number],minWidth:[String,Number],minHeight:[String,Number],maxWidth:[String,Number],maxHeight:[String,Number],loading:Boolean,native:{type:Boolean,default:()=>getConfig().scrollbar.native},padding:{type:Boolean,default:()=>getConfig().scrollbar.padding},autoHide:{type:Boolean,default:()=>getConfig().scrollbar.autoHide},visible:{type:Boolean,default:()=>getConfig().scrollbar.visible},xConfig:Object,yConfig:Object,className:{type:String,default:()=>getConfig().scrollbar.className},viewAttrs:{type:Object,default:()=>getConfig().scrollbar.viewAttrs},viewStyle:{type:Object,default:()=>getConfig().scrollbar.viewStyle},viewClassName:{type:String,default:()=>getConfig().scrollbar.viewClassName},viewInnerClassName:{type:String,default:()=>getConfig().scrollbar.viewInnerClassName},autoResize:{type:Boolean,default:()=>getConfig().scrollbar.autoResize},syncResize:[Boolean,String,Number]},emits:["scroll","scroll-boundary"],setup(g,e){let{emit:i,slots:d}=e;var t=_xeUtils.default.uniqueId();let m=(0,_vue.ref)(),f=(0,_vue.ref)(),b=(0,_vue.ref)(),p=(0,_vue.ref)(),_=(0,_vue.ref)(),T=(0,_vue.ref)(),x=(0,_vue.ref)(),C=(0,_vue.reactive)(createReactData()),y=createInternalData(),w=(0,_vue.computed)(()=>{var{width:e,height:t,minWidth:l,minHeight:i,maxWidth:r,maxHeight:a}=g,o=c.value,u=s.value,n={};return e&&(n.width=(0,_dom.toCssUnit)(e)),t&&(n.height=(0,_dom.toCssUnit)(t)),l&&(n.minWidth=(0,_dom.toCssUnit)(l)),i&&(n.minHeight=(0,_dom.toCssUnit)(i)),r&&(n.maxWidth=(0,_dom.toCssUnit)(r)),a&&(n.maxHeight=(0,_dom.toCssUnit)(a)),(o||u)&&(n["--vxe-ui-scrollbar-y-width"]=(0,_dom.toCssUnit)(o||u),n["--vxe-ui-scrollbar-x-height"]=(0,_dom.toCssUnit)(u||o)),n}),s=(0,_vue.computed)(()=>O.value.height),c=(0,_vue.computed)(()=>U.value.width),H=(0,_vue.computed)(()=>{var e=g.visible,t=O.value;return(0,_utils.getDefaultConfig)(t.visible,e)}),S=(0,_vue.computed)(()=>{var e=g.visible,t=U.value;return(0,_utils.getDefaultConfig)(t.visible,e)}),h=(0,_vue.computed)(()=>{var e=g.autoHide,t=O.value;return(0,_utils.getDefaultConfig)(t.autoHide,e)}),W=(0,_vue.computed)(()=>{var e=g.autoHide,t=U.value;return(0,_utils.getDefaultConfig)(t.autoHide,e)}),D=(0,_vue.computed)(()=>{var{native:e,theme:t,className:l,padding:i}=g,{yThumbHeight:r,xThumbWidth:a}=C,o=z.value,u=L.value,n=H.value,s=S.value,c=h.value,v=W.value;return domUtils.buildClass(["vxe-scrollbar",t?"theme--"+t:"","ov-x--"+(!1===n?"hidden":"visible"),"ov-y--"+(!1===s?"hidden":"visible"),"sx-pos--"+(o?"top":"bottom"),"sy-pos--"+(u?"left":"right"),e?"is--native":"is--virtual",l],{"is--padding":i,"ov-x--auto-hide":c,"ov-y--auto-hide":v,"overflow-y":r,"overflow-x":a})}),N=(0,_vue.computed)(()=>{var e=g.viewClassName;return domUtils.buildClass(["vxe-scrollbar--view",e])}),R=(0,_vue.computed)(()=>{var e=g.viewInnerClassName;return domUtils.buildClass(["vxe-scrollbar--view-inner",e])}),O=(0,_vue.computed)(()=>Object.assign({},getConfig().scrollbar.xConfig,g.xConfig)),U=(0,_vue.computed)(()=>Object.assign({},getConfig().scrollbar.yConfig,g.yConfig)),z=(0,_vue.computed)(()=>"top"===O.value.position),L=(0,_vue.computed)(()=>"left"===U.value.position),l={refElem:m},r={},E={xID:t,props:g,context:e,reactData:C,internalData:y,getRefMaps:()=>l,getComputeMaps:()=>r},I=(e,t,l)=>{i(e,createEvent(l,{$scrollbar:E},t))};t={dispatchEvent:I,getViewElem(){return f.value||null},getViewInnerElem(){return b.value||null},scrollTo(e,t){var l=f.value;l&&(_xeUtils.default.isNumber(e)?l.scrollTo(e,t||0):l.scrollTo(e))},scrollIntoView(){var e=f.value;e&&e.scrollIntoView()},setScrollTop(e){var t=f.value;t&&(t.scrollTop=e)},setScrollLeft(e){var t=f.value;t&&(t.scrollLeft=e)},getScrollTop(){var e=f.value;return e?e.scrollTop:0},getScrollLeft(){var e=f.value;return e?e.scrollLeft:0},clearScroll(){var e=f.value;e&&(e.scrollTop=0,e.scrollLeft=0)},recalculate(){return a(),B(),(0,_vue.nextTick)()}};let a=()=>{var e,t,l=f.value;l&&l.clientHeight&&(t=(t=p.value)?getThumbSize(l.clientWidth,l.scrollWidth,t.clientWidth):0,(e=T.value)&&(e.style.width=t+"px"),C.xThumbWidth=t,t=(e=_.value)?getThumbSize(l.clientHeight,l.scrollHeight,e.clientHeight):0,(l=x.value)&&(l.style.height=t+"px"),C.yThumbHeight=t)},B=()=>{var e,t,l,i,r=f.value;r&&r.clientHeight&&({xThumbWidth:t,yThumbHeight:e}=C,i=p.value,l=T.value,i=i&&t?getThumbOffsetSize(r.scrollLeft,r.clientWidth,r.scrollWidth,i.clientWidth,t):0,y.xThumbLeft=i,l&&t&&(l.style.width=t+"px",l.style.transform=`translateX(${i}px)`),t=_.value,l=x.value,i=t&&e?getThumbOffsetSize(r.scrollTop,r.clientHeight,r.scrollHeight,t.clientHeight,e):0,y.yThumbTop=i,l)&&e&&(l.style.height=e+"px",l.style.transform=`translateY(${i}px)`)},k=e=>{var{xThumbWidth:t,yThumbHeight:l}=C,{lastScrollTop:i,lastScrollLeft:r}=y,a=O.value,o=U.value,{scrollTop:u,scrollLeft:n,clientWidth:s,clientHeight:c,scrollHeight:v,scrollWidth:h}=e.currentTarget;let g="",d=!1,m=!1,f=!1,b=!1;i!==u&&(o=_xeUtils.default.toNumber(o.threshold)||1,i<u?(g="bottom",0<l&&v-o<=u+c&&(m=!0)):(g="top",0<l&&u<=o&&(d=!0))),r!==n&&(i=_xeUtils.default.toNumber(a.threshold)||1,r<n?(g="right",0<t&&h-i<=n+s&&(b=!0)):(g="left",0<t&&n<=i&&(f=!0))),B(),y.lastScrollTop=u,y.lastScrollLeft=n,(m||d||b||f)&&I("scroll-boundary",{direction:g,isTop:d,isBottom:m,isLeft:f,isRight:b,scrollTop:u,scrollLeft:n,clientWidth:s,clientHeight:c,scrollHeight:v,scrollWidth:h},e),I("scroll",{direction:g,isTop:0<l&&u<=0,isBottom:0<l&&v<=u+c,isLeft:0<t&&n<=0,isRight:0<t&&h<=n+s,scrollTop:u,scrollLeft:n,clientWidth:s,clientHeight:c,scrollHeight:v,scrollWidth:h},e)},q=e=>{var t,l,i,r=e.currentTarget;r===e.target&&(t=f.value)&&(l=C.xThumbWidth,i=r.getBoundingClientRect(),t.scrollTo({left:getScrollFromClick(e.clientX-i.left,t.clientWidth,t.scrollWidth,r.clientWidth,l),behavior:"auto"}))},V=e=>{var t,l,i,r=e.currentTarget;r===e.target&&(t=f.value)&&(l=C.yThumbHeight,i=r.getBoundingClientRect(),t.scrollTo({top:getScrollFromClick(e.clientY-i.top,t.clientHeight,t.scrollHeight,r.clientHeight,l),behavior:"auto"}))},j=e=>{var t,l,i=e.currentTarget,r=(y.isThumbDrag=!0,i.setPointerCapture(e.pointerId),f.value);r&&(t=C.xThumbWidth,l=(i=i.parentElement).getBoundingClientRect(),e=e.clientX-l.left,l=getThumbOffsetSize(r.scrollLeft,r.clientWidth,r.scrollWidth,i.clientWidth,t),y.thumbDragOffset=e-l)},F=t=>{let e=t.currentTarget;if(e.hasPointerCapture(t.pointerId)){var{isThumbDrag:l,thumbDragOffset:i}=y;if(l){l=f.value;if(l){var r=C.xThumbWidth;let e=t.currentTarget;var a=e.parentElement,o=a.getBoundingClientRect();l.scrollLeft=getScrollFromDrag(t.clientX-o.left,i,l.clientWidth,l.scrollWidth,a.clientWidth,r)}}}},P=e=>{e.currentTarget.releasePointerCapture(e.pointerId),y.isThumbDrag=!1},M=e=>{var t,l,i=e.currentTarget,r=(y.isThumbDrag=!0,i.setPointerCapture(e.pointerId),f.value);r&&(t=C.yThumbHeight,l=(i=i.parentElement).getBoundingClientRect(),e=e.clientY-l.top,l=getThumbOffsetSize(r.scrollTop,r.clientHeight,r.scrollHeight,i.clientHeight,t),y.thumbDragOffset=e-l)},X=t=>{let e=t.currentTarget;if(e.hasPointerCapture(t.pointerId)){var{isThumbDrag:l,thumbDragOffset:i}=y;if(l){l=f.value;if(l){var r=C.yThumbHeight;let e=t.currentTarget;var a=e.parentElement,o=a.getBoundingClientRect();l.scrollTop=getScrollFromDrag(t.clientY-o.top,i,l.clientHeight,l.scrollHeight,a.clientHeight,r)}}}};Object.assign(E,t,{});let o=(0,_vue.ref)(0);return(0,_vue.watch)(()=>g.height,()=>{o.value++}),(0,_vue.watch)(()=>g.width,()=>{o.value++}),(0,_vue.watch)(()=>g.minHeight,()=>{o.value++}),(0,_vue.watch)(()=>g.minWidth,()=>{o.value++}),(0,_vue.watch)(()=>g.maxHeight,()=>{o.value++}),(0,_vue.watch)(()=>g.maxWidth,()=>{o.value++}),(0,_vue.watch)(()=>g.native,()=>{o.value++}),(0,_vue.watch)(()=>g.syncResize,()=>{o.value++}),(0,_vue.watch)(c,()=>{o.value++}),(0,_vue.watch)(s,()=>{o.value++}),(0,_vue.watch)(H,()=>{(0,_vue.nextTick)(()=>{o.value++})}),(0,_vue.watch)(S,()=>{(0,_vue.nextTick)(()=>{o.value++})}),(0,_vue.watch)(o,()=>{E.recalculate().then(()=>{E.recalculate()})}),(0,_vue.onMounted)(()=>{var e=g.autoResize,t=f.value,l=b.value;e&&(e=globalResize.create(()=>{g.autoResize&&o.value++}),t&&e.observe(t),l&&e.observe(l),y.resizeObserver=e),o.value++,globalEvents.on(E,"resize",()=>{o.value++})}),(0,_vue.onBeforeUnmount)(()=>{var e=y.resizeObserver;e&&e.disconnect(),globalEvents.off(E,"resize")}),E.renderVN=()=>{var{id:e,native:t,loading:l,viewId:i,viewAttrs:r,viewStyle:a}=g,o=w.value,u=D.value,n=N.value,s=R.value,c=H.value,v=S.value,h=d.default;return(0,_vue.h)("div",{ref:m,id:e||null,class:u,style:o},[(0,_vue.h)("div",Object.assign({ref:f,class:n,onScroll:k,id:i||null,style:a},r),[(0,_vue.h)("div",{key:"vi",ref:b,class:s},h?h({}):[])]),t||!1===c?renderEmptyElement(E):(0,_vue.h)("div",{ref:p,class:"vxe-scrollbar--track-x",onClick:q},[(0,_vue.h)("div",{ref:T,class:"vxe-scrollbar--thumb-x",onPointerdown:j,onPointermove:F,onPointerup:P,onPointercancel:P,onLostpointercapture:P})]),t||!1===v?renderEmptyElement(E):(0,_vue.h)("div",{ref:_,class:"vxe-scrollbar--track-y",onClick:V},[(0,_vue.h)("div",{ref:x,class:"vxe-scrollbar--thumb-y",onPointerdown:M,onPointermove:X,onPointerup:P,onPointercancel:P,onLostpointercapture:P})]),(0,_vue.h)(_loading.default,{class:"vxe-scrollbar--loading",modelValue:l})])},E},render(){return this.renderVN()}});
@@ -141,4 +141,15 @@
141
141
  .vxe-scrollbar--thumb-x:active,
142
142
  .vxe-scrollbar--thumb-y:active {
143
143
  background-color: var(--vxe-ui-scrollbar-thumb-active-background-color);
144
+ }
145
+
146
+ .vxe-scrollbar.theme--light {
147
+ --vxe-ui-scrollbar-thumb-background-color: rgba(0,0,0,0.4);
148
+ --vxe-ui-scrollbar-thumb-hover-background-color: rgba(0,0,0,0.5);
149
+ --vxe-ui-scrollbar-thumb-active-background-color: rgba(0,0,0,0.6);
150
+ }
151
+ .vxe-scrollbar.theme--dark {
152
+ --vxe-ui-scrollbar-thumb-background-color: rgba(255,255,255,0.4);
153
+ --vxe-ui-scrollbar-thumb-hover-background-color: rgba(255,255,255,0.5);
154
+ --vxe-ui-scrollbar-thumb-active-background-color: rgba(255,255,255,0.6);
144
155
  }
@@ -1 +1 @@
1
- .vxe-scrollbar{position:relative}.vxe-scrollbar.is--virtual>.vxe-scrollbar--view{scrollbar-width:none;-ms-overflow-style:none}.vxe-scrollbar.is--virtual>.vxe-scrollbar--view::-webkit-scrollbar{display:none}.vxe-scrollbar.is--virtual.ov-x--auto-hide:hover>.vxe-scrollbar--track-x{opacity:1}.vxe-scrollbar.is--virtual.ov-x--auto-hide>.vxe-scrollbar--track-x{opacity:0;transition:opacity .8s ease-in-out}.vxe-scrollbar.is--virtual.ov-y--auto-hide:hover>.vxe-scrollbar--track-y{opacity:1}.vxe-scrollbar.is--virtual.ov-y--auto-hide>.vxe-scrollbar--track-y{opacity:0;transition:opacity .8s ease-in-out}.vxe-scrollbar.is--native>.vxe-scrollbar--view::-webkit-scrollbar{width:var(--vxe-ui-scrollbar-y-width);height:var(--vxe-ui-scrollbar-x-height)}.vxe-scrollbar.is--native>.vxe-scrollbar--view::-webkit-scrollbar-thumb{border-radius:var(--vxe-ui-base-border-radius);background-color:var(--vxe-ui-scrollbar-thumb-background-color)}.vxe-scrollbar.is--native>.vxe-scrollbar--view::-webkit-scrollbar-thumb:hover{background-color:var(--vxe-ui-scrollbar-thumb-hover-background-color)}.vxe-scrollbar.is--native>.vxe-scrollbar--view::-webkit-scrollbar-thumb:active{background-color:var(--vxe-ui-scrollbar-thumb-active-background-color)}.vxe-scrollbar.ov-x--hidden>.vxe-scrollbar--view{overflow-x:hidden}.vxe-scrollbar.ov-y--hidden>.vxe-scrollbar--view{overflow-y:hidden}.vxe-scrollbar--view{height:100%;width:100%;overflow-x:auto;overflow-y:auto}.vxe-scrollbar--track-x,.vxe-scrollbar--track-y{display:none;position:absolute;background-color:var(--vxe-ui-scrollbar-track-background-color);overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none}.vxe-scrollbar.overflow-x>.vxe-scrollbar--track-x{display:block}.vxe-scrollbar.overflow-y>.vxe-scrollbar--track-y{display:block}.vxe-scrollbar--track-x{width:100%;left:0;height:var(--vxe-ui-scrollbar-x-height);padding:var(--vxe-ui-scrollbar-track-padding) 0}.vxe-scrollbar--track-y{height:100%;top:0;width:var(--vxe-ui-scrollbar-y-width);padding:0 var(--vxe-ui-scrollbar-track-padding)}.vxe-scrollbar.sx-pos--top>.vxe-scrollbar--track-x{top:0}.vxe-scrollbar.sx-pos--bottom>.vxe-scrollbar--track-x{bottom:0}.vxe-scrollbar.sy-pos--left>.vxe-scrollbar--track-y{left:0}.vxe-scrollbar.sy-pos--right>.vxe-scrollbar--track-y{right:0}.vxe-scrollbar.overflow-x.overflow-y>.vxe-scrollbar--track-x{width:calc(100% - var(--vxe-ui-scrollbar-x-height))}.vxe-scrollbar.overflow-x.overflow-y>.vxe-scrollbar--track-y{height:calc(100% - var(--vxe-ui-scrollbar-y-width))}.vxe-scrollbar.overflow-x.overflow-y.sx-pos--top.sy-pos--left>.vxe-scrollbar--track-y,.vxe-scrollbar.overflow-x.overflow-y.sx-pos--top.sy-pos--right>.vxe-scrollbar--track-y{top:var(--vxe-ui-scrollbar-x-height)}.vxe-scrollbar.overflow-x.overflow-y.sy-pos--left.sx-pos--bottom>.vxe-scrollbar--track-x,.vxe-scrollbar.overflow-x.overflow-y.sy-pos--left.sx-pos--top>.vxe-scrollbar--track-x{left:var(--vxe-ui-scrollbar-y-width)}.vxe-scrollbar.is--padding.overflow-x.sx-pos--top{padding-top:var(--vxe-ui-scrollbar-x-height)}.vxe-scrollbar.is--padding.overflow-x.sx-pos--bottom{padding-bottom:var(--vxe-ui-scrollbar-x-height)}.vxe-scrollbar.is--padding.overflow-y.sy-pos--left{padding-left:var(--vxe-ui-scrollbar-y-width)}.vxe-scrollbar.is--padding.overflow-y.sy-pos--right{padding-right:var(--vxe-ui-scrollbar-y-width)}.vxe-scrollbar--thumb-y{width:100%}.vxe-scrollbar--thumb-x{height:100%}.vxe-scrollbar--thumb-x,.vxe-scrollbar--thumb-y{border-radius:var(--vxe-ui-scrollbar-thumb-border-radius);background-color:var(--vxe-ui-scrollbar-thumb-background-color)}.vxe-scrollbar--thumb-x:hover,.vxe-scrollbar--thumb-y:hover{background-color:var(--vxe-ui-scrollbar-thumb-hover-background-color)}.vxe-scrollbar--thumb-x:active,.vxe-scrollbar--thumb-y:active{background-color:var(--vxe-ui-scrollbar-thumb-active-background-color)}
1
+ .vxe-scrollbar{position:relative}.vxe-scrollbar.is--virtual>.vxe-scrollbar--view{scrollbar-width:none;-ms-overflow-style:none}.vxe-scrollbar.is--virtual>.vxe-scrollbar--view::-webkit-scrollbar{display:none}.vxe-scrollbar.is--virtual.ov-x--auto-hide:hover>.vxe-scrollbar--track-x{opacity:1}.vxe-scrollbar.is--virtual.ov-x--auto-hide>.vxe-scrollbar--track-x{opacity:0;transition:opacity .8s ease-in-out}.vxe-scrollbar.is--virtual.ov-y--auto-hide:hover>.vxe-scrollbar--track-y{opacity:1}.vxe-scrollbar.is--virtual.ov-y--auto-hide>.vxe-scrollbar--track-y{opacity:0;transition:opacity .8s ease-in-out}.vxe-scrollbar.is--native>.vxe-scrollbar--view::-webkit-scrollbar{width:var(--vxe-ui-scrollbar-y-width);height:var(--vxe-ui-scrollbar-x-height)}.vxe-scrollbar.is--native>.vxe-scrollbar--view::-webkit-scrollbar-thumb{border-radius:var(--vxe-ui-base-border-radius);background-color:var(--vxe-ui-scrollbar-thumb-background-color)}.vxe-scrollbar.is--native>.vxe-scrollbar--view::-webkit-scrollbar-thumb:hover{background-color:var(--vxe-ui-scrollbar-thumb-hover-background-color)}.vxe-scrollbar.is--native>.vxe-scrollbar--view::-webkit-scrollbar-thumb:active{background-color:var(--vxe-ui-scrollbar-thumb-active-background-color)}.vxe-scrollbar.ov-x--hidden>.vxe-scrollbar--view{overflow-x:hidden}.vxe-scrollbar.ov-y--hidden>.vxe-scrollbar--view{overflow-y:hidden}.vxe-scrollbar--view{height:100%;width:100%;overflow-x:auto;overflow-y:auto}.vxe-scrollbar--track-x,.vxe-scrollbar--track-y{display:none;position:absolute;background-color:var(--vxe-ui-scrollbar-track-background-color);overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none}.vxe-scrollbar.overflow-x>.vxe-scrollbar--track-x{display:block}.vxe-scrollbar.overflow-y>.vxe-scrollbar--track-y{display:block}.vxe-scrollbar--track-x{width:100%;left:0;height:var(--vxe-ui-scrollbar-x-height);padding:var(--vxe-ui-scrollbar-track-padding) 0}.vxe-scrollbar--track-y{height:100%;top:0;width:var(--vxe-ui-scrollbar-y-width);padding:0 var(--vxe-ui-scrollbar-track-padding)}.vxe-scrollbar.sx-pos--top>.vxe-scrollbar--track-x{top:0}.vxe-scrollbar.sx-pos--bottom>.vxe-scrollbar--track-x{bottom:0}.vxe-scrollbar.sy-pos--left>.vxe-scrollbar--track-y{left:0}.vxe-scrollbar.sy-pos--right>.vxe-scrollbar--track-y{right:0}.vxe-scrollbar.overflow-x.overflow-y>.vxe-scrollbar--track-x{width:calc(100% - var(--vxe-ui-scrollbar-x-height))}.vxe-scrollbar.overflow-x.overflow-y>.vxe-scrollbar--track-y{height:calc(100% - var(--vxe-ui-scrollbar-y-width))}.vxe-scrollbar.overflow-x.overflow-y.sx-pos--top.sy-pos--left>.vxe-scrollbar--track-y,.vxe-scrollbar.overflow-x.overflow-y.sx-pos--top.sy-pos--right>.vxe-scrollbar--track-y{top:var(--vxe-ui-scrollbar-x-height)}.vxe-scrollbar.overflow-x.overflow-y.sy-pos--left.sx-pos--bottom>.vxe-scrollbar--track-x,.vxe-scrollbar.overflow-x.overflow-y.sy-pos--left.sx-pos--top>.vxe-scrollbar--track-x{left:var(--vxe-ui-scrollbar-y-width)}.vxe-scrollbar.is--padding.overflow-x.sx-pos--top{padding-top:var(--vxe-ui-scrollbar-x-height)}.vxe-scrollbar.is--padding.overflow-x.sx-pos--bottom{padding-bottom:var(--vxe-ui-scrollbar-x-height)}.vxe-scrollbar.is--padding.overflow-y.sy-pos--left{padding-left:var(--vxe-ui-scrollbar-y-width)}.vxe-scrollbar.is--padding.overflow-y.sy-pos--right{padding-right:var(--vxe-ui-scrollbar-y-width)}.vxe-scrollbar--thumb-y{width:100%}.vxe-scrollbar--thumb-x{height:100%}.vxe-scrollbar--thumb-x,.vxe-scrollbar--thumb-y{border-radius:var(--vxe-ui-scrollbar-thumb-border-radius);background-color:var(--vxe-ui-scrollbar-thumb-background-color)}.vxe-scrollbar--thumb-x:hover,.vxe-scrollbar--thumb-y:hover{background-color:var(--vxe-ui-scrollbar-thumb-hover-background-color)}.vxe-scrollbar--thumb-x:active,.vxe-scrollbar--thumb-y:active{background-color:var(--vxe-ui-scrollbar-thumb-active-background-color)}.vxe-scrollbar.theme--light{--vxe-ui-scrollbar-thumb-background-color:rgba(0,0,0,0.4);--vxe-ui-scrollbar-thumb-hover-background-color:rgba(0,0,0,0.5);--vxe-ui-scrollbar-thumb-active-background-color:rgba(0,0,0,0.6)}.vxe-scrollbar.theme--dark{--vxe-ui-scrollbar-thumb-background-color:rgba(255,255,255,0.4);--vxe-ui-scrollbar-thumb-hover-background-color:rgba(255,255,255,0.5);--vxe-ui-scrollbar-thumb-active-background-color:rgba(255,255,255,0.6)}