@jiaozhiye/qm-design-react 1.11.17 → 1.11.19

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