@linzjs/step-ag-grid 17.5.0 → 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 +19 -0
- 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 +19 -0
package/dist/GridTheme.scss
CHANGED
|
@@ -194,4 +194,23 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
|
|
|
194
194
|
.ag-cell-wrapper {
|
|
195
195
|
width: 100%;
|
|
196
196
|
}
|
|
197
|
+
|
|
198
|
+
.ag-row-highlight-above::after, .ag-row-highlight-below::after {
|
|
199
|
+
content: '';
|
|
200
|
+
height: 2px;
|
|
201
|
+
background-color: transparent;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.ag-row-highlight-above::after {
|
|
205
|
+
top:-3px; // moves the top highlight to the position of the bottom highlight
|
|
206
|
+
border-top: 2px dashed lui.$andrea;
|
|
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
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.ag-row-highlight-below::after {
|
|
214
|
+
border-bottom: 2px dashed lui.$andrea;
|
|
215
|
+
}
|
|
197
216
|
}
|
package/dist/step-ag-grid.cjs.js
CHANGED
|
@@ -2765,8 +2765,17 @@ const Grid = ({ "data-testid": dataTestId, rowSelection = "multiple", suppressCo
|
|
|
2765
2765
|
clientSideRowModel.highlightRowAtPixel(null);
|
|
2766
2766
|
}, []);
|
|
2767
2767
|
const onRowDragMove = React.useCallback((event) => {
|
|
2768
|
-
|
|
2769
|
-
|
|
2768
|
+
if (event.overNode && event.node.rowIndex != null) {
|
|
2769
|
+
const clientSideRowModel = event.api.getModel();
|
|
2770
|
+
//position 0 means highlight above, 1 means below
|
|
2771
|
+
const position = clientSideRowModel.getHighlightPosition(event.y, event.overNode);
|
|
2772
|
+
//we don't want to show the row highlight if it wouldn't result in the row moving
|
|
2773
|
+
const targetIndex = event.overIndex + position - (event.node.rowIndex < event.overIndex ? 1 : 0);
|
|
2774
|
+
//console.log(targetIndex)
|
|
2775
|
+
if (event.node.rowIndex != targetIndex) {
|
|
2776
|
+
clientSideRowModel.highlightRowAtPixel(event.node, event.y);
|
|
2777
|
+
}
|
|
2778
|
+
}
|
|
2770
2779
|
}, []);
|
|
2771
2780
|
const onRowDragEnd = React.useCallback(async (event) => {
|
|
2772
2781
|
const clientSideRowModel = event.api.getModel();
|