@jiaozhiye/qm-design-react 1.10.3 → 1.10.5

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,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
- }
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-secondary-color;
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
+ }
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-secondary-color;
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
+ }