@v-c/slider 1.0.0

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 (81) hide show
  1. package/LICENSE +21 -0
  2. package/dist/Handles/Handle.cjs +1 -0
  3. package/dist/Handles/Handle.d.ts +107 -0
  4. package/dist/Handles/Handle.js +203 -0
  5. package/dist/Handles/index.cjs +1 -0
  6. package/dist/Handles/index.d.ts +98 -0
  7. package/dist/Handles/index.js +117 -0
  8. package/dist/Marks/Mark.cjs +1 -0
  9. package/dist/Marks/Mark.d.ts +9 -0
  10. package/dist/Marks/Mark.js +39 -0
  11. package/dist/Marks/index.cjs +1 -0
  12. package/dist/Marks/index.d.ts +15 -0
  13. package/dist/Marks/index.js +31 -0
  14. package/dist/Slider.cjs +1 -0
  15. package/dist/Slider.d.ts +253 -0
  16. package/dist/Slider.js +343 -0
  17. package/dist/Steps/Dot.cjs +1 -0
  18. package/dist/Steps/Dot.d.ts +9 -0
  19. package/dist/Steps/Dot.js +38 -0
  20. package/dist/Steps/index.cjs +1 -0
  21. package/dist/Steps/index.d.ts +11 -0
  22. package/dist/Steps/index.js +41 -0
  23. package/dist/Tracks/Track.cjs +1 -0
  24. package/dist/Tracks/Track.d.ts +61 -0
  25. package/dist/Tracks/Track.js +82 -0
  26. package/dist/Tracks/index.cjs +1 -0
  27. package/dist/Tracks/index.d.ts +47 -0
  28. package/dist/Tracks/index.js +83 -0
  29. package/dist/context.cjs +1 -0
  30. package/dist/context.d.ts +51 -0
  31. package/dist/context.js +27 -0
  32. package/dist/hooks/useDrag.cjs +1 -0
  33. package/dist/hooks/useDrag.d.ts +11 -0
  34. package/dist/hooks/useDrag.js +88 -0
  35. package/dist/hooks/useOffset.cjs +1 -0
  36. package/dist/hooks/useOffset.d.ts +10 -0
  37. package/dist/hooks/useOffset.js +98 -0
  38. package/dist/hooks/useRange.cjs +1 -0
  39. package/dist/hooks/useRange.d.ts +8 -0
  40. package/dist/hooks/useRange.js +10 -0
  41. package/dist/index.cjs +1 -0
  42. package/dist/index.d.ts +3 -0
  43. package/dist/index.js +4 -0
  44. package/dist/interface.cjs +1 -0
  45. package/dist/interface.d.ts +7 -0
  46. package/dist/interface.js +1 -0
  47. package/dist/util.cjs +1 -0
  48. package/dist/util.d.ts +6 -0
  49. package/dist/util.js +29 -0
  50. package/docs/TooltipSlider.tsx +94 -0
  51. package/docs/assets/anim.less +63 -0
  52. package/docs/assets/bootstrap.less +163 -0
  53. package/docs/assets/index.less +337 -0
  54. package/docs/debug.vue +60 -0
  55. package/docs/editable.vue +59 -0
  56. package/docs/handle.vue +45 -0
  57. package/docs/marks.vue +85 -0
  58. package/docs/multiple.vue +54 -0
  59. package/docs/range.vue +211 -0
  60. package/docs/slider.stories.vue +45 -0
  61. package/docs/sliderDemo.vue +267 -0
  62. package/docs/vertical.vue +122 -0
  63. package/package.json +35 -0
  64. package/src/Handles/Handle.tsx +226 -0
  65. package/src/Handles/index.tsx +124 -0
  66. package/src/Marks/Mark.tsx +40 -0
  67. package/src/Marks/index.tsx +40 -0
  68. package/src/Slider.tsx +582 -0
  69. package/src/Steps/Dot.tsx +40 -0
  70. package/src/Steps/index.tsx +54 -0
  71. package/src/Tracks/Track.tsx +89 -0
  72. package/src/Tracks/index.tsx +92 -0
  73. package/src/context.ts +65 -0
  74. package/src/hooks/useDrag.ts +244 -0
  75. package/src/hooks/useOffset.ts +264 -0
  76. package/src/hooks/useRange.ts +24 -0
  77. package/src/index.ts +8 -0
  78. package/src/interface.ts +17 -0
  79. package/src/util.ts +41 -0
  80. package/vite.config.ts +18 -0
  81. package/vitest.config.ts +11 -0
package/dist/util.js ADDED
@@ -0,0 +1,29 @@
1
+ function o(r, e, a) {
2
+ return (r - e) / (a - e);
3
+ }
4
+ function f(r, e, a, s) {
5
+ const n = o(e, a, s), t = {};
6
+ switch (r) {
7
+ case "rtl":
8
+ t.right = `${n * 100}%`, t.transform = "translateX(50%)";
9
+ break;
10
+ case "btt":
11
+ t.bottom = `${n * 100}%`, t.transform = "translateY(50%)";
12
+ break;
13
+ case "ttb":
14
+ t.top = `${n * 100}%`, t.transform = "translateY(-50%)";
15
+ break;
16
+ default:
17
+ t.left = `${n * 100}%`, t.transform = "translateX(-50%)";
18
+ break;
19
+ }
20
+ return t;
21
+ }
22
+ function c(r, e) {
23
+ return Array.isArray(r) ? r[e] : r;
24
+ }
25
+ export {
26
+ f as getDirectionStyle,
27
+ c as getIndex,
28
+ o as getOffset
29
+ };
@@ -0,0 +1,94 @@
1
+ import type { PropType, VNode } from 'vue'
2
+ import type { SliderProps } from '../src'
3
+ import Tooltip from '@v-c/tooltip'
4
+ import raf from '@v-c/util/dist/raf'
5
+ import { defineComponent, ref, watchEffect } from 'vue'
6
+ import Slider from '../src'
7
+ import './assets/bootstrap.less'
8
+
9
+ export const HandleTooltip = defineComponent({
10
+ name: 'HandleTooltip',
11
+ props: {
12
+ value: { type: Number, required: true },
13
+ visible: { type: Boolean, required: true },
14
+ tipFormatter: { type: Function as PropType<(value: number) => string>, default: (val: number) => `${val} %` },
15
+ },
16
+ setup(props, { slots }) {
17
+ const tooltipRef = ref()
18
+ const rafRef = ref<number | null>(null)
19
+
20
+ function cancelKeepAlign() {
21
+ raf.cancel(rafRef.value!)
22
+ }
23
+
24
+ function keepAlign() {
25
+ rafRef.value = raf(() => {
26
+ tooltipRef.value?.forceAlign()
27
+ })
28
+ }
29
+
30
+ watchEffect((onCleanup) => {
31
+ if (props.visible) {
32
+ keepAlign()
33
+ }
34
+ else {
35
+ cancelKeepAlign()
36
+ }
37
+
38
+ onCleanup(cancelKeepAlign)
39
+ })
40
+ return () => (
41
+ <Tooltip
42
+ placement="top"
43
+ overlayInnerStyle={{ minHeight: 'auto' }}
44
+ ref={tooltipRef.value}
45
+ visible={props.visible}
46
+ v-slots={{
47
+ default: slots.default,
48
+ overlay: () => props.tipFormatter(props.value),
49
+ }}
50
+ />
51
+ )
52
+ },
53
+ })
54
+
55
+ interface HandleTooltipProps {
56
+ index: number
57
+ prefixCls: string
58
+ value: number
59
+ dragging: boolean
60
+ draggingDelete: boolean
61
+ node: HTMLElement
62
+ }
63
+ export function HandleRender(props: HandleTooltipProps) {
64
+ return (
65
+ <HandleTooltip value={props.value} visible={props.dragging}>
66
+ {props.node}
67
+ </HandleTooltip>
68
+ )
69
+ }
70
+
71
+ interface TooltipSliderProps extends SliderProps {
72
+ tipFormatter?: (value: number) => VNode
73
+ tipProps?: any
74
+ }
75
+
76
+ const TooltipSlider = defineComponent<TooltipSliderProps>({
77
+ name: 'TooltipSlider',
78
+ props: {
79
+ tipFormatter: Function as PropType<(value: number) => string>,
80
+ tipProps: Object,
81
+ },
82
+ setup(_, { attrs }) {
83
+ return () => {
84
+ return (
85
+ <Slider
86
+ {...attrs}
87
+ handleRender={HandleRender}
88
+ />
89
+ )
90
+ }
91
+ },
92
+ })
93
+
94
+ export default TooltipSlider
@@ -0,0 +1,63 @@
1
+ .@{tooltip-prefix-cls} {
2
+ .effect() {
3
+ animation-duration: 0.3s;
4
+ animation-fill-mode: both;
5
+ }
6
+
7
+ &&-zoom-appear,
8
+ &&-zoom-enter {
9
+ opacity: 0;
10
+ }
11
+
12
+ &&-zoom-enter, &&-zoom-leave {
13
+ display: block;
14
+ }
15
+
16
+ &-zoom-enter, &-zoom-appear {
17
+ opacity: 0;
18
+ .effect();
19
+ animation-timing-function: cubic-bezier(0.18, 0.89, 0.32, 1.28);
20
+ animation-play-state: paused;
21
+ }
22
+
23
+ &-zoom-leave {
24
+ .effect();
25
+ animation-timing-function: cubic-bezier(0.6, -0.3, 0.74, 0.05);
26
+ animation-play-state: paused;
27
+ }
28
+
29
+ &-zoom-enter&-zoom-enter-active, &-zoom-appear&-zoom-appear-active {
30
+ animation-name: rcToolTipZoomIn;
31
+ animation-play-state: running;
32
+ }
33
+
34
+ &-zoom-leave&-zoom-leave-active {
35
+ animation-name: rcToolTipZoomOut;
36
+ animation-play-state: running;
37
+ }
38
+
39
+ @keyframes rcToolTipZoomIn {
40
+ 0% {
41
+ opacity: 0;
42
+ transform-origin: 50% 50%;
43
+ transform: scale(0, 0);
44
+ }
45
+ 100% {
46
+ opacity: 1;
47
+ transform-origin: 50% 50%;
48
+ transform: scale(1, 1);
49
+ }
50
+ }
51
+ @keyframes rcToolTipZoomOut {
52
+ 0% {
53
+ opacity: 1;
54
+ transform-origin: 50% 50%;
55
+ transform: scale(1, 1);
56
+ }
57
+ 100% {
58
+ opacity: 0;
59
+ transform-origin: 50% 50%;
60
+ transform: scale(0, 0);
61
+ }
62
+ }
63
+ }
@@ -0,0 +1,163 @@
1
+ @import './anim.less';
2
+
3
+ @tooltip-prefix-cls: vc-tooltip;
4
+
5
+ //
6
+ // Tooltips
7
+ // --------------------------------------------------
8
+ @font-size-base : 12px;
9
+ @line-height-base : 1.5;
10
+ @border-radius-base : 6px;
11
+ @overlay-shadow : 0 0 4px rgba(0, 0, 0, 0.17);
12
+ //** Tooltip text color
13
+ @tooltip-color: #fff;
14
+ //** Tooltip background color
15
+ @tooltip-bg: #373737;
16
+ @tooltip-opacity: 0.9;
17
+
18
+ //** Tooltip arrow width
19
+ @tooltip-arrow-width: 5px;
20
+ //** Tooltip distance with trigger
21
+ @tooltip-distance: @tooltip-arrow-width + 4;
22
+ //** Tooltip arrow color
23
+ @tooltip-arrow-color: @tooltip-bg;
24
+
25
+ // Base class
26
+ .@{tooltip-prefix-cls} {
27
+ position: absolute;
28
+ z-index: 1070;
29
+ display: block;
30
+ visibility: visible;
31
+ // remove left/top by yiminghe
32
+ // left: -9999px;
33
+ // top: -9999px;
34
+ font-size: @font-size-base;
35
+ line-height: @line-height-base;
36
+ opacity: @tooltip-opacity;
37
+
38
+ &-hidden {
39
+ display: none;
40
+ }
41
+
42
+ //&-placement-top, &-placement-topLeft, &-placement-topRight {
43
+ // padding: @tooltip-arrow-width 0 @tooltip-distance 0;
44
+ //}
45
+ //&-placement-right, &-placement-rightTop, &-placement-rightBottom {
46
+ // padding: 0 @tooltip-arrow-width 0 @tooltip-distance;
47
+ //}
48
+ //&-placement-bottom, &-placement-bottomLeft, &-placement-bottomRight {
49
+ // padding: @tooltip-distance 0 @tooltip-arrow-width 0;
50
+ //}
51
+ //&-placement-left, &-placement-leftTop, &-placement-leftBottom {
52
+ // padding: 0 @tooltip-distance 0 @tooltip-arrow-width;
53
+ //}
54
+ }
55
+
56
+ // Wrapper for the tooltip content
57
+ .@{tooltip-prefix-cls}-inner {
58
+ padding: 8px 10px;
59
+ color: @tooltip-color;
60
+ text-align: left;
61
+ text-decoration: none;
62
+ background-color: @tooltip-bg;
63
+ border-radius: @border-radius-base;
64
+ box-shadow: @overlay-shadow;
65
+ min-height: 34px;
66
+ }
67
+
68
+ // Arrows
69
+ .@{tooltip-prefix-cls}-arrow {
70
+ position: absolute;
71
+ width: 0;
72
+ height: 0;
73
+ border-color: transparent;
74
+ border-style: solid;
75
+ }
76
+
77
+ .@{tooltip-prefix-cls} {
78
+ &-placement-top &-arrow,
79
+ &-placement-topLeft &-arrow,
80
+ &-placement-topRight &-arrow {
81
+ bottom: @tooltip-distance - @tooltip-arrow-width;
82
+ margin-left: -@tooltip-arrow-width;
83
+ border-width: @tooltip-arrow-width @tooltip-arrow-width 0;
84
+ border-top-color: @tooltip-arrow-color;
85
+ }
86
+
87
+ &-placement-top &-arrow {
88
+ left: 50%;
89
+ }
90
+
91
+ &-placement-topLeft &-arrow {
92
+ left: 15%;
93
+ }
94
+
95
+ &-placement-topRight &-arrow {
96
+ right: 15%;
97
+ }
98
+
99
+ &-placement-right &-arrow,
100
+ &-placement-rightTop &-arrow,
101
+ &-placement-rightBottom &-arrow {
102
+ left: @tooltip-distance - @tooltip-arrow-width;
103
+ margin-top: -@tooltip-arrow-width;
104
+ border-width: @tooltip-arrow-width @tooltip-arrow-width @tooltip-arrow-width 0;
105
+ border-right-color: @tooltip-arrow-color;
106
+ }
107
+
108
+ &-placement-right &-arrow {
109
+ top: 50%;
110
+ }
111
+
112
+ &-placement-rightTop &-arrow {
113
+ top: 15%;
114
+ margin-top: 0;
115
+ }
116
+
117
+ &-placement-rightBottom &-arrow {
118
+ bottom: 15%;
119
+ }
120
+
121
+ &-placement-left &-arrow,
122
+ &-placement-leftTop &-arrow,
123
+ &-placement-leftBottom &-arrow {
124
+ right: @tooltip-distance - @tooltip-arrow-width;
125
+ margin-top: -@tooltip-arrow-width;
126
+ border-width: @tooltip-arrow-width 0 @tooltip-arrow-width @tooltip-arrow-width;
127
+ border-left-color: @tooltip-arrow-color;
128
+ }
129
+
130
+ &-placement-left &-arrow {
131
+ top: 50%;
132
+ }
133
+
134
+ &-placement-leftTop &-arrow {
135
+ top: 15%;
136
+ margin-top: 0;
137
+ }
138
+
139
+ &-placement-leftBottom &-arrow {
140
+ bottom: 15%;
141
+ }
142
+
143
+ &-placement-bottom &-arrow,
144
+ &-placement-bottomLeft &-arrow,
145
+ &-placement-bottomRight &-arrow {
146
+ top: @tooltip-distance - @tooltip-arrow-width;
147
+ margin-left: -@tooltip-arrow-width;
148
+ border-width: 0 @tooltip-arrow-width @tooltip-arrow-width;
149
+ border-bottom-color: @tooltip-arrow-color;
150
+ }
151
+
152
+ &-placement-bottom &-arrow {
153
+ left: 50%;
154
+ }
155
+
156
+ &-placement-bottomLeft &-arrow {
157
+ left: 15%;
158
+ }
159
+
160
+ &-placement-bottomRight &-arrow {
161
+ right: 15%;
162
+ }
163
+ }
@@ -0,0 +1,337 @@
1
+
2
+ @prefixClass: vc-slider;
3
+
4
+ @disabledColor: #ccc;
5
+ @border-radius-base: 6px;
6
+ @primary-color: #2db7f5;
7
+ @tooltip-color: #fff;
8
+ @tooltip-bg: tint(#666, 4%);
9
+ @tooltip-arrow-width: 4px;
10
+ @tooltip-distance: @tooltip-arrow-width+4;
11
+ @tooltip-arrow-color: @tooltip-bg;
12
+ @ease-out-quint: cubic-bezier(0.23, 1, 0.32, 1);
13
+ @ease-in-quint: cubic-bezier(0.755, 0.05, 0.855, 0.06);
14
+
15
+ .borderBox() {
16
+ box-sizing: border-box;
17
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0); // remove tap highlight color for mobile safari
18
+
19
+ * {
20
+ box-sizing: border-box;
21
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0); // remove tap highlight color for mobile safari
22
+ }
23
+ }
24
+
25
+ .@{prefixClass} {
26
+ position: relative;
27
+ width: 100%;
28
+ height: 14px;
29
+ padding: 5px 0;
30
+ border-radius: @border-radius-base;
31
+ touch-action: none;
32
+ .borderBox();
33
+
34
+ &-rail {
35
+ position: absolute;
36
+ width: 100%;
37
+ height: 4px;
38
+ background-color: #e9e9e9;
39
+ border-radius: @border-radius-base;
40
+ }
41
+
42
+ &-track,
43
+ &-tracks {
44
+ position: absolute;
45
+ height: 4px;
46
+ background-color: tint(@primary-color, 60%);
47
+ border-radius: @border-radius-base;
48
+ }
49
+
50
+ &-track-draggable {
51
+ z-index: 1;
52
+ box-sizing: content-box;
53
+ background-clip: content-box;
54
+ border-top: 5px solid rgba(0, 0, 0, 0);
55
+ border-bottom: 5px solid rgba(0, 0, 0, 0);
56
+ transform: translateY(-5px);
57
+ }
58
+
59
+ &-handle {
60
+ position: absolute;
61
+ z-index: 1;
62
+ width: 14px;
63
+ height: 14px;
64
+ margin-top: -5px;
65
+ background-color: #fff;
66
+ border: solid 2px tint(@primary-color, 50%);
67
+ border-radius: 50%;
68
+ cursor: pointer;
69
+ cursor: -webkit-grab;
70
+ cursor: grab;
71
+ opacity: 0.8;
72
+ user-select: none;
73
+ touch-action: pan-x;
74
+
75
+ &-dragging&-dragging&-dragging {
76
+ border-color: tint(@primary-color, 20%);
77
+ box-shadow: 0 0 0 5px tint(@primary-color, 50%);
78
+
79
+ &-delete {
80
+ opacity: 0;
81
+ }
82
+ }
83
+
84
+ &:focus {
85
+ outline: none;
86
+ box-shadow: none;
87
+ }
88
+
89
+ &:focus-visible {
90
+ border-color: @primary-color;
91
+ box-shadow: 0 0 0 3px tint(@primary-color, 50%);
92
+ }
93
+
94
+ &-click-focused:focus {
95
+ border-color: tint(@primary-color, 50%);
96
+ box-shadow: unset;
97
+ }
98
+
99
+ &:hover {
100
+ border-color: tint(@primary-color, 20%);
101
+ }
102
+
103
+ &:active {
104
+ border-color: tint(@primary-color, 20%);
105
+ box-shadow: 0 0 5px tint(@primary-color, 20%);
106
+ cursor: -webkit-grabbing;
107
+ cursor: grabbing;
108
+ }
109
+ }
110
+
111
+ &-mark {
112
+ position: absolute;
113
+ top: 18px;
114
+ left: 0;
115
+ width: 100%;
116
+ font-size: 12px;
117
+ }
118
+
119
+ &-mark-text {
120
+ position: absolute;
121
+ display: inline-block;
122
+ color: #999;
123
+ text-align: center;
124
+ vertical-align: middle;
125
+ cursor: pointer;
126
+
127
+ &-active {
128
+ color: #666;
129
+ }
130
+ }
131
+
132
+ &-step {
133
+ position: absolute;
134
+ width: 100%;
135
+ height: 4px;
136
+ background: transparent;
137
+ }
138
+
139
+ &-dot {
140
+ position: absolute;
141
+ bottom: -2px;
142
+ width: 8px;
143
+ height: 8px;
144
+ vertical-align: middle;
145
+ background-color: #fff;
146
+ border: 2px solid #e9e9e9;
147
+ border-radius: 50%;
148
+ cursor: pointer;
149
+ &-active {
150
+ border-color: tint(@primary-color, 50%);
151
+ }
152
+ &-reverse {
153
+ margin-right: -4px;
154
+ }
155
+ }
156
+
157
+ &-disabled {
158
+ background-color: #e9e9e9;
159
+
160
+ .@{prefixClass}-track {
161
+ background-color: @disabledColor;
162
+ }
163
+
164
+ .@{prefixClass}-handle,
165
+ .@{prefixClass}-dot {
166
+ background-color: #fff;
167
+ border-color: @disabledColor;
168
+ box-shadow: none;
169
+ cursor: not-allowed;
170
+ }
171
+
172
+ .@{prefixClass}-mark-text,
173
+ .@{prefixClass}-dot {
174
+ cursor: not-allowed !important;
175
+ }
176
+ }
177
+ }
178
+
179
+ .@{prefixClass}-vertical {
180
+ width: 14px;
181
+ height: 100%;
182
+ padding: 0 5px;
183
+
184
+ .@{prefixClass} {
185
+ &-rail {
186
+ width: 4px;
187
+ height: 100%;
188
+ }
189
+
190
+ &-track {
191
+ bottom: 0;
192
+ left: 5px;
193
+ width: 4px;
194
+ }
195
+
196
+ &-track-draggable {
197
+ border-top: 0;
198
+ border-right: 5px solid rgba(0, 0, 0, 0);
199
+ border-bottom: 0;
200
+ border-left: 5px solid rgba(0, 0, 0, 0);
201
+ transform: translateX(-5px);
202
+ }
203
+
204
+ &-handle {
205
+ position: absolute;
206
+ z-index: 1;
207
+ margin-top: 0;
208
+ margin-left: -5px;
209
+ touch-action: pan-y;
210
+ }
211
+
212
+ &-mark {
213
+ top: 0;
214
+ left: 18px;
215
+ height: 100%;
216
+ }
217
+
218
+ &-step {
219
+ width: 4px;
220
+ height: 100%;
221
+ }
222
+
223
+ &-dot {
224
+ margin-left: -2px;
225
+ }
226
+ }
227
+ }
228
+
229
+ .motion-common() {
230
+ display: block !important;
231
+ animation-duration: 0.3s;
232
+ animation-fill-mode: both;
233
+ }
234
+
235
+ .make-motion(@className, @keyframeName) {
236
+ .@{className}-enter,
237
+ .@{className}-appear {
238
+ .motion-common();
239
+ animation-play-state: paused;
240
+ }
241
+ .@{className}-leave {
242
+ .motion-common();
243
+ animation-play-state: paused;
244
+ }
245
+ .@{className}-enter.@{className}-enter-active,
246
+ .@{className}-appear.@{className}-appear-active {
247
+ animation-name: ~'@{keyframeName}In';
248
+ animation-play-state: running;
249
+ }
250
+ .@{className}-leave.@{className}-leave-active {
251
+ animation-name: ~'@{keyframeName}Out';
252
+ animation-play-state: running;
253
+ }
254
+ }
255
+ .zoom-motion(@className, @keyframeName) {
256
+ .make-motion(@className, @keyframeName);
257
+ .@{className}-enter,
258
+ .@{className}-appear {
259
+ transform: scale(0, 0); // need this by yiminghe
260
+ animation-timing-function: @ease-out-quint;
261
+ }
262
+ .@{className}-leave {
263
+ animation-timing-function: @ease-in-quint;
264
+ }
265
+ }
266
+ .zoom-motion(rc-slider-tooltip-zoom-down, rcSliderTooltipZoomDown);
267
+
268
+ @keyframes rcSliderTooltipZoomDownIn {
269
+ 0% {
270
+ transform: scale(0, 0);
271
+ transform-origin: 50% 100%;
272
+ opacity: 0;
273
+ }
274
+ 100% {
275
+ transform: scale(1, 1);
276
+ transform-origin: 50% 100%;
277
+ }
278
+ }
279
+
280
+ @keyframes rcSliderTooltipZoomDownOut {
281
+ 0% {
282
+ transform: scale(1, 1);
283
+ transform-origin: 50% 100%;
284
+ }
285
+ 100% {
286
+ transform: scale(0, 0);
287
+ transform-origin: 50% 100%;
288
+ opacity: 0;
289
+ }
290
+ }
291
+
292
+ .@{prefixClass}-tooltip {
293
+ position: absolute;
294
+ top: -9999px;
295
+ left: -9999px;
296
+ visibility: visible;
297
+
298
+ .borderBox();
299
+
300
+ &-hidden {
301
+ display: none;
302
+ }
303
+
304
+ &-placement-top {
305
+ padding: @tooltip-arrow-width 0 @tooltip-distance 0;
306
+ }
307
+
308
+ &-inner {
309
+ min-width: 24px;
310
+ height: 24px;
311
+ padding: 6px 2px;
312
+ color: @tooltip-color;
313
+ font-size: 12px;
314
+ line-height: 1;
315
+ text-align: center;
316
+ text-decoration: none;
317
+ background-color: @tooltip-bg;
318
+ border-radius: @border-radius-base;
319
+ box-shadow: 0 0 4px #d9d9d9;
320
+ }
321
+
322
+ &-arrow {
323
+ position: absolute;
324
+ width: 0;
325
+ height: 0;
326
+ border-color: transparent;
327
+ border-style: solid;
328
+ }
329
+
330
+ &-placement-top &-arrow {
331
+ bottom: @tooltip-distance - @tooltip-arrow-width;
332
+ left: 50%;
333
+ margin-left: -@tooltip-arrow-width;
334
+ border-width: @tooltip-arrow-width @tooltip-arrow-width 0;
335
+ border-top-color: @tooltip-arrow-color;
336
+ }
337
+ }