@linzjs/step-ag-grid 17.5.1 → 17.5.2
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.
- package/dist/GridTheme.scss +6 -2
- package/dist/step-ag-grid.cjs.js +11 -2
- package/dist/step-ag-grid.cjs.js.map +1 -1
- package/dist/step-ag-grid.esm.js +11 -2
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Grid.tsx +13 -2
- package/src/styles/GridTheme.scss +6 -2
package/package.json
CHANGED
package/src/components/Grid.tsx
CHANGED
|
@@ -611,8 +611,19 @@ export const Grid = ({
|
|
|
611
611
|
}, []);
|
|
612
612
|
|
|
613
613
|
const onRowDragMove = useCallback((event: RowDragMoveEvent) => {
|
|
614
|
-
|
|
615
|
-
|
|
614
|
+
if (event.overNode && event.node.rowIndex != null) {
|
|
615
|
+
const clientSideRowModel = event.api.getModel() as IClientSideRowModel;
|
|
616
|
+
|
|
617
|
+
//position 0 means highlight above, 1 means below
|
|
618
|
+
const position = clientSideRowModel.getHighlightPosition(event.y, event.overNode as RowNode<any>);
|
|
619
|
+
|
|
620
|
+
//we don't want to show the row highlight if it wouldn't result in the row moving
|
|
621
|
+
const targetIndex = event.overIndex + position - (event.node.rowIndex < event.overIndex ? 1 : 0);
|
|
622
|
+
//console.log(targetIndex)
|
|
623
|
+
if (event.node.rowIndex != targetIndex) {
|
|
624
|
+
clientSideRowModel.highlightRowAtPixel(event.node as RowNode<any>, event.y);
|
|
625
|
+
}
|
|
626
|
+
}
|
|
616
627
|
}, []);
|
|
617
628
|
|
|
618
629
|
const onRowDragEnd = useCallback(
|
|
@@ -201,9 +201,13 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
|
|
|
201
201
|
background-color: transparent;
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
.ag-row-highlight-above::after{
|
|
204
|
+
.ag-row-highlight-above::after {
|
|
205
|
+
top:-3px; // moves the top highlight to the position of the bottom highlight
|
|
205
206
|
border-top: 2px dashed lui.$andrea;
|
|
206
|
-
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.ag-row-highlight-above:first-of-type::after {
|
|
210
|
+
top:0px; // the first row highlight needs to in the normal position otherwise it is cut off by the top of the table
|
|
207
211
|
}
|
|
208
212
|
|
|
209
213
|
.ag-row-highlight-below::after {
|