blixify-ui-web 1.3.37 → 1.3.39

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":"AAoCA,OAAO,KASN,MAAM,OAAO,CAAC;AA8Hf,OAAO,EAGL,iBAAiB,EAIlB,MAAM,kBAAkB,CAAC;AAsK1B,eAAO,MAAM,qBAAqB,OAAO,CAAC;AA6C1C,eAAO,MAAM,yBAAyB,UAAW,GAAG,YAYnD,CAAC;AAeF,eAAO,MAAM,YAAY,mFAq7jBvB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/index.tsx"],"names":[],"mappings":"AAoCA,OAAO,KASN,MAAM,OAAO,CAAC;AA8Hf,OAAO,EAGL,iBAAiB,EAIlB,MAAM,kBAAkB,CAAC;AAyK1B,eAAO,MAAM,qBAAqB,OAAO,CAAC;AA6C1C,eAAO,MAAM,yBAAyB,UAAW,GAAG,YAYnD,CAAC;AAeF,eAAO,MAAM,YAAY,mFAg+jBvB,CAAC"}
@@ -214,6 +214,9 @@ var handleIsEmptyElement = function (element) {
214
214
  var COMMENT_COUNT_BATCH_MS = 50;
215
215
  // INFO: long enough for the views a closing comments panel saves to land
216
216
  var CLOSED_ROW_RECOUNT_MS = 1500;
217
+ // INFO: how long an in-place refresh that keeps the group totals waits for its
218
+ // rows; past this the next rows recount, as a slow read may not be this one's
219
+ var GROUP_SUMMARY_KEEP_MS = 10000;
217
220
  // INFO: rows-per-page choices offered in the view settings panel
218
221
  var PAGE_LIMIT_OPTIONS = [10, 25, 50, 100];
219
222
  // INFO: the most rows a formula sort or filter reads into the browser; each is
@@ -730,6 +733,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
730
733
  // INFO: the grouped count waiting to go out, so a filter change can stop it
731
734
  // before it sends the filters it was scheduled with
732
735
  var groupSummaryTimerRef = (0, react_1.useRef)(null);
736
+ // INFO: set by an in-place refresh, and read by the count its reloaded rows
737
+ // schedule: "keep" when its changes cannot move any group's total, "count"
738
+ // when they can. A "count" still waiting is never turned into "keep" by a
739
+ // later refresh, and "keep" lapses, so a refresh that brings no new rows
740
+ // never holds back a later change's count
741
+ var groupSummaryRefreshRef = (0, react_1.useRef)(null);
733
742
  var _226 = (0, react_1.useState)({}), commentCounts = _226[0], setCommentCounts = _226[1];
734
743
  var _227 = (0, react_1.useState)({}), commentUnread = _227[0], setCommentUnread = _227[1];
735
744
  // INFO: Monday-board per-group paging. Keyed by the group key that
@@ -1021,8 +1030,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1021
1030
  // saved edit, asks again
1022
1031
  // INFO: per-group paging lands one read per group at first load, so the
1023
1032
  // request waits for the reads to settle and goes once
1033
+ // INFO: a refresh that changed no grouping column, summed column or row
1034
+ // count keeps the totals it has — each count sums every record that matches
1024
1035
  (0, react_1.useEffect)(function () {
1025
- var timer = setTimeout(function () { return handleFetchGroupSummaries(); }, 300);
1036
+ var timer = setTimeout(function () {
1037
+ var refresh = groupSummaryRefreshRef.current;
1038
+ groupSummaryRefreshRef.current = null;
1039
+ if ((refresh === null || refresh === void 0 ? void 0 : refresh.mode) === "keep" &&
1040
+ refresh.groupId === (groupId !== null && groupId !== void 0 ? groupId : "") &&
1041
+ Date.now() < refresh.until)
1042
+ return;
1043
+ handleFetchGroupSummaries();
1044
+ }, 300);
1026
1045
  groupSummaryTimerRef.current = timer;
1027
1046
  return function () { return clearTimeout(timer); };
1028
1047
  /* eslint-disable */
@@ -2007,10 +2026,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2007
2026
  // which is right when the caller wants a clean slate but wrong when it only needs the
2008
2027
  // data reloaded in place — e.g. reflecting a write made in an overlay without bouncing
2009
2028
  // the user back to page 1.
2010
- handleRefreshCurrentPage: function () {
2011
- var _a, _b;
2012
- (_a = listRQueryHocRef.current) === null || _a === void 0 ? void 0 : _a.handleRefresh();
2013
- (_b = readQueryHocRef.current) === null || _b === void 0 ? void 0 : _b.handleRefresh();
2029
+ // INFO: changedFields names the columns a caller knows were changed (a
2030
+ // live update of one record); left out, any column may have changed
2031
+ handleRefreshCurrentPage: function (options) {
2032
+ var _a, _b, _c;
2033
+ var isKept = handleCheckGroupSummaryKept(options === null || options === void 0 ? void 0 : options.changedFields) &&
2034
+ ((_a = groupSummaryRefreshRef.current) === null || _a === void 0 ? void 0 : _a.mode) !== "count";
2035
+ groupSummaryRefreshRef.current = {
2036
+ mode: isKept ? "keep" : "count",
2037
+ groupId: groupId !== null && groupId !== void 0 ? groupId : "",
2038
+ until: Date.now() + GROUP_SUMMARY_KEEP_MS,
2039
+ };
2040
+ (_b = listRQueryHocRef.current) === null || _b === void 0 ? void 0 : _b.handleRefresh();
2041
+ (_c = readQueryHocRef.current) === null || _c === void 0 ? void 0 : _c.handleRefresh();
2014
2042
  },
2015
2043
  handleFormSubmit: handleFormSubmit,
2016
2044
  handleFormCheck: handleFormCheck,
@@ -4811,6 +4839,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
4811
4839
  // clears it. The new read lands new rows, which schedule the next count
4812
4840
  if (groupSummaryTimerRef.current)
4813
4841
  clearTimeout(groupSummaryTimerRef.current);
4842
+ groupSummaryRefreshRef.current = null;
4814
4843
  // INFO: In scroll mode, accumulated rows must be cleared on refresh/filter change
4815
4844
  // so the fresh response replaces stale data instead of being deduped away.
4816
4845
  if (renderCheckScrollMode()) {
@@ -11681,6 +11710,17 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
11681
11710
  })
11682
11711
  .map(function (eachColumn) { return eachColumn.id; });
11683
11712
  };
11713
+ // INFO: totals move only when a row's group or a summed number changes;
11714
+ // a new or removed row reaches here without changedFields
11715
+ var handleCheckGroupSummaryKept = function (changedFields) {
11716
+ if (!changedFields || changedFields.length === 0)
11717
+ return false;
11718
+ var column = handleGetGroupColumn();
11719
+ if (!column)
11720
+ return false;
11721
+ var watchedIds = __spreadArray([column.id], handleGetGroupSumIds(), true);
11722
+ return !changedFields.some(function (eachField) { return watchedIds.includes(eachField); });
11723
+ };
11684
11724
  // INFO: whether the database can sum and count the groups of this list
11685
11725
  var handleCheckGroupAggregatable = function () {
11686
11726
  var _a, _b, _c;