@procore/data-table 14.41.0 → 14.42.0
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/CHANGELOG.md +6 -0
- package/dist/legacy/index.cjs +66 -41
- package/dist/legacy/index.d.cts +1 -0
- package/dist/legacy/index.d.ts +1 -0
- package/dist/legacy/index.js +66 -41
- package/dist/modern/index.cjs +65 -40
- package/dist/modern/index.d.cts +1 -0
- package/dist/modern/index.d.ts +1 -0
- package/dist/modern/index.js +65 -40
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/legacy/index.cjs
CHANGED
|
@@ -104497,6 +104497,63 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
|
|
|
104497
104497
|
};
|
|
104498
104498
|
};
|
|
104499
104499
|
|
|
104500
|
+
// src/utils/dragging.ts
|
|
104501
|
+
function handleDragStopped({
|
|
104502
|
+
event,
|
|
104503
|
+
internalTableContext,
|
|
104504
|
+
moveColumnEvent: moveColumnEvent2,
|
|
104505
|
+
rowDragMoveEvent: rowDragMoveEvent2,
|
|
104506
|
+
rowDragEndEvent: rowDragEndEvent2,
|
|
104507
|
+
tableProps
|
|
104508
|
+
}) {
|
|
104509
|
+
var _a, _b, _c;
|
|
104510
|
+
if (event.target.className.includes("ag-header-cell")) {
|
|
104511
|
+
internalTableContext.onTableConfigChange();
|
|
104512
|
+
}
|
|
104513
|
+
if (moveColumnEvent2) {
|
|
104514
|
+
(_b = internalTableContext.analytics) == null ? void 0 : _b.client.addEvent(
|
|
104515
|
+
"design_system.data_table.column.repositioned",
|
|
104516
|
+
{
|
|
104517
|
+
client: internalTableContext.analytics.clientName,
|
|
104518
|
+
column: (_a = moveColumnEvent2.column) == null ? void 0 : _a.getColId(),
|
|
104519
|
+
position: moveColumnEvent2.toIndex
|
|
104520
|
+
}
|
|
104521
|
+
);
|
|
104522
|
+
if (tableProps.onRowDragEnd) {
|
|
104523
|
+
const allColumns = event.columnApi.getAllGridColumns();
|
|
104524
|
+
const firstVisibleColumnIndex = allColumns.findIndex(
|
|
104525
|
+
(col) => col.isVisible()
|
|
104526
|
+
);
|
|
104527
|
+
if (moveColumnEvent2.toIndex === firstVisibleColumnIndex || ((_c = moveColumnEvent2.column) == null ? void 0 : _c.getColDef().rowDrag)) {
|
|
104528
|
+
adjustRowDragIcon(event.api, event.columnApi);
|
|
104529
|
+
}
|
|
104530
|
+
}
|
|
104531
|
+
moveColumnEvent2 = void 0;
|
|
104532
|
+
}
|
|
104533
|
+
if (tableProps.onRowDragEnd && rowDragMoveEvent2) {
|
|
104534
|
+
if (rowDragEndEvent2 && rowDragEndEvent2.overIndex >= 0) {
|
|
104535
|
+
tableProps.onRowDragEnd(
|
|
104536
|
+
rowDragEndEvent2.node.data,
|
|
104537
|
+
rowDragEndEvent2.node.rowIndex,
|
|
104538
|
+
rowDragEndEvent2.node,
|
|
104539
|
+
rowDragEndEvent2.overNode
|
|
104540
|
+
);
|
|
104541
|
+
} else if (tableProps.callOnRowDragEndAfterLeave) {
|
|
104542
|
+
tableProps.onRowDragEnd(
|
|
104543
|
+
rowDragMoveEvent2.node.data,
|
|
104544
|
+
rowDragMoveEvent2.node.rowIndex,
|
|
104545
|
+
rowDragMoveEvent2.node,
|
|
104546
|
+
rowDragMoveEvent2.overNode
|
|
104547
|
+
);
|
|
104548
|
+
}
|
|
104549
|
+
if (tableProps.rows && !tableProps.rowDragManaged) {
|
|
104550
|
+
event.api.setRowData(tableProps.rows);
|
|
104551
|
+
}
|
|
104552
|
+
}
|
|
104553
|
+
rowDragMoveEvent2 = void 0;
|
|
104554
|
+
rowDragEndEvent2 = void 0;
|
|
104555
|
+
}
|
|
104556
|
+
|
|
104500
104557
|
// src/utils/expandRows.ts
|
|
104501
104558
|
function getStringifiedRoute(node) {
|
|
104502
104559
|
var _a;
|
|
@@ -109866,50 +109923,18 @@ var Table = (props) => {
|
|
|
109866
109923
|
}
|
|
109867
109924
|
const onDragStopped = React80__default.default.useCallback(
|
|
109868
109925
|
// eslint-disable-next-line complexity
|
|
109869
|
-
(event) => {
|
|
109870
|
-
|
|
109871
|
-
|
|
109872
|
-
|
|
109873
|
-
|
|
109874
|
-
|
|
109875
|
-
|
|
109876
|
-
|
|
109877
|
-
{
|
|
109878
|
-
client: internalTableContext.analytics.clientName,
|
|
109879
|
-
column: (_a2 = moveColumnEvent.column) == null ? void 0 : _a2.getColId(),
|
|
109880
|
-
position: moveColumnEvent.toIndex
|
|
109881
|
-
}
|
|
109882
|
-
);
|
|
109883
|
-
if (props.onRowDragEnd) {
|
|
109884
|
-
const allColumns = event.columnApi.getAllGridColumns();
|
|
109885
|
-
const firstVisibleColumnIndex = allColumns.findIndex(
|
|
109886
|
-
(col) => col.isVisible()
|
|
109887
|
-
);
|
|
109888
|
-
if (moveColumnEvent.toIndex === firstVisibleColumnIndex || ((_c2 = moveColumnEvent.column) == null ? void 0 : _c2.getColDef().rowDrag)) {
|
|
109889
|
-
adjustRowDragIcon(event.api, event.columnApi);
|
|
109890
|
-
}
|
|
109891
|
-
}
|
|
109892
|
-
moveColumnEvent = void 0;
|
|
109893
|
-
}
|
|
109894
|
-
if (props.onRowDragEnd && rowDragMoveEvent) {
|
|
109895
|
-
if (rowDragEndEvent && rowDragEndEvent.overIndex >= 0) {
|
|
109896
|
-
props.onRowDragEnd(
|
|
109897
|
-
rowDragEndEvent.node.data,
|
|
109898
|
-
rowDragEndEvent.node.rowIndex,
|
|
109899
|
-
rowDragEndEvent.node,
|
|
109900
|
-
rowDragEndEvent.overNode
|
|
109901
|
-
);
|
|
109902
|
-
}
|
|
109903
|
-
if (props.rows && !props.rowDragManaged) {
|
|
109904
|
-
event.api.setRowData(props.rows);
|
|
109905
|
-
}
|
|
109906
|
-
}
|
|
109907
|
-
rowDragMoveEvent = void 0;
|
|
109908
|
-
rowDragEndEvent = void 0;
|
|
109909
|
-
},
|
|
109926
|
+
(event) => handleDragStopped({
|
|
109927
|
+
event,
|
|
109928
|
+
internalTableContext,
|
|
109929
|
+
moveColumnEvent,
|
|
109930
|
+
rowDragMoveEvent,
|
|
109931
|
+
rowDragEndEvent,
|
|
109932
|
+
tableProps: props
|
|
109933
|
+
}),
|
|
109910
109934
|
[
|
|
109911
109935
|
internalTableContext.onTableConfigChange,
|
|
109912
109936
|
props.onRowDragEnd,
|
|
109937
|
+
props.callOnRowDragEndAfterLeave,
|
|
109913
109938
|
props.rowDragManaged,
|
|
109914
109939
|
props.rows
|
|
109915
109940
|
]
|
package/dist/legacy/index.d.cts
CHANGED
|
@@ -1006,6 +1006,7 @@ interface TableProps<TRow = any, TBottomRow = any> {
|
|
|
1006
1006
|
modules: Module[];
|
|
1007
1007
|
onCellValueChanged?: (params: CellValueChangeParams<any>) => void;
|
|
1008
1008
|
onRowDragEnd?: (row: TRow, endIndex: number, node: Pick<RowNode, 'childIndex' | 'group'>, overNode?: Pick<RowNode, 'childIndex' | 'group' | 'data'>) => void;
|
|
1009
|
+
callOnRowDragEndAfterLeave?: boolean;
|
|
1009
1010
|
onRowGroupOpened?: (event: RowGroupToggledEvent<TRow>) => void;
|
|
1010
1011
|
onRowSelected?: (event: RowSelectedEvent) => void;
|
|
1011
1012
|
onSelectAll?: (param: SelectAllState.All | SelectAllState.None) => void;
|
package/dist/legacy/index.d.ts
CHANGED
|
@@ -1006,6 +1006,7 @@ interface TableProps<TRow = any, TBottomRow = any> {
|
|
|
1006
1006
|
modules: Module[];
|
|
1007
1007
|
onCellValueChanged?: (params: CellValueChangeParams<any>) => void;
|
|
1008
1008
|
onRowDragEnd?: (row: TRow, endIndex: number, node: Pick<RowNode, 'childIndex' | 'group'>, overNode?: Pick<RowNode, 'childIndex' | 'group' | 'data'>) => void;
|
|
1009
|
+
callOnRowDragEndAfterLeave?: boolean;
|
|
1009
1010
|
onRowGroupOpened?: (event: RowGroupToggledEvent<TRow>) => void;
|
|
1010
1011
|
onRowSelected?: (event: RowSelectedEvent) => void;
|
|
1011
1012
|
onSelectAll?: (param: SelectAllState.All | SelectAllState.None) => void;
|
package/dist/legacy/index.js
CHANGED
|
@@ -104484,6 +104484,63 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
|
|
|
104484
104484
|
};
|
|
104485
104485
|
};
|
|
104486
104486
|
|
|
104487
|
+
// src/utils/dragging.ts
|
|
104488
|
+
function handleDragStopped({
|
|
104489
|
+
event,
|
|
104490
|
+
internalTableContext,
|
|
104491
|
+
moveColumnEvent: moveColumnEvent2,
|
|
104492
|
+
rowDragMoveEvent: rowDragMoveEvent2,
|
|
104493
|
+
rowDragEndEvent: rowDragEndEvent2,
|
|
104494
|
+
tableProps
|
|
104495
|
+
}) {
|
|
104496
|
+
var _a, _b, _c;
|
|
104497
|
+
if (event.target.className.includes("ag-header-cell")) {
|
|
104498
|
+
internalTableContext.onTableConfigChange();
|
|
104499
|
+
}
|
|
104500
|
+
if (moveColumnEvent2) {
|
|
104501
|
+
(_b = internalTableContext.analytics) == null ? void 0 : _b.client.addEvent(
|
|
104502
|
+
"design_system.data_table.column.repositioned",
|
|
104503
|
+
{
|
|
104504
|
+
client: internalTableContext.analytics.clientName,
|
|
104505
|
+
column: (_a = moveColumnEvent2.column) == null ? void 0 : _a.getColId(),
|
|
104506
|
+
position: moveColumnEvent2.toIndex
|
|
104507
|
+
}
|
|
104508
|
+
);
|
|
104509
|
+
if (tableProps.onRowDragEnd) {
|
|
104510
|
+
const allColumns = event.columnApi.getAllGridColumns();
|
|
104511
|
+
const firstVisibleColumnIndex = allColumns.findIndex(
|
|
104512
|
+
(col) => col.isVisible()
|
|
104513
|
+
);
|
|
104514
|
+
if (moveColumnEvent2.toIndex === firstVisibleColumnIndex || ((_c = moveColumnEvent2.column) == null ? void 0 : _c.getColDef().rowDrag)) {
|
|
104515
|
+
adjustRowDragIcon(event.api, event.columnApi);
|
|
104516
|
+
}
|
|
104517
|
+
}
|
|
104518
|
+
moveColumnEvent2 = void 0;
|
|
104519
|
+
}
|
|
104520
|
+
if (tableProps.onRowDragEnd && rowDragMoveEvent2) {
|
|
104521
|
+
if (rowDragEndEvent2 && rowDragEndEvent2.overIndex >= 0) {
|
|
104522
|
+
tableProps.onRowDragEnd(
|
|
104523
|
+
rowDragEndEvent2.node.data,
|
|
104524
|
+
rowDragEndEvent2.node.rowIndex,
|
|
104525
|
+
rowDragEndEvent2.node,
|
|
104526
|
+
rowDragEndEvent2.overNode
|
|
104527
|
+
);
|
|
104528
|
+
} else if (tableProps.callOnRowDragEndAfterLeave) {
|
|
104529
|
+
tableProps.onRowDragEnd(
|
|
104530
|
+
rowDragMoveEvent2.node.data,
|
|
104531
|
+
rowDragMoveEvent2.node.rowIndex,
|
|
104532
|
+
rowDragMoveEvent2.node,
|
|
104533
|
+
rowDragMoveEvent2.overNode
|
|
104534
|
+
);
|
|
104535
|
+
}
|
|
104536
|
+
if (tableProps.rows && !tableProps.rowDragManaged) {
|
|
104537
|
+
event.api.setRowData(tableProps.rows);
|
|
104538
|
+
}
|
|
104539
|
+
}
|
|
104540
|
+
rowDragMoveEvent2 = void 0;
|
|
104541
|
+
rowDragEndEvent2 = void 0;
|
|
104542
|
+
}
|
|
104543
|
+
|
|
104487
104544
|
// src/utils/expandRows.ts
|
|
104488
104545
|
function getStringifiedRoute(node) {
|
|
104489
104546
|
var _a;
|
|
@@ -109853,50 +109910,18 @@ var Table = (props) => {
|
|
|
109853
109910
|
}
|
|
109854
109911
|
const onDragStopped = React80.useCallback(
|
|
109855
109912
|
// eslint-disable-next-line complexity
|
|
109856
|
-
(event) => {
|
|
109857
|
-
|
|
109858
|
-
|
|
109859
|
-
|
|
109860
|
-
|
|
109861
|
-
|
|
109862
|
-
|
|
109863
|
-
|
|
109864
|
-
{
|
|
109865
|
-
client: internalTableContext.analytics.clientName,
|
|
109866
|
-
column: (_a2 = moveColumnEvent.column) == null ? void 0 : _a2.getColId(),
|
|
109867
|
-
position: moveColumnEvent.toIndex
|
|
109868
|
-
}
|
|
109869
|
-
);
|
|
109870
|
-
if (props.onRowDragEnd) {
|
|
109871
|
-
const allColumns = event.columnApi.getAllGridColumns();
|
|
109872
|
-
const firstVisibleColumnIndex = allColumns.findIndex(
|
|
109873
|
-
(col) => col.isVisible()
|
|
109874
|
-
);
|
|
109875
|
-
if (moveColumnEvent.toIndex === firstVisibleColumnIndex || ((_c2 = moveColumnEvent.column) == null ? void 0 : _c2.getColDef().rowDrag)) {
|
|
109876
|
-
adjustRowDragIcon(event.api, event.columnApi);
|
|
109877
|
-
}
|
|
109878
|
-
}
|
|
109879
|
-
moveColumnEvent = void 0;
|
|
109880
|
-
}
|
|
109881
|
-
if (props.onRowDragEnd && rowDragMoveEvent) {
|
|
109882
|
-
if (rowDragEndEvent && rowDragEndEvent.overIndex >= 0) {
|
|
109883
|
-
props.onRowDragEnd(
|
|
109884
|
-
rowDragEndEvent.node.data,
|
|
109885
|
-
rowDragEndEvent.node.rowIndex,
|
|
109886
|
-
rowDragEndEvent.node,
|
|
109887
|
-
rowDragEndEvent.overNode
|
|
109888
|
-
);
|
|
109889
|
-
}
|
|
109890
|
-
if (props.rows && !props.rowDragManaged) {
|
|
109891
|
-
event.api.setRowData(props.rows);
|
|
109892
|
-
}
|
|
109893
|
-
}
|
|
109894
|
-
rowDragMoveEvent = void 0;
|
|
109895
|
-
rowDragEndEvent = void 0;
|
|
109896
|
-
},
|
|
109913
|
+
(event) => handleDragStopped({
|
|
109914
|
+
event,
|
|
109915
|
+
internalTableContext,
|
|
109916
|
+
moveColumnEvent,
|
|
109917
|
+
rowDragMoveEvent,
|
|
109918
|
+
rowDragEndEvent,
|
|
109919
|
+
tableProps: props
|
|
109920
|
+
}),
|
|
109897
109921
|
[
|
|
109898
109922
|
internalTableContext.onTableConfigChange,
|
|
109899
109923
|
props.onRowDragEnd,
|
|
109924
|
+
props.callOnRowDragEndAfterLeave,
|
|
109900
109925
|
props.rowDragManaged,
|
|
109901
109926
|
props.rows
|
|
109902
109927
|
]
|
package/dist/modern/index.cjs
CHANGED
|
@@ -104363,6 +104363,62 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
|
|
|
104363
104363
|
};
|
|
104364
104364
|
};
|
|
104365
104365
|
|
|
104366
|
+
// src/utils/dragging.ts
|
|
104367
|
+
function handleDragStopped({
|
|
104368
|
+
event,
|
|
104369
|
+
internalTableContext,
|
|
104370
|
+
moveColumnEvent: moveColumnEvent2,
|
|
104371
|
+
rowDragMoveEvent: rowDragMoveEvent2,
|
|
104372
|
+
rowDragEndEvent: rowDragEndEvent2,
|
|
104373
|
+
tableProps
|
|
104374
|
+
}) {
|
|
104375
|
+
if (event.target.className.includes("ag-header-cell")) {
|
|
104376
|
+
internalTableContext.onTableConfigChange();
|
|
104377
|
+
}
|
|
104378
|
+
if (moveColumnEvent2) {
|
|
104379
|
+
internalTableContext.analytics?.client.addEvent(
|
|
104380
|
+
"design_system.data_table.column.repositioned",
|
|
104381
|
+
{
|
|
104382
|
+
client: internalTableContext.analytics.clientName,
|
|
104383
|
+
column: moveColumnEvent2.column?.getColId(),
|
|
104384
|
+
position: moveColumnEvent2.toIndex
|
|
104385
|
+
}
|
|
104386
|
+
);
|
|
104387
|
+
if (tableProps.onRowDragEnd) {
|
|
104388
|
+
const allColumns = event.columnApi.getAllGridColumns();
|
|
104389
|
+
const firstVisibleColumnIndex = allColumns.findIndex(
|
|
104390
|
+
(col) => col.isVisible()
|
|
104391
|
+
);
|
|
104392
|
+
if (moveColumnEvent2.toIndex === firstVisibleColumnIndex || moveColumnEvent2.column?.getColDef().rowDrag) {
|
|
104393
|
+
adjustRowDragIcon(event.api, event.columnApi);
|
|
104394
|
+
}
|
|
104395
|
+
}
|
|
104396
|
+
moveColumnEvent2 = void 0;
|
|
104397
|
+
}
|
|
104398
|
+
if (tableProps.onRowDragEnd && rowDragMoveEvent2) {
|
|
104399
|
+
if (rowDragEndEvent2 && rowDragEndEvent2.overIndex >= 0) {
|
|
104400
|
+
tableProps.onRowDragEnd(
|
|
104401
|
+
rowDragEndEvent2.node.data,
|
|
104402
|
+
rowDragEndEvent2.node.rowIndex,
|
|
104403
|
+
rowDragEndEvent2.node,
|
|
104404
|
+
rowDragEndEvent2.overNode
|
|
104405
|
+
);
|
|
104406
|
+
} else if (tableProps.callOnRowDragEndAfterLeave) {
|
|
104407
|
+
tableProps.onRowDragEnd(
|
|
104408
|
+
rowDragMoveEvent2.node.data,
|
|
104409
|
+
rowDragMoveEvent2.node.rowIndex,
|
|
104410
|
+
rowDragMoveEvent2.node,
|
|
104411
|
+
rowDragMoveEvent2.overNode
|
|
104412
|
+
);
|
|
104413
|
+
}
|
|
104414
|
+
if (tableProps.rows && !tableProps.rowDragManaged) {
|
|
104415
|
+
event.api.setRowData(tableProps.rows);
|
|
104416
|
+
}
|
|
104417
|
+
}
|
|
104418
|
+
rowDragMoveEvent2 = void 0;
|
|
104419
|
+
rowDragEndEvent2 = void 0;
|
|
104420
|
+
}
|
|
104421
|
+
|
|
104366
104422
|
// src/utils/expandRows.ts
|
|
104367
104423
|
function getStringifiedRoute(node) {
|
|
104368
104424
|
return node.getRoute()?.map((r) => typeof r === "object" ? JSON.stringify(r) : r);
|
|
@@ -109685,49 +109741,18 @@ var Table = (props) => {
|
|
|
109685
109741
|
}
|
|
109686
109742
|
const onDragStopped = React80__default.default.useCallback(
|
|
109687
109743
|
// eslint-disable-next-line complexity
|
|
109688
|
-
(event) => {
|
|
109689
|
-
|
|
109690
|
-
|
|
109691
|
-
|
|
109692
|
-
|
|
109693
|
-
|
|
109694
|
-
|
|
109695
|
-
|
|
109696
|
-
client: internalTableContext.analytics.clientName,
|
|
109697
|
-
column: moveColumnEvent.column?.getColId(),
|
|
109698
|
-
position: moveColumnEvent.toIndex
|
|
109699
|
-
}
|
|
109700
|
-
);
|
|
109701
|
-
if (props.onRowDragEnd) {
|
|
109702
|
-
const allColumns = event.columnApi.getAllGridColumns();
|
|
109703
|
-
const firstVisibleColumnIndex = allColumns.findIndex(
|
|
109704
|
-
(col) => col.isVisible()
|
|
109705
|
-
);
|
|
109706
|
-
if (moveColumnEvent.toIndex === firstVisibleColumnIndex || moveColumnEvent.column?.getColDef().rowDrag) {
|
|
109707
|
-
adjustRowDragIcon(event.api, event.columnApi);
|
|
109708
|
-
}
|
|
109709
|
-
}
|
|
109710
|
-
moveColumnEvent = void 0;
|
|
109711
|
-
}
|
|
109712
|
-
if (props.onRowDragEnd && rowDragMoveEvent) {
|
|
109713
|
-
if (rowDragEndEvent && rowDragEndEvent.overIndex >= 0) {
|
|
109714
|
-
props.onRowDragEnd(
|
|
109715
|
-
rowDragEndEvent.node.data,
|
|
109716
|
-
rowDragEndEvent.node.rowIndex,
|
|
109717
|
-
rowDragEndEvent.node,
|
|
109718
|
-
rowDragEndEvent.overNode
|
|
109719
|
-
);
|
|
109720
|
-
}
|
|
109721
|
-
if (props.rows && !props.rowDragManaged) {
|
|
109722
|
-
event.api.setRowData(props.rows);
|
|
109723
|
-
}
|
|
109724
|
-
}
|
|
109725
|
-
rowDragMoveEvent = void 0;
|
|
109726
|
-
rowDragEndEvent = void 0;
|
|
109727
|
-
},
|
|
109744
|
+
(event) => handleDragStopped({
|
|
109745
|
+
event,
|
|
109746
|
+
internalTableContext,
|
|
109747
|
+
moveColumnEvent,
|
|
109748
|
+
rowDragMoveEvent,
|
|
109749
|
+
rowDragEndEvent,
|
|
109750
|
+
tableProps: props
|
|
109751
|
+
}),
|
|
109728
109752
|
[
|
|
109729
109753
|
internalTableContext.onTableConfigChange,
|
|
109730
109754
|
props.onRowDragEnd,
|
|
109755
|
+
props.callOnRowDragEndAfterLeave,
|
|
109731
109756
|
props.rowDragManaged,
|
|
109732
109757
|
props.rows
|
|
109733
109758
|
]
|
package/dist/modern/index.d.cts
CHANGED
|
@@ -1006,6 +1006,7 @@ interface TableProps<TRow = any, TBottomRow = any> {
|
|
|
1006
1006
|
modules: Module[];
|
|
1007
1007
|
onCellValueChanged?: (params: CellValueChangeParams<any>) => void;
|
|
1008
1008
|
onRowDragEnd?: (row: TRow, endIndex: number, node: Pick<RowNode, 'childIndex' | 'group'>, overNode?: Pick<RowNode, 'childIndex' | 'group' | 'data'>) => void;
|
|
1009
|
+
callOnRowDragEndAfterLeave?: boolean;
|
|
1009
1010
|
onRowGroupOpened?: (event: RowGroupToggledEvent<TRow>) => void;
|
|
1010
1011
|
onRowSelected?: (event: RowSelectedEvent) => void;
|
|
1011
1012
|
onSelectAll?: (param: SelectAllState.All | SelectAllState.None) => void;
|
package/dist/modern/index.d.ts
CHANGED
|
@@ -1006,6 +1006,7 @@ interface TableProps<TRow = any, TBottomRow = any> {
|
|
|
1006
1006
|
modules: Module[];
|
|
1007
1007
|
onCellValueChanged?: (params: CellValueChangeParams<any>) => void;
|
|
1008
1008
|
onRowDragEnd?: (row: TRow, endIndex: number, node: Pick<RowNode, 'childIndex' | 'group'>, overNode?: Pick<RowNode, 'childIndex' | 'group' | 'data'>) => void;
|
|
1009
|
+
callOnRowDragEndAfterLeave?: boolean;
|
|
1009
1010
|
onRowGroupOpened?: (event: RowGroupToggledEvent<TRow>) => void;
|
|
1010
1011
|
onRowSelected?: (event: RowSelectedEvent) => void;
|
|
1011
1012
|
onSelectAll?: (param: SelectAllState.All | SelectAllState.None) => void;
|
package/dist/modern/index.js
CHANGED
|
@@ -104350,6 +104350,62 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
|
|
|
104350
104350
|
};
|
|
104351
104351
|
};
|
|
104352
104352
|
|
|
104353
|
+
// src/utils/dragging.ts
|
|
104354
|
+
function handleDragStopped({
|
|
104355
|
+
event,
|
|
104356
|
+
internalTableContext,
|
|
104357
|
+
moveColumnEvent: moveColumnEvent2,
|
|
104358
|
+
rowDragMoveEvent: rowDragMoveEvent2,
|
|
104359
|
+
rowDragEndEvent: rowDragEndEvent2,
|
|
104360
|
+
tableProps
|
|
104361
|
+
}) {
|
|
104362
|
+
if (event.target.className.includes("ag-header-cell")) {
|
|
104363
|
+
internalTableContext.onTableConfigChange();
|
|
104364
|
+
}
|
|
104365
|
+
if (moveColumnEvent2) {
|
|
104366
|
+
internalTableContext.analytics?.client.addEvent(
|
|
104367
|
+
"design_system.data_table.column.repositioned",
|
|
104368
|
+
{
|
|
104369
|
+
client: internalTableContext.analytics.clientName,
|
|
104370
|
+
column: moveColumnEvent2.column?.getColId(),
|
|
104371
|
+
position: moveColumnEvent2.toIndex
|
|
104372
|
+
}
|
|
104373
|
+
);
|
|
104374
|
+
if (tableProps.onRowDragEnd) {
|
|
104375
|
+
const allColumns = event.columnApi.getAllGridColumns();
|
|
104376
|
+
const firstVisibleColumnIndex = allColumns.findIndex(
|
|
104377
|
+
(col) => col.isVisible()
|
|
104378
|
+
);
|
|
104379
|
+
if (moveColumnEvent2.toIndex === firstVisibleColumnIndex || moveColumnEvent2.column?.getColDef().rowDrag) {
|
|
104380
|
+
adjustRowDragIcon(event.api, event.columnApi);
|
|
104381
|
+
}
|
|
104382
|
+
}
|
|
104383
|
+
moveColumnEvent2 = void 0;
|
|
104384
|
+
}
|
|
104385
|
+
if (tableProps.onRowDragEnd && rowDragMoveEvent2) {
|
|
104386
|
+
if (rowDragEndEvent2 && rowDragEndEvent2.overIndex >= 0) {
|
|
104387
|
+
tableProps.onRowDragEnd(
|
|
104388
|
+
rowDragEndEvent2.node.data,
|
|
104389
|
+
rowDragEndEvent2.node.rowIndex,
|
|
104390
|
+
rowDragEndEvent2.node,
|
|
104391
|
+
rowDragEndEvent2.overNode
|
|
104392
|
+
);
|
|
104393
|
+
} else if (tableProps.callOnRowDragEndAfterLeave) {
|
|
104394
|
+
tableProps.onRowDragEnd(
|
|
104395
|
+
rowDragMoveEvent2.node.data,
|
|
104396
|
+
rowDragMoveEvent2.node.rowIndex,
|
|
104397
|
+
rowDragMoveEvent2.node,
|
|
104398
|
+
rowDragMoveEvent2.overNode
|
|
104399
|
+
);
|
|
104400
|
+
}
|
|
104401
|
+
if (tableProps.rows && !tableProps.rowDragManaged) {
|
|
104402
|
+
event.api.setRowData(tableProps.rows);
|
|
104403
|
+
}
|
|
104404
|
+
}
|
|
104405
|
+
rowDragMoveEvent2 = void 0;
|
|
104406
|
+
rowDragEndEvent2 = void 0;
|
|
104407
|
+
}
|
|
104408
|
+
|
|
104353
104409
|
// src/utils/expandRows.ts
|
|
104354
104410
|
function getStringifiedRoute(node) {
|
|
104355
104411
|
return node.getRoute()?.map((r) => typeof r === "object" ? JSON.stringify(r) : r);
|
|
@@ -109672,49 +109728,18 @@ var Table = (props) => {
|
|
|
109672
109728
|
}
|
|
109673
109729
|
const onDragStopped = React80.useCallback(
|
|
109674
109730
|
// eslint-disable-next-line complexity
|
|
109675
|
-
(event) => {
|
|
109676
|
-
|
|
109677
|
-
|
|
109678
|
-
|
|
109679
|
-
|
|
109680
|
-
|
|
109681
|
-
|
|
109682
|
-
|
|
109683
|
-
client: internalTableContext.analytics.clientName,
|
|
109684
|
-
column: moveColumnEvent.column?.getColId(),
|
|
109685
|
-
position: moveColumnEvent.toIndex
|
|
109686
|
-
}
|
|
109687
|
-
);
|
|
109688
|
-
if (props.onRowDragEnd) {
|
|
109689
|
-
const allColumns = event.columnApi.getAllGridColumns();
|
|
109690
|
-
const firstVisibleColumnIndex = allColumns.findIndex(
|
|
109691
|
-
(col) => col.isVisible()
|
|
109692
|
-
);
|
|
109693
|
-
if (moveColumnEvent.toIndex === firstVisibleColumnIndex || moveColumnEvent.column?.getColDef().rowDrag) {
|
|
109694
|
-
adjustRowDragIcon(event.api, event.columnApi);
|
|
109695
|
-
}
|
|
109696
|
-
}
|
|
109697
|
-
moveColumnEvent = void 0;
|
|
109698
|
-
}
|
|
109699
|
-
if (props.onRowDragEnd && rowDragMoveEvent) {
|
|
109700
|
-
if (rowDragEndEvent && rowDragEndEvent.overIndex >= 0) {
|
|
109701
|
-
props.onRowDragEnd(
|
|
109702
|
-
rowDragEndEvent.node.data,
|
|
109703
|
-
rowDragEndEvent.node.rowIndex,
|
|
109704
|
-
rowDragEndEvent.node,
|
|
109705
|
-
rowDragEndEvent.overNode
|
|
109706
|
-
);
|
|
109707
|
-
}
|
|
109708
|
-
if (props.rows && !props.rowDragManaged) {
|
|
109709
|
-
event.api.setRowData(props.rows);
|
|
109710
|
-
}
|
|
109711
|
-
}
|
|
109712
|
-
rowDragMoveEvent = void 0;
|
|
109713
|
-
rowDragEndEvent = void 0;
|
|
109714
|
-
},
|
|
109731
|
+
(event) => handleDragStopped({
|
|
109732
|
+
event,
|
|
109733
|
+
internalTableContext,
|
|
109734
|
+
moveColumnEvent,
|
|
109735
|
+
rowDragMoveEvent,
|
|
109736
|
+
rowDragEndEvent,
|
|
109737
|
+
tableProps: props
|
|
109738
|
+
}),
|
|
109715
109739
|
[
|
|
109716
109740
|
internalTableContext.onTableConfigChange,
|
|
109717
109741
|
props.onRowDragEnd,
|
|
109742
|
+
props.callOnRowDragEndAfterLeave,
|
|
109718
109743
|
props.rowDragManaged,
|
|
109719
109744
|
props.rows
|
|
109720
109745
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@procore/data-table",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.42.0",
|
|
4
4
|
"description": "Complex data grid built on top of ag-grid, with DST components and styles.",
|
|
5
5
|
"author": "Procore Technologies",
|
|
6
6
|
"homepage": "https://github.com/procore/core/tree/main/packages/data-table",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"@procore/cdn-translations": "0.1.13",
|
|
77
77
|
"@procore/error-pages": "^0.2.3",
|
|
78
|
-
"@procore/labs-datetime-select": "^0.2.
|
|
78
|
+
"@procore/labs-datetime-select": "^0.2.1",
|
|
79
79
|
"@procore/labs-group-by-select": "4.1.0",
|
|
80
80
|
"@procore/toast-alert": "^5.1.2",
|
|
81
81
|
"@procore/web-sdk-storage": "^0.1.0",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"@procore/core-css": "10.17.0",
|
|
109
109
|
"@procore/core-icons": "^12.12.0",
|
|
110
110
|
"@procore/core-prettier": "10.2.0",
|
|
111
|
-
"@procore/core-react": "^12.
|
|
111
|
+
"@procore/core-react": "^12.36.0",
|
|
112
112
|
"@procore/eslint-config": "10.0.0",
|
|
113
113
|
"@procore/globalization-toolkit": "3.1.0",
|
|
114
114
|
"@procore/labs-financials-utils": "4.3.1",
|