@jiaozhiye/qm-design-react 1.11.16 → 1.11.18

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,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
- }
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
+ 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
+ }