@jiaozhiye/qm-design-react 1.9.13 → 1.9.14

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,372 +1,372 @@
1
- /*
2
- * @Author: 焦质晔
3
- * @Date: 2021-07-23 19:05:57
4
- * @Last Modified by: 焦质晔
5
- * @Last Modified time: 2024-07-02 09:33:48
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
- &--merge-cell {
72
- position: absolute;
73
- display: none;
74
- border: 2px solid @v-primary-color;
75
- border-radius: @v-border-radius;
76
- background-color: rgba(255, 255, 255, 0.3);
77
- z-index: 9;
78
- .btn {
79
- position: absolute;
80
- right: -54px;
81
- bottom: 0;
82
- }
83
- .cancel {
84
- bottom: 30px;
85
- }
86
- }
87
-
88
- &.c--resize {
89
- cursor: col-resize;
90
- .header--column {
91
- pointer-events: none;
92
- }
93
- }
94
-
95
- .header--column {
96
- background-color: @v-table-header-background-color;
97
- }
98
-
99
- .body--column {
100
- transition: background-color 0.3s ease;
101
- background-color: @v-table-background-color;
102
- }
103
-
104
- .footer--column {
105
- background-color: @v-table-footer-background-color;
106
- border-bottom: 0;
107
- }
108
-
109
- .body--row:hover {
110
- .body--column {
111
- background-color: @v-table-row-hover-background-color;
112
- }
113
- }
114
-
115
- .body--row-striped {
116
- .body--column {
117
- background-color: @v-table-header-background-color;
118
- }
119
- }
120
-
121
- .body--row-selected {
122
- .body--column {
123
- background-color: @v-table-row-selected-background-color;
124
- }
125
- }
126
-
127
- .body--row-current {
128
- .body--column {
129
- background-color: @v-table-row-current-background-color;
130
- }
131
- }
132
-
133
- .body--row-expanded {
134
- .body--column {
135
- background-color: @v-table-row-expanded-background-color;
136
- }
137
- }
138
-
139
- .body--row-group_1 {
140
- .body--column {
141
- background-color: @--primary-1;
142
- }
143
- }
144
-
145
- .body--row-group_2 {
146
- .body--column {
147
- background-color: @--primary-2;
148
- }
149
- }
150
-
151
- .body--row-group_3 {
152
- .body--column {
153
- background-color: @--primary-3;
154
- }
155
- }
156
-
157
- .header--column,
158
- .body--column,
159
- .footer--column {
160
- position: relative;
161
- text-align: left;
162
- // line-height: @v-table-row-line-height;
163
- &:not(.col--ellipsis) {
164
- padding: ceil(((@v-table-row-height - @v-table-row-line-height) / 2)) 0;
165
- .cell {
166
- line-height: 1.2;
167
- }
168
- }
169
- &.col--center:not(.header--column) {
170
- text-align: center;
171
- }
172
- &.col--right:not(.header--column) {
173
- text-align: right;
174
- }
175
- .cell {
176
- white-space: pre-wrap;
177
- word-break: break-all;
178
- padding: 0 @v-module-distance;
179
- .cell--indent {
180
- float: left;
181
- height: 1px;
182
- visibility: hidden;
183
- }
184
- .cell--sign {
185
- content: ' ';
186
- top: -5px;
187
- left: -5px;
188
- position: absolute;
189
- z-index: 1;
190
- border-width: 5px;
191
- border-style: solid;
192
- border-color: transparent @v-primary-color transparent transparent;
193
- transform: rotate(45deg);
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-secondary-color;
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--merge-cell &--body-wrapper > table > tbody {
295
- pointer-events: none;
296
- }
297
-
298
- /* body 填充元素 */
299
- .body--x-space {
300
- height: 0;
301
- visibility: hidden;
302
- &::after {
303
- content: '.';
304
- }
305
- }
306
- .body--y-space {
307
- width: 0;
308
- line-height: 0;
309
- float: left;
310
- visibility: hidden;
311
- &::after {
312
- content: '.';
313
- }
314
- }
315
-
316
- /* 列宽线 */
317
- &--resizable-bar {
318
- display: none;
319
- position: absolute;
320
- top: 0;
321
- left: 0;
322
- width: 1px;
323
- height: 100%;
324
- z-index: 4;
325
- &:before {
326
- content: '';
327
- display: block;
328
- height: 100%;
329
- background-color: @v-table-resizable-color;
330
- }
331
- }
332
-
333
- /* 边框线 */
334
- &--border-line {
335
- &:before,
336
- &:after {
337
- content: '';
338
- position: absolute;
339
- top: 0;
340
- width: 0;
341
- height: 100%;
342
- z-index: 3;
343
- pointer-events: none;
344
- }
345
- &:before {
346
- left: 0;
347
- border-left: 1px solid @v-table-border-color;
348
- }
349
- &:after {
350
- right: 0;
351
- border-right: 1px solid @v-table-border-color;
352
- }
353
- }
354
-
355
- /* 溢出列 */
356
- .header--column,
357
- .body--column,
358
- .footer--column {
359
- &.col--ellipsis {
360
- .cell {
361
- .text-overflow-cut();
362
- word-break: break-all;
363
- white-space: pre;
364
- }
365
- }
366
- }
367
-
368
- /* 弹出层 */
369
- &__popper {
370
- padding: @v-module-distance;
371
- }
372
- }
1
+ /*
2
+ * @Author: 焦质晔
3
+ * @Date: 2021-07-23 19:05:57
4
+ * @Last Modified by: 焦质晔
5
+ * @Last Modified time: 2024-07-02 09:33:48
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
+ &--merge-cell {
72
+ position: absolute;
73
+ display: none;
74
+ border: 2px solid @v-primary-color;
75
+ border-radius: @v-border-radius;
76
+ background-color: rgba(255, 255, 255, 0.3);
77
+ z-index: 9;
78
+ .btn {
79
+ position: absolute;
80
+ right: -54px;
81
+ bottom: 0;
82
+ }
83
+ .cancel {
84
+ bottom: 30px;
85
+ }
86
+ }
87
+
88
+ &.c--resize {
89
+ cursor: col-resize;
90
+ .header--column {
91
+ pointer-events: none;
92
+ }
93
+ }
94
+
95
+ .header--column {
96
+ background-color: @v-table-header-background-color;
97
+ }
98
+
99
+ .body--column {
100
+ transition: background-color 0.3s ease;
101
+ background-color: @v-table-background-color;
102
+ }
103
+
104
+ .footer--column {
105
+ background-color: @v-table-footer-background-color;
106
+ border-bottom: 0;
107
+ }
108
+
109
+ .body--row:hover {
110
+ .body--column {
111
+ background-color: @v-table-row-hover-background-color;
112
+ }
113
+ }
114
+
115
+ .body--row-striped {
116
+ .body--column {
117
+ background-color: @v-table-header-background-color;
118
+ }
119
+ }
120
+
121
+ .body--row-selected {
122
+ .body--column {
123
+ background-color: @v-table-row-selected-background-color;
124
+ }
125
+ }
126
+
127
+ .body--row-current {
128
+ .body--column {
129
+ background-color: @v-table-row-current-background-color;
130
+ }
131
+ }
132
+
133
+ .body--row-expanded {
134
+ .body--column {
135
+ background-color: @v-table-row-expanded-background-color;
136
+ }
137
+ }
138
+
139
+ .body--row-group_1 {
140
+ .body--column {
141
+ background-color: @--primary-1;
142
+ }
143
+ }
144
+
145
+ .body--row-group_2 {
146
+ .body--column {
147
+ background-color: @--primary-2;
148
+ }
149
+ }
150
+
151
+ .body--row-group_3 {
152
+ .body--column {
153
+ background-color: @--primary-3;
154
+ }
155
+ }
156
+
157
+ .header--column,
158
+ .body--column,
159
+ .footer--column {
160
+ position: relative;
161
+ text-align: left;
162
+ // line-height: @v-table-row-line-height;
163
+ &:not(.col--ellipsis) {
164
+ padding: ceil(((@v-table-row-height - @v-table-row-line-height) / 2)) 0;
165
+ .cell {
166
+ line-height: 1.2;
167
+ }
168
+ }
169
+ &.col--center:not(.header--column) {
170
+ text-align: center;
171
+ }
172
+ &.col--right:not(.header--column) {
173
+ text-align: right;
174
+ }
175
+ .cell {
176
+ white-space: pre-wrap;
177
+ word-break: break-all;
178
+ padding: 0 @v-module-distance;
179
+ .cell--indent {
180
+ float: left;
181
+ height: 1px;
182
+ visibility: hidden;
183
+ }
184
+ .cell--sign {
185
+ content: ' ';
186
+ top: -5px;
187
+ left: -5px;
188
+ position: absolute;
189
+ z-index: 1;
190
+ border-width: 5px;
191
+ border-style: solid;
192
+ border-color: transparent @v-primary-color transparent transparent;
193
+ transform: rotate(45deg);
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-secondary-color;
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--merge-cell &--body-wrapper > table > tbody {
295
+ pointer-events: none;
296
+ }
297
+
298
+ /* body 填充元素 */
299
+ .body--x-space {
300
+ height: 0;
301
+ visibility: hidden;
302
+ &::after {
303
+ content: '.';
304
+ }
305
+ }
306
+ .body--y-space {
307
+ width: 0;
308
+ line-height: 0;
309
+ float: left;
310
+ visibility: hidden;
311
+ &::after {
312
+ content: '.';
313
+ }
314
+ }
315
+
316
+ /* 列宽线 */
317
+ &--resizable-bar {
318
+ display: none;
319
+ position: absolute;
320
+ top: 0;
321
+ left: 0;
322
+ width: 1px;
323
+ height: 100%;
324
+ z-index: 4;
325
+ &:before {
326
+ content: '';
327
+ display: block;
328
+ height: 100%;
329
+ background-color: @v-table-resizable-color;
330
+ }
331
+ }
332
+
333
+ /* 边框线 */
334
+ &--border-line {
335
+ &:before,
336
+ &:after {
337
+ content: '';
338
+ position: absolute;
339
+ top: 0;
340
+ width: 0;
341
+ height: 100%;
342
+ z-index: 3;
343
+ pointer-events: none;
344
+ }
345
+ &:before {
346
+ left: 0;
347
+ border-left: 1px solid @v-table-border-color;
348
+ }
349
+ &:after {
350
+ right: 0;
351
+ border-right: 1px solid @v-table-border-color;
352
+ }
353
+ }
354
+
355
+ /* 溢出列 */
356
+ .header--column,
357
+ .body--column,
358
+ .footer--column {
359
+ &.col--ellipsis {
360
+ .cell {
361
+ .text-overflow-cut();
362
+ word-break: break-all;
363
+ white-space: pre;
364
+ }
365
+ }
366
+ }
367
+
368
+ /* 弹出层 */
369
+ &__popper {
370
+ padding: @v-module-distance;
371
+ }
372
+ }