blixify-ui-web 1.3.54 → 1.3.55
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/lib/components/data/dataTemplate/index.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/index.js +374 -98
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/viewStatePersistence.d.ts +3 -0
- package/lib/components/data/dataTemplate/viewStatePersistence.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/viewStatePersistence.js.map +1 -1
- package/lib/components/display/newGrid/index.d.ts.map +1 -1
- package/lib/components/display/newGrid/index.js +52 -21
- package/lib/components/display/newGrid/index.js.map +1 -1
- package/lib/components/display/newKanban/index.d.ts +9 -0
- package/lib/components/display/newKanban/index.d.ts.map +1 -1
- package/lib/components/display/newKanban/index.js +162 -47
- package/lib/components/display/newKanban/index.js.map +1 -1
- package/lib/tail.css +1 -1
- package/package.json +1 -1
|
@@ -184,6 +184,7 @@ var timelineBars_1 = require("./timelineBars");
|
|
|
184
184
|
var viewStatePersistence_1 = require("./viewStatePersistence");
|
|
185
185
|
var permissions_1 = require("./permissions");
|
|
186
186
|
var columnWidth_1 = require("../../display/newTable/columnWidth");
|
|
187
|
+
var rowRendering_1 = require("../../display/newTable/rowRendering");
|
|
187
188
|
// INFO: builds the notification message for a failed write. Callers must gate on
|
|
188
189
|
// `err.response` alone, never on a specific status — a catch that only handles 400 shows
|
|
189
190
|
// the user nothing at all for any other status, so a write silently disappears. A 5xx is
|
|
@@ -236,6 +237,9 @@ var PAGE_LIMIT_OPTIONS = [10, 25, 50, 100];
|
|
|
236
237
|
// INFO: the most rows a formula sort or filter reads into the browser; each is
|
|
237
238
|
// evaluated, filtered and ordered locally, so a larger read could freeze the tab
|
|
238
239
|
exports.FORMULA_VIEW_MAX_ROWS = 5000;
|
|
240
|
+
// INFO: holds the per-group loader while a returning kanban reads its lanes
|
|
241
|
+
// back, so lane sentinels queue behind it; no band can take this key
|
|
242
|
+
var KANBAN_LANE_CATCH_UP_KEY = "__laneCatchUp";
|
|
239
243
|
var CALENDAR_VIEW_BY_SWITCH = {
|
|
240
244
|
month: "dayGridMonth",
|
|
241
245
|
week: "timeGridWeek",
|
|
@@ -893,6 +897,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
893
897
|
scrollAnchorId: persistedState === null || persistedState === void 0 ? void 0 : persistedState.scrollAnchorId,
|
|
894
898
|
scrollOffset: persistedState === null || persistedState === void 0 ? void 0 : persistedState.scrollOffset,
|
|
895
899
|
scrollPageIndex: persistedState === null || persistedState === void 0 ? void 0 : persistedState.scrollPageIndex,
|
|
900
|
+
scrollLaneRows: persistedState === null || persistedState === void 0 ? void 0 : persistedState.scrollLaneRows,
|
|
896
901
|
});
|
|
897
902
|
// INFO: one restore per mount — polling and SSE refetches must not scroll the user back
|
|
898
903
|
var scrollRestoredRef = (0, react_1.useRef)(false);
|
|
@@ -917,8 +922,28 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
917
922
|
: null;
|
|
918
923
|
})[0];
|
|
919
924
|
var scrollCatchUpRef = (0, react_1.useRef)(initialScrollCatchUp);
|
|
925
|
+
// INFO: a kanban's lanes page themselves, so a card deep in one lane is not
|
|
926
|
+
// in the board's first pages. On a return to the board a record was opened
|
|
927
|
+
// from, every lane reads back to the cards it held (see
|
|
928
|
+
// handleCatchUpKanbanLanes); null once that is done with or dropped
|
|
929
|
+
var initialLaneCatchUp = (0, react_1.useState)(function () {
|
|
930
|
+
var _a, _b;
|
|
931
|
+
return isPersistEnabled &&
|
|
932
|
+
Object.keys((_a = persistedState === null || persistedState === void 0 ? void 0 : persistedState.scrollLaneRows) !== null && _a !== void 0 ? _a : {}).length > 0 &&
|
|
933
|
+
!!(persistedState === null || persistedState === void 0 ? void 0 : persistedState.scrollAnchorId) &&
|
|
934
|
+
(0, viewStatePersistence_1.handleIsLastDrill)(props.collectionId, (_b = props.organise) === null || _b === void 0 ? void 0 : _b.persistKey)
|
|
935
|
+
? persistedState.scrollLaneRows
|
|
936
|
+
: null;
|
|
937
|
+
})[0];
|
|
938
|
+
var laneCatchUpRef = (0, react_1.useRef)(initialLaneCatchUp);
|
|
939
|
+
var laneCatchUpRunningRef = (0, react_1.useRef)(false);
|
|
920
940
|
// INFO: tells a mount apart from a tab switch on a mounted instance
|
|
921
941
|
var scrollIdentityRef = (0, react_1.useRef)(null);
|
|
942
|
+
// INFO: the grid, list and kanban items built so far, by the settings they
|
|
943
|
+
// were built with and then by their record. An item whose record and
|
|
944
|
+
// settings are unchanged keeps its object, so a page load builds and draws
|
|
945
|
+
// only the new items
|
|
946
|
+
var gridItemCacheRef = (0, react_1.useRef)(new Map());
|
|
922
947
|
var scrollScopeStartRef = (0, react_1.useRef)(null);
|
|
923
948
|
var scrollScopeEndRef = (0, react_1.useRef)(null);
|
|
924
949
|
// INFO: captures the doc exactly as loaded from the server — used by
|
|
@@ -2642,9 +2667,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2642
2667
|
if (!isPersistEnabled)
|
|
2643
2668
|
return;
|
|
2644
2669
|
scrollCaptureRef.current = __assign(__assign({}, (0, viewStatePersistence_1.handleCaptureScrollPosition)(recordId, handleResolveScrollAxis(), handleResolveScrollScope())), {
|
|
2645
|
-
// INFO: page mode saves pageIndex itself
|
|
2646
|
-
|
|
2670
|
+
// INFO: page mode saves pageIndex itself, and kanban lanes their own
|
|
2671
|
+
// depth instead of a page of the whole list
|
|
2672
|
+
scrollPageIndex: renderCheckScrollMode() && !handleCheckKanbanLanePaging()
|
|
2647
2673
|
? handleResolveScrollPageIndex(recordId)
|
|
2674
|
+
: undefined, scrollLaneRows: handleCheckKanbanLanePaging()
|
|
2675
|
+
? handleGetKanbanLaneRows()
|
|
2648
2676
|
: undefined });
|
|
2649
2677
|
handleSaveView(handleBuildViewSnapshot());
|
|
2650
2678
|
(0, viewStatePersistence_1.handleMarkLastDrill)((_a = props.organise) === null || _a === void 0 ? void 0 : _a.persistViewState, props.collectionId, (_b = props.organise) === null || _b === void 0 ? void 0 : _b.persistKey);
|
|
@@ -2666,6 +2694,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2666
2694
|
return;
|
|
2667
2695
|
}
|
|
2668
2696
|
scrollCatchUpRef.current = null;
|
|
2697
|
+
laneCatchUpRef.current = null;
|
|
2669
2698
|
scrollCaptureRef.current = {};
|
|
2670
2699
|
/* eslint-disable */
|
|
2671
2700
|
}, [
|
|
@@ -2789,12 +2818,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2789
2818
|
scrollAnchorId: persistedState === null || persistedState === void 0 ? void 0 : persistedState.scrollAnchorId,
|
|
2790
2819
|
scrollOffset: persistedState === null || persistedState === void 0 ? void 0 : persistedState.scrollOffset,
|
|
2791
2820
|
scrollPageIndex: persistedState === null || persistedState === void 0 ? void 0 : persistedState.scrollPageIndex,
|
|
2821
|
+
scrollLaneRows: persistedState === null || persistedState === void 0 ? void 0 : persistedState.scrollLaneRows,
|
|
2792
2822
|
};
|
|
2793
2823
|
var isOtherListReturn = !(0, viewStatePersistence_1.handleIsLastDrill)(props.collectionId, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.persistKey);
|
|
2794
2824
|
scrollRestoredRef.current = isSwitch || isOtherListReturn;
|
|
2795
2825
|
// INFO: a list that will not restore has no rows to catch up to
|
|
2796
|
-
if (scrollRestoredRef.current)
|
|
2826
|
+
if (scrollRestoredRef.current) {
|
|
2797
2827
|
scrollCatchUpRef.current = null;
|
|
2828
|
+
laneCatchUpRef.current = null;
|
|
2829
|
+
}
|
|
2798
2830
|
/* eslint-disable */
|
|
2799
2831
|
}, [props.collectionId, (_106 = props.organise) === null || _106 === void 0 ? void 0 : _106.persistKey]);
|
|
2800
2832
|
/* eslint-enable */
|
|
@@ -2820,6 +2852,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2820
2852
|
/* eslint-disable */
|
|
2821
2853
|
}, [isPersistEnabled, props.type, tableLoading, spaceTableData.length]);
|
|
2822
2854
|
/* eslint-enable */
|
|
2855
|
+
// INFO: the board's first rows are in, so its lanes read back to the depth
|
|
2856
|
+
// they had. Waits for the kanban tab, as a list can read its first rows on
|
|
2857
|
+
// another tab before the saved one is chosen
|
|
2858
|
+
(0, react_1.useEffect)(function () {
|
|
2859
|
+
if (!laneCatchUpRef.current || laneCatchUpRunningRef.current)
|
|
2860
|
+
return;
|
|
2861
|
+
if (props.type !== "list" || tableLoading)
|
|
2862
|
+
return;
|
|
2863
|
+
if (!handleCheckKanbanLanePaging())
|
|
2864
|
+
return;
|
|
2865
|
+
handleCatchUpKanbanLanes();
|
|
2866
|
+
/* eslint-disable */
|
|
2867
|
+
}, [props.type, tableLoading, tableData.length, selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.id]);
|
|
2868
|
+
/* eslint-enable */
|
|
2823
2869
|
(0, react_1.useEffect)(function () {
|
|
2824
2870
|
handleCheckOfflineDataLength();
|
|
2825
2871
|
/* eslint-disable */
|
|
@@ -4631,7 +4677,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
4631
4677
|
if (!isScrollMode && !isFirebase) {
|
|
4632
4678
|
handleSetListData(dataList, prettierDataList);
|
|
4633
4679
|
setSize((_m = responseData.count) !== null && _m !== void 0 ? _m : 0);
|
|
4634
|
-
|
|
4680
|
+
// INFO: kanban lanes load by scroll from the rows this read gave
|
|
4681
|
+
// them, so they only drop the cursors of the list read before
|
|
4682
|
+
if (handleCheckKanbanLanePaging())
|
|
4683
|
+
handleResetGroupPaging();
|
|
4684
|
+
else if (renderCheckGroupPaging())
|
|
4635
4685
|
handleLoadGroupFirstPages();
|
|
4636
4686
|
}
|
|
4637
4687
|
else {
|
|
@@ -11550,6 +11600,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11550
11600
|
// INFO: a two-line inbox row — the full field list moves behind the row's
|
|
11551
11601
|
// arrow
|
|
11552
11602
|
isCompactRow) {
|
|
11603
|
+
var _a, _b;
|
|
11553
11604
|
var gridData = [];
|
|
11554
11605
|
var isKanban = (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.viewType) === "kanban";
|
|
11555
11606
|
var isListEditable = canInlineUpdate;
|
|
@@ -11592,13 +11643,56 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11592
11643
|
}
|
|
11593
11644
|
return true;
|
|
11594
11645
|
});
|
|
11646
|
+
// INFO: everything an item is built from apart from its own record; host
|
|
11647
|
+
// functions count as unchanged, as the table's rows count them
|
|
11648
|
+
var itemCacheKey = [
|
|
11649
|
+
type,
|
|
11650
|
+
imageTag,
|
|
11651
|
+
kanbanGroupId,
|
|
11652
|
+
useColumnName,
|
|
11653
|
+
isCompactRow,
|
|
11654
|
+
titleKey,
|
|
11655
|
+
isListEditable,
|
|
11656
|
+
visibleColumns.map(function (eachModel) { return (0, rowRendering_1.handleFingerprint)(eachModel); }).join("|"),
|
|
11657
|
+
booleanModels.map(function (eachModel) { return eachModel.id; }).join(","),
|
|
11658
|
+
booleanModels.length ? (0, rowRendering_1.handleGetIdentity)(kanbanChecked) : "",
|
|
11659
|
+
Object.keys((_a = props.bareSettings) !== null && _a !== void 0 ? _a : {})
|
|
11660
|
+
.sort()
|
|
11661
|
+
.map(function (eachKey) {
|
|
11662
|
+
return "".concat(eachKey, "=").concat((0, rowRendering_1.handleFingerprint)(props.bareSettings[eachKey]));
|
|
11663
|
+
})
|
|
11664
|
+
.join(","),
|
|
11665
|
+
(_b = props.organise) === null || _b === void 0 ? void 0 : _b.disableEllipsisOnLongWord,
|
|
11666
|
+
(0, rowRendering_1.handleFingerprint)(selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.kanbanSettings),
|
|
11667
|
+
groupId,
|
|
11668
|
+
isCompactRow ? handleCheckGroupSectionTab() : "",
|
|
11669
|
+
].join("|");
|
|
11670
|
+
var itemCache = gridItemCacheRef.current.get(itemCacheKey);
|
|
11671
|
+
if (!itemCache) {
|
|
11672
|
+
// INFO: a few settings are kept, so switching between two tabs reuses
|
|
11673
|
+
// both tabs' items
|
|
11674
|
+
if (gridItemCacheRef.current.size >= 4)
|
|
11675
|
+
gridItemCacheRef.current.clear();
|
|
11676
|
+
itemCache = new WeakMap();
|
|
11677
|
+
gridItemCacheRef.current.set(itemCacheKey, itemCache);
|
|
11678
|
+
}
|
|
11595
11679
|
spaceTableData.forEach(function (eachData, index) {
|
|
11596
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
11597
|
-
var
|
|
11598
|
-
|
|
11680
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
11681
|
+
var selectedTData = tableData[index];
|
|
11682
|
+
// INFO: the legacy kanban moves a dropped card by writing its lane onto
|
|
11683
|
+
// the item, so its items are built afresh on every draw as before
|
|
11684
|
+
var isItemCached = !!eachData &&
|
|
11685
|
+
typeof eachData === "object" &&
|
|
11686
|
+
!(isKanban && !((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareNewDTW));
|
|
11687
|
+
var cachedItem = isItemCached ? itemCache.get(eachData) : undefined;
|
|
11688
|
+
if (cachedItem && cachedItem.raw === selectedTData) {
|
|
11689
|
+
gridData.push(cachedItem.data);
|
|
11690
|
+
return;
|
|
11691
|
+
}
|
|
11692
|
+
var allValues = Object.values(eachData);
|
|
11599
11693
|
var title = "";
|
|
11600
11694
|
if (allValues.length > 0) {
|
|
11601
|
-
var renderedTitle = (0, readModule_1.renderEachRowDataBasedOnDataType)(titleKey, eachData[titleKey], props.bareSettings, true, (
|
|
11695
|
+
var renderedTitle = (0, readModule_1.renderEachRowDataBasedOnDataType)(titleKey, eachData[titleKey], props.bareSettings, true, (_b = props.organise) === null || _b === void 0 ? void 0 : _b.disableEllipsisOnLongWord);
|
|
11602
11696
|
if (renderedTitle !== " - ")
|
|
11603
11697
|
title = renderedTitle;
|
|
11604
11698
|
}
|
|
@@ -11662,8 +11756,6 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11662
11756
|
}, className: "border-primary-500 border-2 rounded focus:ring-gray-50" })));
|
|
11663
11757
|
});
|
|
11664
11758
|
}
|
|
11665
|
-
var selectedTGroupData = tableData;
|
|
11666
|
-
var selectedTData = selectedTGroupData[index];
|
|
11667
11759
|
var data = {
|
|
11668
11760
|
id: selectedTData["_id"] ? selectedTData["_id"] : selectedTData["id"],
|
|
11669
11761
|
title: title,
|
|
@@ -11691,9 +11783,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11691
11783
|
// INFO: a host that formats this date itself keeps its format
|
|
11692
11784
|
trailing: !rowFields.dateKey
|
|
11693
11785
|
? undefined
|
|
11694
|
-
: ((
|
|
11786
|
+
: ((_d = (_c = props.bareSettings) === null || _c === void 0 ? void 0 : _c.bareListDescription) === null || _d === void 0 ? void 0 : _d.call(_c, rowFields.dateKey, eachData[rowFields.dateKey]))
|
|
11695
11787
|
? handleRenderField_1(rowFields.dateKey)
|
|
11696
|
-
: (0, listRowFields_1.handleFormatListRowDate)((
|
|
11788
|
+
: (0, listRowFields_1.handleFormatListRowDate)((_e = selectedTData[rowFields.dateKey]) !== null && _e !== void 0 ? _e : eachData[rowFields.dateKey]),
|
|
11697
11789
|
badge: rowFields.badgeKey
|
|
11698
11790
|
? handleRenderField_1(rowFields.badgeKey)
|
|
11699
11791
|
: undefined,
|
|
@@ -11714,12 +11806,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11714
11806
|
if (type === "kanban" && (laneSettings === null || laneSettings === void 0 ? void 0 : laneSettings.subGroupBy)) {
|
|
11715
11807
|
data[laneSettings.subGroupBy] =
|
|
11716
11808
|
selectedTData[laneSettings.subGroupBy];
|
|
11717
|
-
data.subGroupLabel = (0, readModule_1.renderEachRowDataBasedOnDataType)(laneSettings.subGroupBy, eachData[laneSettings.subGroupBy], props.bareSettings, true, (
|
|
11809
|
+
data.subGroupLabel = (0, readModule_1.renderEachRowDataBasedOnDataType)(laneSettings.subGroupBy, eachData[laneSettings.subGroupBy], props.bareSettings, true, (_f = props.organise) === null || _f === void 0 ? void 0 : _f.disableEllipsisOnLongWord);
|
|
11718
11810
|
}
|
|
11719
|
-
var gridComponent = (
|
|
11811
|
+
var gridComponent = (_h = (_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareListGridComponent) === null || _h === void 0 ? void 0 : _h.call(_g, eachData, selectedTData);
|
|
11720
11812
|
if (gridComponent)
|
|
11721
11813
|
data[type === "grid" ? "extra" : "action"] = gridComponent;
|
|
11722
|
-
var eachDataTags = (
|
|
11814
|
+
var eachDataTags = (_k = (_j = props.bareSettings) === null || _j === void 0 ? void 0 : _j.bareListGridTags) === null || _k === void 0 ? void 0 : _k.call(_j, eachData, selectedTData);
|
|
11723
11815
|
if (eachDataTags) {
|
|
11724
11816
|
if (Array.isArray(eachDataTags)) {
|
|
11725
11817
|
var gridTagList_1 = [];
|
|
@@ -11732,12 +11824,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11732
11824
|
data["tags"] = gridTagList_1;
|
|
11733
11825
|
}
|
|
11734
11826
|
}
|
|
11735
|
-
var ribbonText = (
|
|
11827
|
+
var ribbonText = (_m = (_l = props.bareSettings) === null || _l === void 0 ? void 0 : _l.bareListGridRibbonText) === null || _m === void 0 ? void 0 : _m.call(_l, eachData, selectedTData);
|
|
11736
11828
|
if (ribbonText)
|
|
11737
11829
|
data["ribbonText"] = ribbonText;
|
|
11738
11830
|
var eachDataGridImage = "";
|
|
11739
|
-
var gridFallbackImg = (
|
|
11740
|
-
var cellImageSrc = (0, utils_1.handleGetRenderedImageSrc)(
|
|
11831
|
+
var gridFallbackImg = (_p = (_o = props.bareSettings) === null || _o === void 0 ? void 0 : _o.bareListGridFallbackImg) === null || _p === void 0 ? void 0 : _p.call(_o, eachData, selectedTData);
|
|
11832
|
+
var cellImageSrc = (0, utils_1.handleGetRenderedImageSrc)(eachData[imageTag]);
|
|
11741
11833
|
if (cellImageSrc) {
|
|
11742
11834
|
eachDataGridImage = cellImageSrc;
|
|
11743
11835
|
}
|
|
@@ -11753,8 +11845,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11753
11845
|
data["imageUrl"] = eachDataGridImage;
|
|
11754
11846
|
}
|
|
11755
11847
|
else {
|
|
11756
|
-
data["img"] = (0, utils_1.handleGetRenderedImageSrc)(
|
|
11848
|
+
data["img"] = (0, utils_1.handleGetRenderedImageSrc)(eachData[imageTag]);
|
|
11757
11849
|
}
|
|
11850
|
+
if (isItemCached)
|
|
11851
|
+
itemCache.set(eachData, { raw: selectedTData, data: data });
|
|
11758
11852
|
gridData.push(data);
|
|
11759
11853
|
});
|
|
11760
11854
|
return gridData;
|
|
@@ -11776,6 +11870,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11776
11870
|
var paginationType = renderResolvedPaginationType();
|
|
11777
11871
|
if (paginationType !== "scroll" && paginationType !== "page")
|
|
11778
11872
|
return false;
|
|
11873
|
+
if ((selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.viewType) === "kanban")
|
|
11874
|
+
return handleCheckKanbanLanePaging();
|
|
11779
11875
|
if (!groupId || isFirebase)
|
|
11780
11876
|
return false;
|
|
11781
11877
|
// INFO: a formula sort or filter needs every row read and ordered at
|
|
@@ -11806,6 +11902,44 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11806
11902
|
(groupAttributeDS === null || groupAttributeDS === void 0 ? void 0 : groupAttributeDS.type) === "boolean") &&
|
|
11807
11903
|
!!((_d = (0, groupSections_1.handleGetGroupOptions)(groupAttributeDS)) === null || _d === void 0 ? void 0 : _d.length));
|
|
11808
11904
|
};
|
|
11905
|
+
// INFO: a kanban's lanes are its column's options, so each lane pages itself
|
|
11906
|
+
// through the same band reads as a table group, always by scroll — a board
|
|
11907
|
+
// has no room for a pager per lane. A lane joining several values (a
|
|
11908
|
+
// cluster) or a lane per linked record keeps the single board read.
|
|
11909
|
+
var handleCheckKanbanLanePaging = function () {
|
|
11910
|
+
var _a, _b, _c, _d, _e, _f;
|
|
11911
|
+
if ((selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.viewType) !== "kanban")
|
|
11912
|
+
return false;
|
|
11913
|
+
if (!((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareNewDTW) || isFirebase || isFormulaView)
|
|
11914
|
+
return false;
|
|
11915
|
+
if ((_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.unionCollections) === null || _c === void 0 ? void 0 : _c.length)
|
|
11916
|
+
return false;
|
|
11917
|
+
if ((_e = (_d = selectedTab.kanbanSettings) === null || _d === void 0 ? void 0 : _d.groupCluster) === null || _e === void 0 ? void 0 : _e.length)
|
|
11918
|
+
return false;
|
|
11919
|
+
var laneColumn = handleGetKanbanLaneColumn();
|
|
11920
|
+
return ((laneColumn === null || laneColumn === void 0 ? void 0 : laneColumn.type) === "list" && !!((_f = (0, groupSections_1.handleGetGroupOptions)(laneColumn)) === null || _f === void 0 ? void 0 : _f.length));
|
|
11921
|
+
};
|
|
11922
|
+
var handleGetKanbanLaneColumn = function () {
|
|
11923
|
+
var _a;
|
|
11924
|
+
var laneId = (_a = selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.kanbanSettings) === null || _a === void 0 ? void 0 : _a.title;
|
|
11925
|
+
if (!laneId)
|
|
11926
|
+
return undefined;
|
|
11927
|
+
return displayStructure.find(function (eachDS) { return eachDS.id === laneId; });
|
|
11928
|
+
};
|
|
11929
|
+
// INFO: the column the bands page by — the kanban's lane column on a kanban
|
|
11930
|
+
// tab, the list's group-by column everywhere else
|
|
11931
|
+
var handleGetPagedGroupColumn = function () {
|
|
11932
|
+
return (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.viewType) === "kanban"
|
|
11933
|
+
? handleGetKanbanLaneColumn()
|
|
11934
|
+
: handleGetGroupColumn();
|
|
11935
|
+
};
|
|
11936
|
+
var handleGetPagedGroupOptions = function () {
|
|
11937
|
+
return (0, groupSections_1.handleGetGroupOptions)(handleGetPagedGroupColumn(), props.devSettings.organisationMembers);
|
|
11938
|
+
};
|
|
11939
|
+
// INFO: bands load by scroll in scroll mode, and kanban lanes in every mode
|
|
11940
|
+
var renderCheckGroupScroll = function () {
|
|
11941
|
+
return renderCheckScrollMode() || handleCheckKanbanLanePaging();
|
|
11942
|
+
};
|
|
11809
11943
|
// INFO: a list or grid tab draws the table's group sections, unless the
|
|
11810
11944
|
// host replaces it with its own list component
|
|
11811
11945
|
var handleCheckGroupSectionTab = function () {
|
|
@@ -12510,7 +12644,42 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12510
12644
|
}); };
|
|
12511
12645
|
// INFO: a row's section under per-group paging
|
|
12512
12646
|
var handleResolveGroupKey = function (row) {
|
|
12513
|
-
|
|
12647
|
+
var column = handleGetPagedGroupColumn();
|
|
12648
|
+
return (0, groupSections_1.handleGetGroupKey)(column, column ? row === null || row === void 0 ? void 0 : row[column.id] : undefined, handleGetPagedGroupOptions(), isFirebase);
|
|
12649
|
+
};
|
|
12650
|
+
// INFO: the rows of one band already loaded. A kanban's lanes are not table
|
|
12651
|
+
// sections, so they are counted from the rows themselves
|
|
12652
|
+
var handleCountLoadedGroupRows = function (groupKey) {
|
|
12653
|
+
var _a, _b, _c;
|
|
12654
|
+
if (handleCheckKanbanLanePaging())
|
|
12655
|
+
return tableDataRef.current.filter(function (eachRow) { return handleResolveGroupKey(eachRow) === groupKey; }).length;
|
|
12656
|
+
return ((_c = (_b = ((_a = handleBuildNewTableGroups()) !== null && _a !== void 0 ? _a : []).find(function (eachGroup) { return eachGroup.id === groupKey; })) === null || _b === void 0 ? void 0 : _b.rowIds.length) !== null && _c !== void 0 ? _c : 0);
|
|
12657
|
+
};
|
|
12658
|
+
// INFO: a kanban lane's band — an option's lane is its own, Unassigned is No
|
|
12659
|
+
// Value, and a lane per value outside the options belongs to Unknown
|
|
12660
|
+
var handleGetKanbanLaneKey = function (laneId) {
|
|
12661
|
+
var _a;
|
|
12662
|
+
if (laneId === newKanban_1.NEW_KANBAN_UNASSIGNED_ID)
|
|
12663
|
+
return groupSections_1.GROUP_EMPTY_KEY;
|
|
12664
|
+
var isOption = ((_a = handleGetPagedGroupOptions()) !== null && _a !== void 0 ? _a : []).some(function (eachOption) { return eachOption.key === laneId; });
|
|
12665
|
+
return isOption ? laneId : groupSections_1.GROUP_UNKNOWN_KEY;
|
|
12666
|
+
};
|
|
12667
|
+
var handleGetKanbanLaneStatus = function (laneId) {
|
|
12668
|
+
var _a;
|
|
12669
|
+
var groupKey = handleGetKanbanLaneKey(laneId);
|
|
12670
|
+
var state = groupPageState[groupKey];
|
|
12671
|
+
// INFO: the board's first read held every row, so no lane has more
|
|
12672
|
+
var isListLoaded = !tableLoading && tableData.length >= size;
|
|
12673
|
+
return {
|
|
12674
|
+
// INFO: Unknown is read as one band shared by several lanes, so its
|
|
12675
|
+
// total is no single lane's
|
|
12676
|
+
count: (state === null || state === void 0 ? void 0 : state.fetched) && groupKey !== groupSections_1.GROUP_UNKNOWN_KEY
|
|
12677
|
+
? state.size
|
|
12678
|
+
: undefined,
|
|
12679
|
+
loadingMore: state === null || state === void 0 ? void 0 : state.loadingMore,
|
|
12680
|
+
exhausted: (_a = state === null || state === void 0 ? void 0 : state.exhausted) !== null && _a !== void 0 ? _a : isListLoaded,
|
|
12681
|
+
readId: groupPagingGenRef.current,
|
|
12682
|
+
};
|
|
12514
12683
|
};
|
|
12515
12684
|
var handleSetGroupPageState = function (groupKey, state) {
|
|
12516
12685
|
return setGroupPageState(function (previous) {
|
|
@@ -12530,59 +12699,66 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12530
12699
|
// sort the main read uses, scoped to that group, and runs it through the
|
|
12531
12700
|
// same prettifier so its rows carry the shape of every other row. Returns
|
|
12532
12701
|
// undefined when the list was re-read while the page was in flight.
|
|
12533
|
-
var handleReadGroupPage = function (
|
|
12534
|
-
var
|
|
12535
|
-
var
|
|
12536
|
-
|
|
12537
|
-
|
|
12538
|
-
|
|
12539
|
-
|
|
12540
|
-
|
|
12541
|
-
|
|
12542
|
-
|
|
12543
|
-
|
|
12544
|
-
|
|
12545
|
-
|
|
12546
|
-
|
|
12547
|
-
|
|
12548
|
-
|
|
12549
|
-
|
|
12550
|
-
|
|
12551
|
-
|
|
12552
|
-
|
|
12553
|
-
|
|
12554
|
-
|
|
12555
|
-
|
|
12556
|
-
|
|
12557
|
-
|
|
12558
|
-
|
|
12559
|
-
|
|
12560
|
-
|
|
12561
|
-
|
|
12562
|
-
|
|
12563
|
-
if (
|
|
12564
|
-
|
|
12565
|
-
|
|
12566
|
-
|
|
12567
|
-
|
|
12568
|
-
|
|
12569
|
-
|
|
12570
|
-
|
|
12571
|
-
|
|
12572
|
-
|
|
12573
|
-
|
|
12702
|
+
var handleReadGroupPage = function (groupKey_1, cursor_2) {
|
|
12703
|
+
var args_1 = [];
|
|
12704
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
12705
|
+
args_1[_i - 2] = arguments[_i];
|
|
12706
|
+
}
|
|
12707
|
+
return __awaiter(void 0, __spreadArray([groupKey_1, cursor_2], args_1, true), void 0, function (groupKey, cursor, pageLimit) {
|
|
12708
|
+
var generation, groupAttributeDS, groupQuery, mainCond, sectionQuery, responseData, rawRows, count, prettierRows;
|
|
12709
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
12710
|
+
if (pageLimit === void 0) { pageLimit = limit; }
|
|
12711
|
+
return __generator(this, function (_j) {
|
|
12712
|
+
switch (_j.label) {
|
|
12713
|
+
case 0:
|
|
12714
|
+
generation = groupPagingGenRef.current;
|
|
12715
|
+
groupAttributeDS = handleGetPagedGroupColumn();
|
|
12716
|
+
if (!groupAttributeDS)
|
|
12717
|
+
return [2 /*return*/, undefined];
|
|
12718
|
+
groupQuery = (0, groupSections_1.handleGetGroupSectionQuery)(groupAttributeDS, groupKey, (_a = handleGetPagedGroupOptions()) !== null && _a !== void 0 ? _a : []);
|
|
12719
|
+
mainCond = handleReadQueryHocCond();
|
|
12720
|
+
sectionQuery = (0, groupSections_1.handleScopeSectionQuery)(groupQuery, (_b = mainCond.query) !== null && _b !== void 0 ? _b : []);
|
|
12721
|
+
// INFO: the list's own filters leave this section no rows
|
|
12722
|
+
if (!sectionQuery)
|
|
12723
|
+
return [2 /*return*/, { rawRows: [], prettierRows: [], count: 0 }];
|
|
12724
|
+
return [4 /*yield*/, readServerQuery.call(__assign(__assign({}, mainCond), { query: sectionQuery, cursor: cursor, limit: pageLimit, stopLimit: undefined, skip: 0 }))];
|
|
12725
|
+
case 1:
|
|
12726
|
+
responseData = _j.sent();
|
|
12727
|
+
if (generation !== groupPagingGenRef.current)
|
|
12728
|
+
return [2 /*return*/, undefined];
|
|
12729
|
+
rawRows = (_c = responseData === null || responseData === void 0 ? void 0 : responseData.data) !== null && _c !== void 0 ? _c : [];
|
|
12730
|
+
count = (_d = responseData === null || responseData === void 0 ? void 0 : responseData.count) !== null && _d !== void 0 ? _d : 0;
|
|
12731
|
+
prettierRows = [];
|
|
12732
|
+
if (!(rawRows.length > 0)) return [3 /*break*/, 3];
|
|
12733
|
+
return [4 /*yield*/, (0, listModule_1.handleListDataBasedOnModel)(rawRows, props.devSettings, (_e = props.lib) === null || _e === void 0 ? void 0 : _e.axios, displayStructure, (_f = props.organise) === null || _f === void 0 ? void 0 : _f.handleNavigate, setActivityModal, setActivityId, isActivityLog ? (_g = props.edit) === null || _g === void 0 ? void 0 : _g.activityLog : undefined, (_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareListActionBtns, !canUpdateRecord, undefined, handleSeedListReferenceOptions, isDateWarnings)];
|
|
12734
|
+
case 2:
|
|
12735
|
+
prettierRows = _j.sent();
|
|
12736
|
+
rawRows.forEach(function (eachData) {
|
|
12737
|
+
// INFO: normalise _id -> id to match the shape the main list carries
|
|
12738
|
+
if (eachData["_id"]) {
|
|
12739
|
+
eachData["id"] = eachData["_id"];
|
|
12740
|
+
delete eachData["_id"];
|
|
12741
|
+
}
|
|
12742
|
+
});
|
|
12743
|
+
_j.label = 3;
|
|
12744
|
+
case 3:
|
|
12745
|
+
if (generation !== groupPagingGenRef.current)
|
|
12746
|
+
return [2 /*return*/, undefined];
|
|
12747
|
+
return [2 /*return*/, { rawRows: rawRows, prettierRows: prettierRows, count: count }];
|
|
12748
|
+
}
|
|
12749
|
+
});
|
|
12574
12750
|
});
|
|
12575
|
-
}
|
|
12751
|
+
};
|
|
12576
12752
|
// INFO: scroll mode — appends the NEXT page of ONE group to the shared flat
|
|
12577
12753
|
// tableData / spaceTableData, so handleBuildNewTableGroups() keeps building
|
|
12578
12754
|
// bands from one source; each group advances its own cursor
|
|
12579
12755
|
var handleFetchGroupNextPage = function (groupKey) { return __awaiter(void 0, void 0, void 0, function () {
|
|
12580
|
-
var current, groupSize, cursor, generation,
|
|
12581
|
-
var _a
|
|
12582
|
-
return __generator(this, function (
|
|
12583
|
-
switch (
|
|
12756
|
+
var current, groupSize, cursor, generation, page, err_36, nextKey;
|
|
12757
|
+
var _a;
|
|
12758
|
+
return __generator(this, function (_b) {
|
|
12759
|
+
switch (_b.label) {
|
|
12584
12760
|
case 0:
|
|
12585
|
-
if (!renderCheckGroupPaging() || !
|
|
12761
|
+
if (!renderCheckGroupPaging() || !renderCheckGroupScroll())
|
|
12586
12762
|
return [2 /*return*/];
|
|
12587
12763
|
current = groupPageStateRef.current[groupKey];
|
|
12588
12764
|
if ((current === null || current === void 0 ? void 0 : current.loadingMore) || (current === null || current === void 0 ? void 0 : current.exhausted))
|
|
@@ -12593,7 +12769,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12593
12769
|
!tableLoading &&
|
|
12594
12770
|
size > 0 &&
|
|
12595
12771
|
tableDataRef.current.length >= size) {
|
|
12596
|
-
groupSize = (
|
|
12772
|
+
groupSize = handleCountLoadedGroupRows(groupKey);
|
|
12597
12773
|
handleSetGroupPageState(groupKey, {
|
|
12598
12774
|
cursor: groupSize,
|
|
12599
12775
|
size: groupSize,
|
|
@@ -12609,39 +12785,21 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12609
12785
|
return [2 /*return*/];
|
|
12610
12786
|
}
|
|
12611
12787
|
groupLoadingKeyRef.current = groupKey;
|
|
12612
|
-
cursor = (
|
|
12788
|
+
cursor = (_a = current === null || current === void 0 ? void 0 : current.cursor) !== null && _a !== void 0 ? _a : handleCountLoadedGroupRows(groupKey);
|
|
12613
12789
|
generation = groupPagingGenRef.current;
|
|
12614
12790
|
handleSetGroupPageState(groupKey, { cursor: cursor, loadingMore: true });
|
|
12615
|
-
|
|
12791
|
+
_b.label = 1;
|
|
12616
12792
|
case 1:
|
|
12617
|
-
|
|
12793
|
+
_b.trys.push([1, 3, 4, 5]);
|
|
12618
12794
|
return [4 /*yield*/, handleReadGroupPage(groupKey, cursor)];
|
|
12619
12795
|
case 2:
|
|
12620
|
-
|
|
12621
|
-
if (!
|
|
12796
|
+
page = _b.sent();
|
|
12797
|
+
if (!page)
|
|
12622
12798
|
return [2 /*return*/];
|
|
12623
|
-
|
|
12624
|
-
appendRaw_1 = [];
|
|
12625
|
-
appendPretty_1 = [];
|
|
12626
|
-
page_1.rawRows.forEach(function (eachRow, eachIndex) {
|
|
12627
|
-
var _a;
|
|
12628
|
-
if (existingIds_1.has((_a = eachRow.id) !== null && _a !== void 0 ? _a : eachRow._id))
|
|
12629
|
-
return;
|
|
12630
|
-
appendRaw_1.push(eachRow);
|
|
12631
|
-
appendPretty_1.push(page_1.prettierRows[eachIndex]);
|
|
12632
|
-
});
|
|
12633
|
-
handleSetListData(tableDataRef.current.concat(appendRaw_1), spaceTableDataRef.current.concat(appendPretty_1));
|
|
12634
|
-
nextCursor = cursor + page_1.rawRows.length;
|
|
12635
|
-
handleSetGroupPageState(groupKey, {
|
|
12636
|
-
cursor: nextCursor,
|
|
12637
|
-
size: page_1.count,
|
|
12638
|
-
loadingMore: false,
|
|
12639
|
-
fetched: true,
|
|
12640
|
-
exhausted: page_1.rawRows.length === 0 || nextCursor >= page_1.count,
|
|
12641
|
-
});
|
|
12799
|
+
handleAppendGroupPage(groupKey, cursor, page);
|
|
12642
12800
|
return [3 /*break*/, 5];
|
|
12643
12801
|
case 3:
|
|
12644
|
-
err_36 =
|
|
12802
|
+
err_36 = _b.sent();
|
|
12645
12803
|
if (generation !== groupPagingGenRef.current)
|
|
12646
12804
|
return [2 /*return*/];
|
|
12647
12805
|
// INFO: clear the in-flight flag so a failed page can be retried on the
|
|
@@ -12663,14 +12821,120 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12663
12821
|
});
|
|
12664
12822
|
}); };
|
|
12665
12823
|
handleFetchGroupNextPageRef.current = handleFetchGroupNextPage;
|
|
12824
|
+
// INFO: appends one band page read from `cursor` to the shared flat rows and
|
|
12825
|
+
// moves that band on past it
|
|
12826
|
+
var handleAppendGroupPage = function (groupKey, cursor, page) {
|
|
12827
|
+
// INFO: append only rows not already present, keeping tableData and
|
|
12828
|
+
// spaceTableData positionally identical
|
|
12829
|
+
var existingIds = new Set(tableDataRef.current.map(function (eachRow) { var _a; return (_a = eachRow.id) !== null && _a !== void 0 ? _a : eachRow._id; }));
|
|
12830
|
+
var appendRaw = [];
|
|
12831
|
+
var appendPretty = [];
|
|
12832
|
+
page.rawRows.forEach(function (eachRow, eachIndex) {
|
|
12833
|
+
var _a;
|
|
12834
|
+
if (existingIds.has((_a = eachRow.id) !== null && _a !== void 0 ? _a : eachRow._id))
|
|
12835
|
+
return;
|
|
12836
|
+
appendRaw.push(eachRow);
|
|
12837
|
+
appendPretty.push(page.prettierRows[eachIndex]);
|
|
12838
|
+
});
|
|
12839
|
+
handleSetListData(tableDataRef.current.concat(appendRaw), spaceTableDataRef.current.concat(appendPretty));
|
|
12840
|
+
var nextCursor = cursor + page.rawRows.length;
|
|
12841
|
+
handleSetGroupPageState(groupKey, {
|
|
12842
|
+
cursor: nextCursor,
|
|
12843
|
+
size: page.count,
|
|
12844
|
+
loadingMore: false,
|
|
12845
|
+
fetched: true,
|
|
12846
|
+
exhausted: page.rawRows.length === 0 || nextCursor >= page.count,
|
|
12847
|
+
});
|
|
12848
|
+
};
|
|
12849
|
+
// INFO: the cards each kanban lane holds, by encoded band key, kept with the
|
|
12850
|
+
// scroll position when a card is opened
|
|
12851
|
+
var handleGetKanbanLaneRows = function () {
|
|
12852
|
+
var laneRows = {};
|
|
12853
|
+
tableDataRef.current.forEach(function (eachRow) {
|
|
12854
|
+
var _a;
|
|
12855
|
+
var laneKey = (0, viewStatePersistence_1.handleEncodeLaneKey)(handleResolveGroupKey(eachRow));
|
|
12856
|
+
laneRows[laneKey] = ((_a = laneRows[laneKey]) !== null && _a !== void 0 ? _a : 0) + 1;
|
|
12857
|
+
});
|
|
12858
|
+
return laneRows;
|
|
12859
|
+
};
|
|
12860
|
+
// INFO: on a return to the board, reads each lane from the cards the first
|
|
12861
|
+
// read gave it back to the cards it held, plus a page in case the opened
|
|
12862
|
+
// card moved down, then restores the position again — the first restore
|
|
12863
|
+
// ran on the board's first page, where a deep card was not yet drawn. Lane
|
|
12864
|
+
// sentinels wait behind it. A fresh read while it runs drops the pages and
|
|
12865
|
+
// leaves the catch-up for the next first read
|
|
12866
|
+
var handleCatchUpKanbanLanes = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
12867
|
+
var savedLaneRows, generation, isComplete, _i, _a, _b, laneKey, savedRows, groupKey, loaded, target, page, err_37, nextKey;
|
|
12868
|
+
return __generator(this, function (_c) {
|
|
12869
|
+
switch (_c.label) {
|
|
12870
|
+
case 0:
|
|
12871
|
+
savedLaneRows = laneCatchUpRef.current;
|
|
12872
|
+
if (!savedLaneRows || groupLoadingKeyRef.current)
|
|
12873
|
+
return [2 /*return*/];
|
|
12874
|
+
laneCatchUpRunningRef.current = true;
|
|
12875
|
+
generation = groupPagingGenRef.current;
|
|
12876
|
+
groupLoadingKeyRef.current = KANBAN_LANE_CATCH_UP_KEY;
|
|
12877
|
+
isComplete = true;
|
|
12878
|
+
_i = 0, _a = Object.entries(savedLaneRows);
|
|
12879
|
+
_c.label = 1;
|
|
12880
|
+
case 1:
|
|
12881
|
+
if (!(_i < _a.length)) return [3 /*break*/, 6];
|
|
12882
|
+
_b = _a[_i], laneKey = _b[0], savedRows = _b[1];
|
|
12883
|
+
groupKey = (0, viewStatePersistence_1.handleDecodeLaneKey)(laneKey);
|
|
12884
|
+
loaded = handleCountLoadedGroupRows(groupKey);
|
|
12885
|
+
target = Math.min(savedRows + limit, viewStatePersistence_1.SCROLL_RESTORE_MAX_ROWS);
|
|
12886
|
+
if (target <= loaded)
|
|
12887
|
+
return [3 /*break*/, 5];
|
|
12888
|
+
handleSetGroupPageState(groupKey, { cursor: loaded, loadingMore: true });
|
|
12889
|
+
_c.label = 2;
|
|
12890
|
+
case 2:
|
|
12891
|
+
_c.trys.push([2, 4, , 5]);
|
|
12892
|
+
return [4 /*yield*/, handleReadGroupPage(groupKey, loaded, target - loaded)];
|
|
12893
|
+
case 3:
|
|
12894
|
+
page = _c.sent();
|
|
12895
|
+
if (!page) {
|
|
12896
|
+
isComplete = false;
|
|
12897
|
+
return [3 /*break*/, 6];
|
|
12898
|
+
}
|
|
12899
|
+
handleAppendGroupPage(groupKey, loaded, page);
|
|
12900
|
+
return [3 /*break*/, 5];
|
|
12901
|
+
case 4:
|
|
12902
|
+
err_37 = _c.sent();
|
|
12903
|
+
if (generation !== groupPagingGenRef.current) {
|
|
12904
|
+
isComplete = false;
|
|
12905
|
+
return [3 /*break*/, 6];
|
|
12906
|
+
}
|
|
12907
|
+
// INFO: the lane pages on by scroll from what it has
|
|
12908
|
+
handleSetGroupPageState(groupKey, { loadingMore: false });
|
|
12909
|
+
return [3 /*break*/, 5];
|
|
12910
|
+
case 5:
|
|
12911
|
+
_i++;
|
|
12912
|
+
return [3 /*break*/, 1];
|
|
12913
|
+
case 6:
|
|
12914
|
+
laneCatchUpRunningRef.current = false;
|
|
12915
|
+
// INFO: a fresh read already emptied the queue for the new list
|
|
12916
|
+
if (!isComplete || generation !== groupPagingGenRef.current)
|
|
12917
|
+
return [2 /*return*/];
|
|
12918
|
+
laneCatchUpRef.current = null;
|
|
12919
|
+
groupLoadingKeyRef.current = null;
|
|
12920
|
+
requestAnimationFrame(function () {
|
|
12921
|
+
return (0, viewStatePersistence_1.handleRestoreScrollPosition)(scrollCaptureRef.current, handleResolveScrollAxis(), handleResolveScrollScope());
|
|
12922
|
+
});
|
|
12923
|
+
nextKey = groupLoadQueueRef.current.shift();
|
|
12924
|
+
if (nextKey)
|
|
12925
|
+
handleFetchGroupNextPageRef.current(nextKey);
|
|
12926
|
+
return [2 /*return*/];
|
|
12927
|
+
}
|
|
12928
|
+
});
|
|
12929
|
+
}); };
|
|
12666
12930
|
// INFO: page mode — swaps ONE group's rows for its page `page`; every other
|
|
12667
12931
|
// group keeps the page it is on
|
|
12668
12932
|
var handleFetchGroupPage = function (groupKey, page) { return __awaiter(void 0, void 0, void 0, function () {
|
|
12669
|
-
var generation, result, keptRaw_1, keptPretty_1, loaded,
|
|
12933
|
+
var generation, result, keptRaw_1, keptPretty_1, loaded, err_38;
|
|
12670
12934
|
return __generator(this, function (_a) {
|
|
12671
12935
|
switch (_a.label) {
|
|
12672
12936
|
case 0:
|
|
12673
|
-
if (!renderCheckGroupPaging() ||
|
|
12937
|
+
if (!renderCheckGroupPaging() || renderCheckGroupScroll())
|
|
12674
12938
|
return [2 /*return*/];
|
|
12675
12939
|
generation = groupPagingGenRef.current;
|
|
12676
12940
|
handleSetGroupPageState(groupKey, { loadingMore: true });
|
|
@@ -12702,7 +12966,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12702
12966
|
});
|
|
12703
12967
|
return [3 /*break*/, 4];
|
|
12704
12968
|
case 3:
|
|
12705
|
-
|
|
12969
|
+
err_38 = _a.sent();
|
|
12706
12970
|
if (generation !== groupPagingGenRef.current)
|
|
12707
12971
|
return [2 /*return*/];
|
|
12708
12972
|
handleSetGroupPageState(groupKey, { loadingMore: false });
|
|
@@ -12713,6 +12977,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12713
12977
|
}); };
|
|
12714
12978
|
// INFO: page mode — after each fresh read every band reads its own first
|
|
12715
12979
|
// page, so each shows its real total and pages on its own
|
|
12980
|
+
var handleResetGroupPaging = function () {
|
|
12981
|
+
groupPagingGenRef.current += 1;
|
|
12982
|
+
groupLoadingKeyRef.current = null;
|
|
12983
|
+
groupLoadQueueRef.current = [];
|
|
12984
|
+
groupPageStateRef.current = {};
|
|
12985
|
+
setGroupPageState({});
|
|
12986
|
+
};
|
|
12716
12987
|
var handleLoadGroupFirstPages = function () {
|
|
12717
12988
|
var _a;
|
|
12718
12989
|
groupPagingGenRef.current += 1;
|
|
@@ -14256,6 +14527,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
14256
14527
|
var kanbanData = renderGridAndListData("", "kanban", kanbanTitle_2, kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.useColumnName);
|
|
14257
14528
|
// INFO: when bareNewDTW is enabled, render NewKanban instead of legacy Kanban
|
|
14258
14529
|
if ((_57 = props.bareSettings) === null || _57 === void 0 ? void 0 : _57.bareNewDTW) {
|
|
14530
|
+
var isLanePaging = renderCheckGroupPaging();
|
|
14259
14531
|
return (
|
|
14260
14532
|
// INFO: the same top spacing as the table, list and grid
|
|
14261
14533
|
react_1.default.createElement("div", { className: "mt-5" },
|
|
@@ -14273,9 +14545,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
14273
14545
|
.filter(function (_a) {
|
|
14274
14546
|
var width = _a[1];
|
|
14275
14547
|
return Number.isFinite(width);
|
|
14276
|
-
})), onResizeLane: handleResizeLane, data: kanbanData, loading: tableLoading, groupBy: groupBy_1, groupId: kanbanTitle_2 !== null && kanbanTitle_2 !== void 0 ? kanbanTitle_2 : "", groupLabel: groupLabel_1.length > 0 ? groupLabel_1 : undefined, nullColumn: nullColumn_1, alertMessage: kanbanData.length === limit
|
|
14548
|
+
})), onResizeLane: handleResizeLane, data: kanbanData, loading: tableLoading, groupBy: groupBy_1, groupId: kanbanTitle_2 !== null && kanbanTitle_2 !== void 0 ? kanbanTitle_2 : "", groupLabel: groupLabel_1.length > 0 ? groupLabel_1 : undefined, nullColumn: nullColumn_1, alertMessage: !isLanePaging && kanbanData.length === limit
|
|
14277
14549
|
? "Data has exceeded limit, please apply filters"
|
|
14278
|
-
: "",
|
|
14550
|
+
: "", onColumnLoadMore: isLanePaging
|
|
14551
|
+
? function (laneId) {
|
|
14552
|
+
return handleFetchGroupNextPage(handleGetKanbanLaneKey(laneId));
|
|
14553
|
+
}
|
|
14554
|
+
: undefined, getColumnStatus: isLanePaging ? handleGetKanbanLaneStatus : undefined, groupCluster: kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.groupCluster, sortBy: (kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.sortBy)
|
|
14279
14555
|
? {
|
|
14280
14556
|
id: kanbanSettings.sortBy,
|
|
14281
14557
|
type: kanbanSettings.sortType,
|