kui-vue 3.2.11 → 3.3.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.
- package/components/_tool/scroll.js +1 -1
- package/components/alert/alert.jsx +10 -8
- package/components/avatar/AvatarGroup.jsx +22 -0
- package/components/avatar/avatar.jsx +10 -3
- package/components/avatar/demo/base.md +8 -8
- package/components/avatar/demo/types.md +17 -4
- package/components/avatar/styles/index.less +6 -2
- package/components/backtop/backtop.jsx +2 -1
- package/components/badge/demo/color.md +2 -2
- package/components/badge/demo/dot.md +11 -1
- package/components/badge/demo/dynamic.md +5 -3
- package/components/base/input.jsx +6 -5
- package/components/base/pop.jsx +2 -1
- package/components/breadcrumb/breadcrumbItem.jsx +1 -1
- package/components/breadcrumb/demo/icon.md +13 -3
- package/components/breadcrumb/demo/separator.md +13 -3
- package/components/breadcrumb/styles/index.less +3 -1
- package/components/button/button.jsx +3 -2
- package/components/button/demo/group.md +12 -2
- package/components/button/demo/light.md +18 -8
- package/components/button/demo/loading.md +8 -6
- package/components/button/demo/normal.md +18 -8
- package/components/button/demo/size.md +8 -6
- package/components/button/demo/with-icon.md +17 -7
- package/components/button/styles/index.less +5 -5
- package/components/card/card.jsx +1 -1
- package/components/card/demo/base.md +11 -1
- package/components/card/demo/border.md +11 -1
- package/components/carousel/carousel.jsx +4 -2
- package/components/carousel/styles/index.less +7 -1
- package/components/checkbox/checkbox.jsx +2 -1
- package/components/checkbox/demo/base.md +2 -2
- package/components/checkbox/demo/disabled.md +2 -2
- package/components/collapse/demo/accrodion.md +1 -1
- package/components/collapse/demo/base.md +1 -1
- package/components/collapse/demo/extra.md +6 -4
- package/components/collapse/demo/nesting.md +1 -1
- package/components/collapse/demo/sample.md +1 -1
- package/components/collapse/panel.jsx +2 -1
- package/components/collapse/styles/index.less +2 -2
- package/components/colorPicker/colorpicker.jsx +5 -5
- package/components/colorPicker/demo/shape.md +3 -1
- package/components/colorPicker/styles/index.less +13 -1
- package/components/datePicker/datecalendar.jsx +9 -5
- package/components/datePicker/datepicker.jsx +6 -6
- package/components/datePicker/demo/format.md +2 -2
- package/components/datePicker/demo/inside.md +4 -2
- package/components/datePicker/demo/size.md +2 -2
- package/components/datePicker/demo/theme.md +6 -4
- package/components/datePicker/styles/datepicker.less +5 -6
- package/components/descriptions/demo/size.md +2 -2
- package/components/drawer/demo/base.md +2 -2
- package/components/drawer/demo/custom.md +2 -2
- package/components/drawer/demo/form.md +2 -2
- package/components/drawer/demo/target.md +2 -2
- package/components/drawer/drawer.jsx +2 -1
- package/components/dropdown/demo/base.md +16 -6
- package/components/dropdown/demo/cascading.md +11 -1
- package/components/dropdown/demo/custom.md +3 -1
- package/components/dropdown/demo/divider.md +11 -3
- package/components/dropdown/demo/rightmenu.md +9 -3
- package/components/empty/demo/custom.md +12 -2
- package/components/empty/demo/use.md +2 -2
- package/components/empty/empty.jsx +2 -1
- package/components/form/demo/align.md +1 -1
- package/components/form/demo/base.md +3 -3
- package/components/form/demo/customvalid.md +1 -1
- package/components/form/demo/dynamicvalid.md +4 -2
- package/components/form/styles/index.less +0 -5
- package/components/grid/col.jsx +34 -5
- package/components/grid/demo/gutter.md +52 -11
- package/components/grid/index.md +7 -7
- package/components/grid/row.jsx +24 -4
- package/components/grid/styles/index.less +9 -23
- package/components/icon/demo/base.md +14 -4
- package/components/icon/demo/info.md +25 -1
- package/components/icon/demo/search.vue +43 -21
- package/components/icon/demo/stroke.md +17 -4
- package/components/icon/icon.jsx +6 -4
- package/components/icon/index.md +1 -1
- package/components/icon/lib/dist.json +1 -1
- package/components/icon/lib/kui-icons.js +1 -1
- package/components/icon/lib/sprite.svg +1 -1
- package/components/image/demo/errors.md +1 -1
- package/components/image/demo/extra.md +16 -14
- package/components/image/demo/extra_globle.md +8 -7
- package/components/image/image.jsx +3 -13
- package/components/image/preview.jsx +12 -12
- package/components/image/styles/index.less +8 -3
- package/components/input/demo/icon.md +10 -4
- package/components/input/demo/size.md +13 -3
- package/components/input/demo/suffix.md +7 -5
- package/components/input/demo/theme.md +5 -3
- package/components/input/input.jsx +1 -1
- package/components/inputNumber/demo/ffix.md +12 -2
- package/components/inputNumber/demo/format.md +1 -1
- package/components/inputNumber/demo/size.md +13 -3
- package/components/inputNumber/inputNumber.jsx +13 -7
- package/components/inputNumber/styles/index.less +7 -0
- package/components/layout/demo/layout1.md +17 -7
- package/components/layout/demo/layout2.md +18 -17
- package/components/layout/demo/layout3.md +15 -15
- package/components/layout/demo/layout4.md +16 -15
- package/components/layout/demo/layout5.md +90 -67
- package/components/layout/styles/index.less +12 -12
- package/components/menu/demo/accrodion.md +6 -4
- package/components/menu/demo/base.md +7 -5
- package/components/menu/demo/collapsed.md +8 -6
- package/components/menu/demo/inline.md +6 -4
- package/components/menu/demo/mode.md +7 -5
- package/components/menu/demo/theme.md +7 -5
- package/components/menu/demo/vertical.md +7 -5
- package/components/menu/menuitem.jsx +3 -2
- package/components/menu/styles/dropmenu.less +12 -4
- package/components/menu/styles/index.less +501 -495
- package/components/menu/submenu.jsx +4 -3
- package/components/message/demo/icon.md +8 -2
- package/components/message/inner.jsx +8 -7
- package/components/modal/demo/base.md +2 -2
- package/components/modal/demo/custom.md +5 -3
- package/components/modal/demo/global.md +9 -3
- package/components/modal/demo/more.md +2 -2
- package/components/modal/modal.jsx +3 -3
- package/components/notice/demo/icon.md +10 -4
- package/components/page/demo/sizer.md +2 -2
- package/components/page/page.jsx +5 -4
- package/components/page/styles/index.less +21 -7
- package/components/popconfirm/demo/placement.md +2 -2
- package/components/poptip/demo/closeinside.md +2 -2
- package/components/poptip/demo/placement.md +2 -2
- package/components/progress/demo/color.md +5 -3
- package/components/progress/demo/dashboard.md +3 -3
- package/components/progress/demo/dynamic.md +5 -3
- package/components/progress/demo/size.md +4 -4
- package/components/progress/progress.jsx +6 -5
- package/components/radio/demo/base.md +2 -2
- package/components/radio/demo/button.md +2 -2
- package/components/radio/demo/disabled.md +2 -2
- package/components/radio/styles/index.less +3 -0
- package/components/rate/demo/base.md +12 -2
- package/components/rate/demo/character.md +11 -1
- package/components/rate/demo/custom.md +7 -6
- package/components/rate/demo/disabled.md +11 -1
- package/components/rate/demo/tips.md +1 -1
- package/components/rate/rate.jsx +2 -2
- package/components/rate/star.jsx +4 -3
- package/components/select/demo/clearable.md +2 -2
- package/components/select/demo/filterable.md +2 -2
- package/components/select/demo/icon.md +5 -3
- package/components/select/demo/multiple.md +2 -2
- package/components/select/demo/search.md +2 -2
- package/components/select/demo/size.md +7 -5
- package/components/select/demo/theme.md +6 -4
- package/components/select/option.jsx +2 -12
- package/components/select/select.jsx +9 -12
- package/components/select/styles/index.less +4 -15
- package/components/skeleton/demo/child.md +2 -2
- package/components/skeleton/demo/custom.md +1 -1
- package/components/skeleton/demo/list.md +1 -1
- package/components/skeleton/skeletonAvatar.jsx +1 -0
- package/components/skeleton/skeletonButton.jsx +1 -0
- package/components/skeleton/skeletonImage.jsx +1 -0
- package/components/skeleton/skeletonText.jsx +1 -0
- package/components/slider/demo/base.md +11 -6
- package/components/slider/demo/marks.md +37 -26
- package/components/slider/demo/reverse.md +1 -1
- package/components/slider/slider.jsx +79 -35
- package/components/slider/styles/index.less +6 -3
- package/components/slider/thumb.jsx +23 -39
- package/components/space/demo/base.md +11 -1
- package/components/space/demo/custom-size.md +1 -6
- package/components/space/demo/size.md +2 -2
- package/components/space/demo/vertical.md +12 -2
- package/components/space/space.jsx +2 -2
- package/components/spin/demo/container.md +2 -2
- package/components/spin/demo/mode.md +2 -2
- package/components/steps/step.vue +1 -1
- package/components/styles/sys.less +22 -20
- package/components/styles/var.less +140 -149
- package/components/switch/demo/base.md +2 -2
- package/components/switch/demo/disabled.md +2 -2
- package/components/switch/demo/text.md +10 -8
- package/components/switch/switch.jsx +2 -1
- package/components/table/demo/base-render.md +41 -38
- package/components/table/demo/base.md +3 -1
- package/components/table/demo/bordered.md +1 -1
- package/components/table/demo/custom-header.md +10 -8
- package/components/table/demo/edit.md +2 -2
- package/components/table/demo/ellipsis.md +5 -3
- package/components/table/demo/embed.md +2 -2
- package/components/table/demo/expand.md +5 -3
- package/components/table/demo/filter.md +2 -2
- package/components/table/demo/fixed-col.md +5 -5
- package/components/table/demo/fixed-head.md +3 -3
- package/components/table/demo/fixed.md +14 -6
- package/components/table/demo/fixedspan.md +2 -7
- package/components/table/demo/index.vue +1 -1
- package/components/table/demo/selection.md +6 -4
- package/components/table/demo/size.md +3 -1
- package/components/table/demo/span.md +2 -2
- package/components/table/extend.jsx +157 -55
- package/components/table/index.md +1 -0
- package/components/table/styles/index.less +85 -101
- package/components/table/table.jsx +37 -176
- package/components/table/utils.js +17 -13
- package/components/tabs/demo/base.md +2 -2
- package/components/tabs/demo/card.md +2 -2
- package/components/tabs/demo/centered.md +2 -2
- package/components/tabs/demo/closable.md +4 -2
- package/components/tabs/demo/disabled.md +2 -2
- package/components/tabs/demo/extra.md +2 -2
- package/components/tabs/demo/icon.md +6 -4
- package/components/tabs/demo/sample.md +2 -2
- package/components/tabs/styles/index.less +3 -2
- package/components/tabs/tabpane.jsx +1 -1
- package/components/tabs/tabs.jsx +4 -3
- package/components/tag/demo/color.md +2 -2
- package/components/tag/demo/dynamic.md +3 -1
- package/components/tag/tag.jsx +2 -1
- package/components/timeline/demo/icon.md +12 -2
- package/components/timeline/demo/mode.md +6 -4
- package/components/timeline/styles/index.less +8 -0
- package/components/timeline/timelineitem.jsx +2 -3
- package/components/tooltip/demo/base.md +2 -2
- package/components/tooltip/demo/color.md +2 -2
- package/components/tooltip/demo/placement.md +2 -2
- package/components/tree/demo/custom-render.md +8 -7
- package/components/tree/demo/directory.md +59 -47
- package/components/tree/demo/icon.md +13 -11
- package/components/tree/demo/treenode.md +3 -1
- package/components/tree/node.jsx +3 -3
- package/components/tree/styles/index.less +2 -2
- package/components/upload/demo/accept.md +6 -4
- package/components/upload/demo/avatar.md +4 -2
- package/components/upload/demo/base.md +4 -2
- package/components/upload/demo/custom.md +4 -2
- package/components/upload/demo/directory.md +4 -2
- package/components/upload/demo/draggable.md +4 -2
- package/components/upload/demo/exceed.md +4 -2
- package/components/upload/demo/file-list.md +4 -2
- package/components/upload/demo/form.md +5 -3
- package/components/upload/demo/picture.md +1 -1
- package/components/upload/upload.jsx +9 -5
- package/dist/k-ui.css +2 -3
- package/dist/k-ui.js +2 -3
- package/dist/locale/de.js +7 -0
- package/dist/locale/el.js +7 -0
- package/dist/locale/en.js +7 -0
- package/dist/locale/fr.js +7 -0
- package/dist/locale/it.js +7 -0
- package/dist/locale/ja.js +7 -0
- package/dist/locale/ko.js +7 -0
- package/dist/locale/ru.js +7 -0
- package/dist/locale/th.js +7 -0
- package/dist/locale/ua.js +7 -0
- package/dist/locale/vi.js +7 -0
- package/dist/locale/zhCN.js +7 -0
- package/dist/locale/zhTW.js +7 -0
- package/package.json +3 -2
- package/readme.md +39 -22
|
@@ -7,6 +7,14 @@
|
|
|
7
7
|
box-sizing: border-box;
|
|
8
8
|
position: relative;
|
|
9
9
|
color: var(--kui-color-font);
|
|
10
|
+
.k-table-cell-fixed-left {
|
|
11
|
+
position: sticky;
|
|
12
|
+
left: 0;
|
|
13
|
+
}
|
|
14
|
+
.k-table-cell-fixed-right {
|
|
15
|
+
position: sticky;
|
|
16
|
+
right: 0;
|
|
17
|
+
}
|
|
10
18
|
.k-spin {
|
|
11
19
|
position: absolute;
|
|
12
20
|
width: 100%;
|
|
@@ -16,14 +24,14 @@
|
|
|
16
24
|
}
|
|
17
25
|
table {
|
|
18
26
|
width: 100%;
|
|
19
|
-
border-collapse:
|
|
27
|
+
border-collapse: separate;
|
|
20
28
|
border-spacing: 0;
|
|
21
29
|
background: var(--kui-color-back);
|
|
22
30
|
thead {
|
|
23
|
-
background: var(--kui-color-
|
|
24
|
-
border-bottom: 1px solid var(--kui-color-
|
|
25
|
-
.k-
|
|
26
|
-
|
|
31
|
+
background: var(--kui-color-table-header);
|
|
32
|
+
border-bottom: 1px solid var(--kui-color-table-border);
|
|
33
|
+
.k-table-cell-fixed-left, .k-table-cell-fixed-right {
|
|
34
|
+
background: var(--kui-color-table-header);
|
|
27
35
|
}
|
|
28
36
|
}
|
|
29
37
|
tr>th {
|
|
@@ -34,6 +42,9 @@
|
|
|
34
42
|
text-align: center;
|
|
35
43
|
}
|
|
36
44
|
}
|
|
45
|
+
.k-table {
|
|
46
|
+
margin: -10px -10px -11px -10px
|
|
47
|
+
}
|
|
37
48
|
th.k-table-cell-selection {
|
|
38
49
|
text-align: center;
|
|
39
50
|
padding: 0;
|
|
@@ -43,11 +54,27 @@
|
|
|
43
54
|
padding: 10px;
|
|
44
55
|
overflow-wrap: break-word;
|
|
45
56
|
word-wrap: break-word;
|
|
57
|
+
border-bottom: 1px solid var(--kui-color-table-border);
|
|
58
|
+
}
|
|
59
|
+
.k-table-header-col {
|
|
60
|
+
display: inline-block;
|
|
61
|
+
max-width: 100%;
|
|
62
|
+
.k-table-header-title {
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
line-height: 1;
|
|
66
|
+
}
|
|
46
67
|
}
|
|
47
68
|
.k-table-cell-ellipsis {
|
|
48
69
|
white-space: nowrap;
|
|
49
70
|
overflow: hidden;
|
|
50
71
|
text-overflow: ellipsis;
|
|
72
|
+
.k-table-header-title {
|
|
73
|
+
display: block !important;
|
|
74
|
+
overflow: hidden;
|
|
75
|
+
text-overflow: ellipsis;
|
|
76
|
+
white-space: nowrap;
|
|
77
|
+
}
|
|
51
78
|
}
|
|
52
79
|
.k-table-cell-sorter {
|
|
53
80
|
cursor: pointer;
|
|
@@ -59,10 +86,13 @@
|
|
|
59
86
|
line-height: 1;
|
|
60
87
|
.k-table-header-title {
|
|
61
88
|
flex: 1;
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
line-height: 1;
|
|
62
92
|
}
|
|
63
93
|
}
|
|
64
94
|
&:hover {
|
|
65
|
-
background: var(--kui-color-
|
|
95
|
+
background: var(--kui-color-table-header-hover);
|
|
66
96
|
}
|
|
67
97
|
.k-table-sorter {
|
|
68
98
|
display: inline-block;
|
|
@@ -76,13 +106,15 @@
|
|
|
76
106
|
color: #ccc;
|
|
77
107
|
height: 7px;
|
|
78
108
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
109
|
+
.actived {
|
|
110
|
+
color: var(--kui-color-main);
|
|
111
|
+
}
|
|
82
112
|
}
|
|
83
113
|
}
|
|
84
114
|
tbody>tr {
|
|
85
|
-
|
|
115
|
+
.k-table-cell-fixed-left, .k-table-cell-fixed-right {
|
|
116
|
+
background-color: var(--kui-color-back);
|
|
117
|
+
}
|
|
86
118
|
&:nth-child(even) {
|
|
87
119
|
// background: fade(var(--kui-color-border), 30%);
|
|
88
120
|
}
|
|
@@ -90,15 +122,15 @@
|
|
|
90
122
|
// background: #fff;
|
|
91
123
|
}
|
|
92
124
|
&:hover {
|
|
93
|
-
background: var(--kui-color-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
125
|
+
background: var(--kui-color-table-hover);
|
|
126
|
+
.k-table-cell-fixed-left, .k-table-cell-fixed-right {
|
|
127
|
+
background-color: var(--kui-color-table-hover);
|
|
128
|
+
}
|
|
97
129
|
}
|
|
98
130
|
}
|
|
99
131
|
.k-table-expand-row {
|
|
100
132
|
&:hover {
|
|
101
|
-
background: var(--kui-color-
|
|
133
|
+
background: var(--kui-color-table-hover);
|
|
102
134
|
}
|
|
103
135
|
}
|
|
104
136
|
td table {
|
|
@@ -106,18 +138,21 @@
|
|
|
106
138
|
border-bottom: none;
|
|
107
139
|
}
|
|
108
140
|
tbody>tr:hover {
|
|
109
|
-
background: var(--kui-color-
|
|
141
|
+
background: var(--kui-color-table-hover);
|
|
110
142
|
}
|
|
111
143
|
}
|
|
112
144
|
}
|
|
145
|
+
&-thead {
|
|
146
|
+
overflow: auto;
|
|
147
|
+
}
|
|
113
148
|
&-header {
|
|
114
149
|
padding: 10px;
|
|
115
|
-
border-top: 1px solid var(--kui-color-
|
|
150
|
+
border-top: 1px solid var(--kui-color-table-border);
|
|
116
151
|
}
|
|
117
152
|
&-footer {
|
|
118
153
|
padding: 10px;
|
|
119
|
-
border-bottom: 1px solid var(--kui-color-
|
|
120
|
-
background-color: var(--kui-color-
|
|
154
|
+
border-bottom: 1px solid var(--kui-color-table-border);
|
|
155
|
+
background-color: var(--kui-color-table-header);
|
|
121
156
|
}
|
|
122
157
|
th>a, td>a {
|
|
123
158
|
color: #3a95ff;
|
|
@@ -131,66 +166,38 @@
|
|
|
131
166
|
table-layout: fixed;
|
|
132
167
|
}
|
|
133
168
|
}
|
|
134
|
-
&-
|
|
169
|
+
&-header {
|
|
135
170
|
word-break: break-all;
|
|
136
|
-
.k-table-fixed-main-thead {
|
|
137
|
-
&::-webkit-scrollbar {}
|
|
138
|
-
}
|
|
139
|
-
.k-table-fixed-main-thead, .k-table-fixed-right-thead, .k-table-fixed-left-thead {
|
|
140
|
-
overflow: scroll;
|
|
141
|
-
margin-bottom: -20px;
|
|
142
|
-
&::-webkit-scrollbar {
|
|
143
|
-
background-color: transparent !important;
|
|
144
|
-
border-bottom: 1px solid var(--kui-color-gray-80);
|
|
145
|
-
}
|
|
146
|
-
&::-webkit-scrollbar-track {
|
|
147
|
-
background-color: transparent !important;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
.k-table-fixed-left-thead {
|
|
151
|
-
overflow-y: hidden;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
&-fixed-left, &-fixed-right {
|
|
155
|
-
position: absolute;
|
|
156
|
-
top: 0;
|
|
157
|
-
overflow: hidden;
|
|
158
171
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
width: auto; //针对 table-layout: fixed;
|
|
172
|
+
.k-table-cell-fixed-left-last, .k-table-cell-fixed-right-first {
|
|
173
|
+
&::after {
|
|
174
|
+
content: "";
|
|
175
|
+
position: absolute;
|
|
176
|
+
height: calc(100% + 1px);
|
|
177
|
+
width: 30px;
|
|
178
|
+
top: 0;
|
|
167
179
|
}
|
|
168
180
|
}
|
|
169
|
-
&-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
181
|
+
&-ping-middle {
|
|
182
|
+
.k-table-cell-fixed-right-first::after {
|
|
183
|
+
box-shadow: inset -6px 0 6px -4px var(--kui-color-shadow);
|
|
184
|
+
left: -30px;
|
|
173
185
|
}
|
|
174
|
-
table {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
&-scroll-left {
|
|
179
|
-
.k-table-fixed-right {
|
|
180
|
-
box-shadow: -6px 0 6px -4px rgba(0, 0, 0, .15);
|
|
186
|
+
.k-table-cell-fixed-left-last::after {
|
|
187
|
+
box-shadow: inset 6px 0 6px -4px var(--kui-color-shadow);
|
|
188
|
+
right: -30px;
|
|
181
189
|
}
|
|
182
190
|
}
|
|
183
|
-
&-
|
|
184
|
-
.k-table-fixed-left {
|
|
185
|
-
box-shadow: 6px 0 6px -4px
|
|
191
|
+
&-ping-right {
|
|
192
|
+
.k-table-cell-fixed-left-last::after {
|
|
193
|
+
box-shadow: inset 6px 0 6px -4px var(--kui-color-shadow);
|
|
194
|
+
right: -30px;
|
|
186
195
|
}
|
|
187
196
|
}
|
|
188
|
-
&-
|
|
189
|
-
.k-table-fixed-right {
|
|
190
|
-
box-shadow: -6px 0 6px -4px
|
|
191
|
-
|
|
192
|
-
.k-table-fixed-left {
|
|
193
|
-
box-shadow: 6px 0 6px -4px rgba(0, 0, 0, .15);
|
|
197
|
+
&-ping-left {
|
|
198
|
+
.k-table-cell-fixed-right-first::after {
|
|
199
|
+
box-shadow: inset -6px 0 6px -4px var(--kui-color-shadow);
|
|
200
|
+
left: -30px;
|
|
194
201
|
}
|
|
195
202
|
}
|
|
196
203
|
&-sm {
|
|
@@ -207,47 +214,24 @@
|
|
|
207
214
|
}
|
|
208
215
|
}
|
|
209
216
|
}
|
|
210
|
-
.k-table {
|
|
211
|
-
margin: -10px;
|
|
212
|
-
width: auto;
|
|
213
|
-
&:after {
|
|
214
|
-
content: '';
|
|
215
|
-
display: table;
|
|
216
|
-
}
|
|
217
|
-
table tbody tr {
|
|
218
|
-
// background-color: fade(var(--kui-color-border), 30%);
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
217
|
&-bordered {
|
|
222
|
-
border: 1px solid var(--kui-color-
|
|
218
|
+
border: 1px solid var(--kui-color-table-border);
|
|
223
219
|
.k-table-footer {
|
|
224
|
-
border-top: 1px solid var(--kui-color-
|
|
220
|
+
border-top: 1px solid var(--kui-color-table-border);
|
|
225
221
|
border-bottom: none;
|
|
226
222
|
}
|
|
227
223
|
thead {
|
|
228
224
|
th {
|
|
229
|
-
border-bottom: 1px solid var(--kui-color-
|
|
230
|
-
border-right: 1px solid var(--kui-color-
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
.k-table-fixed-main-thead, .k-table-fixed-right-thead, .k-table-fixed-left-thead {
|
|
234
|
-
&::-webkit-scrollbar {
|
|
235
|
-
border-top: none;
|
|
225
|
+
border-bottom: 1px solid var(--kui-color-table-border);
|
|
226
|
+
border-right: 1px solid var(--kui-color-table-border);
|
|
236
227
|
}
|
|
237
228
|
}
|
|
238
|
-
// .k-table-fixed-main-thead, .k-table-fixed-right-thead, .k-table-fixed-left-thead {
|
|
239
|
-
// border-bottom: 1px solid fade(var(--kui-color-border), 30%);
|
|
240
|
-
// }
|
|
241
229
|
.k-table-header {
|
|
242
|
-
border-bottom: 1px solid var(--kui-color-
|
|
230
|
+
border-bottom: 1px solid var(--kui-color-table-border);
|
|
243
231
|
border-top: none;
|
|
244
232
|
}
|
|
245
|
-
// .k-table-body tr:first-child td {
|
|
246
|
-
// border-top: none;
|
|
247
|
-
// }
|
|
248
|
-
// // border-bottom: none;
|
|
249
233
|
th, td {
|
|
250
|
-
border: 1px solid var(--kui-color-
|
|
234
|
+
border-right: 1px solid var(--kui-color-table-border);
|
|
251
235
|
}
|
|
252
236
|
tr {
|
|
253
237
|
&:first-child td {
|
|
@@ -263,14 +247,14 @@
|
|
|
263
247
|
tr td:first-child, tr th:first-child {
|
|
264
248
|
border-left: none;
|
|
265
249
|
}
|
|
266
|
-
tr td:last-child, tr th:last-child {
|
|
250
|
+
tr td:last-child, thead tr:first-child th:last-child {
|
|
267
251
|
border-right: none;
|
|
268
252
|
}
|
|
269
253
|
tr th:first-child, table thead, tr th {
|
|
270
254
|
border-top: none;
|
|
271
255
|
}
|
|
272
256
|
.k-table-fixed-right {
|
|
273
|
-
border-left: 1px solid var(--kui-color-
|
|
257
|
+
border-left: 1px solid var(--kui-color-table-border);
|
|
274
258
|
}
|
|
275
259
|
& .k-table {
|
|
276
260
|
margin: -11px -10px -11px -11px;
|
|
@@ -5,10 +5,7 @@ import { Checkbox } from '../checkbox'
|
|
|
5
5
|
import { Radio } from '../radio'
|
|
6
6
|
import ExtendTable from './extend'
|
|
7
7
|
import { sortFixedCol, hasChild, sortColumnsOnline } from './utils'
|
|
8
|
-
|
|
9
|
-
const getHeight = (el) => {
|
|
10
|
-
return el ? el.getBoundingClientRect().height : 0
|
|
11
|
-
}
|
|
8
|
+
import { Remove, Add } from 'kui-icons'
|
|
12
9
|
export default {
|
|
13
10
|
name: 'Table',
|
|
14
11
|
props: {
|
|
@@ -28,32 +25,21 @@ export default {
|
|
|
28
25
|
},
|
|
29
26
|
data() {
|
|
30
27
|
return {
|
|
31
|
-
|
|
28
|
+
ping: 'left',
|
|
32
29
|
filters: {},
|
|
33
|
-
scrollFocus: 'body',
|
|
30
|
+
// scrollFocus: 'body',
|
|
34
31
|
}
|
|
35
32
|
},
|
|
36
|
-
|
|
37
|
-
this.renderEnd = true
|
|
38
|
-
this.resetHeight()
|
|
39
|
-
this.$isServer && window.addEventListener('resize', this.autoResize)
|
|
40
|
-
},
|
|
41
|
-
beforeDestroy() {
|
|
42
|
-
this.$isServer && window.removeEventListener('resize', this.autoResize)
|
|
43
|
-
},
|
|
44
|
-
updated() {
|
|
45
|
-
this.autoResize()
|
|
46
|
-
},
|
|
47
|
-
render(h) {
|
|
33
|
+
render() {
|
|
48
34
|
let { $slots, data, $scopedSlots, loading, height, width } = this
|
|
49
35
|
// bordered = true
|
|
50
36
|
const { header, footer } = $slots
|
|
51
37
|
let isTableFixed = width || height
|
|
52
|
-
const content = [], tbody = []
|
|
38
|
+
const content = [], tbody = [];
|
|
53
39
|
|
|
54
40
|
//custom head
|
|
55
41
|
if (header) {
|
|
56
|
-
content.push(<div class="k-table-header"
|
|
42
|
+
content.push(<div class="k-table-header"> {header}</div>)
|
|
57
43
|
}
|
|
58
44
|
|
|
59
45
|
const isFixedHeader = height
|
|
@@ -62,7 +48,7 @@ export default {
|
|
|
62
48
|
|
|
63
49
|
//重新排序
|
|
64
50
|
|
|
65
|
-
let { columns
|
|
51
|
+
let { columns } = sortFixedCol(this.columns)
|
|
66
52
|
|
|
67
53
|
//reset custom header
|
|
68
54
|
columns.forEach(col => {
|
|
@@ -88,7 +74,7 @@ export default {
|
|
|
88
74
|
// d._checked = d._checked || false
|
|
89
75
|
// d._disabled = d._disabled || false
|
|
90
76
|
|
|
91
|
-
|
|
77
|
+
let left = 0, right = _columns.filter(c => c.fixed == 'right').map(c => c.width).reduce((a, b) => a + b, 0);
|
|
92
78
|
_columns.forEach((c, j) => {
|
|
93
79
|
// $scopedSlots[c.key]({ text: d[c.key] })
|
|
94
80
|
if (c.key || c.type) {
|
|
@@ -98,16 +84,29 @@ export default {
|
|
|
98
84
|
class: [{
|
|
99
85
|
"k-table-cell-ellipsis": c.ellipsis,
|
|
100
86
|
'k-table-cell-selection': c.type == 'selection',
|
|
87
|
+
'k-table-cell-fixed-left': c.fixed == 'left',
|
|
88
|
+
'k-table-cell-fixed-left-last': c.last,
|
|
89
|
+
'k-table-cell-fixed-right-first': c.first,
|
|
90
|
+
'k-table-cell-fixed-right': c.fixed == 'right',
|
|
101
91
|
[c.className]: c.className
|
|
102
92
|
}],
|
|
103
93
|
attrs: {
|
|
104
94
|
title: c.ellipsis ? d[c.key] : null
|
|
105
95
|
},
|
|
96
|
+
style: {}
|
|
97
|
+
}
|
|
98
|
+
if (c.fixed == 'left' && j > 0) {
|
|
99
|
+
left += _columns[j - 1].width
|
|
100
|
+
props.style.left = left + 'px'
|
|
101
|
+
}
|
|
102
|
+
if (c.fixed == 'right' && j < _columns.length - 1) {
|
|
103
|
+
right -= c.width
|
|
104
|
+
props.style.right = right + 'px'
|
|
106
105
|
}
|
|
107
106
|
if (c.render) {
|
|
107
|
+
let h = this.$createElement
|
|
108
108
|
let scope = c.render(h, d, i, c.key)
|
|
109
109
|
|
|
110
|
-
// let { children, attrs } = c.render($scope, d, i)
|
|
111
110
|
let { children, attrs } = scope
|
|
112
111
|
if (attrs) {
|
|
113
112
|
props = Object.assign(props, { attrs })
|
|
@@ -115,6 +114,7 @@ export default {
|
|
|
115
114
|
} else {
|
|
116
115
|
$scope = scope
|
|
117
116
|
}
|
|
117
|
+
// console.log($scope)
|
|
118
118
|
} else if ($scopedSlots[c.key]) {
|
|
119
119
|
$scope = $scopedSlots[c.key](d[c.key], d, c)
|
|
120
120
|
} else if (c.type == 'selection') {
|
|
@@ -135,20 +135,16 @@ export default {
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
if (props.attrs.rowSpan !== 0 && props.attrs.colSpan !== 0) {
|
|
138
|
-
tr.push(h('td', props, [!c.fixed ? $scope : null]))
|
|
139
|
-
// tr.push(
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
trL.push(h('td', props, [$scope]))
|
|
138
|
+
// tr.push(h('td', props, [!c.fixed ? $scope : null]))
|
|
139
|
+
// tr.push(h('td', props, $scope))
|
|
140
|
+
//or
|
|
141
|
+
tr.push(<td {...props}>{$scope}</td>)
|
|
143
142
|
}
|
|
144
143
|
|
|
145
|
-
if (c.fixed == 'right') {
|
|
146
|
-
trR.push(h('td', props, [$scope]))
|
|
147
|
-
}
|
|
148
144
|
}
|
|
149
145
|
})
|
|
150
146
|
if (expandNode) {
|
|
151
|
-
tr.unshift(<td class="k-table-row-expand-icon-cell"><Icon onClick={e => this.onExpand(d)} type={d._expanded ?
|
|
147
|
+
tr.unshift(<td class="k-table-row-expand-icon-cell"><Icon onClick={e => this.onExpand(d)} type={d._expanded ? Remove : Add} /></td>)
|
|
152
148
|
}
|
|
153
149
|
let trProps = {
|
|
154
150
|
class: { 'k-table-row-hover': d._hover },
|
|
@@ -159,79 +155,18 @@ export default {
|
|
|
159
155
|
}
|
|
160
156
|
}
|
|
161
157
|
}
|
|
162
|
-
|
|
163
|
-
trProps.on.mouseenter = () => {
|
|
164
|
-
this.$set(d, '_hover', true)
|
|
165
|
-
}
|
|
166
|
-
trProps.on.mouseleave = () => {
|
|
167
|
-
this.$set(d, '_hover', false)
|
|
168
|
-
}
|
|
169
|
-
}
|
|
158
|
+
|
|
170
159
|
if (tr.length) {
|
|
171
160
|
tbody.push(<tr {...trProps}>{tr}</tr>)
|
|
172
161
|
}
|
|
173
|
-
if (trL.length) {
|
|
174
|
-
tbodyL.push(<tr {...trProps}>{trL}</tr>)
|
|
175
|
-
}
|
|
176
|
-
if (trR.length) {
|
|
177
|
-
tbodyR.push(<tr {...trProps}>{trR}</tr>)
|
|
178
|
-
}
|
|
179
162
|
|
|
180
163
|
if (expandNode) {
|
|
181
164
|
tbody.push(<tr v-show={d._expanded} class="k-table-expand-row"><td></td><td colSpan={_columns.length}>{expandNode(d)}</td></tr>)
|
|
182
165
|
}
|
|
183
166
|
})
|
|
184
167
|
|
|
185
|
-
if (tbodyL.length) {
|
|
186
|
-
const props = {
|
|
187
|
-
props: {
|
|
188
|
-
columns: columns.filter(x => x.fixed == 'left'),
|
|
189
|
-
body: tbodyL,
|
|
190
|
-
mode: 'left',
|
|
191
|
-
height,
|
|
192
|
-
indeterminate,
|
|
193
|
-
checkAll,
|
|
194
|
-
},
|
|
195
|
-
ref: 'leftTable',
|
|
196
|
-
on: {
|
|
197
|
-
scroll: this.fixedScroll,
|
|
198
|
-
sorter: this.sorter,
|
|
199
|
-
'select-all': this.onSelectAll,
|
|
200
|
-
mouseenter: () => this.scrollFocus = `fixed-left`,
|
|
201
|
-
mouseleave: () => this.scrollFocus = 'body'
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
content.push(<ExtendTable {...props} />)
|
|
205
|
-
}
|
|
206
|
-
if (tbodyR.length) {
|
|
207
|
-
const props = {
|
|
208
|
-
props: {
|
|
209
|
-
columns: columns.filter(x => x.fixed == 'right'),
|
|
210
|
-
body: tbodyR,
|
|
211
|
-
mode: 'right',
|
|
212
|
-
height,
|
|
213
|
-
indeterminate,
|
|
214
|
-
checkAll,
|
|
215
|
-
},
|
|
216
|
-
ref: 'rightTable',
|
|
217
|
-
on: {
|
|
218
|
-
scroll: this.fixedScroll,
|
|
219
|
-
sorter: this.sorter,
|
|
220
|
-
'select-all': this.onSelectAll,
|
|
221
|
-
mouseenter: e => {
|
|
222
|
-
this.scrollFocus = `fixed-right`
|
|
223
|
-
},
|
|
224
|
-
mouseleave: e => {
|
|
225
|
-
this.scrollFocus = 'body'
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
content.push(<ExtendTable {...props} />)
|
|
230
|
-
}
|
|
231
|
-
|
|
232
168
|
let mainProps = {
|
|
233
169
|
props: {
|
|
234
|
-
mode: 'main',
|
|
235
170
|
columns: columns,
|
|
236
171
|
columns2: _columns,
|
|
237
172
|
body: tbody,
|
|
@@ -241,24 +176,28 @@ export default {
|
|
|
241
176
|
width,
|
|
242
177
|
hasExpand: expandNode != null
|
|
243
178
|
},
|
|
244
|
-
ref: 'mainTable',
|
|
245
179
|
on: {
|
|
246
|
-
scroll: this.scroll,
|
|
247
180
|
sorter: this.sorter,
|
|
248
181
|
'select-all': this.onSelectAll,
|
|
182
|
+
ping: p => {
|
|
183
|
+
this.ping = p
|
|
184
|
+
// todo: class 动态赋值 会重新 render 造成卡顿,后面再细细 可能是table 数据有内存泄露问题
|
|
185
|
+
|
|
186
|
+
}
|
|
249
187
|
// resize: this.resetHeight
|
|
250
188
|
}
|
|
251
189
|
}
|
|
252
190
|
content.push(<ExtendTable {...mainProps} />)
|
|
253
191
|
|
|
254
192
|
const rootProps = {
|
|
193
|
+
// ref: 'table',
|
|
255
194
|
class: ["k-table", {
|
|
256
195
|
'k-table-fixed': isTableFixed,
|
|
257
196
|
'k-table-sm': this.size == 'small',
|
|
258
197
|
'k-table-lg': this.size == 'large',
|
|
259
|
-
'k-table-fixed-header': isFixedHeader,
|
|
198
|
+
// 'k-table-fixed-header': isFixedHeader,
|
|
260
199
|
'k-table-bordered': this.bordered,
|
|
261
|
-
[`k-table-
|
|
200
|
+
[`k-table-ping-${this.ping}`]: width !== undefined
|
|
262
201
|
}]
|
|
263
202
|
}
|
|
264
203
|
|
|
@@ -280,53 +219,6 @@ export default {
|
|
|
280
219
|
let { key, _order } = item
|
|
281
220
|
this.$emit('change', this.filters, { key, order: _order })
|
|
282
221
|
},
|
|
283
|
-
autoResize() {
|
|
284
|
-
clearTimeout(this.timer)
|
|
285
|
-
this.timer = setTimeout(() => {
|
|
286
|
-
this.resetHeight()
|
|
287
|
-
}, 300);
|
|
288
|
-
},
|
|
289
|
-
resetHeight() {
|
|
290
|
-
let { mainTable, leftTable, rightTable } = this.$refs
|
|
291
|
-
if (!this.renderEnd || !mainTable) return
|
|
292
|
-
let headHeight = mainTable.$refs.head.offsetHeight
|
|
293
|
-
let leftChild = [], rightChild = [];
|
|
294
|
-
|
|
295
|
-
if (leftTable) {
|
|
296
|
-
leftTable.$refs.head.firstChild.style.height = `${headHeight}px`
|
|
297
|
-
leftChild = leftTable.$refs.tbody.children
|
|
298
|
-
// if (leftTable.$refs.body && this.width) {
|
|
299
|
-
// leftTable.$refs.body.style.height = `${this.height - scrollBarHeight}px`
|
|
300
|
-
// }
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
if (rightTable) {
|
|
304
|
-
rightTable.$refs.head.firstChild.style.height = `${headHeight}px`
|
|
305
|
-
rightChild = rightTable.$refs.tbody.children
|
|
306
|
-
// if (rightTable.$refs.body && this.width) {
|
|
307
|
-
// rightTable.$refs.body.style.height = `${this.height - scrollBarHeight}px`
|
|
308
|
-
// }
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
const mainChild = mainTable.$refs.tbody.children
|
|
312
|
-
// reset tbody's height
|
|
313
|
-
for (let i = 0; i < mainChild.length; i++) {
|
|
314
|
-
let leftHeight = getHeight(leftChild[i])//(leftChild[i] || {}).offsetHeight || 0
|
|
315
|
-
let mainHeight = getHeight(mainChild[i])//.offsetHeight
|
|
316
|
-
let rightHeight = getHeight(rightChild[i])// || {}).offsetHeight || 0
|
|
317
|
-
let maxHeight = Math.max(leftHeight, mainHeight, rightHeight)
|
|
318
|
-
if (leftHeight && leftHeight < maxHeight) {
|
|
319
|
-
leftChild[i].style.height = `${maxHeight}px`
|
|
320
|
-
}
|
|
321
|
-
if (rightHeight && rightHeight < maxHeight) {
|
|
322
|
-
rightChild[i].style.height = `${maxHeight}px`
|
|
323
|
-
}
|
|
324
|
-
if (mainHeight < maxHeight) {
|
|
325
|
-
mainChild[i].style.height = `${maxHeight}px`
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
},
|
|
330
222
|
onExpand(item) {
|
|
331
223
|
this.$set(item, '_expanded', !item._expanded)
|
|
332
224
|
},
|
|
@@ -366,37 +258,6 @@ export default {
|
|
|
366
258
|
|
|
367
259
|
this.$emit('on-change', keys, checkData, e)
|
|
368
260
|
this.checkAll = checked
|
|
369
|
-
},
|
|
370
|
-
fixedScroll({ target }) {
|
|
371
|
-
let { mainTable, leftTable, rightTable } = this.$refs
|
|
372
|
-
if (this.scrollFocus == 'fixed-right') {
|
|
373
|
-
mainTable.$refs.body && mainTable.$refs.body.scrollTo(mainTable.$refs.body.scrollLeft, target.scrollTop)
|
|
374
|
-
leftTable && leftTable.$refs.body && leftTable.$refs.body.scrollTo(leftTable.$refs.body.scrollLeft, target.scrollTop)
|
|
375
|
-
}
|
|
376
|
-
},
|
|
377
|
-
scroll({ target }) {
|
|
378
|
-
let { mainTable, leftTable, rightTable } = this.$refs
|
|
379
|
-
|
|
380
|
-
let { scrollLeft, scrollTop } = target
|
|
381
|
-
let min = 0, max = target.scrollWidth - target.offsetWidth;
|
|
382
|
-
// console.log(min, scrollLeft, max)
|
|
383
|
-
if (scrollLeft > min && scrollLeft < max) {
|
|
384
|
-
this.scrollType = 'middle'
|
|
385
|
-
} else if (scrollLeft == min) {
|
|
386
|
-
this.scrollType = 'left'
|
|
387
|
-
} else if (scrollLeft >= max) {
|
|
388
|
-
this.scrollType = 'right'
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
//同步thead scroll
|
|
392
|
-
if (mainTable && mainTable.$refs.thead) {
|
|
393
|
-
mainTable.$refs.thead.scrollTo(scrollLeft, 0)
|
|
394
|
-
}
|
|
395
|
-
if (this.scrollFocus == 'body') {
|
|
396
|
-
leftTable && leftTable.$refs.body && leftTable.$refs.body.scrollTo(0, scrollTop);
|
|
397
|
-
rightTable && rightTable.$refs.body && rightTable.$refs.body.scrollTo(0, scrollTop);
|
|
398
|
-
}
|
|
399
|
-
|
|
400
261
|
}
|
|
401
262
|
}
|
|
402
263
|
}
|
|
@@ -4,19 +4,23 @@
|
|
|
4
4
|
* @param {*} cols
|
|
5
5
|
*/
|
|
6
6
|
export function sortFixedCol(cols) {
|
|
7
|
-
let
|
|
8
|
-
cols.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
let middleCol = cols.filter(c => !c.fixed)
|
|
8
|
+
let leftCol = cols.filter(c => c.fixed == 'left').map(x => {
|
|
9
|
+
x.width = x.width || 150
|
|
10
|
+
return x
|
|
11
|
+
})
|
|
12
|
+
let rightCol = cols.filter(c => c.fixed == 'right').map(x => {
|
|
13
|
+
x.width = x.width || 150
|
|
14
|
+
return x
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
if (leftCol.length) {
|
|
18
|
+
leftCol[leftCol.length - 1].last = true
|
|
19
|
+
}
|
|
20
|
+
if (rightCol.length) {
|
|
21
|
+
rightCol[0].first = true
|
|
22
|
+
}
|
|
23
|
+
return { columns: [].concat(leftCol, middleCol, rightCol) }
|
|
20
24
|
}
|
|
21
25
|
/***
|
|
22
26
|
* 是否有子集
|