@jiaozhiye/qm-design-react 1.11.16 → 1.11.17

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.
@@ -1,373 +1,377 @@
1
- /*
2
- * @Author: 焦质晔
3
- * @Date: 2021-07-23 19:05:57
4
- * @Last Modified by: 焦质晔
5
- * @Last Modified time: 2024-07-24 10:41:26
6
- */
7
- @import '../../style/common';
8
-
9
- // 外层容器
10
- .@{prefix-table}--wrapper {
11
- .reset-container();
12
- }
13
-
14
- /* 全屏 */
15
- .@{prefix-table}--maximize {
16
- position: fixed;
17
- top: 0;
18
- left: 0;
19
- right: 0;
20
- height: 100%;
21
- z-index: 100;
22
- overflow-y: auto;
23
- padding: @v-module-distance;
24
- padding-bottom: 0;
25
- background-color: @v-table-background-color;
26
- }
27
-
28
- /* table 样式 */
29
- .@{prefix-table} {
30
- position: relative;
31
- background-color: @v-table-background-color;
32
- &:before,
33
- &:after {
34
- content: '';
35
- position: absolute;
36
- left: 0;
37
- width: 100%;
38
- height: 0;
39
- z-index: 3;
40
- pointer-events: none;
41
- }
42
- &:before {
43
- top: 0;
44
- border-top: 1px solid @v-table-border-color;
45
- }
46
- &:after {
47
- bottom: 0;
48
- border-bottom: 1px solid @v-table-border-color;
49
- }
50
-
51
- &--header,
52
- &--body,
53
- &--footer {
54
- border: 0;
55
- border-spacing: 0;
56
- border-collapse: separate;
57
- table-layout: fixed;
58
- }
59
-
60
- &--header-wrapper,
61
- &--footer-wrapper {
62
- overflow-x: hidden;
63
- overflow-y: hidden;
64
- }
65
-
66
- &--body-wrapper {
67
- overflow-y: auto;
68
- overflow-x: auto;
69
- }
70
-
71
- &.c--resize {
72
- cursor: col-resize;
73
- .header--column {
74
- pointer-events: none;
75
- }
76
- }
77
-
78
- .header--column {
79
- background-color: @v-table-header-background-color;
80
- }
81
-
82
- .body--column {
83
- transition: background-color 0.3s ease;
84
- background-color: @v-table-background-color;
85
- }
86
-
87
- .footer--column {
88
- background-color: @v-table-footer-background-color;
89
- border-bottom: 0;
90
- }
91
-
92
- .body--row:hover {
93
- .body--column {
94
- background-color: @v-table-row-hover-background-color;
95
- }
96
- }
97
-
98
- .body--row-striped {
99
- .body--column {
100
- background-color: @v-table-header-background-color;
101
- }
102
- }
103
-
104
- .body--row-selected {
105
- .body--column {
106
- background-color: @v-table-row-selected-background-color;
107
- }
108
- }
109
-
110
- .body--row-current {
111
- .body--column {
112
- background-color: @v-table-row-current-background-color;
113
- }
114
- }
115
-
116
- .body--row-expanded {
117
- .body--column {
118
- background-color: @v-table-row-expanded-background-color;
119
- }
120
- }
121
-
122
- .body--row-group_1 {
123
- .body--column {
124
- background-color: @--primary-1;
125
- }
126
- }
127
-
128
- .body--row-group_2 {
129
- .body--column {
130
- background-color: @--primary-2;
131
- }
132
- }
133
-
134
- .body--row-group_3 {
135
- .body--column {
136
- background-color: @--primary-3;
137
- }
138
- }
139
-
140
- .header--column,
141
- .body--column,
142
- .footer--column {
143
- position: relative;
144
- text-align: left;
145
- // line-height: @v-table-row-line-height;
146
- &:not(.col--ellipsis) {
147
- padding: ceil(((@v-table-row-height - @v-table-row-line-height) / 2)) 0;
148
- .cell {
149
- line-height: 1.2;
150
- }
151
- }
152
- &.col--center:not(.header--column) {
153
- text-align: center;
154
- }
155
- &.col--right:not(.header--column) {
156
- text-align: right;
157
- }
158
- .cell {
159
- white-space: pre-wrap;
160
- word-break: break-all;
161
- padding: 0 @v-module-distance;
162
- .cell--indent {
163
- float: left;
164
- height: 1px;
165
- visibility: hidden;
166
- }
167
- .cell--sign {
168
- content: ' ';
169
- top: -5px;
170
- left: -5px;
171
- position: absolute;
172
- z-index: 1;
173
- border-width: 5px;
174
- border-style: solid;
175
- border-color: transparent @v-primary-color transparent transparent;
176
- transform: rotate(45deg);
177
- pointer-events: none;
178
- }
179
- .is-cell-bg {
180
- position: relative;
181
- z-index: 1;
182
- }
183
- .cell--bg {
184
- position: absolute;
185
- top: 0;
186
- left: 0;
187
- width: 100%;
188
- height: 100%;
189
- z-index: 0;
190
- pointer-events: none;
191
- }
192
- .cell--copy {
193
- display: flex;
194
- flex-shrink: 0;
195
- align-items: center;
196
- justify-content: space-between;
197
- .text {
198
- flex: 1;
199
- .text-overflow-cut();
200
- }
201
- .icon {
202
- margin-right: -2px;
203
- color: @v-font-color-placeholder;
204
- cursor: pointer;
205
- }
206
- }
207
- }
208
- }
209
-
210
- // 自定义
211
- &.is--fixed {
212
- .cell-fix-left,
213
- .cell-fix-right {
214
- position: sticky;
215
- z-index: 2;
216
- }
217
- .cell-fix-left-last {
218
- &::after {
219
- content: '';
220
- position: absolute;
221
- top: 0;
222
- right: 0;
223
- bottom: -1px;
224
- width: 20px;
225
- transform: translateX(100%);
226
- transition: box-shadow 0.3s, -webkit-box-shadow 0.3s;
227
- pointer-events: none;
228
- }
229
- }
230
- .cell-fix-right-first {
231
- &::after {
232
- content: '';
233
- position: absolute;
234
- top: 0;
235
- left: 0;
236
- bottom: -1px;
237
- width: 20px;
238
- transform: translateX(-100%);
239
- transition: box-shadow 0.3s, -webkit-box-shadow 0.3s;
240
- pointer-events: none;
241
- }
242
- }
243
- &.is--ping-left .cell-fix-left-last::after {
244
- box-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, 0.15);
245
- }
246
- &.is--ping-right .cell-fix-right-first::after {
247
- box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, 0.15);
248
- }
249
- }
250
-
251
- &.is--sortable {
252
- .column-has-sorter {
253
- transition: background-color 0.3s ease;
254
- cursor: pointer;
255
- &:hover {
256
- background-color: @v-table-column-sort-hover-color;
257
- }
258
- &.column--sort {
259
- background-color: @v-table-column-sorted-color;
260
- }
261
- }
262
- .column--sort {
263
- background-color: @v-table-header-background-color;
264
- }
265
- }
266
-
267
- &.is--border {
268
- .header--column,
269
- .body--column,
270
- .footer--column {
271
- border-bottom: 1px solid @v-table-border-color;
272
- border-inline-end: 1px solid @v-table-border-color;
273
- // box-shadow: inset -1px -1px 0 @v-table-border-color;
274
- .box-sizing-content();
275
- }
276
- }
277
-
278
- &:not(.is--border) {
279
- &:before,
280
- &:after {
281
- border: 0;
282
- }
283
- .header--column,
284
- .body--column {
285
- border-bottom: 1px solid @v-table-border-color;
286
- // box-shadow: inset 0 -1px 0 @v-table-border-color;
287
- }
288
- }
289
-
290
- &.is--area-select &--body-wrapper {
291
- & > div {
292
- position: relative;
293
- }
294
- table td {
295
- user-select: none;
296
- }
297
- }
298
-
299
- /* body 填充元素 */
300
- .body--x-space {
301
- height: 0;
302
- visibility: hidden;
303
- &::after {
304
- content: '.';
305
- }
306
- }
307
- .body--y-space {
308
- width: 0;
309
- line-height: 0;
310
- float: left;
311
- visibility: hidden;
312
- &::after {
313
- content: '.';
314
- }
315
- }
316
-
317
- /* 列宽线 */
318
- &--resizable-bar {
319
- display: none;
320
- position: absolute;
321
- top: 0;
322
- left: 0;
323
- width: 1px;
324
- height: 100%;
325
- z-index: 4;
326
- &:before {
327
- content: '';
328
- display: block;
329
- height: 100%;
330
- background-color: @v-table-resizable-color;
331
- }
332
- }
333
-
334
- /* 边框线 */
335
- &--border-line {
336
- &:before,
337
- &:after {
338
- content: '';
339
- position: absolute;
340
- top: 0;
341
- width: 0;
342
- height: 100%;
343
- z-index: 3;
344
- pointer-events: none;
345
- }
346
- &:before {
347
- left: 0;
348
- border-left: 1px solid @v-table-border-color;
349
- }
350
- &:after {
351
- right: 0;
352
- border-right: 1px solid @v-table-border-color;
353
- }
354
- }
355
-
356
- /* 溢出列 */
357
- .header--column,
358
- .body--column,
359
- .footer--column {
360
- &.col--ellipsis {
361
- .cell {
362
- .text-overflow-cut();
363
- word-break: break-all;
364
- white-space: pre;
365
- }
366
- }
367
- }
368
-
369
- /* 弹出层 */
370
- &__popper {
371
- padding: @v-module-distance;
372
- }
373
- }
1
+ /*
2
+ * @Author: 焦质晔
3
+ * @Date: 2021-07-23 19:05:57
4
+ * @Last Modified by: 焦质晔
5
+ * @Last Modified time: 2024-07-24 10:41:26
6
+ */
7
+ @import '../../style/common';
8
+
9
+ // 外层容器
10
+ .@{prefix-table}--wrapper {
11
+ .reset-container();
12
+ }
13
+
14
+ /* 全屏 */
15
+ .@{prefix-table}--maximize {
16
+ position: fixed;
17
+ top: 0;
18
+ left: 0;
19
+ right: 0;
20
+ height: 100%;
21
+ z-index: 100;
22
+ overflow-y: auto;
23
+ padding: @v-module-distance;
24
+ padding-bottom: 0;
25
+ background-color: @v-table-background-color;
26
+ }
27
+
28
+ /* table 样式 */
29
+ .@{prefix-table} {
30
+ position: relative;
31
+ background-color: @v-table-background-color;
32
+ &:before,
33
+ &:after {
34
+ content: '';
35
+ position: absolute;
36
+ left: 0;
37
+ width: 100%;
38
+ height: 0;
39
+ z-index: 3;
40
+ pointer-events: none;
41
+ }
42
+ &:before {
43
+ top: 0;
44
+ border-top: 1px solid @v-table-border-color;
45
+ }
46
+ &:after {
47
+ bottom: 0;
48
+ border-bottom: 1px solid @v-table-border-color;
49
+ }
50
+
51
+ &--header,
52
+ &--body,
53
+ &--footer {
54
+ border: 0;
55
+ border-spacing: 0;
56
+ border-collapse: separate;
57
+ table-layout: fixed;
58
+ }
59
+
60
+ &--header-wrapper,
61
+ &--footer-wrapper {
62
+ overflow-x: hidden;
63
+ overflow-y: hidden;
64
+ }
65
+
66
+ &--body-wrapper {
67
+ overflow-y: auto;
68
+ overflow-x: auto;
69
+ .virtual-container {
70
+ contain: paint;
71
+ will-change: margin-top, margin-left;
72
+ }
73
+ }
74
+
75
+ &.c--resize {
76
+ cursor: col-resize;
77
+ .header--column {
78
+ pointer-events: none;
79
+ }
80
+ }
81
+
82
+ .header--column {
83
+ background-color: @v-table-header-background-color;
84
+ }
85
+
86
+ .body--column {
87
+ transition: background-color 0.3s ease;
88
+ background-color: @v-table-background-color;
89
+ }
90
+
91
+ .footer--column {
92
+ background-color: @v-table-footer-background-color;
93
+ border-bottom: 0;
94
+ }
95
+
96
+ .body--row:hover {
97
+ .body--column {
98
+ background-color: @v-table-row-hover-background-color;
99
+ }
100
+ }
101
+
102
+ .body--row-striped {
103
+ .body--column {
104
+ background-color: @v-table-header-background-color;
105
+ }
106
+ }
107
+
108
+ .body--row-selected {
109
+ .body--column {
110
+ background-color: @v-table-row-selected-background-color;
111
+ }
112
+ }
113
+
114
+ .body--row-current {
115
+ .body--column {
116
+ background-color: @v-table-row-current-background-color;
117
+ }
118
+ }
119
+
120
+ .body--row-expanded {
121
+ .body--column {
122
+ background-color: @v-table-row-expanded-background-color;
123
+ }
124
+ }
125
+
126
+ .body--row-group_1 {
127
+ .body--column {
128
+ background-color: @--primary-1;
129
+ }
130
+ }
131
+
132
+ .body--row-group_2 {
133
+ .body--column {
134
+ background-color: @--primary-2;
135
+ }
136
+ }
137
+
138
+ .body--row-group_3 {
139
+ .body--column {
140
+ background-color: @--primary-3;
141
+ }
142
+ }
143
+
144
+ .header--column,
145
+ .body--column,
146
+ .footer--column {
147
+ position: relative;
148
+ text-align: left;
149
+ // line-height: @v-table-row-line-height;
150
+ &:not(.col--ellipsis) {
151
+ padding: ceil(((@v-table-row-height - @v-table-row-line-height) / 2)) 0;
152
+ .cell {
153
+ line-height: 1.2;
154
+ }
155
+ }
156
+ &.col--center:not(.header--column) {
157
+ text-align: center;
158
+ }
159
+ &.col--right:not(.header--column) {
160
+ text-align: right;
161
+ }
162
+ .cell {
163
+ white-space: pre-wrap;
164
+ word-break: break-all;
165
+ padding: 0 @v-module-distance;
166
+ .cell--indent {
167
+ float: left;
168
+ height: 1px;
169
+ visibility: hidden;
170
+ }
171
+ .cell--sign {
172
+ content: ' ';
173
+ top: -5px;
174
+ left: -5px;
175
+ position: absolute;
176
+ z-index: 1;
177
+ border-width: 5px;
178
+ border-style: solid;
179
+ border-color: transparent @v-primary-color transparent transparent;
180
+ transform: rotate(45deg);
181
+ pointer-events: none;
182
+ }
183
+ .is-cell-bg {
184
+ position: relative;
185
+ z-index: 1;
186
+ }
187
+ .cell--bg {
188
+ position: absolute;
189
+ top: 0;
190
+ left: 0;
191
+ width: 100%;
192
+ height: 100%;
193
+ z-index: 0;
194
+ pointer-events: none;
195
+ }
196
+ .cell--copy {
197
+ display: flex;
198
+ flex-shrink: 0;
199
+ align-items: center;
200
+ justify-content: space-between;
201
+ .text {
202
+ flex: 1;
203
+ .text-overflow-cut();
204
+ }
205
+ .icon {
206
+ margin-right: -2px;
207
+ color: @v-font-color-placeholder;
208
+ cursor: pointer;
209
+ }
210
+ }
211
+ }
212
+ }
213
+
214
+ // 自定义
215
+ &.is--fixed {
216
+ .cell-fix-left,
217
+ .cell-fix-right {
218
+ position: sticky;
219
+ z-index: 2;
220
+ }
221
+ .cell-fix-left-last {
222
+ &::after {
223
+ content: '';
224
+ position: absolute;
225
+ top: 0;
226
+ right: 0;
227
+ bottom: -1px;
228
+ width: 20px;
229
+ transform: translateX(100%);
230
+ transition: box-shadow 0.3s, -webkit-box-shadow 0.3s;
231
+ pointer-events: none;
232
+ }
233
+ }
234
+ .cell-fix-right-first {
235
+ &::after {
236
+ content: '';
237
+ position: absolute;
238
+ top: 0;
239
+ left: 0;
240
+ bottom: -1px;
241
+ width: 20px;
242
+ transform: translateX(-100%);
243
+ transition: box-shadow 0.3s, -webkit-box-shadow 0.3s;
244
+ pointer-events: none;
245
+ }
246
+ }
247
+ &.is--ping-left .cell-fix-left-last::after {
248
+ box-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, 0.15);
249
+ }
250
+ &.is--ping-right .cell-fix-right-first::after {
251
+ box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, 0.15);
252
+ }
253
+ }
254
+
255
+ &.is--sortable {
256
+ .column-has-sorter {
257
+ transition: background-color 0.3s ease;
258
+ cursor: pointer;
259
+ &:hover {
260
+ background-color: @v-table-column-sort-hover-color;
261
+ }
262
+ &.column--sort {
263
+ background-color: @v-table-column-sorted-color;
264
+ }
265
+ }
266
+ .column--sort {
267
+ background-color: @v-table-header-background-color;
268
+ }
269
+ }
270
+
271
+ &.is--border {
272
+ .header--column,
273
+ .body--column,
274
+ .footer--column {
275
+ border-bottom: 1px solid @v-table-border-color;
276
+ border-inline-end: 1px solid @v-table-border-color;
277
+ // box-shadow: inset -1px -1px 0 @v-table-border-color;
278
+ .box-sizing-content();
279
+ }
280
+ }
281
+
282
+ &:not(.is--border) {
283
+ &:before,
284
+ &:after {
285
+ border: 0;
286
+ }
287
+ .header--column,
288
+ .body--column {
289
+ border-bottom: 1px solid @v-table-border-color;
290
+ // box-shadow: inset 0 -1px 0 @v-table-border-color;
291
+ }
292
+ }
293
+
294
+ &.is--area-select &--body-wrapper {
295
+ & > div {
296
+ position: relative;
297
+ }
298
+ table td {
299
+ user-select: none;
300
+ }
301
+ }
302
+
303
+ /* body 填充元素 */
304
+ .body--x-space {
305
+ height: 0;
306
+ visibility: hidden;
307
+ &::after {
308
+ content: '.';
309
+ }
310
+ }
311
+ .body--y-space {
312
+ width: 0;
313
+ line-height: 0;
314
+ float: left;
315
+ visibility: hidden;
316
+ &::after {
317
+ content: '.';
318
+ }
319
+ }
320
+
321
+ /* 列宽线 */
322
+ &--resizable-bar {
323
+ display: none;
324
+ position: absolute;
325
+ top: 0;
326
+ left: 0;
327
+ width: 1px;
328
+ height: 100%;
329
+ z-index: 4;
330
+ &:before {
331
+ content: '';
332
+ display: block;
333
+ height: 100%;
334
+ background-color: @v-table-resizable-color;
335
+ }
336
+ }
337
+
338
+ /* 边框线 */
339
+ &--border-line {
340
+ &:before,
341
+ &:after {
342
+ content: '';
343
+ position: absolute;
344
+ top: 0;
345
+ width: 0;
346
+ height: 100%;
347
+ z-index: 3;
348
+ pointer-events: none;
349
+ }
350
+ &:before {
351
+ left: 0;
352
+ border-left: 1px solid @v-table-border-color;
353
+ }
354
+ &:after {
355
+ right: 0;
356
+ border-right: 1px solid @v-table-border-color;
357
+ }
358
+ }
359
+
360
+ /* 溢出列 */
361
+ .header--column,
362
+ .body--column,
363
+ .footer--column {
364
+ &.col--ellipsis {
365
+ .cell {
366
+ .text-overflow-cut();
367
+ word-break: break-all;
368
+ white-space: pre;
369
+ }
370
+ }
371
+ }
372
+
373
+ /* 弹出层 */
374
+ &__popper {
375
+ padding: @v-module-distance;
376
+ }
377
+ }