kui-vue 3.3.0 → 3.3.1
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.
- package/components/affix/demo/callbacks.md +25 -0
- package/components/affix/demo/index.vue +2 -2
- package/components/avatar/demo/change.md +7 -8
- package/components/avatar/demo/index.vue +9 -2
- package/components/avatar/demo/types.md +4 -4
- package/components/badge/demo/color.md +1 -1
- package/components/badge/demo/dot.md +1 -1
- package/components/badge/demo/index.vue +8 -8
- package/components/base/input.jsx +2 -1
- package/components/breadcrumb/demo/icon.md +1 -1
- package/components/breadcrumb/demo/index.vue +4 -4
- package/components/breadcrumb/demo/separator.md +5 -7
- package/components/breadcrumb/styles/index.less +12 -0
- package/components/button/demo/index.vue +7 -7
- package/components/button/demo/normal.md +2 -2
- package/components/button/demo/size.md +1 -1
- package/components/button/styles/index.less +145 -44
- package/components/card/demo/index.vue +3 -3
- package/components/carousel/demo/index.vue +1 -1
- package/components/checkbox/demo/disabled.md +15 -10
- package/components/checkbox/demo/index.vue +16 -9
- package/components/collapse/demo/index.vue +6 -6
- package/components/colorPicker/colorpicker.jsx +1 -0
- package/components/colorPicker/demo/index.vue +2 -2
- package/components/colorPicker/styles/index.less +293 -240
- package/components/datePicker/demo/index.vue +1 -1
- package/components/datePicker/styles/datepicker.less +1 -0
- package/components/descriptions/demo/index.vue +2 -2
- package/components/divider/demo/index.vue +4 -4
- package/components/drawer/demo/form.md +0 -26
- package/components/drawer/demo/index.vue +16 -8
- package/components/dropdown/demo/base.md +2 -2
- package/components/dropdown/demo/index.vue +12 -3
- package/components/dropdown/demo/placement.md +0 -8
- package/components/empty/demo/custom.md +2 -2
- package/components/empty/demo/index.vue +5 -5
- package/components/form/styles/index.less +39 -4
- package/components/icon/demo/index.vue +3 -3
- package/components/image/demo/base.md +1 -1
- package/components/image/demo/errors.md +2 -2
- package/components/image/demo/extra.md +3 -3
- package/components/image/demo/extra_globle.md +3 -3
- package/components/image/demo/globle.md +4 -4
- package/components/image/demo/group.md +2 -2
- package/components/image/demo/index.vue +8 -8
- package/components/image/demo/origin.md +2 -2
- package/components/image/preview.jsx +13 -6
- package/components/image/styles/index.less +5 -2
- package/components/input/demo/index.vue +9 -9
- package/components/input/styles/index.less +21 -8
- package/components/input/textarea.jsx +5 -0
- package/components/inputNumber/demo/index.vue +6 -6
- package/components/inputNumber/styles/index.less +1 -1
- package/components/layout/styles/index.less +5 -1
- package/components/loading/demo/index.vue +10 -3
- package/components/locale/index.js +1 -1
- package/components/menu/styles/dropmenu.less +19 -1
- package/components/menu/styles/index.less +156 -19
- package/components/message/demo/index.vue +16 -7
- package/components/modal/demo/base.md +3 -1
- package/components/modal/demo/confrim.md +3 -2
- package/components/modal/demo/index.vue +17 -8
- package/components/modal/index.js +6 -5
- package/components/modal/modal.jsx +1 -1
- package/components/modal/styles/index.less +18 -14
- package/components/notice/demo/index.vue +16 -7
- package/components/notice/styles/index.less +1 -0
- package/components/page/demo/index.vue +6 -6
- package/components/page/styles/index.less +10 -3
- package/components/popconfirm/demo/index.vue +1 -1
- package/components/popconfirm/styles/index.less +1 -1
- package/components/poptip/demo/index.vue +1 -1
- package/components/poptip/styles/index.less +197 -170
- package/components/progress/demo/index.vue +1 -1
- package/components/radio/demo/index.vue +9 -10
- package/components/radio/styles/index.less +1 -1
- package/components/rate/demo/index.vue +9 -9
- package/components/select/demo/index.vue +10 -10
- package/components/skeleton/demo/custom.md +1 -1
- package/components/skeleton/demo/index.vue +1 -1
- package/components/slider/demo/index.vue +8 -8
- package/components/slider/styles/index.less +5 -1
- package/components/slider/thumb.jsx +25 -7
- package/components/space/demo/index.vue +8 -8
- package/components/spin/demo/base.md +3 -1
- package/components/spin/demo/index.vue +5 -5
- package/components/spin/spin.jsx +8 -1
- package/components/spin/styles/index.less +18 -4
- package/components/styles/color.less +18 -2
- package/components/styles/var.less +26 -4
- package/components/switch/demo/index.vue +8 -8
- package/components/switch/styles/index.less +28 -1
- package/components/table/demo/base.md +1 -1
- package/components/table/demo/fixed-head.md +3 -1
- package/components/table/demo/index.vue +19 -21
- package/components/table/extend.jsx +41 -23
- package/components/table/index.md +1 -0
- package/components/table/styles/index.less +10 -1
- package/components/table/table.jsx +3 -3
- package/components/tabs/demo/index.vue +10 -10
- package/components/tag/demo/index.vue +4 -4
- package/components/timeline/demo/index.vue +4 -4
- package/components/tooltip/demo/index.vue +1 -1
- package/components/tooltip/styles/index.less +1 -1
- package/components/tree/demo/index.vue +1 -1
- package/components/upload/demo/index.vue +12 -12
- package/components/upload/demo/picture.md +2 -2
- package/dist/k-ui.css +2 -2
- package/dist/k-ui.js +2 -2
- package/dist/locale/de.js +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/ua.js +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/zhCN.js +1 -1
- package/dist/locale/zhTW.js +1 -1
- package/package.json +17 -20
- package/readme.md +2 -2
|
@@ -1,191 +1,218 @@
|
|
|
1
1
|
@import '../../styles/var.less';
|
|
2
|
+
|
|
2
3
|
.k-poptip {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
4
|
+
display: inline-block;
|
|
5
|
+
position: relative;
|
|
6
|
+
// max-width: 300px;
|
|
7
|
+
color: var(--kui-color-font);
|
|
8
|
+
font-size: 12px;
|
|
9
|
+
line-height: 1.5;
|
|
10
|
+
position: absolute;
|
|
11
|
+
z-index: 1001;
|
|
12
|
+
transform: translateZ(0);
|
|
13
|
+
|
|
14
|
+
&[k-placement^=top] {
|
|
15
|
+
.k-poptip-arrow {
|
|
16
|
+
bottom: -7px;
|
|
17
|
+
height: 9px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.k-poptip-content {
|
|
21
|
+
margin-bottom: 12px;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&[k-placement=top] {
|
|
26
|
+
.k-poptip-arrow {
|
|
27
|
+
left: 50%;
|
|
28
|
+
transform: translateX(-50%);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&[k-placement=top-right] {
|
|
33
|
+
.k-poptip-arrow {
|
|
34
|
+
right: 12px;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&[k-placement=top-left] {
|
|
39
|
+
.k-poptip-arrow {
|
|
40
|
+
left: 12px;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&[k-placement^=bottom] {
|
|
45
|
+
.k-poptip-arrow {
|
|
46
|
+
top: -7px;
|
|
47
|
+
height: 9px;
|
|
48
|
+
transform: rotate(180deg);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.k-poptip-content {
|
|
52
|
+
margin-top: 12px;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&[k-placement=bottom] {
|
|
57
|
+
.k-poptip-arrow {
|
|
58
|
+
left: 50%;
|
|
59
|
+
transform: translateX(-50%) rotate(180deg);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&[k-placement=bottom-left] {
|
|
64
|
+
.k-poptip-arrow {
|
|
65
|
+
left: 12px;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&[k-placement=bottom-right] {
|
|
70
|
+
.k-poptip-arrow {
|
|
71
|
+
right: 12px;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&[k-placement^=left] {
|
|
76
|
+
.k-poptip-arrow {
|
|
77
|
+
right: -14px;
|
|
78
|
+
width: 24px;
|
|
79
|
+
height: 7px;
|
|
80
|
+
transform: rotate(-90deg);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.k-poptip-content {
|
|
84
|
+
margin-right: 12px;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&[k-placement=left] {
|
|
89
|
+
.k-poptip-arrow {
|
|
90
|
+
top: 50%;
|
|
91
|
+
transform: translateY(-50%) rotate(-90deg);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&[k-placement=left-bottom] {
|
|
96
|
+
.k-poptip-arrow {
|
|
97
|
+
bottom: 12px;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&[k-placement=left-top] {
|
|
102
|
+
.k-poptip-arrow {
|
|
103
|
+
top: 12px;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&[k-placement^=right] {
|
|
108
|
+
.k-poptip-arrow {
|
|
109
|
+
left: -14px;
|
|
110
|
+
width: 24px;
|
|
111
|
+
height: 7px;
|
|
112
|
+
transform: rotate(90deg);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.k-poptip-content {
|
|
116
|
+
margin-left: 12px;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&[k-placement=right] {
|
|
121
|
+
.k-poptip-arrow {
|
|
122
|
+
top: 50%;
|
|
123
|
+
transform: translateY(-50%) rotate(90deg);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&[k-placement=right-top] {
|
|
128
|
+
.k-poptip-arrow {
|
|
129
|
+
top: 12px;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&[k-placement=right-bottom] {
|
|
134
|
+
.k-poptip-arrow {
|
|
135
|
+
bottom: 12px;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
117
138
|
}
|
|
118
139
|
|
|
119
140
|
.k-poptip-content {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
141
|
+
min-width: 200px;
|
|
142
|
+
// .k-poptip-inner {
|
|
143
|
+
background: var(--kui-color-control-10);
|
|
144
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
145
|
+
border-radius: 8px; // var(--kui-border-radius);
|
|
146
|
+
position: relative;
|
|
147
|
+
|
|
148
|
+
// }
|
|
149
|
+
.k-poptip-body {
|
|
150
|
+
font-size: 14px;
|
|
151
|
+
padding: 8px 16px;
|
|
152
|
+
box-sizing: border-box;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.k-poptip-title {
|
|
156
|
+
font-size: 16px;
|
|
157
|
+
font-weight: 500;
|
|
158
|
+
color: var(--kui-color-font);
|
|
159
|
+
margin: 0;
|
|
160
|
+
padding: 8px 16px;
|
|
161
|
+
position: relative;
|
|
162
|
+
border-bottom: 1px solid var(--kui-color-gray-80);
|
|
163
|
+
text-overflow: ellipsis;
|
|
164
|
+
overflow: hidden;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.k-poptip-arrow {
|
|
168
|
+
position: absolute;
|
|
169
|
+
box-sizing: border-box;
|
|
170
|
+
display: flex;
|
|
171
|
+
width: 24px;
|
|
172
|
+
height: 7px;
|
|
173
|
+
color: var(--kui-color-control-10);
|
|
174
|
+
}
|
|
151
175
|
}
|
|
152
176
|
|
|
153
177
|
.k-poptip-dark {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
178
|
+
background-color: var(--kui-color-dark);
|
|
179
|
+
color: #fff;
|
|
180
|
+
|
|
181
|
+
.k-poptip-title {
|
|
182
|
+
border-bottom: 1px solid rgba(0, 0, 0, .2);
|
|
183
|
+
}
|
|
159
184
|
}
|
|
160
185
|
|
|
161
186
|
@keyframes pop-zoom-in {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
187
|
+
from {
|
|
188
|
+
opacity: 0;
|
|
189
|
+
transform: scale(.8, .8);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
to {
|
|
193
|
+
opacity: 1;
|
|
194
|
+
transform: scale(1, 1);
|
|
195
|
+
}
|
|
170
196
|
}
|
|
171
197
|
|
|
172
198
|
@keyframes pop-zoom-out {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
199
|
+
from {
|
|
200
|
+
opacity: 1;
|
|
201
|
+
transform: scale(1, 1);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
to {
|
|
205
|
+
opacity: 0;
|
|
206
|
+
transform: scale(.8, .8);
|
|
207
|
+
}
|
|
181
208
|
}
|
|
182
209
|
|
|
183
210
|
.k-poptip-enter-active {
|
|
184
|
-
|
|
185
|
-
|
|
211
|
+
// transform-origin: center bottom;
|
|
212
|
+
animation: pop-zoom-in .3s;
|
|
186
213
|
}
|
|
187
214
|
|
|
188
215
|
.k-poptip-leave-active {
|
|
189
|
-
|
|
190
|
-
|
|
216
|
+
// transform-origin: center bottom;
|
|
217
|
+
animation: pop-zoom-out .3s;
|
|
191
218
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import Base from './base'
|
|
3
|
-
import Info from './info'
|
|
4
|
-
import Disabled from './disabled'
|
|
5
|
-
import Group from './group'
|
|
6
|
-
import Options from './options'
|
|
7
|
-
import GroupVertical from './group-vertical'
|
|
8
|
-
import Button from './button'
|
|
2
|
+
import Base from './base.md'
|
|
3
|
+
import Info from './info.md'
|
|
4
|
+
import Disabled from './disabled.md'
|
|
5
|
+
import Group from './group.md'
|
|
6
|
+
import Options from './options.md'
|
|
7
|
+
import GroupVertical from './group-vertical.md'
|
|
8
|
+
import Button from './button.md'
|
|
9
9
|
import CN from '../index.md'
|
|
10
10
|
export default {
|
|
11
11
|
render() {
|
|
12
12
|
return (
|
|
13
|
-
<div class="
|
|
13
|
+
<div class="demo-radio">
|
|
14
14
|
<Info class="typo" />
|
|
15
15
|
<Base />
|
|
16
16
|
<Disabled />
|
|
@@ -23,5 +23,4 @@ export default {
|
|
|
23
23
|
)
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
</script>
|
|
26
|
+
</script>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import Info from "./info";
|
|
3
|
-
import Base from "./base";
|
|
4
|
-
import Half from "./half";
|
|
5
|
-
import Tips from "./tips";
|
|
6
|
-
import Disabled from "./disabled";
|
|
7
|
-
import Clear from "./clear";
|
|
8
|
-
import Character from "./character";
|
|
9
|
-
import Custom from "./custom";
|
|
2
|
+
import Info from "./info.md";
|
|
3
|
+
import Base from "./base.md";
|
|
4
|
+
import Half from "./half.md";
|
|
5
|
+
import Tips from "./tips.md";
|
|
6
|
+
import Disabled from "./disabled.md";
|
|
7
|
+
import Clear from "./clear.md";
|
|
8
|
+
import Character from "./character.md";
|
|
9
|
+
import Custom from "./custom.md";
|
|
10
10
|
|
|
11
11
|
import CN from "../index.md";
|
|
12
12
|
export default {
|
|
13
13
|
render() {
|
|
14
14
|
return (
|
|
15
|
-
<div class="
|
|
15
|
+
<div class="demo-rate">
|
|
16
16
|
<Info class="typo" />
|
|
17
17
|
<Base />
|
|
18
18
|
<Half />
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import Info from './info'
|
|
3
|
-
import Base from './base'
|
|
4
|
-
import Theme from './theme'
|
|
5
|
-
import Icons from './icon'
|
|
6
|
-
import Size from './size'
|
|
7
|
-
import Clearable from './clearable'
|
|
8
|
-
import NoBordered from './nobordered'
|
|
9
|
-
import Multiple from './multiple'
|
|
10
|
-
import Filterable from './filterable'
|
|
11
|
-
import Search from './search'
|
|
2
|
+
import Info from './info.md'
|
|
3
|
+
import Base from './base.md'
|
|
4
|
+
import Theme from './theme.md'
|
|
5
|
+
import Icons from './icon.md'
|
|
6
|
+
import Size from './size.md'
|
|
7
|
+
import Clearable from './clearable.md'
|
|
8
|
+
import NoBordered from './nobordered.md'
|
|
9
|
+
import Multiple from './multiple.md'
|
|
10
|
+
import Filterable from './filterable.md'
|
|
11
|
+
import Search from './search.md'
|
|
12
12
|
import CN from '../index.md'
|
|
13
13
|
export default {
|
|
14
14
|
render() {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
height:100px;
|
|
32
32
|
width:166px;
|
|
33
33
|
border-radius:8px;
|
|
34
|
-
background:url("https://
|
|
34
|
+
background:url("https://cdn.chuchur.com/upload/demo/test_300.jpg") no-repeat center;
|
|
35
35
|
background-size:cover;
|
|
36
36
|
}
|
|
37
37
|
.demo-skeleton-card h2{
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import Info from "./info";
|
|
3
|
-
import Base from "./base";
|
|
4
|
-
import WithNumber from "./withNumber";
|
|
5
|
-
import Formatter from "./formatter";
|
|
6
|
-
import Marks from "./marks";
|
|
7
|
-
import Vertical from "./vertical";
|
|
8
|
-
import Reverse from "./reverse";
|
|
2
|
+
import Info from "./info.md";
|
|
3
|
+
import Base from "./base.md";
|
|
4
|
+
import WithNumber from "./withNumber.md";
|
|
5
|
+
import Formatter from "./formatter.md";
|
|
6
|
+
import Marks from "./marks.md";
|
|
7
|
+
import Vertical from "./vertical.md";
|
|
8
|
+
import Reverse from "./reverse.md";
|
|
9
9
|
|
|
10
10
|
import CN from "../index.md";
|
|
11
11
|
export default {
|
|
12
12
|
render() {
|
|
13
13
|
return (
|
|
14
|
-
<div class="
|
|
14
|
+
<div class="demo-slider">
|
|
15
15
|
<Info class="typo" />
|
|
16
16
|
<Base />
|
|
17
17
|
<WithNumber />
|
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
position: relative;
|
|
15
15
|
}
|
|
16
16
|
.k-slider-thumb {
|
|
17
|
+
outline: none;
|
|
17
18
|
user-select: none;
|
|
19
|
+
touch-action: none;
|
|
18
20
|
box-shadow: 0 4px 6px rgb(0 0 0 / 10%), 0 0 1px rgb(0 0 0 / 30%);
|
|
19
21
|
width: 24px;
|
|
20
22
|
height: 24px;
|
|
@@ -22,12 +24,13 @@
|
|
|
22
24
|
border: none;
|
|
23
25
|
border-radius: 50%;
|
|
24
26
|
position: absolute;
|
|
25
|
-
cursor:
|
|
27
|
+
cursor: grab;
|
|
26
28
|
background: #fff;
|
|
27
29
|
border: 1px solid #fff;
|
|
28
30
|
transform: translateX(-50%);
|
|
29
31
|
&:active {
|
|
30
32
|
border: 1px solid var(--kui-color-main);
|
|
33
|
+
cursor: grabbing;
|
|
31
34
|
}
|
|
32
35
|
}
|
|
33
36
|
.k-slider-track {
|
|
@@ -40,6 +43,7 @@
|
|
|
40
43
|
pointer-events: none;
|
|
41
44
|
}
|
|
42
45
|
.k-slider-rail {
|
|
46
|
+
touch-action: none;
|
|
43
47
|
cursor: pointer;
|
|
44
48
|
height: 4px;
|
|
45
49
|
border-radius: 2px;
|
|
@@ -20,13 +20,27 @@ export default {
|
|
|
20
20
|
data() {
|
|
21
21
|
return {
|
|
22
22
|
index: 1,
|
|
23
|
-
showTip: false
|
|
23
|
+
showTip: false,
|
|
24
|
+
touch: false
|
|
24
25
|
}
|
|
25
26
|
},
|
|
27
|
+
mounted() {
|
|
28
|
+
let touch = !!(('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch)
|
|
29
|
+
this.touch = touch
|
|
30
|
+
},
|
|
26
31
|
methods: {
|
|
27
32
|
mouseMove(e) {
|
|
28
33
|
if (this.isMouseDown) {
|
|
29
|
-
|
|
34
|
+
e.preventDefault()
|
|
35
|
+
let clientX, clientY;
|
|
36
|
+
// let { clientX, clientY } = e
|
|
37
|
+
if (e.touches && e.touches.length == 1) {
|
|
38
|
+
clientX = e.touches[0].clientX
|
|
39
|
+
clientY = e.touches[0].clientY
|
|
40
|
+
} else {
|
|
41
|
+
clientX = e.clientX
|
|
42
|
+
clientY = e.clientY
|
|
43
|
+
}
|
|
30
44
|
// let r = e.target.getBoundingClientRect()
|
|
31
45
|
// console.log(e)
|
|
32
46
|
// let clientX = r.left + r.width / 2, clientY = r.top + r.height / 2
|
|
@@ -67,8 +81,9 @@ export default {
|
|
|
67
81
|
} else {
|
|
68
82
|
this.showTip = false
|
|
69
83
|
}
|
|
70
|
-
|
|
71
|
-
document.removeEventListener(
|
|
84
|
+
let [e1, e2] = this.touch ? ['touchmove', 'touchend'] : ['mousemove', 'mouseup']
|
|
85
|
+
document.removeEventListener(e1, this.mouseMove)
|
|
86
|
+
document.removeEventListener(e2, this.mouseUp)
|
|
72
87
|
},
|
|
73
88
|
onMouseDown(e) {
|
|
74
89
|
if (this.disabled) return;
|
|
@@ -76,9 +91,11 @@ export default {
|
|
|
76
91
|
this.showTip = true
|
|
77
92
|
this.index = 2
|
|
78
93
|
// this.mouseMove(e)
|
|
79
|
-
|
|
80
|
-
document.addEventListener(
|
|
81
|
-
|
|
94
|
+
let [e1, e2] = this.touch ? ['touchmove', 'touchend'] : ['mousemove', 'mouseup']
|
|
95
|
+
document.addEventListener(e1, this.mouseMove)
|
|
96
|
+
document.addEventListener(e2, this.mouseUp)
|
|
97
|
+
},
|
|
98
|
+
|
|
82
99
|
},
|
|
83
100
|
render() {
|
|
84
101
|
let { vertical, value, index, disabled, max, min, tipFormatter, range, type, reverse, tooltipVisible } = this
|
|
@@ -90,6 +107,7 @@ export default {
|
|
|
90
107
|
},
|
|
91
108
|
on: {
|
|
92
109
|
mousedown: this.onMouseDown,
|
|
110
|
+
touchstart: this.onMouseDown,
|
|
93
111
|
mouseenter: () => {
|
|
94
112
|
if (!disabled) this.showTip = true
|
|
95
113
|
},
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import Info from "./info";
|
|
3
|
-
import Base from "./base";
|
|
4
|
-
import Vertical from "./vertical";
|
|
5
|
-
import Align from "./align";
|
|
6
|
-
import Size from "./size";
|
|
7
|
-
import Warp from "./wrap";
|
|
8
|
-
import CustomSize from "./custom-size";
|
|
2
|
+
import Info from "./info.md";
|
|
3
|
+
import Base from "./base.md";
|
|
4
|
+
import Vertical from "./vertical.md";
|
|
5
|
+
import Align from "./align.md";
|
|
6
|
+
import Size from "./size.md";
|
|
7
|
+
import Warp from "./wrap.md";
|
|
8
|
+
import CustomSize from "./custom-size.md";
|
|
9
9
|
|
|
10
10
|
import CN from "../index.md";
|
|
11
11
|
export default {
|
|
12
12
|
render() {
|
|
13
13
|
return (
|
|
14
|
-
<div class="
|
|
14
|
+
<div class="demo-space">
|
|
15
15
|
<Info class="typo" />
|
|
16
16
|
<Base />
|
|
17
17
|
<Vertical />
|