@teselagen/ui 0.5.23-beta.17 → 0.5.23-beta.18
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/DataTable/Columns.d.ts +1 -2
- package/DataTable/RenderCell.d.ts +18 -0
- package/index.cjs.js +214 -197
- package/index.es.js +214 -197
- package/package.json +1 -1
- package/src/DataTable/Columns.js +7 -186
- package/src/DataTable/RenderCell.jsx +191 -0
- package/src/DataTable/index.js +23 -18
- package/src/DataTable/utils/withTableParams.js +4 -1
package/DataTable/Columns.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function useColumns({ addFilters, cellRenderer, columns, currentParams, compact, editingCell, editingCellSelectAll, entities, expandedEntityIdMap, extraCompact, filters, formName, getCellHoverText, isCellEditable, isEntityDisabled, isLocalCall, isSimple, isSingleSelect, isSelectionARectangle, noDeselectAll, noSelect, noUserSelect, onDeselect, onMultiRowSelect, onRowClick, onRowSelect, onSingleRowSelect, order, primarySelectedCellId, reduxFormCellValidation, reduxFormSelectedEntityIdMap, refocusTable, removeSingleFilter, schema, selectedCells,
|
|
1
|
+
export function useColumns({ addFilters, cellRenderer, columns, currentParams, compact, editingCell, editingCellSelectAll, entities, expandedEntityIdMap, extraCompact, filters, formName, getCellHoverText, isCellEditable, isEntityDisabled, isLocalCall, isSimple, isSingleSelect, isSelectionARectangle, noDeselectAll, noSelect, noUserSelect, onDeselect, onMultiRowSelect, onRowClick, onRowSelect, onSingleRowSelect, order, primarySelectedCellId, reduxFormCellValidation, reduxFormSelectedEntityIdMap, refocusTable, removeSingleFilter, schema, selectedCells, setExpandedEntityIdMap, setNewParams, setOrder, setSelectedCells, shouldShowSubComponent, startCellEdit, SubComponent, tableRef, updateEntitiesHelper, updateValidation, withCheckboxes, withExpandAndCollapseAllButton, withFilter: _withFilter, withSort }: {
|
|
2
2
|
addFilters: any;
|
|
3
3
|
cellRenderer: any;
|
|
4
4
|
columns: any;
|
|
@@ -34,7 +34,6 @@ export function useColumns({ addFilters, cellRenderer, columns, currentParams, c
|
|
|
34
34
|
removeSingleFilter?: ((...args: any[]) => void) | undefined;
|
|
35
35
|
schema: any;
|
|
36
36
|
selectedCells: any;
|
|
37
|
-
setEditingCell: any;
|
|
38
37
|
setExpandedEntityIdMap: any;
|
|
39
38
|
setNewParams: any;
|
|
40
39
|
setOrder?: ((...args: any[]) => void) | undefined;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function RenderCell({ oldFunc, getCopyTextForCell, column, isCellEditable, isEntityDisabled, finishCellEdit, formName, noEllipsis, cancelCellEdit, getCellHoverText, selectedCells, isSelectionARectangle, startCellEdit, tableRef, onDragEnd, args }: {
|
|
2
|
+
oldFunc: any;
|
|
3
|
+
getCopyTextForCell: any;
|
|
4
|
+
column: any;
|
|
5
|
+
isCellEditable: any;
|
|
6
|
+
isEntityDisabled: any;
|
|
7
|
+
finishCellEdit: any;
|
|
8
|
+
formName: any;
|
|
9
|
+
noEllipsis: any;
|
|
10
|
+
cancelCellEdit: any;
|
|
11
|
+
getCellHoverText: any;
|
|
12
|
+
selectedCells: any;
|
|
13
|
+
isSelectionARectangle: any;
|
|
14
|
+
startCellEdit: any;
|
|
15
|
+
tableRef: any;
|
|
16
|
+
onDragEnd: any;
|
|
17
|
+
args: any;
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element;
|
package/index.cjs.js
CHANGED
|
@@ -47274,6 +47274,177 @@ const CellDragHandle = /* @__PURE__ */ __name(({
|
|
|
47274
47274
|
}
|
|
47275
47275
|
);
|
|
47276
47276
|
}, "CellDragHandle");
|
|
47277
|
+
const RenderCell = /* @__PURE__ */ __name(({
|
|
47278
|
+
oldFunc,
|
|
47279
|
+
getCopyTextForCell,
|
|
47280
|
+
column,
|
|
47281
|
+
isCellEditable,
|
|
47282
|
+
isEntityDisabled,
|
|
47283
|
+
finishCellEdit,
|
|
47284
|
+
formName,
|
|
47285
|
+
noEllipsis,
|
|
47286
|
+
cancelCellEdit,
|
|
47287
|
+
getCellHoverText,
|
|
47288
|
+
selectedCells,
|
|
47289
|
+
isSelectionARectangle,
|
|
47290
|
+
startCellEdit,
|
|
47291
|
+
tableRef,
|
|
47292
|
+
onDragEnd,
|
|
47293
|
+
args
|
|
47294
|
+
}) => {
|
|
47295
|
+
var _a;
|
|
47296
|
+
const editingCell = reactRedux.useSelector(
|
|
47297
|
+
(state) => {
|
|
47298
|
+
var _a2, _b, _c;
|
|
47299
|
+
return (_c = (_b = (_a2 = state.form) == null ? void 0 : _a2[formName]) == null ? void 0 : _b.values) == null ? void 0 : _c.reduxFormEditingCell;
|
|
47300
|
+
}
|
|
47301
|
+
);
|
|
47302
|
+
const initialValue = reactRedux.useSelector(
|
|
47303
|
+
(state) => {
|
|
47304
|
+
var _a2, _b, _c;
|
|
47305
|
+
return (_c = (_b = (_a2 = state.form) == null ? void 0 : _a2[formName]) == null ? void 0 : _b.values) == null ? void 0 : _c.reduxFormInitialValue;
|
|
47306
|
+
}
|
|
47307
|
+
);
|
|
47308
|
+
const [row] = args;
|
|
47309
|
+
const rowId = getIdOrCodeOrIndex(row.original, row.index);
|
|
47310
|
+
const cellId = `${rowId}:${row.column.path}`;
|
|
47311
|
+
const isEditingCell = editingCell === cellId;
|
|
47312
|
+
let val = oldFunc(...args);
|
|
47313
|
+
const oldVal = val;
|
|
47314
|
+
const text2 = getCopyTextForCell(val, row, column);
|
|
47315
|
+
const dataTest = {
|
|
47316
|
+
"data-test": "tgCell_" + column.path
|
|
47317
|
+
};
|
|
47318
|
+
const fullValue = (_a = row.original) == null ? void 0 : _a[row.column.path];
|
|
47319
|
+
if (isEditingCell) {
|
|
47320
|
+
if (column.type === "genericSelect") {
|
|
47321
|
+
const GenericSelectComp = column.GenericSelectComp;
|
|
47322
|
+
return /* @__PURE__ */ React$1.createElement(
|
|
47323
|
+
GenericSelectComp,
|
|
47324
|
+
__spreadProps(__spreadValues({
|
|
47325
|
+
rowId,
|
|
47326
|
+
fullValue,
|
|
47327
|
+
initialValue: text2
|
|
47328
|
+
}, dataTest), {
|
|
47329
|
+
finishEdit: (newVal, doNotStopEditing) => {
|
|
47330
|
+
finishCellEdit(cellId, newVal, doNotStopEditing);
|
|
47331
|
+
},
|
|
47332
|
+
dataTest,
|
|
47333
|
+
cancelEdit: cancelCellEdit
|
|
47334
|
+
})
|
|
47335
|
+
);
|
|
47336
|
+
}
|
|
47337
|
+
if (column.type === "dropdown" || column.type === "dropdownMulti") {
|
|
47338
|
+
return /* @__PURE__ */ React$1.createElement(
|
|
47339
|
+
DropdownCell,
|
|
47340
|
+
{
|
|
47341
|
+
isMulti: dataTest.isMulti || column.type === "dropdownMulti",
|
|
47342
|
+
initialValue: dataTest.initialValue || text2,
|
|
47343
|
+
options: getVals(column.values),
|
|
47344
|
+
finishEdit: (newVal, doNotStopEditing) => {
|
|
47345
|
+
finishCellEdit(cellId, newVal, doNotStopEditing);
|
|
47346
|
+
},
|
|
47347
|
+
dataTest,
|
|
47348
|
+
cancelEdit: cancelCellEdit
|
|
47349
|
+
}
|
|
47350
|
+
);
|
|
47351
|
+
} else {
|
|
47352
|
+
return /* @__PURE__ */ React$1.createElement(
|
|
47353
|
+
EditableCell,
|
|
47354
|
+
{
|
|
47355
|
+
dataTest,
|
|
47356
|
+
cancelEdit: cancelCellEdit,
|
|
47357
|
+
isNumeric: column.type === "number",
|
|
47358
|
+
initialValue: initialValue || text2,
|
|
47359
|
+
finishEdit: (newVal) => {
|
|
47360
|
+
finishCellEdit(cellId, newVal);
|
|
47361
|
+
}
|
|
47362
|
+
}
|
|
47363
|
+
);
|
|
47364
|
+
}
|
|
47365
|
+
}
|
|
47366
|
+
const isBool = column.type === "boolean";
|
|
47367
|
+
if (isCellEditable && isBool) {
|
|
47368
|
+
val = /* @__PURE__ */ React$1.createElement(
|
|
47369
|
+
core.Checkbox,
|
|
47370
|
+
{
|
|
47371
|
+
disabled: isEntityDisabled(row.original),
|
|
47372
|
+
className: "tg-cell-edit-boolean-checkbox",
|
|
47373
|
+
checked: oldVal === "True",
|
|
47374
|
+
onChange: (e2) => {
|
|
47375
|
+
const checked = e2.target.checked;
|
|
47376
|
+
finishCellEdit(cellId, checked);
|
|
47377
|
+
}
|
|
47378
|
+
}
|
|
47379
|
+
);
|
|
47380
|
+
noEllipsis = true;
|
|
47381
|
+
}
|
|
47382
|
+
let title = text2;
|
|
47383
|
+
if (getCellHoverText)
|
|
47384
|
+
title = getCellHoverText(...args);
|
|
47385
|
+
else if (column.getTitleAttr)
|
|
47386
|
+
title = column.getTitleAttr(...args);
|
|
47387
|
+
const isSelectedCell = selectedCells == null ? void 0 : selectedCells[cellId];
|
|
47388
|
+
const {
|
|
47389
|
+
isRect,
|
|
47390
|
+
selectionGrid,
|
|
47391
|
+
lastRowIndex,
|
|
47392
|
+
lastCellIndex,
|
|
47393
|
+
entityMap,
|
|
47394
|
+
pathToIndex
|
|
47395
|
+
} = isSelectionARectangle();
|
|
47396
|
+
return /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(
|
|
47397
|
+
"div",
|
|
47398
|
+
__spreadProps(__spreadValues({
|
|
47399
|
+
style: __spreadValues({}, !noEllipsis && {
|
|
47400
|
+
textOverflow: "ellipsis",
|
|
47401
|
+
overflow: "hidden"
|
|
47402
|
+
})
|
|
47403
|
+
}, dataTest), {
|
|
47404
|
+
className: "tg-cell-wrapper",
|
|
47405
|
+
"data-copy-text": text2,
|
|
47406
|
+
"data-copy-json": JSON.stringify(
|
|
47407
|
+
//tnw: eventually we'll parse these back out and use either the fullValue (for the generic selects) or the regular text vals for everything else
|
|
47408
|
+
column.type === "genericSelect" ? {
|
|
47409
|
+
__strVal: fullValue,
|
|
47410
|
+
__genSelCol: column.path
|
|
47411
|
+
} : { __strVal: text2 }
|
|
47412
|
+
),
|
|
47413
|
+
title: title || void 0
|
|
47414
|
+
}),
|
|
47415
|
+
val
|
|
47416
|
+
), isCellEditable && (column.type === "dropdown" || column.type === "dropdownMulti" || column.type === "genericSelect") && /* @__PURE__ */ React$1.createElement(
|
|
47417
|
+
core.Icon,
|
|
47418
|
+
{
|
|
47419
|
+
icon: "caret-down",
|
|
47420
|
+
style: {
|
|
47421
|
+
position: "absolute",
|
|
47422
|
+
right: 5,
|
|
47423
|
+
opacity: 0.3
|
|
47424
|
+
},
|
|
47425
|
+
className: "cell-edit-dropdown",
|
|
47426
|
+
onClick: () => {
|
|
47427
|
+
startCellEdit(cellId);
|
|
47428
|
+
}
|
|
47429
|
+
}
|
|
47430
|
+
), isSelectedCell && (isRect ? isBottomRightCornerOfRectangle({
|
|
47431
|
+
cellId,
|
|
47432
|
+
selectionGrid,
|
|
47433
|
+
lastRowIndex,
|
|
47434
|
+
lastCellIndex,
|
|
47435
|
+
entityMap,
|
|
47436
|
+
pathToIndex
|
|
47437
|
+
}) : isSelectedCell === PRIMARY_SELECTED_VAL) && /* @__PURE__ */ React$1.createElement(
|
|
47438
|
+
CellDragHandle,
|
|
47439
|
+
{
|
|
47440
|
+
key: cellId,
|
|
47441
|
+
thisTable: tableRef.current.tableRef,
|
|
47442
|
+
cellId,
|
|
47443
|
+
isSelectionARectangle,
|
|
47444
|
+
onDragEnd
|
|
47445
|
+
}
|
|
47446
|
+
));
|
|
47447
|
+
}, "RenderCell");
|
|
47277
47448
|
dayjs.extend(localizedFormat);
|
|
47278
47449
|
const RenderColumnHeader = /* @__PURE__ */ __name(({
|
|
47279
47450
|
addFilters,
|
|
@@ -47525,171 +47696,6 @@ const renderCheckboxHeader = /* @__PURE__ */ __name(({
|
|
|
47525
47696
|
}, checkboxProps)
|
|
47526
47697
|
) : null;
|
|
47527
47698
|
}, "renderCheckboxHeader");
|
|
47528
|
-
const RenderCell = /* @__PURE__ */ __name(({
|
|
47529
|
-
oldFunc,
|
|
47530
|
-
getCopyTextForCell,
|
|
47531
|
-
column,
|
|
47532
|
-
isCellEditable,
|
|
47533
|
-
isEntityDisabled,
|
|
47534
|
-
finishCellEdit,
|
|
47535
|
-
formName,
|
|
47536
|
-
noEllipsis,
|
|
47537
|
-
cancelCellEdit,
|
|
47538
|
-
getCellHoverText,
|
|
47539
|
-
selectedCells,
|
|
47540
|
-
isSelectionARectangle,
|
|
47541
|
-
startCellEdit,
|
|
47542
|
-
tableRef,
|
|
47543
|
-
onDragEnd,
|
|
47544
|
-
args
|
|
47545
|
-
}) => {
|
|
47546
|
-
var _a;
|
|
47547
|
-
const editingCell = reactRedux.useSelector(
|
|
47548
|
-
(state) => {
|
|
47549
|
-
var _a2, _b, _c;
|
|
47550
|
-
return (_c = (_b = (_a2 = state.form) == null ? void 0 : _a2[formName]) == null ? void 0 : _b.values) == null ? void 0 : _c.editingCell;
|
|
47551
|
-
}
|
|
47552
|
-
);
|
|
47553
|
-
const [row] = args;
|
|
47554
|
-
const rowId = getIdOrCodeOrIndex(row.original, row.index);
|
|
47555
|
-
const cellId = `${rowId}:${row.column.path}`;
|
|
47556
|
-
const isEditingCell = editingCell === cellId;
|
|
47557
|
-
let val = oldFunc(...args);
|
|
47558
|
-
const oldVal = val;
|
|
47559
|
-
const text2 = getCopyTextForCell(val, row, column);
|
|
47560
|
-
const dataTest = {
|
|
47561
|
-
"data-test": "tgCell_" + column.path
|
|
47562
|
-
};
|
|
47563
|
-
const fullValue = (_a = row.original) == null ? void 0 : _a[row.column.path];
|
|
47564
|
-
if (isEditingCell) {
|
|
47565
|
-
if (column.type === "genericSelect") {
|
|
47566
|
-
const GenericSelectComp = column.GenericSelectComp;
|
|
47567
|
-
return /* @__PURE__ */ React$1.createElement(
|
|
47568
|
-
GenericSelectComp,
|
|
47569
|
-
__spreadProps(__spreadValues({
|
|
47570
|
-
rowId,
|
|
47571
|
-
fullValue,
|
|
47572
|
-
initialValue: text2
|
|
47573
|
-
}, dataTest), {
|
|
47574
|
-
finishEdit: (newVal, doNotStopEditing) => {
|
|
47575
|
-
finishCellEdit(cellId, newVal, doNotStopEditing);
|
|
47576
|
-
},
|
|
47577
|
-
dataTest,
|
|
47578
|
-
cancelEdit: cancelCellEdit
|
|
47579
|
-
})
|
|
47580
|
-
);
|
|
47581
|
-
}
|
|
47582
|
-
if (column.type === "dropdown" || column.type === "dropdownMulti") {
|
|
47583
|
-
return /* @__PURE__ */ React$1.createElement(
|
|
47584
|
-
DropdownCell,
|
|
47585
|
-
{
|
|
47586
|
-
isMulti: dataTest.isMulti || column.type === "dropdownMulti",
|
|
47587
|
-
initialValue: dataTest.initialValue || text2,
|
|
47588
|
-
options: getVals(column.values),
|
|
47589
|
-
finishEdit: (newVal, doNotStopEditing) => {
|
|
47590
|
-
finishCellEdit(cellId, newVal, doNotStopEditing);
|
|
47591
|
-
},
|
|
47592
|
-
dataTest,
|
|
47593
|
-
cancelEdit: cancelCellEdit
|
|
47594
|
-
}
|
|
47595
|
-
);
|
|
47596
|
-
} else {
|
|
47597
|
-
return /* @__PURE__ */ React$1.createElement(
|
|
47598
|
-
EditableCell,
|
|
47599
|
-
{
|
|
47600
|
-
dataTest,
|
|
47601
|
-
cancelEdit: cancelCellEdit,
|
|
47602
|
-
isNumeric: column.type === "number",
|
|
47603
|
-
initialValue: text2,
|
|
47604
|
-
finishEdit: (newVal) => {
|
|
47605
|
-
finishCellEdit(cellId, newVal);
|
|
47606
|
-
}
|
|
47607
|
-
}
|
|
47608
|
-
);
|
|
47609
|
-
}
|
|
47610
|
-
}
|
|
47611
|
-
const isBool = column.type === "boolean";
|
|
47612
|
-
if (isCellEditable && isBool) {
|
|
47613
|
-
val = /* @__PURE__ */ React$1.createElement(
|
|
47614
|
-
core.Checkbox,
|
|
47615
|
-
{
|
|
47616
|
-
disabled: isEntityDisabled(row.original),
|
|
47617
|
-
className: "tg-cell-edit-boolean-checkbox",
|
|
47618
|
-
checked: oldVal === "True",
|
|
47619
|
-
onChange: (e2) => {
|
|
47620
|
-
const checked = e2.target.checked;
|
|
47621
|
-
finishCellEdit(cellId, checked);
|
|
47622
|
-
}
|
|
47623
|
-
}
|
|
47624
|
-
);
|
|
47625
|
-
noEllipsis = true;
|
|
47626
|
-
}
|
|
47627
|
-
let title = text2;
|
|
47628
|
-
if (getCellHoverText)
|
|
47629
|
-
title = getCellHoverText(...args);
|
|
47630
|
-
else if (column.getTitleAttr)
|
|
47631
|
-
title = column.getTitleAttr(...args);
|
|
47632
|
-
const isSelectedCell = selectedCells == null ? void 0 : selectedCells[cellId];
|
|
47633
|
-
const {
|
|
47634
|
-
isRect,
|
|
47635
|
-
selectionGrid,
|
|
47636
|
-
lastRowIndex,
|
|
47637
|
-
lastCellIndex,
|
|
47638
|
-
entityMap,
|
|
47639
|
-
pathToIndex
|
|
47640
|
-
} = isSelectionARectangle();
|
|
47641
|
-
return /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(
|
|
47642
|
-
"div",
|
|
47643
|
-
__spreadProps(__spreadValues({
|
|
47644
|
-
style: __spreadValues({}, !noEllipsis && {
|
|
47645
|
-
textOverflow: "ellipsis",
|
|
47646
|
-
overflow: "hidden"
|
|
47647
|
-
})
|
|
47648
|
-
}, dataTest), {
|
|
47649
|
-
className: "tg-cell-wrapper",
|
|
47650
|
-
"data-copy-text": text2,
|
|
47651
|
-
"data-copy-json": JSON.stringify(
|
|
47652
|
-
//tnw: eventually we'll parse these back out and use either the fullValue (for the generic selects) or the regular text vals for everything else
|
|
47653
|
-
column.type === "genericSelect" ? {
|
|
47654
|
-
__strVal: fullValue,
|
|
47655
|
-
__genSelCol: column.path
|
|
47656
|
-
} : { __strVal: text2 }
|
|
47657
|
-
),
|
|
47658
|
-
title: title || void 0
|
|
47659
|
-
}),
|
|
47660
|
-
val
|
|
47661
|
-
), isCellEditable && (column.type === "dropdown" || column.type === "dropdownMulti" || column.type === "genericSelect") && /* @__PURE__ */ React$1.createElement(
|
|
47662
|
-
core.Icon,
|
|
47663
|
-
{
|
|
47664
|
-
icon: "caret-down",
|
|
47665
|
-
style: {
|
|
47666
|
-
position: "absolute",
|
|
47667
|
-
right: 5,
|
|
47668
|
-
opacity: 0.3
|
|
47669
|
-
},
|
|
47670
|
-
className: "cell-edit-dropdown",
|
|
47671
|
-
onClick: () => {
|
|
47672
|
-
startCellEdit(cellId);
|
|
47673
|
-
}
|
|
47674
|
-
}
|
|
47675
|
-
), isSelectedCell && (isRect ? isBottomRightCornerOfRectangle({
|
|
47676
|
-
cellId,
|
|
47677
|
-
selectionGrid,
|
|
47678
|
-
lastRowIndex,
|
|
47679
|
-
lastCellIndex,
|
|
47680
|
-
entityMap,
|
|
47681
|
-
pathToIndex
|
|
47682
|
-
}) : isSelectedCell === PRIMARY_SELECTED_VAL) && /* @__PURE__ */ React$1.createElement(
|
|
47683
|
-
CellDragHandle,
|
|
47684
|
-
{
|
|
47685
|
-
key: cellId,
|
|
47686
|
-
thisTable: tableRef.current.tableRef,
|
|
47687
|
-
cellId,
|
|
47688
|
-
isSelectionARectangle,
|
|
47689
|
-
onDragEnd
|
|
47690
|
-
}
|
|
47691
|
-
));
|
|
47692
|
-
}, "RenderCell");
|
|
47693
47699
|
const useColumns = /* @__PURE__ */ __name(({
|
|
47694
47700
|
addFilters,
|
|
47695
47701
|
cellRenderer,
|
|
@@ -47726,7 +47732,6 @@ const useColumns = /* @__PURE__ */ __name(({
|
|
|
47726
47732
|
removeSingleFilter = noop$3,
|
|
47727
47733
|
schema,
|
|
47728
47734
|
selectedCells,
|
|
47729
|
-
setEditingCell,
|
|
47730
47735
|
setExpandedEntityIdMap,
|
|
47731
47736
|
setNewParams,
|
|
47732
47737
|
setOrder = noop$3,
|
|
@@ -48036,7 +48041,7 @@ const useColumns = /* @__PURE__ */ __name(({
|
|
|
48036
48041
|
const finishCellEdit = React$1.useCallback(
|
|
48037
48042
|
(cellId, newVal, doNotStopEditing) => {
|
|
48038
48043
|
const [rowId, path2] = cellId.split(":");
|
|
48039
|
-
!doNotStopEditing &&
|
|
48044
|
+
!doNotStopEditing && change("reduxFormEditingCell", null);
|
|
48040
48045
|
updateEntitiesHelper(entities, (entities2) => {
|
|
48041
48046
|
const entity = entities2.find((e2, i) => {
|
|
48042
48047
|
return getIdOrCodeOrIndex(e2, i) === rowId;
|
|
@@ -48055,19 +48060,19 @@ const useColumns = /* @__PURE__ */ __name(({
|
|
|
48055
48060
|
!doNotStopEditing && refocusTable();
|
|
48056
48061
|
},
|
|
48057
48062
|
[
|
|
48063
|
+
change,
|
|
48058
48064
|
entities,
|
|
48059
48065
|
reduxFormCellValidation,
|
|
48060
48066
|
refocusTable,
|
|
48061
48067
|
schema,
|
|
48062
|
-
setEditingCell,
|
|
48063
48068
|
updateEntitiesHelper,
|
|
48064
48069
|
updateValidation
|
|
48065
48070
|
]
|
|
48066
48071
|
);
|
|
48067
48072
|
const cancelCellEdit = React$1.useCallback(() => {
|
|
48068
|
-
|
|
48073
|
+
change("reduxFormEditingCell", null);
|
|
48069
48074
|
refocusTable();
|
|
48070
|
-
}, [
|
|
48075
|
+
}, [change, refocusTable]);
|
|
48071
48076
|
if (!columns.length) {
|
|
48072
48077
|
return columns;
|
|
48073
48078
|
}
|
|
@@ -48250,6 +48255,7 @@ const useColumns = /* @__PURE__ */ __name(({
|
|
|
48250
48255
|
RenderCell,
|
|
48251
48256
|
{
|
|
48252
48257
|
oldFunc,
|
|
48258
|
+
formName,
|
|
48253
48259
|
getCopyTextForCell,
|
|
48254
48260
|
column,
|
|
48255
48261
|
isCellEditable,
|
|
@@ -48282,21 +48288,6 @@ const throwFormError = /* @__PURE__ */ __name((error) => {
|
|
|
48282
48288
|
}
|
|
48283
48289
|
throw new reduxForm.SubmissionError(errorToUse);
|
|
48284
48290
|
}, "throwFormError");
|
|
48285
|
-
const useTraceUpdate = /* @__PURE__ */ __name((props) => {
|
|
48286
|
-
const prev = React$1.useRef(props);
|
|
48287
|
-
React$1.useEffect(() => {
|
|
48288
|
-
const changedProps = Object.entries(props).reduce((ps, [k2, v2]) => {
|
|
48289
|
-
if (prev.current[k2] !== v2) {
|
|
48290
|
-
ps[k2] = [prev.current[k2], v2];
|
|
48291
|
-
}
|
|
48292
|
-
return ps;
|
|
48293
|
-
}, {});
|
|
48294
|
-
if (Object.keys(changedProps).length > 0) {
|
|
48295
|
-
console.log("Changed props:", changedProps);
|
|
48296
|
-
}
|
|
48297
|
-
prev.current = props;
|
|
48298
|
-
});
|
|
48299
|
-
}, "useTraceUpdate");
|
|
48300
48291
|
T();
|
|
48301
48292
|
const IS_LINUX = window.navigator.platform.toLowerCase().search("linux") > -1;
|
|
48302
48293
|
const itemSizeEstimators = {
|
|
@@ -48457,7 +48448,6 @@ const DataTable = /* @__PURE__ */ __name((_G) => {
|
|
|
48457
48448
|
return tmp;
|
|
48458
48449
|
}, [history, reduxFormQueryParams, reduxFormSearchInput, urlConnected]);
|
|
48459
48450
|
const currentParams = useDeepEqualMemo(_currentParams);
|
|
48460
|
-
useTraceUpdate({ currentParams });
|
|
48461
48451
|
const tableParams = React$1.useMemo(() => {
|
|
48462
48452
|
if (!isTableParamsConnected) {
|
|
48463
48453
|
const updateSearch = /* @__PURE__ */ __name((val) => {
|
|
@@ -48663,20 +48653,28 @@ const DataTable = /* @__PURE__ */ __name((_G) => {
|
|
|
48663
48653
|
}, [entitiesAcrossPages, reduxFormSelectedEntityIdMap, change]);
|
|
48664
48654
|
const [tableConfig, setTableConfig] = React$1.useState({ fieldOptions: [] });
|
|
48665
48655
|
React$1.useEffect(() => {
|
|
48666
|
-
let newTableConfig = {};
|
|
48667
48656
|
if (withDisplayOptions) {
|
|
48657
|
+
let newTableConfig = {};
|
|
48668
48658
|
if (syncDisplayOptionsToDb) {
|
|
48669
48659
|
newTableConfig = tableConfigurations && tableConfigurations[0];
|
|
48670
48660
|
} else {
|
|
48671
48661
|
newTableConfig = getTableConfigFromStorage(formName);
|
|
48672
48662
|
}
|
|
48673
|
-
|
|
48674
|
-
newTableConfig
|
|
48675
|
-
|
|
48676
|
-
|
|
48677
|
-
|
|
48663
|
+
setTableConfig((prev) => {
|
|
48664
|
+
if (!newTableConfig) {
|
|
48665
|
+
newTableConfig = {
|
|
48666
|
+
fieldOptions: []
|
|
48667
|
+
};
|
|
48668
|
+
if (isEqual(prev, newTableConfig)) {
|
|
48669
|
+
return prev;
|
|
48670
|
+
} else {
|
|
48671
|
+
return newTableConfig;
|
|
48672
|
+
}
|
|
48673
|
+
} else {
|
|
48674
|
+
return newTableConfig;
|
|
48675
|
+
}
|
|
48676
|
+
});
|
|
48678
48677
|
}
|
|
48679
|
-
setTableConfig(newTableConfig);
|
|
48680
48678
|
}, [
|
|
48681
48679
|
formName,
|
|
48682
48680
|
syncDisplayOptionsToDb,
|
|
@@ -49125,7 +49123,8 @@ const DataTable = /* @__PURE__ */ __name((_G) => {
|
|
|
49125
49123
|
}
|
|
49126
49124
|
}, [selectedCells]);
|
|
49127
49125
|
const startCellEdit = React$1.useCallback(
|
|
49128
|
-
(cellId) => {
|
|
49126
|
+
(cellId, initialValue) => {
|
|
49127
|
+
change("reduxFormInitialValue", initialValue);
|
|
49129
49128
|
change("reduxFormEditingCell", (prev) => {
|
|
49130
49129
|
if (prev === cellId)
|
|
49131
49130
|
return cellId;
|
|
@@ -50831,7 +50830,7 @@ const DataTable = /* @__PURE__ */ __name((_G) => {
|
|
|
50831
50830
|
if (rowDisabled)
|
|
50832
50831
|
return;
|
|
50833
50832
|
e2.stopPropagation();
|
|
50834
|
-
startCellEdit(primarySelectedCellId);
|
|
50833
|
+
startCellEdit(primarySelectedCellId, e2.key);
|
|
50835
50834
|
}
|
|
50836
50835
|
}),
|
|
50837
50836
|
isCellEditable && entities.length > 50 && // test for this!!
|
|
@@ -64425,6 +64424,7 @@ const useTableParams = /* @__PURE__ */ __name((props) => {
|
|
|
64425
64424
|
syncDisplayOptionsToDb,
|
|
64426
64425
|
tableParams: _tableParams,
|
|
64427
64426
|
urlConnected,
|
|
64427
|
+
withDisplayOptions,
|
|
64428
64428
|
withPaging,
|
|
64429
64429
|
withSelectedEntities: withSelectedEntities2
|
|
64430
64430
|
} = props;
|
|
@@ -64585,7 +64585,8 @@ const useTableParams = /* @__PURE__ */ __name((props) => {
|
|
|
64585
64585
|
formName,
|
|
64586
64586
|
isLocalCall,
|
|
64587
64587
|
schema,
|
|
64588
|
-
currentParams
|
|
64588
|
+
currentParams,
|
|
64589
|
+
withDisplayOptions
|
|
64589
64590
|
}), queryParams), boundDispatchProps), {
|
|
64590
64591
|
form: formName,
|
|
64591
64592
|
//this will override the default redux form name
|
|
@@ -64604,7 +64605,8 @@ const useTableParams = /* @__PURE__ */ __name((props) => {
|
|
|
64604
64605
|
queryParams,
|
|
64605
64606
|
schema,
|
|
64606
64607
|
selectedEntities,
|
|
64607
|
-
urlConnected
|
|
64608
|
+
urlConnected,
|
|
64609
|
+
withDisplayOptions
|
|
64608
64610
|
]);
|
|
64609
64611
|
return __spreadProps(__spreadValues(__spreadValues({
|
|
64610
64612
|
isLocalCall,
|
|
@@ -69575,6 +69577,21 @@ const CmdButton = withCommand({
|
|
|
69575
69577
|
icon: "icon",
|
|
69576
69578
|
disabled: "isDisabled"
|
|
69577
69579
|
})(core.Button);
|
|
69580
|
+
const useTraceUpdate = /* @__PURE__ */ __name((props) => {
|
|
69581
|
+
const prev = React$1.useRef(props);
|
|
69582
|
+
React$1.useEffect(() => {
|
|
69583
|
+
const changedProps = Object.entries(props).reduce((ps, [k2, v2]) => {
|
|
69584
|
+
if (prev.current[k2] !== v2) {
|
|
69585
|
+
ps[k2] = [prev.current[k2], v2];
|
|
69586
|
+
}
|
|
69587
|
+
return ps;
|
|
69588
|
+
}, {});
|
|
69589
|
+
if (Object.keys(changedProps).length > 0) {
|
|
69590
|
+
console.log("Changed props:", changedProps);
|
|
69591
|
+
}
|
|
69592
|
+
prev.current = props;
|
|
69593
|
+
});
|
|
69594
|
+
}, "useTraceUpdate");
|
|
69578
69595
|
const showProgressToast = /* @__PURE__ */ __name((message, value, key, opts) => {
|
|
69579
69596
|
return window.toastr.default(
|
|
69580
69597
|
/* @__PURE__ */ React$1.createElement("div", null, /* @__PURE__ */ React$1.createElement("div", { style: { marginBottom: 10 } }, message), /* @__PURE__ */ React$1.createElement(
|