blixify-ui-web 1.2.177 → 1.2.178
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/index.tsx"],"names":[],"mappings":"AAqCA,OAAO,KASN,MAAM,OAAO,CAAC;AAqGf,OAAO,EACL,iBAAiB,EAKlB,MAAM,kBAAkB,CAAC;AAyH1B,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/index.tsx"],"names":[],"mappings":"AAqCA,OAAO,KASN,MAAM,OAAO,CAAC;AAqGf,OAAO,EACL,iBAAiB,EAKlB,MAAM,kBAAkB,CAAC;AAyH1B,eAAO,MAAM,YAAY,mFA+4cvB,CAAC"}
|
|
@@ -569,6 +569,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
569
569
|
var previousSelectedData = (0, react_1.useRef)(null);
|
|
570
570
|
var scrollSentinelRef = (0, react_1.useRef)(null);
|
|
571
571
|
var scrollSentinelDebounce = (0, react_1.useRef)(false);
|
|
572
|
+
// INFO: observer callbacks may already be queued when refresh is requested.
|
|
573
|
+
// Block them synchronously, before React commits the loading/row reset.
|
|
574
|
+
var scrollPaginationPendingRef = (0, react_1.useRef)(true);
|
|
572
575
|
// INFO: a ref, filled in the row click before navigating unmounts the list
|
|
573
576
|
var scrollCaptureRef = (0, react_1.useRef)({
|
|
574
577
|
scrollAnchorId: persistedState === null || persistedState === void 0 ? void 0 : persistedState.scrollAnchorId,
|
|
@@ -1753,16 +1756,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1753
1756
|
// page is in flight; it resets whenever tableData length changes.
|
|
1754
1757
|
(0, react_1.useEffect)(function () {
|
|
1755
1758
|
var isScrollMode = renderCheckScrollMode();
|
|
1756
|
-
if (!isScrollMode)
|
|
1759
|
+
if (!isScrollMode || tableLoading || tableData.length === 0)
|
|
1757
1760
|
return;
|
|
1758
1761
|
var sentinel = scrollSentinelRef.current;
|
|
1759
1762
|
if (!sentinel)
|
|
1760
1763
|
return;
|
|
1761
1764
|
if (renderCheckScrollExhausted())
|
|
1762
1765
|
return;
|
|
1766
|
+
var active = true;
|
|
1763
1767
|
var observer = new IntersectionObserver(function (entries) {
|
|
1764
1768
|
var _a;
|
|
1765
|
-
if (
|
|
1769
|
+
if (active &&
|
|
1770
|
+
!scrollPaginationPendingRef.current &&
|
|
1771
|
+
((_a = entries[0]) === null || _a === void 0 ? void 0 : _a.isIntersecting) &&
|
|
1766
1772
|
!scrollSentinelDebounce.current &&
|
|
1767
1773
|
!tableLoading) {
|
|
1768
1774
|
scrollSentinelDebounce.current = true;
|
|
@@ -1770,7 +1776,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1770
1776
|
}
|
|
1771
1777
|
}, { rootMargin: "200px", threshold: 0 });
|
|
1772
1778
|
observer.observe(sentinel);
|
|
1773
|
-
return function () {
|
|
1779
|
+
return function () {
|
|
1780
|
+
active = false;
|
|
1781
|
+
observer.disconnect();
|
|
1782
|
+
};
|
|
1774
1783
|
/* eslint-disable */
|
|
1775
1784
|
}, [
|
|
1776
1785
|
viewType,
|
|
@@ -2790,6 +2799,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2790
2799
|
var handlePagination = function (value) {
|
|
2791
2800
|
var _a, _b, _c, _d, _e, _f;
|
|
2792
2801
|
var isScrollMode = renderCheckScrollMode();
|
|
2802
|
+
if (isScrollMode) {
|
|
2803
|
+
// INFO: appending must keep existing rows visible. tableLoading replaces
|
|
2804
|
+
// them with skeletons; the synchronous ref alone guards queued callbacks.
|
|
2805
|
+
scrollPaginationPendingRef.current = true;
|
|
2806
|
+
}
|
|
2793
2807
|
if (!isFirebase && !isScrollMode) {
|
|
2794
2808
|
setTableLoading(true);
|
|
2795
2809
|
handleSetListData([], []);
|
|
@@ -3060,12 +3074,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3060
3074
|
err_1 = _l.sent();
|
|
3061
3075
|
return [3 /*break*/, 8];
|
|
3062
3076
|
case 8:
|
|
3077
|
+
// INFO: inline writes update rows too, but do not finish a pending list read.
|
|
3078
|
+
if (!type)
|
|
3079
|
+
scrollPaginationPendingRef.current = false;
|
|
3063
3080
|
setTableLoading(false);
|
|
3064
3081
|
return [2 /*return*/];
|
|
3065
3082
|
}
|
|
3066
3083
|
});
|
|
3067
3084
|
}); };
|
|
3068
3085
|
var handleRefresh = function (open, retainSelectedId) {
|
|
3086
|
+
scrollPaginationPendingRef.current = true;
|
|
3069
3087
|
setTimeout(function () {
|
|
3070
3088
|
handleClearDataByFilter();
|
|
3071
3089
|
if (!retainSelectedId)
|
|
@@ -3168,6 +3186,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3168
3186
|
});
|
|
3169
3187
|
}); };
|
|
3170
3188
|
var handleClearDataByFilter = function (ignore) {
|
|
3189
|
+
scrollPaginationPendingRef.current = true;
|
|
3171
3190
|
if (isFirebase) {
|
|
3172
3191
|
if (ignore) {
|
|
3173
3192
|
if (ignore === "search") {
|