kui-vue 3.6.1 → 3.6.3
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/button/demo/size.md +1 -1
- package/components/card/card.jsx +19 -9
- package/components/card/demo/basic.md +3 -3
- package/components/card/demo/border.md +1 -7
- package/components/card/demo/index.jsx +9 -7
- package/components/card/demo/notitle.md +23 -0
- package/components/card/styles/index.less +5 -3
- package/components/checkbox/checkbox.jsx +17 -16
- package/components/checkbox/checkboxGroup.jsx +1 -1
- package/components/checkbox/styles/index.less +1 -0
- package/components/collapse/collapse.jsx +9 -10
- package/components/collapse/demo/accordion.md +2 -2
- package/components/collapse/demo/basic.md +2 -2
- package/components/collapse/demo/extra.md +2 -2
- package/components/collapse/demo/nesting.md +4 -4
- package/components/collapse/demo/sample.md +2 -2
- package/components/collapse/index.md +6 -6
- package/components/collapse/styles/index.less +2 -2
- package/components/colorPicker/demo/basic.md +14 -2
- package/components/colorPicker/demo/index.jsx +0 -8
- package/components/colorPicker/demo/size.md +24 -10
- package/components/colorPicker/mode.jsx +1 -1
- package/components/components.js +3 -0
- package/components/datePicker/demo/size.md +1 -1
- package/components/drawer/demo/target.md +2 -2
- package/components/dropdown/demo/basic.md +1 -1
- package/components/dropdown/dropdownButton.jsx +18 -7
- package/components/dropdown/styles/index.less +1 -0
- package/components/empty/demo/basic.md +1 -3
- package/components/empty/demo/nodesc.md +1 -3
- package/components/empty/demo/used.md +4 -6
- package/components/empty/empty.jsx +19 -17
- package/components/empty/styles/index.less +18 -5
- package/components/flex/demo/size.md +14 -5
- package/components/form/demo/align.md +10 -10
- package/components/form/demo/customvalid.md +1 -1
- package/components/form/demo/dynamicvalid.md +1 -1
- package/components/form/demo/length.md +1 -13
- package/components/form/demo/valid.md +11 -3
- package/components/form/form.jsx +2 -2
- package/components/form/formitem.jsx +1 -1
- package/components/image/preview.jsx +1 -1
- package/components/input/demo/basic.md +1 -1
- package/components/input/demo/group.md +1 -1
- package/components/input/input.jsx +19 -15
- package/components/input/inputBox.jsx +2 -2
- package/components/inputNumber/demo/basic.md +1 -0
- package/components/inputNumber/demo/format.md +3 -8
- package/components/inputNumber/inputNumber.jsx +116 -139
- package/components/inputNumber/styles/index.less +3 -3
- package/components/layout/demo/layout5.md +0 -1
- package/components/locale/de.js +1 -0
- package/components/locale/el.js +1 -0
- package/components/locale/en.js +1 -0
- package/components/locale/fr.js +1 -0
- package/components/locale/it.js +1 -0
- package/components/locale/ja.js +1 -0
- package/components/locale/ko.js +1 -0
- package/components/locale/ru.js +1 -0
- package/components/locale/th.js +1 -0
- package/components/locale/uk.js +1 -0
- package/components/locale/vi.js +1 -0
- package/components/locale/zh-CN.js +1 -0
- package/components/locale/zh-TW.js +1 -0
- package/components/menu/demo/collapsed.md +9 -9
- package/components/menu/index.md +1 -0
- package/components/message/demo/close.md +1 -1
- package/components/message/group.jsx +13 -6
- package/components/message/index.md +1 -1
- package/components/message/inner.jsx +26 -7
- package/components/notice/demo/close.md +1 -1
- package/components/notice/index.md +1 -1
- package/components/page/styles/index.less +7 -1
- package/components/popconfirm/popconfirm.jsx +14 -16
- package/components/progress/progress.jsx +1 -1
- package/components/radio/radio.jsx +14 -11
- package/components/radio/radioButton.jsx +1 -1
- package/components/radio/radioGroup.jsx +1 -1
- package/components/rate/demo/basic.md +12 -2
- package/components/rate/demo/character.md +16 -2
- package/components/rate/demo/index.jsx +0 -8
- package/components/rate/demo/tips.md +15 -5
- package/components/rate/rate.jsx +30 -6
- package/components/rate/star.jsx +20 -5
- package/components/select/demo/size.md +1 -1
- package/components/select/select.jsx +5 -4
- package/components/slider/demo/vertical.md +2 -1
- package/components/slider/demo/withNumber.md +0 -2
- package/components/slider/index.md +2 -3
- package/components/slider/slider.jsx +296 -291
- package/components/slider/styles/index.less +11 -12
- package/components/slider/thumb.jsx +70 -148
- package/components/space/styles/index.less +3 -1
- package/components/spin/demo/container.md +1 -1
- package/components/spin/demo/mode.md +1 -1
- package/components/spin/index.md +6 -5
- package/components/statCard/countup.js +254 -0
- package/components/statCard/countup.jsx +45 -0
- package/components/statCard/demo/basic.md +31 -0
- package/components/statCard/demo/card.md +40 -0
- package/components/statCard/demo/index.jsx +19 -0
- package/components/statCard/demo/info.md +9 -0
- package/components/statCard/demo/with-card.md +43 -0
- package/components/statCard/index.js +3 -0
- package/components/statCard/index.md +28 -0
- package/components/statCard/rollup.jsx +64 -0
- package/components/statCard/statCard.jsx +42 -0
- package/components/statCard/statNumber.jsx +53 -0
- package/components/statCard/styles/index.less +76 -0
- package/components/styles/color.less +4 -2
- package/components/styles/index.less +1 -0
- package/components/styles/sys.less +2 -3
- package/components/styles/var.less +1 -0
- package/components/switch/switch.jsx +1 -3
- package/components/table/demo/col-row-span.md +1 -1
- package/components/table/demo/fixed-col-head.md +1 -1
- package/components/table/demo/head-span.md +2 -2
- package/components/table/demo/size.md +2 -2
- package/components/table/demo/table-check.md +11 -1
- package/components/table/index.md +13 -12
- package/components/table/styles/index.less +67 -58
- package/components/table/table.jsx +7 -5
- package/components/tabs/demo/sample.md +1 -8
- package/components/tabs/index.md +9 -9
- package/components/tabs/tabs.jsx +7 -5
- package/components/tooltip/tooltip.jsx +13 -8
- package/components/treeselect/demo/basic.md +11 -8
- package/components/treeselect/demo/size.md +4 -3
- package/components/treeselect/demo/theme.md +0 -1
- package/components/treeselect/treeselect.jsx +5 -3
- package/components/upload/demo/custom.md +5 -2
- package/components/upload/demo/exceed.md +1 -1
- package/components/upload/demo/pictures.md +14 -0
- package/components/upload/fileList.jsx +24 -47
- package/components/upload/index.md +13 -4
- package/components/upload/selector.jsx +37 -117
- package/components/upload/styles/index.less +2 -3
- package/components/upload/upload.jsx +189 -117
- package/components/utils/number.js +79 -65
- package/components/utils/placement.js +62 -35
- package/dist/k-ui.cjs.js +2 -2
- package/dist/k-ui.css +2 -2
- package/dist/k-ui.d.ts +172 -129
- package/dist/k-ui.esm.js +2 -2
- package/dist/k-ui.umd.js +2 -2
- package/dist/locale/de.js +2 -2
- package/dist/locale/el.js +2 -2
- package/dist/locale/en.js +2 -2
- package/dist/locale/fr.js +2 -2
- package/dist/locale/it.js +2 -2
- package/dist/locale/ja.js +2 -2
- package/dist/locale/ko.js +2 -2
- package/dist/locale/ru.js +2 -2
- package/dist/locale/th.js +2 -2
- package/dist/locale/ua.js +1 -1
- package/dist/locale/uk.js +2 -2
- package/dist/locale/vi.js +2 -2
- package/dist/locale/zh-CN.js +2 -2
- package/dist/locale/zh-TW.js +2 -2
- package/package.json +3 -1
- package/types/checkbox/Checkbox.d.ts +1 -1
- package/types/collapse/Collapse.d.ts +1 -1
- package/types/index.d.ts +14 -10
- package/types/popconfirm/Popconfirm.d.ts +1 -0
- package/types/radio/Radio.d.ts +1 -1
- package/types/radio/RadioButton.d.ts +1 -1
- package/types/rate/Rate.d.ts +1 -1
- package/types/slider/Slider.d.ts +7 -6
- package/types/statCard/StatCard.d.ts +20 -0
- package/types/statCard/StatNumber.d.ts +26 -0
- package/types/switch/Switch.d.ts +1 -2
- package/types/table/Table.d.ts +1 -0
- package/types/tooltip/Tooltip.d.ts +1 -0
- package/components/base/collapse.jsx +0 -15
- package/components/base/input.jsx +0 -210
- package/components/colorPicker/demo/disabled.md +0 -16
- package/components/colorPicker/demo/disabledAlpha.md +0 -13
- package/components/colorPicker/demo/mode.md +0 -21
- package/components/colorPicker/demo/presets.md +0 -17
- package/components/rate/demo/clear.md +0 -13
- package/components/rate/demo/custom.md +0 -23
- package/components/rate/demo/disabled.md +0 -12
- package/components/rate/demo/half.md +0 -12
- package/components/utils/element.js +0 -122
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
@import "../../styles/var.less";
|
|
2
2
|
|
|
3
3
|
.k-table {
|
|
4
|
-
background: var(--kui-color-back);
|
|
5
|
-
border-radius: @radius;
|
|
6
4
|
width: 100%;
|
|
7
5
|
margin: 10px 0;
|
|
8
6
|
box-sizing: border-box;
|
|
9
7
|
position: relative;
|
|
10
8
|
color: var(--kui-color-font);
|
|
11
9
|
font-size: 14px;
|
|
10
|
+
overflow: hidden;
|
|
12
11
|
&-thead-sticky {
|
|
13
12
|
position: sticky;
|
|
14
13
|
position: -webkit-sticky;
|
|
@@ -50,6 +49,7 @@
|
|
|
50
49
|
}
|
|
51
50
|
.k-table-header,
|
|
52
51
|
.k-table-footer {
|
|
52
|
+
background-color: var(--kui-color-table-header);
|
|
53
53
|
padding: 16px;
|
|
54
54
|
}
|
|
55
55
|
table {
|
|
@@ -65,11 +65,11 @@
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
tr th:first-child {
|
|
68
|
-
border-top-left-radius: @
|
|
68
|
+
border-top-left-radius: @radiusInner;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
tr th:last-child {
|
|
72
|
-
border-top-right-radius: @
|
|
72
|
+
border-top-right-radius: @radiusInner;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
.k-table {
|
|
@@ -157,7 +157,6 @@
|
|
|
157
157
|
position: sticky;
|
|
158
158
|
right: 0;
|
|
159
159
|
padding: 0;
|
|
160
|
-
border: 0;
|
|
161
160
|
z-index: 5;
|
|
162
161
|
top: 0;
|
|
163
162
|
}
|
|
@@ -210,10 +209,6 @@
|
|
|
210
209
|
}
|
|
211
210
|
|
|
212
211
|
td table {
|
|
213
|
-
tr:last-child {
|
|
214
|
-
border-bottom: none;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
212
|
tbody > tr:hover {
|
|
218
213
|
background: var(--kui-color-table-hover);
|
|
219
214
|
}
|
|
@@ -221,13 +216,9 @@
|
|
|
221
216
|
}
|
|
222
217
|
|
|
223
218
|
.k-table-thead {
|
|
224
|
-
border-top-left-radius: @
|
|
225
|
-
border-top-right-radius: @
|
|
219
|
+
border-top-left-radius: @radiusInner;
|
|
220
|
+
border-top-right-radius: @radiusInner;
|
|
226
221
|
background: var(--kui-color-table-header);
|
|
227
|
-
tr th:first-child,
|
|
228
|
-
tr th:last-child {
|
|
229
|
-
border-radius: 0;
|
|
230
|
-
}
|
|
231
222
|
}
|
|
232
223
|
|
|
233
224
|
&-thead {
|
|
@@ -236,9 +227,8 @@
|
|
|
236
227
|
|
|
237
228
|
&-footer {
|
|
238
229
|
padding: 10px;
|
|
239
|
-
|
|
240
|
-
border-bottom-
|
|
241
|
-
border-bottom-right-radius: @radius;
|
|
230
|
+
border-bottom-left-radius: @radiusInner;
|
|
231
|
+
border-bottom-right-radius: @radiusInner;
|
|
242
232
|
}
|
|
243
233
|
|
|
244
234
|
th > a,
|
|
@@ -303,10 +293,12 @@
|
|
|
303
293
|
table tr {
|
|
304
294
|
th {
|
|
305
295
|
padding: 10px 8px;
|
|
296
|
+
font-size: 14px;
|
|
306
297
|
}
|
|
307
298
|
|
|
308
299
|
td {
|
|
309
300
|
padding: 5px 8px;
|
|
301
|
+
font-size: 12px;
|
|
310
302
|
}
|
|
311
303
|
}
|
|
312
304
|
.k-table-header,
|
|
@@ -331,10 +323,15 @@
|
|
|
331
323
|
}
|
|
332
324
|
}
|
|
333
325
|
.k-table-body {
|
|
326
|
+
background: var(--kui-color-back);
|
|
334
327
|
-webkit-overflow-scrolling: touch;
|
|
335
328
|
will-change: scroll-position;
|
|
336
329
|
}
|
|
330
|
+
.k-table-thead + .k-table-body {
|
|
331
|
+
border-radius: 0;
|
|
332
|
+
}
|
|
337
333
|
.k-table-header + .k-table-body {
|
|
334
|
+
border-radius: 0;
|
|
338
335
|
table tr th:first-child {
|
|
339
336
|
border-radius: 0;
|
|
340
337
|
}
|
|
@@ -343,18 +340,51 @@
|
|
|
343
340
|
border-radius: 0;
|
|
344
341
|
}
|
|
345
342
|
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
border
|
|
349
|
-
|
|
350
|
-
|
|
343
|
+
& {
|
|
344
|
+
border-top-left-radius: @radius;
|
|
345
|
+
border-top-right-radius: @radius;
|
|
346
|
+
.k-table-thead {
|
|
347
|
+
border-top-left-radius: @radius;
|
|
348
|
+
border-top-right-radius: @radius;
|
|
349
|
+
}
|
|
350
|
+
.k-table-body {
|
|
351
|
+
border-top-left-radius: @radius;
|
|
352
|
+
border-top-right-radius: @radius;
|
|
353
|
+
}
|
|
351
354
|
.k-table-footer {
|
|
352
|
-
border-top: 1px solid var(--kui-color-table-border);
|
|
353
|
-
border-bottom: none;
|
|
354
355
|
border-bottom-left-radius: @radius;
|
|
355
356
|
border-bottom-right-radius: @radius;
|
|
356
357
|
}
|
|
357
|
-
|
|
358
|
+
.k-table-header {
|
|
359
|
+
border-top-left-radius: @radiusInner;
|
|
360
|
+
border-top-right-radius: @radiusInner;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
&-bordered {
|
|
364
|
+
.k-table-thead {
|
|
365
|
+
border-top: 1px solid var(--kui-color-table-border);
|
|
366
|
+
border-left: 1px solid var(--kui-color-table-border);
|
|
367
|
+
}
|
|
368
|
+
.k-table-body {
|
|
369
|
+
border-right: 1px solid var(--kui-color-table-border);
|
|
370
|
+
border-top: 1px solid var(--kui-color-table-border);
|
|
371
|
+
border-left: 1px solid var(--kui-color-table-border);
|
|
372
|
+
}
|
|
373
|
+
.k-table-footer {
|
|
374
|
+
border-right: 1px solid var(--kui-color-table-border);
|
|
375
|
+
border-bottom: 1px solid var(--kui-color-table-border);
|
|
376
|
+
border-left: 1px solid var(--kui-color-table-border);
|
|
377
|
+
}
|
|
378
|
+
.k-scroll {
|
|
379
|
+
&::-webkit-scrollbar {
|
|
380
|
+
border-bottom: 1px solid var(--kui-color-border);
|
|
381
|
+
}
|
|
382
|
+
&::-webkit-scrollbar-corner {
|
|
383
|
+
border-bottom: 1px solid var(--kui-color-border);
|
|
384
|
+
border-left: 1px solid var(--kui-color-border);
|
|
385
|
+
background-color: var(--kui-color-back);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
358
388
|
thead {
|
|
359
389
|
th {
|
|
360
390
|
border-bottom: 1px solid var(--kui-color-table-border);
|
|
@@ -363,45 +393,21 @@
|
|
|
363
393
|
}
|
|
364
394
|
|
|
365
395
|
.k-table-header {
|
|
366
|
-
border-
|
|
367
|
-
border-
|
|
368
|
-
border-top-
|
|
369
|
-
border-top-right-radius: @radius;
|
|
396
|
+
border-left: 1px solid var(--kui-color-table-border);
|
|
397
|
+
border-right: 1px solid var(--kui-color-table-border);
|
|
398
|
+
border-top: 1px solid var(--kui-color-table-border);
|
|
370
399
|
}
|
|
371
400
|
|
|
372
401
|
th,
|
|
373
402
|
td {
|
|
374
403
|
border-right: 1px solid var(--kui-color-table-border);
|
|
375
404
|
}
|
|
376
|
-
|
|
377
|
-
tr {
|
|
378
|
-
|
|
379
|
-
border-top: none;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
&:last-child {
|
|
383
|
-
border-bottom: none;
|
|
384
|
-
|
|
385
|
-
td {
|
|
386
|
-
border-bottom: none;
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
tr td:first-child,
|
|
392
|
-
tr th:first-child {
|
|
393
|
-
border-left: none;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
tr td:last-child,
|
|
397
|
-
thead tr:first-child th:last-child {
|
|
398
|
-
border-right: none;
|
|
405
|
+
// tr th:last-child,
|
|
406
|
+
tr td:last-child {
|
|
407
|
+
border-right: 0;
|
|
399
408
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
table thead,
|
|
403
|
-
tr th {
|
|
404
|
-
border-top: none;
|
|
409
|
+
.k-table-body tr th:last-child {
|
|
410
|
+
border-right: 0;
|
|
405
411
|
}
|
|
406
412
|
|
|
407
413
|
.k-table-fixed-right {
|
|
@@ -412,6 +418,9 @@
|
|
|
412
418
|
margin: -11px -10px -11px -11px;
|
|
413
419
|
border-right: none;
|
|
414
420
|
}
|
|
421
|
+
.k-table-thead + .k-table-body {
|
|
422
|
+
border-top: 0;
|
|
423
|
+
}
|
|
415
424
|
}
|
|
416
425
|
|
|
417
426
|
&-cell-selection {
|
|
@@ -29,7 +29,7 @@ const Table = defineComponent({
|
|
|
29
29
|
return ["small", "large", "default"].indexOf(value) >= 0;
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
|
-
bordered: Boolean,
|
|
32
|
+
bordered: { type: Boolean, default: false },
|
|
33
33
|
checkable: Boolean,
|
|
34
34
|
loading: Boolean,
|
|
35
35
|
emptyText: String,
|
|
@@ -143,7 +143,7 @@ const Table = defineComponent({
|
|
|
143
143
|
};
|
|
144
144
|
headerStyles[col.key] = style;
|
|
145
145
|
bodyStyles[col.key] = style;
|
|
146
|
-
leftOffset += col.width ||
|
|
146
|
+
leftOffset += col.width || 150;
|
|
147
147
|
}
|
|
148
148
|
});
|
|
149
149
|
|
|
@@ -167,7 +167,7 @@ const Table = defineComponent({
|
|
|
167
167
|
transform: "translateZ(0)",
|
|
168
168
|
};
|
|
169
169
|
|
|
170
|
-
rightOffset += col.width ||
|
|
170
|
+
rightOffset += col.width || 150;
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
return { header: headerStyles, body: bodyStyles };
|
|
@@ -213,7 +213,9 @@ const Table = defineComponent({
|
|
|
213
213
|
const measureScrollbar = () => {
|
|
214
214
|
if (bodyWrapperRef.value) {
|
|
215
215
|
const width =
|
|
216
|
-
bodyWrapperRef.value.offsetWidth -
|
|
216
|
+
bodyWrapperRef.value.offsetWidth -
|
|
217
|
+
bodyWrapperRef.value.clientWidth -
|
|
218
|
+
(props.bordered ? 1 : 0);
|
|
217
219
|
if (scrollbarWidth.value !== width) scrollbarWidth.value = width;
|
|
218
220
|
}
|
|
219
221
|
};
|
|
@@ -480,7 +482,7 @@ const Table = defineComponent({
|
|
|
480
482
|
"k-table-cell-fix-left",
|
|
481
483
|
pingLeft.value && "k-table-cell-fix-left-last",
|
|
482
484
|
]}
|
|
483
|
-
style={{ width: "50px" }}
|
|
485
|
+
style={{ width: "50px", left: 0 }}
|
|
484
486
|
>
|
|
485
487
|
<Checkbox
|
|
486
488
|
checked={innerSelectedKeys.value.has(rowId)}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
|
-
<div class="demo-
|
|
8
|
+
<div class="demo-back">
|
|
9
9
|
<Tabs v-model="current" sample @change="change">
|
|
10
10
|
<TabPanel key="1" title="Tab 1">
|
|
11
11
|
<p>Content of Tab Pane 1</p>
|
|
@@ -32,11 +32,4 @@ const change = (key) => {
|
|
|
32
32
|
console.log(key);
|
|
33
33
|
};
|
|
34
34
|
</script>
|
|
35
|
-
|
|
36
|
-
<style scoped>
|
|
37
|
-
.demo-tabs-sample {
|
|
38
|
-
padding: 10px;
|
|
39
|
-
background-color: rgba(0, 0, 0, 0.2);
|
|
40
|
-
}
|
|
41
|
-
</style>
|
|
42
35
|
```
|
package/components/tabs/index.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
## Tabs API
|
|
2
2
|
|
|
3
|
-
| 属性
|
|
4
|
-
|
|
|
5
|
-
| value
|
|
6
|
-
| card
|
|
7
|
-
| sample
|
|
8
|
-
| animated
|
|
9
|
-
| remove
|
|
10
|
-
| change
|
|
11
|
-
| tab-click
|
|
3
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
4
|
+
| -------------- | ------------------------------------- | ------------------- | ------ |
|
|
5
|
+
| value(v-model) | 当前激活 tab 面板的 key | String | - |
|
|
6
|
+
| card | 页签样式是否为卡片样式 | Boolean | false |
|
|
7
|
+
| sample | 页签样式是否为简洁样式 | Boolean | false |
|
|
8
|
+
| animated | 是否使用动画切换 Tabs | Boolean | true |
|
|
9
|
+
| remove | tab关闭时的回调,返回关闭的tab的key值 | Function(activeKey) | - |
|
|
10
|
+
| change | 切换面板的回调 | Function(activeKey) | - |
|
|
11
|
+
| tab-click | tab点击时的回调 | Function(activeKey) | - |
|
|
12
12
|
|
|
13
13
|
## Tabs.TabPanel API
|
|
14
14
|
|
package/components/tabs/tabs.jsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Icon from "../icon";
|
|
2
|
-
import { getChildren } from "../utils/
|
|
2
|
+
import { getChildren } from "../utils/vnode";
|
|
3
3
|
import { Close, ChevronBack, ChevronForward } from "kui-icons";
|
|
4
4
|
import {
|
|
5
5
|
defineComponent,
|
|
@@ -137,10 +137,12 @@ const Tabs = defineComponent({
|
|
|
137
137
|
emit("input", key);
|
|
138
138
|
// emit("update:activeKey", key);
|
|
139
139
|
emit("tab-click", key);
|
|
140
|
-
defaultActiveKey.value
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
140
|
+
if (defaultActiveKey.value !== key) {
|
|
141
|
+
defaultActiveKey.value = key;
|
|
142
|
+
currentIndex.value = index;
|
|
143
|
+
updateIndex();
|
|
144
|
+
emit("change", key);
|
|
145
|
+
}
|
|
144
146
|
}
|
|
145
147
|
};
|
|
146
148
|
const updateIndex = () => {
|
|
@@ -17,6 +17,7 @@ const Tooltip = defineComponent({
|
|
|
17
17
|
transfer,
|
|
18
18
|
},
|
|
19
19
|
props: {
|
|
20
|
+
show: Boolean,
|
|
20
21
|
dark: Boolean,
|
|
21
22
|
title: [String, Number, Object, Array],
|
|
22
23
|
color: String,
|
|
@@ -31,7 +32,7 @@ const Tooltip = defineComponent({
|
|
|
31
32
|
},
|
|
32
33
|
show: Boolean,
|
|
33
34
|
},
|
|
34
|
-
setup(ps, { slots, attrs }) {
|
|
35
|
+
setup(ps, { slots, attrs, emit }) {
|
|
35
36
|
const rendered = ref(ps.show);
|
|
36
37
|
const visible = ref(ps.show);
|
|
37
38
|
const refPopper = ref();
|
|
@@ -42,6 +43,10 @@ const Tooltip = defineComponent({
|
|
|
42
43
|
const transOrigin = ref("bottom");
|
|
43
44
|
const hideTimer = ref();
|
|
44
45
|
const showTimer = ref();
|
|
46
|
+
const updateShow = (value) => {
|
|
47
|
+
visible.value = value;
|
|
48
|
+
emit("update:show", value);
|
|
49
|
+
};
|
|
45
50
|
const updatePosition = () => {
|
|
46
51
|
nextTick(() => {
|
|
47
52
|
setPlacement({
|
|
@@ -79,19 +84,19 @@ const Tooltip = defineComponent({
|
|
|
79
84
|
if (!rendered.value) {
|
|
80
85
|
rendered.value = true;
|
|
81
86
|
nextTick(() => {
|
|
82
|
-
|
|
87
|
+
updateShow(true);
|
|
83
88
|
updatePosition();
|
|
84
89
|
});
|
|
85
90
|
} else {
|
|
86
91
|
clearTimeout(showTimer.value);
|
|
87
|
-
|
|
92
|
+
updateShow(true);
|
|
88
93
|
updatePosition();
|
|
89
94
|
}
|
|
90
95
|
};
|
|
91
96
|
const hide = () => {
|
|
92
97
|
hideTimer.value = setTimeout(() => {
|
|
93
98
|
if (!ps.show) {
|
|
94
|
-
|
|
99
|
+
updateShow(false);
|
|
95
100
|
}
|
|
96
101
|
}, 300);
|
|
97
102
|
};
|
|
@@ -150,24 +155,24 @@ const Tooltip = defineComponent({
|
|
|
150
155
|
mouseenter: () => {
|
|
151
156
|
clearTimeout(hideTimer.value);
|
|
152
157
|
if (ps.disabled) return;
|
|
153
|
-
|
|
158
|
+
updateShow(true);
|
|
154
159
|
},
|
|
155
160
|
mouseleave: () => {
|
|
156
161
|
showTimer.value = setTimeout(() => {
|
|
157
162
|
if (!ps.show) {
|
|
158
|
-
|
|
163
|
+
updateShow(false);
|
|
159
164
|
}
|
|
160
165
|
}, 300);
|
|
161
166
|
},
|
|
162
167
|
},
|
|
163
168
|
// onMouseenter: () => {
|
|
164
169
|
// clearTimeout(hideTimer.value);
|
|
165
|
-
//
|
|
170
|
+
// updateShow(true)
|
|
166
171
|
// },
|
|
167
172
|
// onMouseleave: () => {
|
|
168
173
|
// showTimer.value = setTimeout(() => {
|
|
169
174
|
// if (!ps.show) {
|
|
170
|
-
//
|
|
175
|
+
// updateShow(false)
|
|
171
176
|
// }
|
|
172
177
|
// }, 300);
|
|
173
178
|
// },
|
|
@@ -5,18 +5,21 @@
|
|
|
5
5
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
|
-
<
|
|
9
|
-
v-model
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
<Space vertical>
|
|
9
|
+
<code>v-model: {{ value }}</code>
|
|
10
|
+
<TreeSelect
|
|
11
|
+
v-model="value"
|
|
12
|
+
:tree-data="data"
|
|
13
|
+
tree-showLine
|
|
14
|
+
:treeExpandedKeys="expandedKeys"
|
|
15
|
+
block
|
|
16
|
+
/>
|
|
17
|
+
</Space>
|
|
15
18
|
</template>
|
|
16
19
|
<script setup>
|
|
17
20
|
import { ref } from "vue";
|
|
18
21
|
const expandedKeys = ["0-1", "1-1", "1-1-2", "1-2"];
|
|
19
|
-
const value = ref();
|
|
22
|
+
const value = ref("0-1");
|
|
20
23
|
const data = [
|
|
21
24
|
{
|
|
22
25
|
title: "tree 1",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
/>
|
|
18
18
|
<TreeSelect
|
|
19
19
|
:size="size"
|
|
20
|
-
v-model="
|
|
20
|
+
v-model="value1"
|
|
21
21
|
:tree-data="data"
|
|
22
22
|
tree-showLine
|
|
23
23
|
:treeExpandedKeys="expandedKeys"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
/>
|
|
27
27
|
<TreeSelect
|
|
28
28
|
:size="size"
|
|
29
|
-
v-model="
|
|
29
|
+
v-model="value1"
|
|
30
30
|
:tree-data="data"
|
|
31
31
|
tree-showLine
|
|
32
32
|
:treeExpandedKeys="expandedKeys"
|
|
@@ -46,7 +46,8 @@ const sizes = [
|
|
|
46
46
|
const size = ref("default");
|
|
47
47
|
|
|
48
48
|
const expandedKeys = ["0-1", "1-1", "1-1-2", "1-2"];
|
|
49
|
-
const value = ref();
|
|
49
|
+
const value = ref('0-1');
|
|
50
|
+
const value1 = ref(['0-1']);
|
|
50
51
|
const data = [
|
|
51
52
|
{
|
|
52
53
|
title: "tree 1",
|
|
@@ -259,9 +259,11 @@ const TreeSelect = defineComponent({
|
|
|
259
259
|
}
|
|
260
260
|
};
|
|
261
261
|
const labelText = computed(() => {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
.
|
|
262
|
+
const lookup = new Map();
|
|
263
|
+
optionsData.value.forEach((item) => {
|
|
264
|
+
lookup.set(item.value, item.label);
|
|
265
|
+
});
|
|
266
|
+
return currentValue.value.map(val => lookup.get(val) ?? val);
|
|
265
267
|
});
|
|
266
268
|
|
|
267
269
|
const optionsData = computed(() => {
|
|
@@ -13,8 +13,7 @@ name 为上传文件名
|
|
|
13
13
|
:headers="headers"
|
|
14
14
|
:data="prams"
|
|
15
15
|
:autoTrigger="false"
|
|
16
|
-
@
|
|
17
|
-
@remove="beforeUpload"
|
|
16
|
+
@onSelectFiles="onSelectFiles"
|
|
18
17
|
multiple
|
|
19
18
|
ref="uploadRef"
|
|
20
19
|
>
|
|
@@ -40,6 +39,10 @@ const beforeUpload = (info) => {
|
|
|
40
39
|
console.log(info.file, info.fileList);
|
|
41
40
|
disabled.value = info.fileList.length == 0;
|
|
42
41
|
};
|
|
42
|
+
const onSelectFiles = (fileList) => {
|
|
43
|
+
console.log(fileList);
|
|
44
|
+
disabled.value = fileList.length == 0;
|
|
45
|
+
};
|
|
43
46
|
const startUpload = () => {
|
|
44
47
|
console.log("startUpload",uploadRef);
|
|
45
48
|
uploadRef.value.upload();
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
uploadText="上传图片"
|
|
17
17
|
>
|
|
18
18
|
</Upload>
|
|
19
|
+
<br />
|
|
20
|
+
<Button @click="test">change</Button>
|
|
19
21
|
</template>
|
|
20
22
|
<script setup>
|
|
21
23
|
import { ref } from "vue";
|
|
@@ -43,5 +45,17 @@ const handleChange = (info) => {
|
|
|
43
45
|
console.log(info.file, info.fileList);
|
|
44
46
|
}
|
|
45
47
|
};
|
|
48
|
+
const test = () => {
|
|
49
|
+
fileList.value = [
|
|
50
|
+
{
|
|
51
|
+
url: "https://cdn.chuchur.com/upload/cat/cat1.jpg",
|
|
52
|
+
status: "uploading",
|
|
53
|
+
filename: "test.jpg",
|
|
54
|
+
size: "222kb",
|
|
55
|
+
percent: 50,
|
|
56
|
+
status: "uploading",
|
|
57
|
+
},
|
|
58
|
+
];
|
|
59
|
+
};
|
|
46
60
|
</script>
|
|
47
61
|
```
|