kui-vue 3.6.4 → 3.6.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.
- package/components/alert/alert.jsx +26 -7
- package/components/alert/demo/basic.md +4 -4
- package/components/alert/demo/icon.md +15 -6
- package/components/alert/styles/index.less +42 -14
- package/components/avatar/styles/index.less +4 -4
- package/components/backtop/styles/index.less +10 -14
- package/components/badge/styles/index.less +7 -13
- package/components/breadcrumb/index.md +7 -6
- package/components/breadcrumb/styles/index.less +7 -21
- package/components/button/demo/color.md +0 -1
- package/components/button/demo/disabled.md +6 -0
- package/components/button/demo/light.md +1 -1
- package/components/button/styles/index.less +165 -111
- package/components/card/card.jsx +1 -1
- package/components/card/demo/basic.md +1 -1
- package/components/card/demo/border.md +1 -1
- package/components/card/demo/notitle.md +1 -1
- package/components/card/styles/index.less +5 -4
- package/components/carousel/carousel.jsx +186 -175
- package/components/carousel/styles/index.less +11 -16
- package/components/checkbox/checkbox.jsx +2 -2
- package/components/checkbox/styles/index.less +21 -29
- package/components/collapse/styles/index.less +7 -11
- package/components/colorPicker/styles/index.less +83 -71
- package/components/config/context.js +21 -0
- package/components/config/index.js +10 -2
- package/components/datePicker/datepicker.jsx +6 -2
- package/components/datePicker/styles/index.less +54 -57
- package/components/descriptions/styles/index.less +8 -17
- package/components/divider/styles/index.less +20 -18
- package/components/drawer/demo/target.md +1 -0
- package/components/drawer/styles/animal.less +0 -1
- package/components/drawer/styles/index.less +8 -11
- package/components/dropdown/demo/cascading.md +30 -16
- package/components/dropdown/styles/index.less +26 -34
- package/components/empty/index.md +3 -2
- package/components/empty/styles/index.less +2 -2
- package/components/flex/demo/align.md +1 -1
- package/components/flex/demo/basic.md +1 -2
- package/components/flex/index.md +1 -1
- package/components/form/demo/dynamicvalid.md +1 -3
- package/components/form/demo/info.md +22 -12
- package/components/form/demo/valid.md +6 -6
- package/components/form/demo/withmodal.md +6 -6
- package/components/form/styles/index.less +10 -11
- package/components/grid/index.md +4 -1
- package/components/grid/styles/index.less +1 -1
- package/components/icon/demo/search.vue +44 -21
- package/components/icon/index.md +1 -1
- package/components/icon/styles/index.less +7 -8
- package/components/image/index.md +7 -1
- package/components/image/preview.jsx +17 -4
- package/components/image/styles/index.less +36 -42
- package/components/index.js +9 -9
- package/components/input/demo/icon.md +0 -1
- package/components/input/demo/suffix.md +2 -7
- package/components/input/input.jsx +31 -29
- package/components/input/inputBox.jsx +13 -0
- package/components/input/inputGroup.jsx +2 -0
- package/components/input/styles/index.less +47 -53
- package/components/input/textarea.jsx +1 -1
- package/components/inputNumber/demo/basic.md +3 -3
- package/components/inputNumber/demo/ffix.md +2 -2
- package/components/inputNumber/inputNumber.jsx +2 -2
- package/components/inputNumber/styles/index.less +36 -42
- package/components/layout/demo/basic.md +5 -5
- package/components/layout/demo/info.md +1 -34
- package/components/layout/demo/layout1.md +7 -7
- package/components/layout/demo/layout2.md +32 -20
- package/components/layout/demo/layout3.md +20 -13
- package/components/layout/demo/layout4.md +12 -8
- package/components/layout/demo/layout5.md +6 -2
- package/components/layout/styles/index.less +1 -18
- package/components/loading/demo/info.md +3 -3
- package/components/loading/styles/index.less +31 -31
- package/components/menu/demo/accordion.md +44 -22
- package/components/menu/demo/basic.md +35 -20
- package/components/menu/demo/collapsed.md +37 -19
- package/components/menu/demo/inline.md +44 -23
- package/components/menu/demo/mode.md +42 -26
- package/components/menu/demo/theme.md +34 -18
- package/components/menu/demo/vertical.md +34 -18
- package/components/menu/index.md +14 -3
- package/components/menu/menu.jsx +9 -3
- package/components/menu/menuitem.jsx +4 -4
- package/components/menu/recursiveMenu.jsx +40 -0
- package/components/menu/styles/index.less +46 -58
- package/components/message/demo/basic.md +0 -7
- package/components/message/index.js +0 -4
- package/components/message/index.md +0 -1
- package/components/message/inner.jsx +15 -2
- package/components/message/styles/index.less +12 -17
- package/components/modal/demo/confirm.md +6 -6
- package/components/modal/demo/global.md +0 -15
- package/components/modal/demo/info.md +0 -1
- package/components/modal/index.js +5 -34
- package/components/modal/index.md +1 -2
- package/components/modal/modal.jsx +2 -1
- package/components/modal/styles/index.less +14 -21
- package/components/notice/demo/basic.md +0 -9
- package/components/notice/demo/close.md +4 -0
- package/components/notice/demo/types.md +1 -2
- package/components/notice/index.js +1 -19
- package/components/notice/styles/index.less +16 -22
- package/components/page/page.jsx +5 -4
- package/components/page/styles/index.less +49 -50
- package/components/popconfirm/demo/basic.md +11 -18
- package/components/popconfirm/demo/info.md +3 -1
- package/components/popconfirm/demo/local.md +14 -20
- package/components/popconfirm/demo/placement.md +3 -9
- package/components/popconfirm/index.md +3 -2
- package/components/popconfirm/styles/index.less +9 -15
- package/components/poptip/styles/index.less +44 -49
- package/components/progress/styles/index.less +13 -13
- package/components/radio/index.md +7 -7
- package/components/radio/radio.jsx +5 -1
- package/components/radio/styles/index.less +26 -32
- package/components/rate/index.md +11 -11
- package/components/rate/styles/index.less +4 -7
- package/components/select/select.jsx +2 -2
- package/components/select/styles/index.less +37 -50
- package/components/skeleton/index.md +5 -1
- package/components/skeleton/styles/index.less +21 -19
- package/components/slider/slider.jsx +25 -13
- package/components/slider/styles/index.less +13 -12
- package/components/space/space.jsx +2 -1
- package/components/spin/styles/index.less +25 -40
- package/components/statCard/demo/card.md +18 -4
- package/components/statCard/index.md +5 -5
- package/components/statCard/statCard.jsx +4 -1
- package/components/statCard/styles/index.less +9 -6
- package/components/styles/less-css-var.less +305 -0
- package/components/styles/less-var.less +296 -0
- package/components/styles/sys.less +19 -15
- package/components/switch/styles/index.less +9 -24
- package/components/table/index.md +1 -1
- package/components/table/styles/index.less +63 -59
- package/components/table/table.jsx +1 -1
- package/components/tabs/styles/index.less +22 -24
- package/components/tag/demo/basic.md +0 -8
- package/components/tag/index.md +2 -1
- package/components/tag/styles/index.less +40 -41
- package/components/tag/tag.jsx +2 -2
- package/components/timeline/styles/index.less +8 -14
- package/components/tooltip/styles/index.less +35 -40
- package/components/tree/index.md +15 -15
- package/components/tree/styles/index.less +36 -56
- package/components/tree/tree.jsx +1 -0
- package/components/treeselect/index.md +1 -1
- package/components/treeselect/styles/index.less +26 -32
- package/components/treeselect/treeselect.jsx +3 -3
- package/components/upload/demo/forms.md +0 -1
- package/components/upload/fileList.jsx +6 -3
- package/components/upload/styles/index.less +33 -29
- package/components/upload/upload.jsx +5 -1
- package/components/utils/vue.js +4 -2
- package/dist/k-ui.cjs.js +3 -2
- package/dist/k-ui.css +4 -3
- package/dist/k-ui.d.ts +71 -54
- package/dist/k-ui.esm.js +3 -2
- package/dist/k-ui.umd.js +3 -2
- package/dist/locale/de.js +2 -1
- package/dist/locale/el.js +2 -1
- package/dist/locale/en.js +2 -1
- package/dist/locale/fr.js +2 -1
- package/dist/locale/it.js +2 -1
- package/dist/locale/ja.js +2 -1
- package/dist/locale/ko.js +2 -1
- package/dist/locale/ru.js +2 -1
- package/dist/locale/th.js +2 -1
- package/dist/locale/uk.js +2 -1
- package/dist/locale/vi.js +2 -1
- package/dist/locale/zh-CN.js +2 -1
- package/dist/locale/zh-TW.js +2 -1
- package/package.json +14 -16
- package/types/alert/Alert.d.ts +2 -0
- package/types/card/Card.d.ts +1 -1
- package/types/checkbox/Checkbox.d.ts +1 -0
- package/types/datePicker/DatePicker.d.ts +1 -0
- package/types/index.d.ts +6 -6
- package/types/input/Input.d.ts +1 -0
- package/types/input/InputGroup.d.ts +2 -0
- package/types/input/TextArea.d.ts +1 -0
- package/types/inputNumber/InputNumber.d.ts +1 -0
- package/types/menu/Menu.d.ts +1 -0
- package/types/page/Page.d.ts +1 -0
- package/types/select/Select.d.ts +1 -0
- package/types/statCard/StatCard.d.ts +2 -0
- package/types/table/Table.d.ts +1 -1
- package/types/tag/Tag.d.ts +1 -0
- package/types/treeselect/TreeSelect.d.ts +1 -0
- package/components/dropdown/demo/custom.md +0 -31
- package/components/icon/lib/dist.json +0 -1
- package/components/icon/lib/kui-icons.js +0 -1
- package/components/icon/lib/sprite.svg +0 -1
- package/components/styles/color.less +0 -209
- package/components/styles/var.less +0 -207
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import "../../styles/var.less";
|
|
1
|
+
@import "../../styles/less-css-var.less";
|
|
2
2
|
|
|
3
3
|
.k-select {
|
|
4
4
|
display: inline-flex;
|
|
@@ -6,28 +6,27 @@
|
|
|
6
6
|
min-width: 80px;
|
|
7
7
|
box-sizing: border-box;
|
|
8
8
|
vertical-align: middle;
|
|
9
|
-
color: var(--kui-color-
|
|
9
|
+
color: var(--kui-color-text);
|
|
10
10
|
font-size: 14px;
|
|
11
11
|
position: relative;
|
|
12
12
|
outline: none;
|
|
13
13
|
box-sizing: border-box;
|
|
14
14
|
// flex-shrink: 0;
|
|
15
15
|
align-items: center;
|
|
16
|
-
background-color: var(--kui-color-
|
|
16
|
+
background-color: var(--kui-color-bg-container);
|
|
17
17
|
border-radius: var(--kui-border-radius);
|
|
18
18
|
border: 1px solid var(--kui-color-border);
|
|
19
19
|
padding: 0 8px;
|
|
20
20
|
transition: border 0.3s ease-in-out;
|
|
21
21
|
line-height: 1.571;
|
|
22
22
|
position: relative;
|
|
23
|
-
// max-width: 100%;
|
|
24
23
|
&:not(.k-select-disabled, .k-select-borderless):focus {
|
|
25
|
-
outline: 2px solid var(--kui-color-
|
|
24
|
+
outline: 2px solid var(--kui-color-outline);
|
|
26
25
|
outline-offset: 1px;
|
|
27
26
|
}
|
|
28
27
|
&:hover {
|
|
29
|
-
border-color: var(--kui-color-
|
|
30
|
-
box-shadow:
|
|
28
|
+
border-color: var(--kui-color-primary);
|
|
29
|
+
box-shadow: var(--kui-component-shadow);
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
&-selection {
|
|
@@ -73,7 +72,7 @@
|
|
|
73
72
|
background: none;
|
|
74
73
|
outline: none;
|
|
75
74
|
font-size: 14px;
|
|
76
|
-
color: var(--kui-color-
|
|
75
|
+
color: var(--kui-color-text);
|
|
77
76
|
}
|
|
78
77
|
}
|
|
79
78
|
|
|
@@ -88,7 +87,7 @@
|
|
|
88
87
|
.k-select-tag {
|
|
89
88
|
padding: 2px 5px;
|
|
90
89
|
border: 1px solid var(--kui-color-border);
|
|
91
|
-
background-color: var(--kui-color-
|
|
90
|
+
background-color: var(--kui-color-bg-component);
|
|
92
91
|
border-radius: var(--kui-border-radius);
|
|
93
92
|
display: inline-flex;
|
|
94
93
|
align-items: center;
|
|
@@ -98,13 +97,9 @@
|
|
|
98
97
|
transition: all 0.25s ease-in-out;
|
|
99
98
|
|
|
100
99
|
.k-icon {
|
|
101
|
-
// position: absolute;
|
|
102
|
-
// right: 3px;
|
|
103
100
|
font-size: 16px;
|
|
104
101
|
text-align: center;
|
|
105
102
|
display: block;
|
|
106
|
-
// top: 50%;
|
|
107
|
-
// transform: translateY(-50%);
|
|
108
103
|
}
|
|
109
104
|
}
|
|
110
105
|
|
|
@@ -136,7 +131,7 @@
|
|
|
136
131
|
line-height: 1.571;
|
|
137
132
|
overflow: hidden;
|
|
138
133
|
text-overflow: ellipsis;
|
|
139
|
-
color: var(--kui-color-
|
|
134
|
+
color: var(--kui-color-text-placeholder);
|
|
140
135
|
white-space: nowrap;
|
|
141
136
|
max-width: 100%;
|
|
142
137
|
box-sizing: border-box;
|
|
@@ -185,14 +180,17 @@
|
|
|
185
180
|
display: none;
|
|
186
181
|
cursor: pointer;
|
|
187
182
|
&:hover {
|
|
188
|
-
color: var(--kui-color-
|
|
183
|
+
color: var(--kui-color-icon-hover);
|
|
184
|
+
}
|
|
185
|
+
&:active {
|
|
186
|
+
color: var(--kui-color-icon-active);
|
|
189
187
|
}
|
|
190
188
|
}
|
|
191
189
|
|
|
192
190
|
.k-select-search-mirror,
|
|
193
191
|
.k-select-search {
|
|
194
192
|
font-size: 14px;
|
|
195
|
-
color: var(--kui-color-
|
|
193
|
+
color: var(--kui-color-text);
|
|
196
194
|
}
|
|
197
195
|
|
|
198
196
|
&.k-select-circle {
|
|
@@ -227,9 +225,8 @@
|
|
|
227
225
|
.k-select-light {
|
|
228
226
|
&.k-select {
|
|
229
227
|
border-color: transparent;
|
|
230
|
-
background: var(--kui-color-
|
|
228
|
+
background: var(--kui-color-bg-component);
|
|
231
229
|
transition: none;
|
|
232
|
-
// box-shadow: none;
|
|
233
230
|
|
|
234
231
|
&:hover {
|
|
235
232
|
box-shadow: none;
|
|
@@ -237,7 +234,7 @@
|
|
|
237
234
|
}
|
|
238
235
|
|
|
239
236
|
.k-select-tag {
|
|
240
|
-
background-color: var(--kui-color-
|
|
237
|
+
background-color: var(--kui-color-bg-component);
|
|
241
238
|
border-color: transparent;
|
|
242
239
|
}
|
|
243
240
|
}
|
|
@@ -251,19 +248,21 @@
|
|
|
251
248
|
width: 100%;
|
|
252
249
|
}
|
|
253
250
|
.k-select-dropdown {
|
|
251
|
+
-webkit-user-select: none;
|
|
254
252
|
user-select: none;
|
|
255
253
|
border-radius: var(--kui-border-radius);
|
|
256
254
|
width: inherit;
|
|
257
255
|
max-height: 200px;
|
|
258
256
|
overflow: auto;
|
|
259
|
-
background-color: var(--kui-color-
|
|
257
|
+
background-color: var(--kui-color-bg-pop);
|
|
258
|
+
border: 1px solid var(--kui-color-pop-border);
|
|
260
259
|
box-sizing: border-box;
|
|
261
|
-
|
|
260
|
+
box-shadow: var(--kui-pop-shadow);
|
|
261
|
+
|
|
262
262
|
position: absolute;
|
|
263
263
|
z-index: 1003;
|
|
264
264
|
padding: 5px;
|
|
265
|
-
box-sizing: border-box;
|
|
266
|
-
border: 1px solid var(--kui-color-gray-80);
|
|
265
|
+
box-sizing: border-box;
|
|
267
266
|
|
|
268
267
|
ul {
|
|
269
268
|
padding: 0;
|
|
@@ -275,7 +274,7 @@
|
|
|
275
274
|
.k-select-loading {
|
|
276
275
|
padding: 10px;
|
|
277
276
|
font-size: 14px;
|
|
278
|
-
color: var(--kui-color-
|
|
277
|
+
color: var(--kui-color-text);
|
|
279
278
|
display: flex;
|
|
280
279
|
align-items: center;
|
|
281
280
|
|
|
@@ -293,7 +292,7 @@
|
|
|
293
292
|
line-height: 1;
|
|
294
293
|
padding: 8px 8px;
|
|
295
294
|
clear: both;
|
|
296
|
-
color: var(--kui-color-
|
|
295
|
+
color: var(--kui-color-text);
|
|
297
296
|
font-size: 14px;
|
|
298
297
|
white-space: nowrap;
|
|
299
298
|
list-style: none;
|
|
@@ -303,15 +302,15 @@
|
|
|
303
302
|
text-overflow: ellipsis;
|
|
304
303
|
cursor: pointer;
|
|
305
304
|
position: relative;
|
|
306
|
-
border-radius:
|
|
305
|
+
border-radius: var(--kui-border-radius);
|
|
307
306
|
margin-bottom: 1px;
|
|
308
307
|
|
|
309
|
-
&:not(.k-select-item-disabled):hover {
|
|
310
|
-
background: var(--kui-color-hover);
|
|
308
|
+
&:not(.k-select-item-disabled, .k-select-item-selected):hover {
|
|
309
|
+
background: var(--kui-color-item-hover);
|
|
311
310
|
}
|
|
312
311
|
|
|
313
|
-
&:not(.k-select-item-disabled):active {
|
|
314
|
-
background: var(--kui-color-active);
|
|
312
|
+
&:not(.k-select-item-disabled, .k-select-item-selected):active {
|
|
313
|
+
background: var(--kui-color-item-active);
|
|
315
314
|
}
|
|
316
315
|
|
|
317
316
|
.k-icon {
|
|
@@ -336,22 +335,18 @@
|
|
|
336
335
|
}
|
|
337
336
|
|
|
338
337
|
.k-select-item-selected {
|
|
339
|
-
background: var(--kui-color-selected);
|
|
338
|
+
background: var(--kui-color-item-selected);
|
|
340
339
|
font-weight: 500;
|
|
341
340
|
|
|
342
|
-
&:hover {
|
|
343
|
-
background: var(--kui-color-selected);
|
|
344
|
-
}
|
|
345
|
-
|
|
346
341
|
.k-icon {
|
|
347
|
-
color: var(--kui-color-
|
|
342
|
+
color: var(--kui-color-primary);
|
|
348
343
|
display: block;
|
|
349
344
|
}
|
|
350
345
|
}
|
|
351
346
|
|
|
352
347
|
.k-select-item-disabled {
|
|
353
|
-
background: var(--kui-color-disable
|
|
354
|
-
color: var(--kui-color-disabled);
|
|
348
|
+
background: var(--kui-color-item-disable);
|
|
349
|
+
color: var(--kui-color-text-disabled);
|
|
355
350
|
cursor: not-allowed;
|
|
356
351
|
}
|
|
357
352
|
}
|
|
@@ -401,7 +396,6 @@
|
|
|
401
396
|
.k-select-label {
|
|
402
397
|
line-height: 22px;
|
|
403
398
|
height: 22px;
|
|
404
|
-
// padding-right: 23px;
|
|
405
399
|
font-size: 12px;
|
|
406
400
|
}
|
|
407
401
|
|
|
@@ -445,7 +439,7 @@
|
|
|
445
439
|
.k-select-search-mirror,
|
|
446
440
|
.k-select-search {
|
|
447
441
|
font-size: 12px;
|
|
448
|
-
color: var(--kui-color-
|
|
442
|
+
color: var(--kui-color-text);
|
|
449
443
|
}
|
|
450
444
|
}
|
|
451
445
|
|
|
@@ -507,8 +501,7 @@
|
|
|
507
501
|
}
|
|
508
502
|
|
|
509
503
|
.k-select-opened {
|
|
510
|
-
border-color: var(--kui-color-
|
|
511
|
-
box-shadow: 0 0 0 2px var(--kui-color-main-90);
|
|
504
|
+
border-color: var(--kui-color-primary);
|
|
512
505
|
|
|
513
506
|
.k-select-label {
|
|
514
507
|
opacity: 0.5;
|
|
@@ -521,8 +514,8 @@
|
|
|
521
514
|
}
|
|
522
515
|
|
|
523
516
|
.k-select-disabled {
|
|
524
|
-
color: var(--kui-color-disabled);
|
|
525
|
-
background: var(--kui-color-
|
|
517
|
+
color: var(--kui-color-text-disabled);
|
|
518
|
+
background: var(--kui-color-bg-component-disabled);
|
|
526
519
|
|
|
527
520
|
.k-select-label {
|
|
528
521
|
cursor: not-allowed;
|
|
@@ -535,12 +528,6 @@
|
|
|
535
528
|
.k-select-arrow {
|
|
536
529
|
color: var(--kui-color-disable-border);
|
|
537
530
|
}
|
|
538
|
-
|
|
539
|
-
&:hover,
|
|
540
|
-
&:focus {
|
|
541
|
-
border-color: var(--kui-color-disable-border);
|
|
542
|
-
box-shadow: none;
|
|
543
|
-
}
|
|
544
531
|
}
|
|
545
532
|
|
|
546
533
|
.k-select-has-clear {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
## API
|
|
2
|
+
|
|
2
3
|
| 属性 | 说明 | 类型 | 默认值 |
|
|
3
4
|
| -------- | -------------------------------------------- | ------------------- | ------ |
|
|
4
5
|
| animated | 是否展示动画效果 | Boolean | false |
|
|
@@ -9,6 +10,7 @@
|
|
|
9
10
|
| delay | 防抖(动画延迟关闭) | Number(毫秒) | 500 |
|
|
10
11
|
|
|
11
12
|
## Avatar Props
|
|
13
|
+
|
|
12
14
|
| 属性 | 说明 | 类型 | 默认值 |
|
|
13
15
|
| -------- | -------------------------------------------- | ----------------------------------- | ------ |
|
|
14
16
|
| animated | 是否展示动画效果 | Boolean | false |
|
|
@@ -18,6 +20,7 @@
|
|
|
18
20
|
| size | 设置头像占位图的大小 | number \| large \| small \| default | - |
|
|
19
21
|
|
|
20
22
|
## Button Props
|
|
23
|
+
|
|
21
24
|
| 属性 | 说明 | 类型 | 默认值 |
|
|
22
25
|
| -------- | -------------------------------------------- | -------------------------- | ------ |
|
|
23
26
|
| animated | 是否展示动画效果 | Boolean | false |
|
|
@@ -28,6 +31,7 @@
|
|
|
28
31
|
| width | 按钮宽度 | Number | - |
|
|
29
32
|
|
|
30
33
|
## Text Props
|
|
34
|
+
|
|
31
35
|
| 属性 | 说明 | 类型 | 默认值 |
|
|
32
36
|
| -------- | -------------------------------------------- | ------------------------- | ------ |
|
|
33
37
|
| animated | 是否展示动画效果 | Boolean | false |
|
|
@@ -36,10 +40,10 @@
|
|
|
36
40
|
| width | 文本宽度 | Number | - |
|
|
37
41
|
|
|
38
42
|
## Image Props
|
|
43
|
+
|
|
39
44
|
| 属性 | 说明 | 类型 | 默认值 |
|
|
40
45
|
| -------- | -------------------------------------------- | ------------- | ------ |
|
|
41
46
|
| animated | 是否展示动画效果 | Boolean | false |
|
|
42
47
|
| loading | 为 true 时,显示占位图。反之则直接展示子组件 | Boolean | - |
|
|
43
48
|
| radius | 指定图片的圆角大小 | Number | - |
|
|
44
49
|
| size | 图片的宽(高)度 | Number\|Array | - |
|
|
45
|
-
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import
|
|
1
|
+
@import "../../styles/less-css-var.less";
|
|
2
2
|
.k-skeleton {
|
|
3
3
|
display: table;
|
|
4
4
|
width: 100%;
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
margin-top: 20px;
|
|
23
23
|
list-style: none;
|
|
24
24
|
padding-left: 0;
|
|
25
|
-
|
|
25
|
+
& > li {
|
|
26
26
|
width: 100%;
|
|
27
27
|
height: 16px;
|
|
28
28
|
list-style: none;
|
|
@@ -32,14 +32,24 @@
|
|
|
32
32
|
width: 61%;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
& > li + li {
|
|
36
36
|
margin-top: 16px;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
&.k-skeleton-animated {
|
|
41
|
-
.k-skeleton-paragraph>li,
|
|
42
|
-
|
|
41
|
+
.k-skeleton-paragraph > li,
|
|
42
|
+
.k-skeleton-avatar,
|
|
43
|
+
.k-skeleton-title,
|
|
44
|
+
.k-skeleton-btn,
|
|
45
|
+
.k-skeleton-image,
|
|
46
|
+
.k-skeleton-text {
|
|
47
|
+
background: linear-gradient(
|
|
48
|
+
90deg,
|
|
49
|
+
var(--kui-color-skeleton) 25%,
|
|
50
|
+
var(--kui-color-skeleton-high) 37%,
|
|
51
|
+
var(--kui-color-skeleton) 63%
|
|
52
|
+
);
|
|
43
53
|
background-size: 400% 100%;
|
|
44
54
|
-webkit-animation: k-skeleton-loading 1.4s ease infinite;
|
|
45
55
|
animation: k-skeleton-loading 1.4s ease infinite;
|
|
@@ -51,7 +61,6 @@
|
|
|
51
61
|
width: 100%;
|
|
52
62
|
}
|
|
53
63
|
}
|
|
54
|
-
//text
|
|
55
64
|
.k-skeleton-text {
|
|
56
65
|
display: inline-block;
|
|
57
66
|
vertical-align: top;
|
|
@@ -75,7 +84,7 @@
|
|
|
75
84
|
display: inline-block;
|
|
76
85
|
vertical-align: top;
|
|
77
86
|
background: var(--kui-color-skeleton);
|
|
78
|
-
border-radius:
|
|
87
|
+
border-radius: var(--kui-border-radius);
|
|
79
88
|
width: 64px;
|
|
80
89
|
min-width: 64px;
|
|
81
90
|
height: 32px;
|
|
@@ -150,7 +159,6 @@
|
|
|
150
159
|
min-height: 96px;
|
|
151
160
|
height: 100%;
|
|
152
161
|
width: 100%;
|
|
153
|
-
// line-height: 96px;
|
|
154
162
|
font-size: 30px;
|
|
155
163
|
color: var(--kui-color-icon);
|
|
156
164
|
}
|
|
@@ -159,27 +167,21 @@
|
|
|
159
167
|
.k-skeleton-ele {
|
|
160
168
|
display: inline-block;
|
|
161
169
|
width: auto;
|
|
162
|
-
// &.k-skeleton-block {
|
|
163
|
-
// width: 100%;
|
|
164
|
-
// .k-skeleton-btn {
|
|
165
|
-
// width: 100%;
|
|
166
|
-
// }
|
|
167
|
-
// }
|
|
168
170
|
}
|
|
169
171
|
@keyframes k-skeleton-loading {
|
|
170
172
|
0% {
|
|
171
|
-
background-position: 100% 50
|
|
173
|
+
background-position: 100% 50%;
|
|
172
174
|
}
|
|
173
175
|
to {
|
|
174
|
-
background-position: 0 50
|
|
176
|
+
background-position: 0 50%;
|
|
175
177
|
}
|
|
176
178
|
}
|
|
177
179
|
|
|
178
180
|
@-webkit-keyframes k-skeleton-loading {
|
|
179
181
|
0% {
|
|
180
|
-
background-position: 100% 50
|
|
182
|
+
background-position: 100% 50%;
|
|
181
183
|
}
|
|
182
184
|
to {
|
|
183
|
-
background-position: 0 50
|
|
185
|
+
background-position: 0 50%;
|
|
184
186
|
}
|
|
185
|
-
}
|
|
187
|
+
}
|
|
@@ -73,8 +73,9 @@ const Slider = defineComponent({
|
|
|
73
73
|
// 计算鼠标位置对应的数值
|
|
74
74
|
const getValueFromEvent = (e) => {
|
|
75
75
|
const rect = railRef.value.getBoundingClientRect();
|
|
76
|
-
const
|
|
77
|
-
const
|
|
76
|
+
const touch = e.touches?.[0] || e.changedTouches?.[0];
|
|
77
|
+
const clientX = touch ? touch.clientX : e.clientX;
|
|
78
|
+
const clientY = touch ? touch.clientY : e.clientY;
|
|
78
79
|
|
|
79
80
|
let percent;
|
|
80
81
|
if (props.vertical) {
|
|
@@ -89,13 +90,17 @@ const Slider = defineComponent({
|
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
const rawValue = new Big(props.max - props.min)
|
|
92
|
-
.times(percent)
|
|
93
|
+
.times(Math.max(0, Math.min(1, percent)))
|
|
93
94
|
.plus(props.min);
|
|
94
95
|
return getClosestStep(Number(rawValue), props);
|
|
95
96
|
};
|
|
96
97
|
|
|
97
98
|
// 处理滑块拖动
|
|
98
99
|
const handleThumbMove = (e) => {
|
|
100
|
+
if (e.cancelable) {
|
|
101
|
+
e.preventDefault();
|
|
102
|
+
}
|
|
103
|
+
|
|
99
104
|
if (props.disabled || draggingIndex.value === -1) return;
|
|
100
105
|
|
|
101
106
|
const newValue = getValueFromEvent(e);
|
|
@@ -153,24 +158,31 @@ const Slider = defineComponent({
|
|
|
153
158
|
emit("input", internalValue.value);
|
|
154
159
|
emit("change", internalValue.value);
|
|
155
160
|
};
|
|
156
|
-
|
|
161
|
+
const touch = !!(
|
|
162
|
+
"ontouchstart" in window ||
|
|
163
|
+
(window.DocumentTouch && document instanceof window.DocumentTouch)
|
|
164
|
+
);
|
|
157
165
|
const handleThumbDown = (index) => {
|
|
158
166
|
if (props.disabled) return;
|
|
159
167
|
draggingIndex.value = index;
|
|
160
168
|
|
|
169
|
+
let [e1, e2] = touch
|
|
170
|
+
? ["touchmove", "touchend"]
|
|
171
|
+
: ["mousemove", "mouseup"];
|
|
172
|
+
console.log(e1,e2,222);
|
|
161
173
|
const onMove = (e) => handleThumbMove(e);
|
|
162
174
|
const onUp = () => {
|
|
163
175
|
draggingIndex.value = -1;
|
|
164
|
-
document.removeEventListener(
|
|
165
|
-
document.removeEventListener(
|
|
166
|
-
document.removeEventListener("touchmove", onMove);
|
|
167
|
-
document.removeEventListener("touchend", onUp);
|
|
176
|
+
document.removeEventListener(e1, onMove);
|
|
177
|
+
document.removeEventListener(e2, onUp);
|
|
178
|
+
// document.removeEventListener("touchmove", onMove);
|
|
179
|
+
// document.removeEventListener("touchend", onUp);
|
|
168
180
|
};
|
|
169
181
|
|
|
170
|
-
document.addEventListener(
|
|
171
|
-
document.addEventListener(
|
|
172
|
-
document.addEventListener("touchmove", onMove, { passive: false });
|
|
173
|
-
document.addEventListener("touchend", onUp);
|
|
182
|
+
document.addEventListener(e1, onMove);
|
|
183
|
+
document.addEventListener(e2, onUp);
|
|
184
|
+
// document.addEventListener("touchmove", onMove, { passive: false });
|
|
185
|
+
// document.addEventListener("touchend", onUp);
|
|
174
186
|
};
|
|
175
187
|
|
|
176
188
|
const handleKeydown = (e, index) => {
|
|
@@ -202,7 +214,6 @@ const Slider = defineComponent({
|
|
|
202
214
|
);
|
|
203
215
|
}
|
|
204
216
|
|
|
205
|
-
// 理键盘交错逻辑 ---
|
|
206
217
|
if (props.range) {
|
|
207
218
|
const otherIndex = index === 0 ? 1 : 0;
|
|
208
219
|
const otherValue = currentValues[otherIndex];
|
|
@@ -357,6 +368,7 @@ const Slider = defineComponent({
|
|
|
357
368
|
<div
|
|
358
369
|
class="k-slider-rail"
|
|
359
370
|
ref={railRef}
|
|
371
|
+
onTouchstart={handleRailClick}
|
|
360
372
|
onClick={handleRailClick}
|
|
361
373
|
></div>
|
|
362
374
|
{renderTrack()}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import "../../styles/var.less";
|
|
1
|
+
@import "../../styles/less-css-var.less";
|
|
2
2
|
|
|
3
3
|
.k-slider {
|
|
4
4
|
width: 100%;
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
-webkit-user-select: none;
|
|
22
22
|
user-select: none;
|
|
23
23
|
touch-action: none;
|
|
24
|
+
-webkit-touch-callout: none;
|
|
24
25
|
box-shadow:
|
|
25
26
|
0 4px 6px rgb(0 0 0 / 10%),
|
|
26
27
|
0 0 1px rgb(0 0 0 / 30%);
|
|
@@ -31,7 +32,7 @@
|
|
|
31
32
|
border-radius: 50%;
|
|
32
33
|
position: absolute;
|
|
33
34
|
cursor: grab;
|
|
34
|
-
background: var(--kui-color-
|
|
35
|
+
background: var(--kui-color-bg);
|
|
35
36
|
border: 1px solid var(--kui-color-border);
|
|
36
37
|
top: 50%;
|
|
37
38
|
transform: translateX(-50%) translateY(-50%);
|
|
@@ -39,10 +40,10 @@
|
|
|
39
40
|
outline-offset: 1px;
|
|
40
41
|
z-index: 0;
|
|
41
42
|
&:focus {
|
|
42
|
-
outline-color: var(--kui-color-
|
|
43
|
+
outline-color: var(--kui-color-primary-8);
|
|
43
44
|
}
|
|
44
45
|
&.is-dragging {
|
|
45
|
-
border: 1px solid var(--kui-color-
|
|
46
|
+
border: 1px solid var(--kui-color-primary);
|
|
46
47
|
z-index: 1;
|
|
47
48
|
cursor: grabbing;
|
|
48
49
|
}
|
|
@@ -51,11 +52,11 @@
|
|
|
51
52
|
.k-slider-thumb-sm {
|
|
52
53
|
height: 14px;
|
|
53
54
|
width: 14px;
|
|
54
|
-
border: 2px solid var(--kui-color-
|
|
55
|
+
border: 2px solid var(--kui-color-primary);
|
|
55
56
|
|
|
56
57
|
&:active {
|
|
57
58
|
border-width: 2px;
|
|
58
|
-
box-shadow: 0 0 2px 5px var(--kui-color-
|
|
59
|
+
box-shadow: 0 0 2px 5px var(--kui-color-primary-6);
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
|
|
@@ -63,7 +64,7 @@
|
|
|
63
64
|
height: 4px;
|
|
64
65
|
cursor: pointer;
|
|
65
66
|
border-radius: 2px;
|
|
66
|
-
background: var(--kui-color-
|
|
67
|
+
background: var(--kui-color-primary);
|
|
67
68
|
position: absolute;
|
|
68
69
|
top: 14px;
|
|
69
70
|
pointer-events: none;
|
|
@@ -74,7 +75,7 @@
|
|
|
74
75
|
cursor: pointer;
|
|
75
76
|
height: 4px;
|
|
76
77
|
border-radius: 2px;
|
|
77
|
-
background: var(--kui-color-
|
|
78
|
+
background: var(--kui-color-bg-component);
|
|
78
79
|
position: absolute;
|
|
79
80
|
width: 100%;
|
|
80
81
|
top: 14px;
|
|
@@ -96,27 +97,27 @@
|
|
|
96
97
|
height: 4px;
|
|
97
98
|
width: 4px;
|
|
98
99
|
border: 2px solid var(--kui-color-border);
|
|
99
|
-
background: var(--kui-color-
|
|
100
|
+
background: var(--kui-color-bg);
|
|
100
101
|
border-radius: 50%;
|
|
101
102
|
transform: translateX(-50%);
|
|
102
103
|
pointer-events: none;
|
|
103
104
|
box-sizing: content-box;
|
|
104
105
|
|
|
105
106
|
&.is-active {
|
|
106
|
-
border-color: var(--kui-color-
|
|
107
|
+
border-color: var(--kui-color-primary);
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
.k-slider-mark-text {
|
|
111
112
|
position: absolute;
|
|
112
113
|
transform: translateX(-50%);
|
|
113
|
-
color: var(--kui-color-
|
|
114
|
+
color: var(--kui-color-text-placeholder);
|
|
114
115
|
z-index: 0;
|
|
115
116
|
line-height: 1;
|
|
116
117
|
margin-top: 18px;
|
|
117
118
|
|
|
118
119
|
&-active {
|
|
119
|
-
color: var(--kui-color-
|
|
120
|
+
color: var(--kui-color-text);
|
|
120
121
|
}
|
|
121
122
|
}
|
|
122
123
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineComponent, h, /*cloneVNode*/ provide } from "vue";
|
|
2
2
|
import { getChildren } from "../utils/vnode";
|
|
3
3
|
import { withInstall, cloneVNode } from "../utils/vue";
|
|
4
|
+
import { filterSize } from "../utils/size";
|
|
4
5
|
const Space = defineComponent({
|
|
5
6
|
name: "Space",
|
|
6
7
|
props: {
|
|
@@ -21,7 +22,7 @@ const Space = defineComponent({
|
|
|
21
22
|
validator(value) {
|
|
22
23
|
return typeof value === "number" || Array.isArray(value)
|
|
23
24
|
? true
|
|
24
|
-
:
|
|
25
|
+
: filterSize(value);
|
|
25
26
|
},
|
|
26
27
|
},
|
|
27
28
|
},
|