vxe-pc-ui 3.18.21 → 3.18.22

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 (68) hide show
  1. package/es/components.js +3 -0
  2. package/es/icon/style.css +1 -1
  3. package/es/scrollbar/index.js +12 -0
  4. package/es/scrollbar/src/scrollbar.js +540 -0
  5. package/es/scrollbar/src/util.js +54 -0
  6. package/es/scrollbar/style.css +102 -0
  7. package/es/scrollbar/style.min.css +1 -0
  8. package/es/style.css +1 -1
  9. package/es/style.min.css +1 -1
  10. package/es/ui/index.js +10 -1
  11. package/es/ui/src/log.js +1 -1
  12. package/es/vxe-scrollbar/index.js +3 -0
  13. package/es/vxe-scrollbar/style.css +102 -0
  14. package/es/vxe-scrollbar/style.min.css +1 -0
  15. package/lib/components.js +13 -1
  16. package/lib/components.min.js +1 -1
  17. package/lib/icon/style/style.css +1 -1
  18. package/lib/icon/style/style.min.css +1 -1
  19. package/lib/index.umd.js +694 -7
  20. package/lib/index.umd.min.js +1 -1
  21. package/lib/scrollbar/index.js +19 -0
  22. package/lib/scrollbar/index.min.js +1 -0
  23. package/lib/scrollbar/src/scrollbar.js +551 -0
  24. package/lib/scrollbar/src/scrollbar.min.js +1 -0
  25. package/lib/scrollbar/src/util.js +63 -0
  26. package/lib/scrollbar/src/util.min.js +1 -0
  27. package/lib/scrollbar/style/index.js +1 -0
  28. package/lib/scrollbar/style/style.css +102 -0
  29. package/lib/scrollbar/style/style.min.css +1 -0
  30. package/lib/style.css +1 -1
  31. package/lib/style.min.css +1 -1
  32. package/lib/ui/index.js +10 -1
  33. package/lib/ui/index.min.js +1 -1
  34. package/lib/ui/src/log.js +1 -1
  35. package/lib/ui/src/log.min.js +1 -1
  36. package/lib/vxe-scrollbar/index.js +22 -0
  37. package/lib/vxe-scrollbar/index.min.js +1 -0
  38. package/lib/vxe-scrollbar/style/index.js +1 -0
  39. package/lib/vxe-scrollbar/style/style.css +102 -0
  40. package/lib/vxe-scrollbar/style/style.min.css +1 -0
  41. package/package.json +2 -2
  42. package/packages/components.ts +3 -0
  43. package/packages/scrollbar/index.ts +16 -0
  44. package/packages/scrollbar/src/scrollbar.ts +583 -0
  45. package/packages/scrollbar/src/util.ts +57 -0
  46. package/packages/ui/index.ts +9 -0
  47. package/styles/all.scss +1 -0
  48. package/styles/components/scrollbar.scss +114 -0
  49. package/styles/theme/base.scss +5 -0
  50. package/styles/theme/dark.scss +5 -0
  51. package/styles/theme/light.scss +5 -0
  52. package/styles/variable.scss +5 -0
  53. package/types/all.d.ts +3 -0
  54. package/types/components/gantt.d.ts +3 -3
  55. package/types/components/scrollbar.d.ts +209 -0
  56. package/types/ui/global-config.d.ts +2 -0
  57. /package/es/icon/{iconfont.1790757609697.ttf → iconfont.1791471260167.ttf} +0 -0
  58. /package/es/icon/{iconfont.1790757609697.woff → iconfont.1791471260167.woff} +0 -0
  59. /package/es/icon/{iconfont.1790757609697.woff2 → iconfont.1791471260167.woff2} +0 -0
  60. /package/es/{iconfont.1790757609697.ttf → iconfont.1791471260167.ttf} +0 -0
  61. /package/es/{iconfont.1790757609697.woff → iconfont.1791471260167.woff} +0 -0
  62. /package/es/{iconfont.1790757609697.woff2 → iconfont.1791471260167.woff2} +0 -0
  63. /package/lib/icon/style/{iconfont.1790757609697.ttf → iconfont.1791471260167.ttf} +0 -0
  64. /package/lib/icon/style/{iconfont.1790757609697.woff → iconfont.1791471260167.woff} +0 -0
  65. /package/lib/icon/style/{iconfont.1790757609697.woff2 → iconfont.1791471260167.woff2} +0 -0
  66. /package/lib/{iconfont.1790757609697.ttf → iconfont.1791471260167.ttf} +0 -0
  67. /package/lib/{iconfont.1790757609697.woff → iconfont.1791471260167.woff} +0 -0
  68. /package/lib/{iconfont.1790757609697.woff2 → iconfont.1791471260167.woff2} +0 -0
@@ -0,0 +1,114 @@
1
+ @use '../helpers/baseMixin.scss';
2
+
3
+ .vxe-scrollbar {
4
+ width: 100%;
5
+ position: relative;
6
+ &.is--virtual {
7
+ & > .vxe-scrollbar--view {
8
+ scrollbar-width: none;
9
+ -ms-overflow-style: none;
10
+ overflow-x: auto;
11
+ overflow-y: auto;
12
+ }
13
+ & > .vxe-scrollbar--view::-webkit-scrollbar {
14
+ display: none;
15
+ }
16
+ &.ov-x--auto-hide {
17
+ &:hover {
18
+ & > .vxe-scrollbar--track-x {
19
+ opacity: 1;
20
+ }
21
+ }
22
+ & > .vxe-scrollbar--track-x {
23
+ opacity: 0;
24
+ @include baseMixin.createAnimationTransition(opacity, 0.3s);
25
+ }
26
+ }
27
+ &.ov-y--auto-hide {
28
+ &:hover {
29
+ & > .vxe-scrollbar--track-y {
30
+ opacity: 1;
31
+ }
32
+ }
33
+ & > .vxe-scrollbar--track-y {
34
+ opacity: 0;
35
+ @include baseMixin.createAnimationTransition(opacity, 0.3s);
36
+ }
37
+ }
38
+ }
39
+ &.is--native {
40
+ & > .vxe-scrollbar--view {
41
+ overflow-x: auto;
42
+ overflow-y: auto;
43
+ }
44
+ &.ov-x--hidden {
45
+ & > .vxe-scrollbar--view {
46
+ overflow-x: hidden;
47
+ }
48
+ }
49
+ &.ov-y--hidden {
50
+ & > .vxe-scrollbar--view {
51
+ overflow-y: hidden;
52
+ }
53
+ }
54
+ & > .vxe-scrollbar--view::-webkit-scrollbar {
55
+ width: var(--vxe-ui-scrollbar-y-width);
56
+ height: var(--vxe-ui-scrollbar-x-height);
57
+ }
58
+ & > .vxe-scrollbar--view::-webkit-scrollbar-thumb {
59
+ border-radius: var(--vxe-ui-base-border-radius);
60
+ background-color: var(--vxe-ui-scrollbar-thumb-background-color);
61
+ }
62
+ & > .vxe-scrollbar--view::-webkit-scrollbar-thumb:hover {
63
+ background-color: var(--vxe-ui-scrollbar-thumb-hover-background-color);
64
+ }
65
+ & > .vxe-scrollbar--view::-webkit-scrollbar-thumb:active {
66
+ background-color: var(--vxe-ui-scrollbar-thumb-active-background-color);
67
+ }
68
+ }
69
+ }
70
+
71
+ .vxe-scrollbar--view {
72
+ height: 100%;
73
+ width: 100%;
74
+ }
75
+
76
+ .vxe-scrollbar--track-x,
77
+ .vxe-scrollbar--track-y {
78
+ position: absolute;
79
+ background-color: var(--vxe-ui-scrollbar-track-background-color);
80
+ user-select: none;
81
+ }
82
+
83
+ .vxe-scrollbar--track-x {
84
+ width: 100%;
85
+ bottom: 0;
86
+ left: 0;
87
+ height: var(--vxe-ui-scrollbar-x-height);
88
+ }
89
+
90
+ .vxe-scrollbar--track-y {
91
+ height: 100%;
92
+ right: 0;
93
+ top: 0;
94
+ width: var(--vxe-ui-scrollbar-y-width);
95
+ }
96
+
97
+ .vxe-scrollbar--thumb-y {
98
+ width: 100%;
99
+ }
100
+ .vxe-scrollbar--thumb-x {
101
+ height: 100%;
102
+ }
103
+
104
+ .vxe-scrollbar--thumb-x,
105
+ .vxe-scrollbar--thumb-y {
106
+ border-radius: var(--vxe-ui-base-border-radius);
107
+ background-color: var(--vxe-ui-scrollbar-thumb-background-color);
108
+ &:hover {
109
+ background-color: var(--vxe-ui-scrollbar-thumb-hover-background-color);
110
+ }
111
+ &:active {
112
+ background-color: var(--vxe-ui-scrollbar-thumb-active-background-color);
113
+ }
114
+ }
@@ -318,4 +318,9 @@
318
318
  --vxe-ui-divider-vertical-margin-small: 8px;
319
319
  --vxe-ui-divider-vertical-margin-mini: 6px;
320
320
  --vxe-ui-divider-border-width: 1px;
321
+
322
+ /*scrollbar*/
323
+ --vxe-ui-scrollbar-y-width: 10px;
324
+ --vxe-ui-scrollbar-x-height: var(--vxe-ui-scrollbar-y-width);
325
+ --vxe-ui-scrollbar-track-background-color: transparent;
321
326
  }
@@ -147,4 +147,9 @@
147
147
  /*image-preview*/
148
148
  --vxe-ui-vxe-image-preview-operation-color: rgba(0,0,0,0.7);
149
149
  --vxe-ui-vxe-image-preview-operation-background-color: rgba(255,255,255,0.4);
150
+
151
+ /*scrollbar*/
152
+ --vxe-ui-scrollbar-thumb-background-color: #8b8b8b;
153
+ --vxe-ui-scrollbar-thumb-hover-background-color: #d1d1d1;
154
+ --vxe-ui-scrollbar-thumb-active-background-color: #e0e0e0;
150
155
  }
@@ -146,4 +146,9 @@
146
146
  /*image-preview*/
147
147
  --vxe-ui-vxe-image-preview-operation-color: #{light_variable.$vxe-ui-vxe-image-preview-operation-color};
148
148
  --vxe-ui-vxe-image-preview-operation-background-color: #{light_variable.$vxe-ui-vxe-image-preview-operation-background-color};
149
+
150
+ /*scrollbar*/
151
+ --vxe-ui-scrollbar-thumb-background-color: #{light_variable.$vxe-ui-scrollbar-thumb-background-color};
152
+ --vxe-ui-scrollbar-thumb-hover-background-color: #{light_variable.$vxe-ui-scrollbar-thumb-hover-background-color};
153
+ --vxe-ui-scrollbar-thumb-active-background-color: #{light_variable.$vxe-ui-scrollbar-thumb-active-background-color};
149
154
  }
@@ -141,3 +141,8 @@ $vxe-ui-list-drag-over-background-color: rgba(255,255,200,0.3) !default;
141
141
  /*image-preview*/
142
142
  $vxe-ui-vxe-image-preview-operation-color: rgba(255,255,255,0.6) !default;
143
143
  $vxe-ui-vxe-image-preview-operation-background-color: rgba(0, 0, 0, 0.7) !default;
144
+
145
+ /*scrollbar*/
146
+ $vxe-ui-scrollbar-thumb-background-color: #8b8b8b !default;
147
+ $vxe-ui-scrollbar-thumb-hover-background-color: #636363 !default;
148
+ $vxe-ui-scrollbar-thumb-active-background-color: #555555 !default;
package/types/all.d.ts CHANGED
@@ -67,6 +67,7 @@ import VxeRadioGroup from './components/radio-group'
67
67
  import VxeRate from './components/rate'
68
68
  import VxeResult from './components/result'
69
69
  import VxeRow from './components/row'
70
+ import VxeScrollbar from './components/scrollbar'
70
71
  import VxeSegmented from './components/segmented'
71
72
  import VxeSelect from './components/select'
72
73
  import VxeSplitter from './components/splitter'
@@ -349,6 +350,7 @@ interface UIComponents {
349
350
  VxeRate: typeof VxeRate
350
351
  VxeResult: typeof VxeResult
351
352
  VxeRow: typeof VxeRow
353
+ VxeScrollbar: typeof VxeScrollbar
352
354
  VxeSegmented: typeof VxeSegmented
353
355
  VxeSelect: typeof VxeSelect
354
356
  VxeSplitter: typeof VxeSplitter
@@ -520,6 +522,7 @@ export * from './components/radio-group'
520
522
  export * from './components/rate'
521
523
  export * from './components/result'
522
524
  export * from './components/row'
525
+ export * from './components/scrollbar'
523
526
  export * from './components/segmented'
524
527
  export * from './components/select'
525
528
  export * from './components/splitter'
@@ -28,15 +28,15 @@ export namespace VxeGanttPropTypes {
28
28
  export type Columns<D = any> = Column<D>[]
29
29
  export interface Link<D = any> extends VxeGanttDefines.LinkStyleConfig {
30
30
  /**
31
- * 线类型
31
+ * 线类型 (0 = FinishToStart), (1 = StartToFinish), (2 = StartToStart), (3 = FinishToFinish)
32
32
  */
33
33
  type: VxeGanttDependencyType
34
34
  /**
35
- * 从指定行
35
+ * 从指定行开始线连接
36
36
  */
37
37
  from: D | string | number
38
38
  /**
39
- * 到目标行
39
+ * 到目标行结束线连接
40
40
  */
41
41
  to: D | string | number
42
42
  }
@@ -0,0 +1,209 @@
1
+ import { DefineVxeComponentApp, DefineVxeComponentOptions, DefineVxeComponentInstance, VxeComponentEventParams, ValueOf } from '@vxe-ui/core'
2
+
3
+ /* eslint-disable @typescript-eslint/no-empty-interface,no-use-before-define,@typescript-eslint/ban-types */
4
+
5
+ export declare const VxeScrollbar: DefineVxeComponentApp<VxeScrollbarProps, VxeScrollbarEventProps, VxeScrollbarSlots, VxeScrollbarMethods>
6
+ export type VxeScrollbarComponent = DefineVxeComponentOptions<VxeScrollbarProps>
7
+
8
+ export type VxeScrollbarInstance = DefineVxeComponentInstance<{
9
+ reactData: ScrollbarReactData
10
+ internalData: ScrollbarInternalData
11
+ }, VxeScrollbarProps, VxeScrollbarPrivateComputed, VxeScrollbarMethods>
12
+
13
+ export type VxeScrollbarConstructor = VxeScrollbarInstance
14
+
15
+ export interface ScrollbarPrivateRef {
16
+ }
17
+ export interface VxeScrollbarPrivateRef extends ScrollbarPrivateRef { }
18
+
19
+ export namespace VxeScrollbarPropTypes {
20
+ export type Width = number | string
21
+ export type Height = number | string
22
+ export type MinWidth = number | string
23
+ export type MinHeight = number | string
24
+ export type MaxWidth = number | string
25
+ export type MaxHeight = number | string
26
+ export type Loading = boolean
27
+ export type Native = boolean
28
+ export interface XConfig {
29
+ height?: number | string
30
+ // showArrows?: boolean
31
+ /**
32
+ * 是否自动隐藏滚动条
33
+ */
34
+ autoHide?: boolean
35
+ visible?: 'auto' | 'hidden' | 'visible' | ''
36
+ /**
37
+ * 滚动到边界触发的阈值会触发 scroll-boundary 事件
38
+ */
39
+ threshold?: string | number
40
+ }
41
+ export interface YConfig {
42
+ width?: number | string
43
+ // showArrows?: boolean
44
+ /**
45
+ * 是否自动隐藏滚动条
46
+ */
47
+ autoHide?: boolean
48
+ visible?: 'auto' | 'hidden' | 'visible' | ''
49
+ /**
50
+ * 滚动到边界触发的阈值会触发 scroll-boundary 事件
51
+ */
52
+ threshold?: string | number
53
+ }
54
+ export type ClassName = string
55
+ export type ViewClassName = string
56
+ export type AutoResize = boolean
57
+ export type SyncResize = boolean
58
+ }
59
+
60
+ export interface VxeScrollbarProps {
61
+ /**
62
+ * 容器宽度
63
+ */
64
+ width?: VxeScrollbarPropTypes.Width
65
+ /**
66
+ * 容器最小高度
67
+ */
68
+ height?: VxeScrollbarPropTypes.Height
69
+ /**
70
+ * 容器最小宽度
71
+ */
72
+ minWidth?: VxeScrollbarPropTypes.MinWidth
73
+ /**
74
+ * 容器最大高度
75
+ */
76
+ minHeight?: VxeScrollbarPropTypes.MinHeight
77
+ /**
78
+ * 容器最大宽度
79
+ */
80
+ maxWidth?: VxeScrollbarPropTypes.MaxWidth
81
+ /**
82
+ * 容器高度
83
+ */
84
+ maxHeight?: VxeScrollbarPropTypes.MaxHeight
85
+ /**
86
+ * 是否加载中
87
+ */
88
+ loading?: VxeScrollbarPropTypes.Loading
89
+ /**
90
+ * 是否使用原生滚动条
91
+ */
92
+ native?: VxeScrollbarPropTypes.Native
93
+ /**
94
+ * 纵向滚动条宽度
95
+ */
96
+ xConfig?: VxeScrollbarPropTypes.XConfig
97
+ /**
98
+ * 横向滚动条高度
99
+ */
100
+ yConfig?: VxeScrollbarPropTypes.YConfig
101
+ /**
102
+ * 给容器附加 class
103
+ */
104
+ className?: VxeScrollbarPropTypes.ClassName
105
+ /**
106
+ * 给视图元素附加 class
107
+ */
108
+ viewClassName?: VxeScrollbarPropTypes.ViewClassName
109
+ /**
110
+ * 自动监听元素的变化去重新计算样式
111
+ */
112
+ autoResize?: VxeScrollbarPropTypes.AutoResize
113
+ /**
114
+ * 自动跟随某个属性的变化去重新计算表格,和手动调用 recalculate 方法是一样的效果(对于通过某个属性来更新内容时可能会用到)
115
+ */
116
+ syncResize?: VxeScrollbarPropTypes.SyncResize
117
+ }
118
+
119
+ export interface ScrollbarPrivateComputed {
120
+ }
121
+ export interface VxeScrollbarPrivateComputed extends ScrollbarPrivateComputed { }
122
+
123
+ export interface ScrollbarReactData {
124
+ yThumbHeight: number
125
+ xThumbWidth: number
126
+ }
127
+ export interface ScrollbarInternalData {
128
+ resizeObserver?: ResizeObserver
129
+ isThumbDrag?: boolean
130
+ thumbDragOffset: number
131
+ yThumbTop: number
132
+ xThumbLeft: number
133
+ lastScrollTop: number
134
+ lastScrollLeft: number
135
+ }
136
+
137
+ export interface ScrollbarMethods {
138
+ dispatchEvent(type: ValueOf<VxeScrollbarEmits>, params: Record<string, any>, evnt: Event | null): void
139
+ /**
140
+ * 滚动到指定位置
141
+ */
142
+ scrollTo(options: ScrollToOptions): void
143
+ scrollTo(left: number, top: number): void
144
+ /**
145
+ * 滚动元素到可见位置
146
+ */
147
+ scrollIntoView(): void
148
+ /**
149
+ * 重新计算样式
150
+ * 对于某些特殊场景可能会用到,比如更新内容
151
+ */
152
+ recalculate(): Promise<void>
153
+ }
154
+ export interface VxeScrollbarMethods extends ScrollbarMethods { }
155
+
156
+ export interface ScrollbarPrivateMethods { }
157
+ export interface VxeScrollbarPrivateMethods extends ScrollbarPrivateMethods { }
158
+
159
+ export type VxeScrollbarEmits = [
160
+ 'scroll',
161
+ 'scroll-boundary'
162
+ ]
163
+
164
+ export namespace VxeScrollbarDefines {
165
+ export interface ScrollbarEventParams extends VxeComponentEventParams {
166
+ $scrollbar: VxeScrollbarConstructor
167
+ }
168
+
169
+ export interface ScrollEventParams extends ScrollbarEventParams {
170
+ direction: 'top' | 'bottom' | 'left' | 'right'
171
+ isTop: boolean
172
+ isBottom: boolean
173
+ isLeft: boolean
174
+ isRight: boolean
175
+ scrollTop: number
176
+ scrollLeft: number
177
+ clientWidth: number
178
+ clientHeight: number
179
+ scrollHeight: number
180
+ scrollWidth: number
181
+ }
182
+ export interface ScrollBoundaryEventParams extends ScrollEventParams {}
183
+ }
184
+
185
+ export type VxeScrollbarEventProps = {
186
+ onScroll?: VxeScrollbarEvents.Scroll
187
+ onScrolllBoundary?: VxeScrollbarEvents.ScrollBoundary
188
+ }
189
+
190
+ export interface VxeScrollbarListeners {
191
+ scroll?: VxeScrollbarEvents.Scroll
192
+ scrolllBoundary?: VxeScrollbarEvents.ScrollBoundary
193
+ }
194
+
195
+ export namespace VxeScrollbarEvents {
196
+ export type Scroll = (params: VxeScrollbarDefines.ScrollEventParams) => void
197
+ export type ScrollBoundary = (params: VxeScrollbarDefines.ScrollBoundaryEventParams) => void
198
+ }
199
+
200
+ export namespace VxeScrollbarSlotTypes {
201
+ export interface DefaultSlotParams {}
202
+ }
203
+
204
+ export interface VxeScrollbarSlots {
205
+ default?: (params: VxeScrollbarSlotTypes.DefaultSlotParams) => any
206
+ }
207
+
208
+ export const Scrollbar: typeof VxeScrollbar
209
+ export default VxeScrollbar
@@ -65,6 +65,7 @@ import { VxeRadioGroupProps } from '../components/radio-group'
65
65
  import { VxeRateProps } from '../components/rate'
66
66
  import { VxeResultProps } from '../components/result'
67
67
  import { VxeRowProps } from '../components/row'
68
+ import { VxeScrollbarProps } from '../components/scrollbar'
68
69
  import { VxeSegmentedProps } from '../components/segmented'
69
70
  import { VxeSelectProps } from '../components/select'
70
71
  import { VxeSplitterProps } from '../components/splitter'
@@ -180,6 +181,7 @@ declare module '@vxe-ui/core' {
180
181
  rate?: VxeRateProps
181
182
  result?: VxeResultProps
182
183
  row?: VxeRowProps
184
+ scrollbar?: VxeScrollbarProps
183
185
  segmented?: VxeSegmentedProps
184
186
  select?: VxeSelectProps
185
187
  splitter?: VxeSplitterProps