vxe-pc-ui 4.20.1 → 4.20.5

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 (105) hide show
  1. package/dist/all.esm.js +1306 -1214
  2. package/dist/style.css +1 -1
  3. package/dist/style.min.css +1 -1
  4. package/es/card/src/card.js +2 -1
  5. package/es/drawer/src/drawer.js +59 -15
  6. package/es/drawer/style.css +13 -6
  7. package/es/drawer/style.min.css +1 -1
  8. package/es/icon/style.css +1 -1
  9. package/es/layout-aside/src/layout-aside.js +2 -1
  10. package/es/layout-body/src/layout-body.js +2 -1
  11. package/es/list/src/list.js +52 -25
  12. package/es/menu/src/menu.js +2 -2
  13. package/es/modal/src/modal.js +56 -12
  14. package/es/modal/style.css +15 -4
  15. package/es/modal/style.min.css +1 -1
  16. package/es/scrollbar/src/scrollbar.js +18 -6
  17. package/es/style.css +1 -1
  18. package/es/style.min.css +1 -1
  19. package/es/tabs/src/tabs.js +2 -2
  20. package/es/tree/src/tree.js +45 -26
  21. package/es/ui/index.js +1 -1
  22. package/es/ui/src/log.js +1 -1
  23. package/es/vxe-drawer/style.css +13 -6
  24. package/es/vxe-drawer/style.min.css +1 -1
  25. package/es/vxe-modal/style.css +15 -4
  26. package/es/vxe-modal/style.min.css +1 -1
  27. package/lib/card/src/card.js +2 -1
  28. package/lib/card/src/card.min.js +1 -1
  29. package/lib/drawer/src/drawer.js +64 -11
  30. package/lib/drawer/src/drawer.min.js +1 -1
  31. package/lib/drawer/style/style.css +13 -6
  32. package/lib/drawer/style/style.min.css +1 -1
  33. package/lib/icon/style/style.css +1 -1
  34. package/lib/icon/style/style.min.css +1 -1
  35. package/lib/index.umd.js +396 -190
  36. package/lib/index.umd.min.js +1 -1
  37. package/lib/layout-aside/src/layout-aside.js +2 -1
  38. package/lib/layout-aside/src/layout-aside.min.js +1 -1
  39. package/lib/layout-body/src/layout-body.js +2 -1
  40. package/lib/layout-body/src/layout-body.min.js +1 -1
  41. package/lib/list/src/list.js +106 -66
  42. package/lib/list/src/list.min.js +1 -1
  43. package/lib/menu/src/menu.js +1 -1
  44. package/lib/menu/src/menu.min.js +1 -1
  45. package/lib/modal/src/modal.js +61 -10
  46. package/lib/modal/src/modal.min.js +1 -1
  47. package/lib/modal/style/style.css +15 -4
  48. package/lib/modal/style/style.min.css +1 -1
  49. package/lib/scrollbar/src/scrollbar.js +33 -15
  50. package/lib/scrollbar/src/scrollbar.min.js +1 -1
  51. package/lib/style.css +1 -1
  52. package/lib/style.min.css +1 -1
  53. package/lib/tabs/src/tabs.js +1 -1
  54. package/lib/tabs/src/tabs.min.js +1 -1
  55. package/lib/tree/src/tree.js +60 -36
  56. package/lib/tree/src/tree.min.js +1 -1
  57. package/lib/ui/index.js +1 -1
  58. package/lib/ui/index.min.js +1 -1
  59. package/lib/ui/src/log.js +1 -1
  60. package/lib/ui/src/log.min.js +1 -1
  61. package/lib/vxe-drawer/style/style.css +13 -6
  62. package/lib/vxe-drawer/style/style.min.css +1 -1
  63. package/lib/vxe-modal/style/style.css +15 -4
  64. package/lib/vxe-modal/style/style.min.css +1 -1
  65. package/package.json +2 -2
  66. package/packages/card/src/card.ts +2 -1
  67. package/packages/drawer/src/drawer.ts +73 -16
  68. package/packages/layout-aside/src/layout-aside.ts +2 -1
  69. package/packages/layout-body/src/layout-body.ts +2 -1
  70. package/packages/list/src/list.ts +58 -25
  71. package/packages/menu/src/menu.ts +2 -2
  72. package/packages/modal/src/modal.ts +71 -14
  73. package/packages/scrollbar/src/scrollbar.ts +21 -6
  74. package/packages/tabs/src/tabs.ts +2 -2
  75. package/packages/tree/src/tree.ts +49 -26
  76. package/styles/components/drawer.scss +13 -6
  77. package/styles/components/modal.scss +12 -4
  78. package/types/components/drawer.d.ts +20 -0
  79. package/types/components/gantt-module/gantt-view.d.ts +24 -1
  80. package/types/components/gantt-plugins/extend-gantt-chart.d.ts +1 -1
  81. package/types/components/gantt.d.ts +2 -0
  82. package/types/components/layout-aside.d.ts +15 -0
  83. package/types/components/layout-body.d.ts +3 -0
  84. package/types/components/list.d.ts +18 -1
  85. package/types/components/modal.d.ts +20 -0
  86. package/types/components/number-input.d.ts +12 -2
  87. package/types/components/table-plugins/extend-pivot-table.d.ts +1 -1
  88. package/types/components/table.d.ts +36 -2
  89. package/types/components/tree.d.ts +15 -1
  90. package/es/scrollbar/src/util.js +0 -54
  91. package/lib/scrollbar/src/util.js +0 -63
  92. package/lib/scrollbar/src/util.min.js +0 -1
  93. package/packages/scrollbar/src/util.ts +0 -57
  94. /package/es/icon/{iconfont.1791950625324.ttf → iconfont.1792048659766.ttf} +0 -0
  95. /package/es/icon/{iconfont.1791950625324.woff → iconfont.1792048659766.woff} +0 -0
  96. /package/es/icon/{iconfont.1791950625324.woff2 → iconfont.1792048659766.woff2} +0 -0
  97. /package/es/{iconfont.1791950625324.ttf → iconfont.1792048659766.ttf} +0 -0
  98. /package/es/{iconfont.1791950625324.woff → iconfont.1792048659766.woff} +0 -0
  99. /package/es/{iconfont.1791950625324.woff2 → iconfont.1792048659766.woff2} +0 -0
  100. /package/lib/icon/style/{iconfont.1791950625324.ttf → iconfont.1792048659766.ttf} +0 -0
  101. /package/lib/icon/style/{iconfont.1791950625324.woff → iconfont.1792048659766.woff} +0 -0
  102. /package/lib/icon/style/{iconfont.1791950625324.woff2 → iconfont.1792048659766.woff2} +0 -0
  103. /package/lib/{iconfont.1791950625324.ttf → iconfont.1792048659766.ttf} +0 -0
  104. /package/lib/{iconfont.1791950625324.woff → iconfont.1792048659766.woff} +0 -0
  105. /package/lib/{iconfont.1791950625324.woff2 → iconfont.1792048659766.woff2} +0 -0
@@ -1,5 +1,6 @@
1
1
  import { RenderFunction, SetupContext, Ref } from 'vue'
2
2
  import { DefineVxeComponentApp, DefineVxeComponentOptions, DefineVxeComponentInstance, VxeComponentBaseOptions, VxeComponentEventParams, VxeComponentSizeType, VxeComponentSlotType, ValueOf } from '@vxe-ui/core'
3
+ import { VxeScrollbarProps } from './scrollbar'
3
4
 
4
5
  /* eslint-disable no-use-before-define,@typescript-eslint/ban-types */
5
6
 
@@ -73,6 +74,17 @@ export namespace VxeDrawerPropTypes {
73
74
  export type Padding = boolean
74
75
  export type BeforeHideMethod = (params: VxeDrawerDefines.DrawerVisibleParams) => Promise<any>
75
76
  export type Slots = VxeDrawerSlots
77
+ export type UseScrollbar = boolean
78
+ export interface ScrollbarConfig extends Pick<VxeScrollbarProps, 'xConfig' | 'yConfig' | 'padding' | 'autoHide' | 'visible' | 'className' | 'viewAttrs' | 'viewClassName' | 'viewInnerClassName'> {
79
+ /**
80
+ * 滚动条宽度
81
+ */
82
+ width?: number | string
83
+ /**
84
+ * 滚动条高度
85
+ */
86
+ height?: number | string
87
+ }
76
88
  }
77
89
 
78
90
  export interface VxeDrawerProps {
@@ -125,6 +137,14 @@ export interface VxeDrawerProps {
125
137
  padding?: VxeDrawerPropTypes.Padding
126
138
  beforeHideMethod?: VxeDrawerPropTypes.BeforeHideMethod
127
139
  slots?: VxeDrawerPropTypes.Slots
140
+ /**
141
+ * 使用虚拟滚动条
142
+ */
143
+ useScrollbar?: VxeDrawerPropTypes.UseScrollbar
144
+ /**
145
+ * 滚动条配置项
146
+ */
147
+ scrollbarConfig?: VxeDrawerPropTypes.ScrollbarConfig
128
148
  }
129
149
 
130
150
  export interface DrawerPrivateComputed {
@@ -2,6 +2,7 @@ import { RenderFunction, SetupContext, Ref, ComputedRef } from 'vue'
2
2
  import { VxeComponentBaseOptions, DefineVxeComponentInstance } from '@vxe-ui/core'
3
3
  import { VxeTableConstructor, VxeTableMethods, VxeTablePrivateMethods } from '../table'
4
4
  import { VxeGanttDefines } from '../gantt'
5
+ import { VxeScrollbarPropTypes } from '../scrollbar'
5
6
 
6
7
  /* eslint-disable no-use-before-define */
7
8
 
@@ -37,6 +38,10 @@ export interface GanttViewReactData {
37
38
  lastScrollTime: number
38
39
  lazScrollLoading: boolean
39
40
 
41
+ // 滚动条
42
+ yThumbHeight: number
43
+ xThumbWidth: number
44
+
40
45
  scrollVMLoading: boolean
41
46
  scrollYHeight: number
42
47
  scrollYTop: number
@@ -75,7 +80,13 @@ export interface GanttViewInternalData {
75
80
  startIndex: number
76
81
  endIndex: number
77
82
  }
78
- // 最后滚动位置
83
+
84
+ // 滚动条
85
+ scrollObserver?: ResizeObserver
86
+ isThumbDrag?: boolean
87
+ thumbDragOffset: number
88
+ yThumbTop: number
89
+ xThumbLeft: number
79
90
  lastScrollLeft: number
80
91
  lastScrollTop: number
81
92
 
@@ -111,6 +122,14 @@ export interface GanttViewPrivateRef {
111
122
  }
112
123
 
113
124
  export interface GanttViewPrivateComputed {
125
+ computeScrollXHeight: ComputedRef<number | undefined>
126
+ computeScrollYWidth: ComputedRef<number | undefined>
127
+ computeScrollXVisible: ComputedRef<'auto' | 'visible' | 'hidden' | boolean | undefined>
128
+ computeScrollYVisible: ComputedRef<'auto' | 'visible' | 'hidden' | boolean | undefined>
129
+ computeScrollXAutoHide: ComputedRef<VxeScrollbarPropTypes.AutoHide | undefined>
130
+ computeScrollYAutoHide: ComputedRef<VxeScrollbarPropTypes.AutoHide | undefined>
131
+ computeScrollbarXToTop: ComputedRef<boolean>
132
+ computeScrollbarYToLeft: ComputedRef<boolean>
114
133
  computeScaleDateList: ComputedRef<Date[]>
115
134
  computeNowLineLeft: ComputedRef<number>
116
135
  }
@@ -164,6 +183,10 @@ export interface VxeGanttViewPrivateMethods {
164
183
  * @private
165
184
  */
166
185
  handleUpdateSYStatus(scrollYLoad: boolean): void
186
+ /**
187
+ * @private
188
+ */
189
+ updateScrollbar(): void
167
190
  }
168
191
 
169
192
  export interface VxeGanttViewMethods {
@@ -37,7 +37,7 @@ export interface VxeGanttExtendChartPrivateMethods<D = any> {
37
37
  * 内部方法
38
38
  * @private
39
39
  */
40
- handleTaskBarMousedownEvent(evnt: MouseEvent, params: {
40
+ handleTaskBarModnEvent(evnt: MouseEvent, params: {
41
41
  $gantt: VxeGanttConstructor<D> & VxeGanttPrivateMethods<D>
42
42
  row: D
43
43
  scaleType: VxeGanttDefines.ColumnScaleType
@@ -731,6 +731,8 @@ export interface GanttPrivateComputed<D = any> extends GridPrivateComputed<D> {
731
731
  computeTypeField: ComputedRef<string>
732
732
  computeProgressField: ComputedRef<string>
733
733
  computeScrollbarOpts: ComputedRef<VxeTablePropTypes.ScrollbarConfig>
734
+ computeScrollbarXOpts: ComputedRef<VxeTablePropTypes.ScrollbarXConfig>
735
+ computeScrollbarYOpts: ComputedRef<VxeTablePropTypes.ScrollbarYConfig>
734
736
  computeScrollbarXToTop: ComputedRef<boolean>
735
737
  computeScrollbarYToLeft: ComputedRef<boolean>
736
738
  }
@@ -50,10 +50,25 @@ export namespace VxeLayoutAsidePropTypes {
50
50
  }
51
51
 
52
52
  export interface VxeLayoutAsideProps {
53
+ /**
54
+ * 宽度
55
+ */
53
56
  width?: VxeLayoutAsidePropTypes.Width
57
+ /**
58
+ * 是否折叠
59
+ */
54
60
  collapsed?: VxeLayoutAsidePropTypes.Collapsed
61
+ /**
62
+ * 折叠后宽度
63
+ */
55
64
  collapseWidth?: VxeLayoutAsidePropTypes.CollapseWidth
65
+ /**
66
+ * 加载中
67
+ */
56
68
  loading?: VxeLayoutAsidePropTypes.Loading
69
+ /**
70
+ * 显示内边距
71
+ */
57
72
  padding?: VxeLayoutAsidePropTypes.Padding
58
73
  size?: VxeLayoutAsidePropTypes.Size
59
74
  collapseConfig?: VxeLayoutAsidePropTypes.CollapseConfig
@@ -45,6 +45,9 @@ export namespace VxeLayoutBodyPropTypes {
45
45
  }
46
46
  export interface VxeLayoutBodyProps {
47
47
  size?: VxeLayoutBodyPropTypes.Size
48
+ /**
49
+ * 加载中
50
+ */
48
51
  loading?: VxeLayoutBodyPropTypes.Loading
49
52
  padding?: VxeLayoutBodyPropTypes.Padding
50
53
  showBacktop?: VxeLayoutBodyPropTypes.ShowBacktop
@@ -243,8 +243,17 @@ export namespace VxeListPropTypes {
243
243
  export interface VxeListProps<D = any> {
244
244
  size?: VxeListPropTypes.Size
245
245
  data?: D[]
246
+ /**
247
+ * 高度
248
+ */
246
249
  height?: VxeListPropTypes.Height
250
+ /**
251
+ * 最大高度
252
+ */
247
253
  maxHeight?: VxeListPropTypes.MaxHeight
254
+ /**
255
+ * 加载中
256
+ */
248
257
  loading?: VxeListPropTypes.Loading
249
258
  autoResize?: VxeListPropTypes.AutoResize
250
259
  syncResize?: VxeListPropTypes.SyncResize
@@ -258,7 +267,13 @@ export interface VxeListProps<D = any> {
258
267
  checkboxConfig?: VxeListPropTypes.CheckboxConfig
259
268
  rowConfig?: VxeListPropTypes.RowConfig
260
269
  dragConfig?: VxeListPropTypes.DragConfig
270
+ /**
271
+ * 右键菜单配置项
272
+ */
261
273
  menuConfig?: VxeListPropTypes.MenuConfig
274
+ /**
275
+ * 纵向虚拟滚动配置
276
+ */
262
277
  virtualYConfig?: VxeListPropTypes.VirtualYConfig
263
278
  /**
264
279
  * 使用虚拟滚动条
@@ -314,8 +329,10 @@ export interface ListInternalData {
314
329
  fullKeyMaps: Record<string, any>
315
330
  rowMaps: Record<string, VxeListDefines.RowCacheItem>
316
331
 
317
- // 滚动条
318
332
  resizeObserver?: ResizeObserver
333
+
334
+ // 滚动条
335
+ scrollObserver?: ResizeObserver
319
336
  isThumbDrag?: boolean
320
337
  thumbDragOffset: number
321
338
  yThumbTop: number
@@ -1,5 +1,6 @@
1
1
  import { RenderFunction, SetupContext, Ref, ComputedRef } from 'vue'
2
2
  import { DefineVxeComponentApp, DefineVxeComponentOptions, DefineVxeComponentInstance, VxeComponentSizeType, VxeComponentBaseOptions, VxeComponentEventParams, ValueOf, VxeComponentSlotType } from '@vxe-ui/core'
3
+ import { VxeScrollbarProps } from './scrollbar'
3
4
 
4
5
  /* eslint-disable no-use-before-define,@typescript-eslint/ban-types */
5
6
 
@@ -126,6 +127,17 @@ export namespace VxeModalPropTypes {
126
127
  type: ModalEventTypes
127
128
  }) => Promise<any>
128
129
  export type Slots = VxeModalSlots
130
+ export type UseScrollbar = boolean
131
+ export interface ScrollbarConfig extends Pick<VxeScrollbarProps, 'xConfig' | 'yConfig' | 'padding' | 'autoHide' | 'visible' | 'className' | 'viewAttrs' | 'viewClassName' | 'viewInnerClassName'> {
132
+ /**
133
+ * 滚动条宽度
134
+ */
135
+ width?: number | string
136
+ /**
137
+ * 滚动条高度
138
+ */
139
+ height?: number | string
140
+ }
129
141
  }
130
142
 
131
143
  export interface VxeModalProps {
@@ -194,6 +206,14 @@ export interface VxeModalProps {
194
206
  animat?: VxeModalPropTypes.Animat
195
207
  padding?: VxeModalPropTypes.Padding
196
208
  beforeHideMethod?: VxeModalPropTypes.BeforeHideMethod
209
+ /**
210
+ * 使用虚拟滚动条
211
+ */
212
+ useScrollbar?: VxeModalPropTypes.UseScrollbar
213
+ /**
214
+ * 滚动条配置项
215
+ */
216
+ scrollbarConfig?: VxeModalPropTypes.ScrollbarConfig
197
217
  slots?: VxeModalPropTypes.Slots
198
218
  /**
199
219
  * @deprecated 已废弃,请使用 content
@@ -39,7 +39,6 @@ export namespace VxeNumberInputPropTypes {
39
39
  export type FloatContent = string
40
40
  export type FloatAlign = VxeComponentAlignType
41
41
  export type MaxLength = string | number | null
42
- export type Multiple = boolean
43
42
  export type AutoComplete = string
44
43
  export type Align = VxeComponentAlignType
45
44
  export type Form = string
@@ -126,6 +125,9 @@ export namespace VxeNumberInputPropTypes {
126
125
  }
127
126
 
128
127
  export interface VxeNumberInputProps {
128
+ /**
129
+ * 尺寸大小
130
+ */
129
131
  size?: VxeNumberInputPropTypes.Size
130
132
  modelValue?: VxeNumberInputPropTypes.ModelValue
131
133
  className?: VxeNumberInputPropTypes.ClassName
@@ -136,7 +138,13 @@ export interface VxeNumberInputProps {
136
138
  width?: VxeNumberInputPropTypes.Width
137
139
  immediate?: VxeNumberInputPropTypes.Immediate
138
140
  name?: VxeNumberInputPropTypes.Name
141
+ /**
142
+ * 控件类型
143
+ */
139
144
  type?: VxeNumberInputPropTypes.Type
145
+ /**
146
+ * 显示清除按钮
147
+ */
140
148
  clearable?: VxeNumberInputPropTypes.Clearable
141
149
  readonly?: VxeNumberInputPropTypes.Readonly
142
150
  disabled?: VxeNumberInputPropTypes.Disabled
@@ -144,8 +152,10 @@ export interface VxeNumberInputProps {
144
152
  floatContent?: VxeNumberInputPropTypes.FloatContent
145
153
  floatAlign?: VxeNumberInputPropTypes.FloatAlign
146
154
  maxLength?: VxeNumberInputPropTypes.MaxLength
147
- multiple?: VxeNumberInputPropTypes.Multiple
148
155
  autoComplete?: VxeNumberInputPropTypes.AutoComplete
156
+ /**
157
+ * 对齐方式
158
+ */
149
159
  align?: VxeNumberInputPropTypes.Align
150
160
  form?: VxeNumberInputPropTypes.Form
151
161
 
@@ -44,7 +44,7 @@ export interface VxeTableExtendPivotTablePrivateMethods<D = any> {
44
44
  * 内部方法
45
45
  * @private
46
46
  */
47
- handlePivotTableAggregatePanelDragendEvent(evnt: DragEvent): void
47
+ handlePivotTableAggPanelDragendEvent(evnt: DragEvent): void
48
48
  }
49
49
 
50
50
  declare module '../table' {
@@ -10,6 +10,7 @@ import { VxeToolbarConstructor, VxeToolbarInstance } from './toolbar'
10
10
  import { VxeTableCustomPanelConstructor } from './table-module/custom'
11
11
  import { VxeGanttConstructor, VxeGanttPrivateMethods } from './gantt'
12
12
  import { VxeGanttViewConstructor, VxeGanttViewInstance, VxeGanttViewPrivateMethods } from './gantt-module/gantt-view'
13
+ import { VxeScrollbarPropTypes } from './scrollbar'
13
14
 
14
15
  /* eslint-disable no-use-before-define,@typescript-eslint/ban-types */
15
16
 
@@ -3541,6 +3542,9 @@ export namespace VxeTablePropTypes {
3541
3542
  }
3542
3543
 
3543
3544
  export interface VxeTableProps<D = any> {
3545
+ /**
3546
+ * 尺寸大小
3547
+ */
3544
3548
  size?: VxeTablePropTypes.Size
3545
3549
  /**
3546
3550
  * 唯一标识
@@ -3999,8 +4003,15 @@ export interface TablePrivateComputed<D = any> {
3999
4003
  computeScrollbarOpts: ComputedRef<VxeTablePropTypes.ScrollbarConfig>
4000
4004
  computeScrollbarXOpts: ComputedRef<VxeTablePropTypes.ScrollbarXConfig>
4001
4005
  computeScrollbarYOpts: ComputedRef<VxeTablePropTypes.ScrollbarYConfig>
4006
+ computeScrollXHeight: ComputedRef<number | undefined>
4007
+ computeScrollYWidth: ComputedRef<number | undefined>
4008
+ computeScrollXVisible: ComputedRef<'auto' | 'visible' | 'hidden' | boolean | undefined>
4009
+ computeScrollYVisible: ComputedRef<'auto' | 'visible' | 'hidden' | boolean | undefined>
4010
+ computeScrollXAutoHide: ComputedRef<VxeScrollbarPropTypes.AutoHide | undefined>
4011
+ computeScrollYAutoHide: ComputedRef<VxeScrollbarPropTypes.AutoHide | undefined>
4002
4012
  computeScrollbarXToTop: ComputedRef<boolean>
4003
4013
  computeScrollbarYToLeft: ComputedRef<boolean>
4014
+ computeScrollbarWrapperClss: ComputedRef<string>
4004
4015
  computeColumnOpts: ComputedRef<VxeTablePropTypes.ColumnOpts>
4005
4016
  computeCurrentColumnOpts: ComputedRef<VxeTablePropTypes.CurrentColumnConfig>
4006
4017
  computeScrollXThreshold: ComputedRef<number>
@@ -4119,6 +4130,11 @@ export interface TableReactData<D = any> {
4119
4130
  scrollbarWidth: number
4120
4131
  // 横向滚动条的高度
4121
4132
  scrollbarHeight: number
4133
+
4134
+ // 滚动条
4135
+ yThumbHeight: number
4136
+ xThumbWidth: number
4137
+
4122
4138
  /**
4123
4139
  * 行高
4124
4140
  * @deprecated
@@ -4360,9 +4376,17 @@ export interface TableInternalData<D = any> {
4360
4376
  currentRow: D | null
4361
4377
  currentCol: VxeTableDefines.ColumnInfo | null
4362
4378
 
4363
- // 最后滚动位置
4364
- lastScrollLeft: number
4379
+ resizeObserver?: ResizeObserver
4380
+
4381
+ // 滚动条
4382
+ scrollObserver?: ResizeObserver
4383
+ isThumbDrag?: boolean
4384
+ thumbDragOffset: number
4385
+ yThumbTop: number
4386
+ xThumbLeft: number
4365
4387
  lastScrollTop: number
4388
+ lastScrollLeft: number
4389
+
4366
4390
  // 单选框属性,已选中保留的行
4367
4391
  radioReserveRow: any
4368
4392
  // 复选框属性,已选中保留的行
@@ -5959,6 +5983,16 @@ export interface TablePrivateMethods<D = any> {
5959
5983
  row: any
5960
5984
  column: VxeTableDefines.ColumnInfo
5961
5985
  }, cellValue?: any): Promise<any>
5986
+ /**
5987
+ * 内部方法
5988
+ * @private
5989
+ */
5990
+ updateScrollbar(): void
5991
+ /**
5992
+ * 内部方法
5993
+ * @private
5994
+ */
5995
+ updateThumbOffset(): void
5962
5996
  /**
5963
5997
  * 内部方法
5964
5998
  * @private
@@ -346,10 +346,22 @@ export namespace VxeTreePropTypes {
346
346
  }
347
347
 
348
348
  export interface VxeTreeProps<D = any> {
349
+ /**
350
+ * 数据源
351
+ */
349
352
  data?: VxeTreePropTypes.Data<D>
350
353
  autoResize?: VxeTreePropTypes.AutoResize
354
+ /**
355
+ * 高度
356
+ */
351
357
  height?: VxeTreePropTypes.Height
358
+ /**
359
+ * 最小高度
360
+ */
352
361
  minHeight?: VxeTreePropTypes.MinHeight
362
+ /**
363
+ * 最大高度
364
+ */
353
365
  maxHeight?: VxeTreePropTypes.MaxHeight
354
366
  loading?: VxeTreePropTypes.Loading
355
367
  loadingConfig?: VxeTreePropTypes.LoadingConfig
@@ -487,8 +499,10 @@ export interface TreeInternalData {
487
499
  treeExpandedMaps: Record<string, boolean>
488
500
  treeExpandLazyLoadedMaps: Record<string, boolean>
489
501
 
490
- // 滚动条
491
502
  resizeObserver?: ResizeObserver
503
+
504
+ // 滚动条
505
+ scrollObserver?: ResizeObserver
492
506
  isThumbDrag?: boolean
493
507
  thumbDragOffset: number
494
508
  yThumbTop: number
@@ -1,54 +0,0 @@
1
- /**
2
- * 计算滚动条滑块的长度
3
- */
4
- export function getThumbSize(viewportSize, contentSize, trackSize) {
5
- if (contentSize <= viewportSize) {
6
- return 0;
7
- }
8
- const ratio = viewportSize / contentSize;
9
- const ideal = trackSize * ratio;
10
- return Math.max(20, Math.min(ideal, trackSize));
11
- }
12
- /**
13
- * 计算滚动条滑块的偏移位置
14
- */
15
- export function getThumbOffsetSize(offsetSize, viewportSize, contentSize, trackSize, thumbSize) {
16
- const maxScroll = contentSize - viewportSize;
17
- if (maxScroll <= 0) {
18
- return 0;
19
- }
20
- const maxThumbOffset = trackSize - thumbSize;
21
- if (maxThumbOffset <= 0) {
22
- return 0;
23
- }
24
- const clamped = Math.min(Math.max(offsetSize, 0), maxScroll);
25
- const ratio = clamped / maxScroll;
26
- return ratio * maxThumbOffset;
27
- }
28
- /**
29
- * 根据点击轨道的位置,计算滑块的偏移位置
30
- */
31
- export function getScrollFromClick(clickPosition, viewportSize, contentSize, trackSize, thumbSize) {
32
- const maxThumbOffset = trackSize - thumbSize;
33
- const maxScroll = contentSize - viewportSize;
34
- if (maxScroll <= 0 || maxThumbOffset <= 0) {
35
- return 0;
36
- }
37
- let thumbOffset = clickPosition - thumbSize / 2;
38
- thumbOffset = Math.min(Math.max(thumbOffset, 0), maxThumbOffset);
39
- const scrollOffset = (thumbOffset / maxThumbOffset) * maxScroll;
40
- return scrollOffset;
41
- }
42
- /**
43
- * 拖拽 thumb 时,根据鼠标位置计算滑块的偏移位置
44
- */
45
- export function getScrollFromDrag(pointerPosition, dragOffset, viewportSize, contentSize, trackSize, thumbSize) {
46
- const maxScroll = contentSize - viewportSize;
47
- const maxThumbOffset = trackSize - thumbSize;
48
- if (maxScroll <= 0 || maxThumbOffset <= 0) {
49
- return 0;
50
- }
51
- let thumbOffset = pointerPosition - dragOffset;
52
- thumbOffset = Math.min(Math.max(thumbOffset, 0), maxThumbOffset);
53
- return (thumbOffset / maxThumbOffset) * maxScroll;
54
- }
@@ -1,63 +0,0 @@
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
- }
@@ -1 +0,0 @@
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;
@@ -1,57 +0,0 @@
1
- /**
2
- * 计算滚动条滑块的长度
3
- */
4
- export function getThumbSize (viewportSize: number, contentSize: number, trackSize: number) {
5
- if (contentSize <= viewportSize) {
6
- return 0
7
- }
8
- const ratio = viewportSize / contentSize
9
- const ideal = trackSize * ratio
10
- return Math.max(20, Math.min(ideal, trackSize))
11
- }
12
-
13
- /**
14
- * 计算滚动条滑块的偏移位置
15
- */
16
- export function getThumbOffsetSize (offsetSize: number, viewportSize: number, contentSize: number, trackSize: number, thumbSize: number) {
17
- const maxScroll = contentSize - viewportSize
18
- if (maxScroll <= 0) {
19
- return 0
20
- }
21
- const maxThumbOffset = trackSize - thumbSize
22
- if (maxThumbOffset <= 0) {
23
- return 0
24
- }
25
- const clamped = Math.min(Math.max(offsetSize, 0), maxScroll)
26
- const ratio = clamped / maxScroll
27
- return ratio * maxThumbOffset
28
- }
29
-
30
- /**
31
- * 根据点击轨道的位置,计算滑块的偏移位置
32
- */
33
- export function getScrollFromClick (clickPosition: number, viewportSize: number, contentSize: number, trackSize: number, thumbSize: number) {
34
- const maxThumbOffset = trackSize - thumbSize
35
- const maxScroll = contentSize - viewportSize
36
- if (maxScroll <= 0 || maxThumbOffset <= 0) {
37
- return 0
38
- }
39
- let thumbOffset = clickPosition - thumbSize / 2
40
- thumbOffset = Math.min(Math.max(thumbOffset, 0), maxThumbOffset)
41
- const scrollOffset = (thumbOffset / maxThumbOffset) * maxScroll
42
- return scrollOffset
43
- }
44
-
45
- /**
46
- * 拖拽 thumb 时,根据鼠标位置计算滑块的偏移位置
47
- */
48
- export function getScrollFromDrag (pointerPosition: number, dragOffset: number, viewportSize: number, contentSize: number, trackSize: number, thumbSize: number) {
49
- const maxScroll = contentSize - viewportSize
50
- const maxThumbOffset = trackSize - thumbSize
51
- if (maxScroll <= 0 || maxThumbOffset <= 0) {
52
- return 0
53
- }
54
- let thumbOffset = pointerPosition - dragOffset
55
- thumbOffset = Math.min(Math.max(thumbOffset, 0), maxThumbOffset)
56
- return (thumbOffset / maxThumbOffset) * maxScroll
57
- }