32
32
} ,
33
33
props : [ 'data-source' , 'customRow' ] ,
34
34
inheritAttrs : false ,
35
- provide ( ) {
35
+ provide ( ) {
36
36
const sortable = { }
37
37
38
38
Object . defineProperty ( sortable , "setSortableIndex" , {
50
50
}
51
51
} ,
52
52
render : function ( createElement ) {
53
- return createElement (
54
- 'a-table' ,
55
- {
56
- class : {
57
- 'ant-table-is-sorting' : this . isDragging ( ) ,
58
- } ,
59
- props : {
60
- ...this . $attrs ,
61
- 'data-source' : this . records ,
62
- customRow : ( record , index ) => this . customRowRender ( record , index ) ,
63
- } ,
64
- on : this . $listeners ,
65
- nativeOn : {
66
- drop : ( e ) => this . dropHandler ( e ) ,
67
- } ,
68
- scopedSlots : this . $scopedSlots ,
53
+ return createElement ( 'a-table' , {
54
+ class : {
55
+ 'ant-table-is-sorting' : this . isDragging ( ) ,
56
+ } ,
57
+ props : {
58
+ ...this . $attrs ,
59
+ 'data-source' : this . records ,
60
+ customRow : ( record , index ) => this . customRowRender ( record , index ) ,
69
61
} ,
70
- this . $slots . default ,
71
- )
62
+ on : this . $listeners ,
63
+ nativeOn : {
64
+ drop : ( e ) => this . dropHandler ( e ) ,
65
+ } ,
66
+ scopedSlots : this . $scopedSlots ,
67
+ } , this . $slots . default , )
72
68
} ,
73
69
created ( ) {
74
70
this . $memoSort = { } ;
91
87
e . preventDefault ( ) ;
92
88
return ;
93
89
}
90
+ const hideDragImage = this . $el . cloneNode ( true ) ;
91
+ hideDragImage . id = "hideDragImage-hide" ;
92
+ hideDragImage . style . opacity = 0 ;
93
+ document . body . appendChild ( hideDragImage ) ;
94
+ e . dataTransfer . setDragImage ( hideDragImage , 0 , 0 ) ;
94
95
} ,
95
96
dragStopHandler ( e , index ) {
97
+ const hideDragImage = document . getElementById ( 'hideDragImage-hide' ) ;
98
+ if ( hideDragImage ) hideDragImage . remove ( ) ;
96
99
this . resetSortableIndex ( e , index ) ;
97
100
} ,
98
101
dragOverHandler ( e , index ) {
209
212
}
210
213
}
211
214
.ant-table-is-sorting .draggable-row td {
212
- background-color : white !important ;
215
+ background-color : # ffffff !important ;
213
216
}
214
217
.dark .ant-table-is-sorting .draggable-row td {
215
218
background-color : var (--dark-color-surface-100 ) !important ;
216
219
}
220
+ .ant-table-is-sorting .dragging td {
221
+ background-color : rgb (232 244 242 ) !important ;
222
+ color : rgba (0 , 0 , 0 , 0.3 );
223
+ }
224
+ .dark .ant-table-is-sorting .dragging td {
225
+ background-color : var (--dark-color-table-hover ) !important ;
226
+ color : rgba (255 , 255 , 255 , 0.3 );
227
+ }
217
228
.ant-table-is-sorting .dragging {
218
- opacity : 0.5 ;
229
+ opacity : 1 ;
230
+ box-shadow : 1px -2px 2px # 008771 ;
231
+ transition : all 0.2s ;
219
232
}
220
233
.ant-table-is-sorting .dragging .ant-table-row-index {
221
- opacity : 0 ;
234
+ opacity : 0.3 ;
222
235
}
223
236
</ style >
224
- {{end}}
237
+ {{end}}
0 commit comments