blixify-ui-web 1.2.3 → 1.2.4

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.
Files changed (56) hide show
  1. package/lib/components/action/button/index.d.ts +1 -1
  2. package/lib/components/action/button/index.d.ts.map +1 -1
  3. package/lib/components/action/button/index.js +9 -2
  4. package/lib/components/action/button/index.js.map +1 -1
  5. package/lib/components/action/buttonGroup/index.d.ts +3 -2
  6. package/lib/components/action/buttonGroup/index.d.ts.map +1 -1
  7. package/lib/components/action/buttonGroup/index.js +13 -0
  8. package/lib/components/action/buttonGroup/index.js.map +1 -1
  9. package/lib/components/data/dataTemplate/dataStateModel.d.ts +1 -0
  10. package/lib/components/data/dataTemplate/dataStateModel.d.ts.map +1 -1
  11. package/lib/components/data/dataTemplate/dataStateModel.js.map +1 -1
  12. package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
  13. package/lib/components/data/dataTemplate/index.js +215 -98
  14. package/lib/components/data/dataTemplate/index.js.map +1 -1
  15. package/lib/components/data/dataTemplate/model.d.ts +1 -0
  16. package/lib/components/data/dataTemplate/model.d.ts.map +1 -1
  17. package/lib/components/data/dataTemplate/pagination.d.ts +2 -2
  18. package/lib/components/data/dataTemplate/pagination.d.ts.map +1 -1
  19. package/lib/components/data/dataTemplate/pagination.js +3 -0
  20. package/lib/components/data/dataTemplate/pagination.js.map +1 -1
  21. package/lib/components/data/dataTemplate/spaceModel.d.ts +0 -1
  22. package/lib/components/data/dataTemplate/spaceModel.d.ts.map +1 -1
  23. package/lib/components/data/dataWrapper/index.js +1 -3
  24. package/lib/components/data/dataWrapper/index.js.map +1 -1
  25. package/lib/components/data/testData.d.ts +1 -1
  26. package/lib/components/data/testData.d.ts.map +1 -1
  27. package/lib/components/data/testData.js +2 -2
  28. package/lib/components/data/testData.js.map +1 -1
  29. package/lib/components/data/testSchema.d.ts +6 -6
  30. package/lib/components/data/testSchema.d.ts.map +1 -1
  31. package/lib/components/data/testSchema.js +26 -26
  32. package/lib/components/data/testSchema.js.map +1 -1
  33. package/lib/components/display/grid/index.d.ts +1 -2
  34. package/lib/components/display/grid/index.d.ts.map +1 -1
  35. package/lib/components/display/grid/index.js +6 -13
  36. package/lib/components/display/grid/index.js.map +1 -1
  37. package/lib/components/display/list/index.d.ts +1 -1
  38. package/lib/components/display/list/index.d.ts.map +1 -1
  39. package/lib/components/display/table/index.d.ts +1 -1
  40. package/lib/components/display/table/index.d.ts.map +1 -1
  41. package/lib/components/input/address/index.d.ts.map +1 -1
  42. package/lib/components/input/address/index.js +4 -4
  43. package/lib/components/input/address/index.js.map +1 -1
  44. package/lib/components/input/datePicker/index.d.ts.map +1 -1
  45. package/lib/components/input/datePicker/index.js +9 -5
  46. package/lib/components/input/datePicker/index.js.map +1 -1
  47. package/lib/components/input/select/index.d.ts.map +1 -1
  48. package/lib/components/input/select/index.js +5 -7
  49. package/lib/components/input/select/index.js.map +1 -1
  50. package/lib/components/input/textInput/index.d.ts.map +1 -1
  51. package/lib/components/input/textInput/index.js +4 -4
  52. package/lib/components/input/textInput/index.js.map +1 -1
  53. package/lib/components/input/uploadInput/index.js +3 -3
  54. package/lib/components/input/uploadInput/index.js.map +1 -1
  55. package/lib/tail.css +1 -1
  56. package/package.json +1 -1
@@ -326,6 +326,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
326
326
  var _126 = (0, react_1.useState)(false), offlineModal = _126[0], setOfflineModal = _126[1];
327
327
  var previousType = (0, react_1.useRef)(null);
328
328
  var previousSelectedData = (0, react_1.useRef)(null);
329
+ var scrollSentinelRef = (0, react_1.useRef)(null);
330
+ var scrollSentinelDebounce = (0, react_1.useRef)(false);
329
331
  // INFO: captures the doc exactly as loaded from the server — used by
330
332
  // bareUpsertPartialUpdate to diff only the fields the user actually changed.
331
333
  // Intentionally separate from previousSelectedData, which advances on every
@@ -522,6 +524,45 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
522
524
  /* eslint-disable */
523
525
  }, [props.collectionId]);
524
526
  /* eslint-enable */
527
+ // INFO: scroll-mode auto-pagination. Observes a sentinel below the list;
528
+ // when it enters the viewport we fire handlePagination("next"). End-of-list
529
+ // is per-backend — Firebase relies on cursor presence; non-Firebase uses
530
+ // size returned by the server. Debounce ref prevents repeat fires while a
531
+ // page is in flight; it resets whenever tableData length changes.
532
+ (0, react_1.useEffect)(function () {
533
+ var isScrollMode = renderCheckScrollMode();
534
+ if (!isScrollMode)
535
+ return;
536
+ var sentinel = scrollSentinelRef.current;
537
+ if (!sentinel)
538
+ return;
539
+ if (renderCheckScrollExhausted())
540
+ return;
541
+ var observer = new IntersectionObserver(function (entries) {
542
+ var _a;
543
+ if (((_a = entries[0]) === null || _a === void 0 ? void 0 : _a.isIntersecting) &&
544
+ !scrollSentinelDebounce.current &&
545
+ !tableLoading) {
546
+ scrollSentinelDebounce.current = true;
547
+ handlePagination("next");
548
+ }
549
+ }, { rootMargin: "200px", threshold: 0 });
550
+ observer.observe(sentinel);
551
+ return function () { return observer.disconnect(); };
552
+ /* eslint-disable */
553
+ }, [
554
+ viewType,
555
+ selectedTab,
556
+ tableData.length,
557
+ size,
558
+ cursor,
559
+ tableLoading,
560
+ isFirebase,
561
+ ]);
562
+ /* eslint-enable */
563
+ (0, react_1.useEffect)(function () {
564
+ scrollSentinelDebounce.current = false;
565
+ }, [tableData.length]);
525
566
  //INFO : Change Data Type & ID Refresh
526
567
  (0, react_1.useEffect)(function () {
527
568
  var _a, _b, _c;
@@ -1016,8 +1057,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1016
1057
  };
1017
1058
  var handlePagination = function (value) {
1018
1059
  var _a, _b, _c, _d, _e, _f;
1019
- var isGridScroll = renderCheckGridScroll();
1020
- if (!isFirebase && !isGridScroll) {
1060
+ var isScrollMode = renderCheckScrollMode();
1061
+ if (!isFirebase && !isScrollMode) {
1021
1062
  setTableLoading(true);
1022
1063
  handleSetListData([], []);
1023
1064
  }
@@ -1027,20 +1068,22 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1027
1068
  }
1028
1069
  else {
1029
1070
  if (value === "next") {
1030
- //INFO : Retrieve latest cursor data from Firebase only
1031
- if ((isFirebase || isGridScroll) &&
1071
+ // INFO: cursor advance for Firebase and for scroll-mode append
1072
+ if ((isFirebase || isScrollMode) &&
1032
1073
  cursor &&
1033
1074
  (pageIndex + 1) * limit + 1 > tableData.length) {
1034
1075
  setLastCursor(cursor);
1035
- if (!isGridScroll) {
1076
+ if (!isScrollMode) {
1036
1077
  setTableLoading(true);
1037
1078
  }
1038
1079
  }
1039
- setPageIndex(pageIndex + 1);
1080
+ // INFO: functional updater so rapid observer-driven calls in scroll mode
1081
+ // chain correctly (0 → 1 → 2) instead of all bumping from a stale closure value
1082
+ setPageIndex(function (p) { return p + 1; });
1040
1083
  (_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.onChangePagination) === null || _d === void 0 ? void 0 : _d.call(_c, pageIndex + 1);
1041
1084
  }
1042
1085
  else {
1043
- setPageIndex(pageIndex - 1);
1086
+ setPageIndex(function (p) { return p - 1; });
1044
1087
  (_f = (_e = props.organise) === null || _e === void 0 ? void 0 : _e.onChangePagination) === null || _f === void 0 ? void 0 : _f.call(_e, pageIndex - 1);
1045
1088
  }
1046
1089
  }
@@ -1090,16 +1133,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1090
1133
  }
1091
1134
  };
1092
1135
  var handleGetListData = function (responseData, type, rowId) { return __awaiter(void 0, void 0, void 0, function () {
1093
- var dataList, prettierDataList, clonedTableData, clonedSpaceTableData, dummyPrettierDataList_1, selectedIndex_1, isGridScroll, newTableData, newPrettierTableData, isExists, cursorResp, lastDataId, err_1;
1094
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
1095
- return __generator(this, function (_o) {
1096
- switch (_o.label) {
1136
+ var dataList, prettierDataList, clonedTableData, clonedSpaceTableData, dummyPrettierDataList_1, selectedIndex_1, isScrollMode, newTableData, newPrettierTableData, isExists, cursorResp, lastDataId, err_1;
1137
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
1138
+ return __generator(this, function (_p) {
1139
+ switch (_p.label) {
1097
1140
  case 0:
1098
1141
  dataList = [];
1099
1142
  prettierDataList = [];
1100
- _o.label = 1;
1143
+ _p.label = 1;
1101
1144
  case 1:
1102
- _o.trys.push([1, 6, , 7]);
1145
+ _p.trys.push([1, 6, , 7]);
1103
1146
  clonedTableData = JSON.parse(JSON.stringify(tableData));
1104
1147
  clonedSpaceTableData = JSON.parse(JSON.stringify(spaceTableData));
1105
1148
  if (!(responseData === null || responseData === void 0 ? void 0 : responseData.data)) return [3 /*break*/, 5];
@@ -1116,7 +1159,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1116
1159
  return [3 /*break*/, 4];
1117
1160
  case 2: return [4 /*yield*/, (0, listModule_1.handleListDataBasedOnModel)(responseData === null || responseData === void 0 ? void 0 : responseData.data, props.devSettings, (_c = props.lib) === null || _c === void 0 ? void 0 : _c.axios, structure, (_d = props.organise) === null || _d === void 0 ? void 0 : _d.handleNavigate, ((_e = props.organise) === null || _e === void 0 ? void 0 : _e.viewId) === "general", setActivityModal, setActivityId, isActivityLog ? (_f = props.edit) === null || _f === void 0 ? void 0 : _f.activityLog : undefined, (_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareListActionBtns, (_h = props.edit) === null || _h === void 0 ? void 0 : _h.disabledUpdate)];
1118
1161
  case 3:
1119
- prettierDataList = _o.sent();
1162
+ prettierDataList = _p.sent();
1120
1163
  if (props.groupId) {
1121
1164
  prettierDataList.forEach(function (item, idx) {
1122
1165
  var _a, _b;
@@ -1125,7 +1168,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1125
1168
  }
1126
1169
  });
1127
1170
  }
1128
- _o.label = 4;
1171
+ _p.label = 4;
1129
1172
  case 4:
1130
1173
  (_j = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _j === void 0 ? void 0 : _j.map(function (eachData) {
1131
1174
  if (eachData["_id"]) {
@@ -1135,7 +1178,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1135
1178
  return null;
1136
1179
  });
1137
1180
  dataList = responseData.data;
1138
- _o.label = 5;
1181
+ _p.label = 5;
1139
1182
  case 5:
1140
1183
  if (type === "update" || type === "create") {
1141
1184
  try {
@@ -1160,8 +1203,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1160
1203
  catch (err) { }
1161
1204
  }
1162
1205
  else {
1163
- isGridScroll = renderCheckGridScroll();
1164
- if (!isGridScroll && !isFirebase) {
1206
+ isScrollMode = renderCheckScrollMode();
1207
+ if (!isScrollMode && !isFirebase) {
1165
1208
  handleSetListData(dataList, prettierDataList);
1166
1209
  setSize((_m = responseData.count) !== null && _m !== void 0 ? _m : 0);
1167
1210
  }
@@ -1184,7 +1227,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1184
1227
  handleSetListData(newTableData, newPrettierTableData);
1185
1228
  setSize(newTableData.length);
1186
1229
  cursorResp = responseData.count;
1187
- if (isGridScroll) {
1230
+ if (isScrollMode) {
1188
1231
  if (dataList.length === 0)
1189
1232
  cursorResp = "";
1190
1233
  else {
@@ -1193,11 +1236,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1193
1236
  }
1194
1237
  }
1195
1238
  setCursor(cursorResp);
1239
+ if (isScrollMode && !isFirebase) {
1240
+ setSize((_o = responseData.count) !== null && _o !== void 0 ? _o : 0);
1241
+ }
1196
1242
  }
1197
1243
  }
1198
1244
  return [3 /*break*/, 7];
1199
1245
  case 6:
1200
- err_1 = _o.sent();
1246
+ err_1 = _p.sent();
1201
1247
  return [3 /*break*/, 7];
1202
1248
  case 7:
1203
1249
  setTableLoading(false);
@@ -5334,7 +5380,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
5334
5380
  authList));
5335
5381
  };
5336
5382
  var renderContent = function () {
5337
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24;
5383
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26;
5338
5384
  var isBottom = ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareUpdateActionBottom) ? true : false;
5339
5385
  var tabs = renderTabs();
5340
5386
  var pages = [
@@ -5369,9 +5415,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
5369
5415
  renderBreadcrumb(pages),
5370
5416
  react_1.default.createElement("div", null,
5371
5417
  react_1.default.createElement("div", { className: "flex flex-col justify-between sm:py-2 sm:items-center sm:flex-row" },
5372
- react_1.default.createElement("div", { className: "flex flex-col" },
5373
- react_1.default.createElement("p", { className: "text-xl font-medium" }, props.title),
5374
- react_1.default.createElement("span", { className: "text-sm text-gray-500" }, props.description)),
5418
+ (props.title || props.description) && (react_1.default.createElement("div", { className: "flex flex-col" },
5419
+ props.title && (react_1.default.createElement("p", { className: "text-xl font-medium" }, props.title)),
5420
+ props.description && (react_1.default.createElement("span", { className: "text-sm text-gray-500" }, props.description)))),
5375
5421
  !isBottom && renderActionButtons(props.type))),
5376
5422
  (schemaPresent || ((_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareReadListTabs)) && (react_1.default.createElement(tabs_1.Tabs, { tabs: tabs, selectedId: viewType, linkType: props.linkType, custom: props.custom, onClick: function (id) { return handleSelectTab(id); }, darkMode: (_j = props.organise) === null || _j === void 0 ? void 0 : _j.darkMode })),
5377
5423
  ((_k = props.bareSettings) === null || _k === void 0 ? void 0 : _k.bareReadComponentPos) === "top" &&
@@ -5559,9 +5605,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
5559
5605
  }, offline: (_6 = props.bareSettings) === null || _6 === void 0 ? void 0 : _6.bareOffline, onChangeData: handleRetrieveSelectedData, onError: handleGetItemError })),
5560
5606
  renderBreadcrumb(pages),
5561
5607
  react_1.default.createElement("div", { className: "flex flex-col py-2 sm:items-center sm:flex-row" },
5562
- react_1.default.createElement("div", { className: "flex flex-col w-full" },
5563
- react_1.default.createElement("p", { className: "text-xl font-medium" }, props.title),
5564
- react_1.default.createElement("span", { className: "text-sm text-gray-500" }, props.description)),
5608
+ (props.title || props.description) && (react_1.default.createElement("div", { className: "flex flex-col w-full" },
5609
+ props.title && (react_1.default.createElement("p", { className: "text-xl font-medium" }, props.title)),
5610
+ props.description && (react_1.default.createElement("span", { className: "text-sm text-gray-500" }, props.description)))),
5565
5611
  !isBottom &&
5566
5612
  renderActionButtons(props.type, false, hasTabAlign_1, uniqueTabIds_2)),
5567
5613
  hasTabAlign_1 ? (react_1.default.createElement("div", { className: "w-full ".concat(leftTabAlign
@@ -5637,14 +5683,30 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
5637
5683
  props.renderSettings.renderListUI(actionComponent, filterComponent_1, dataComponent)));
5638
5684
  }
5639
5685
  var renderListFilterElements = function () {
5640
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
5641
- // INFO: When bareListFilterAsPopup is true, filters are shown in a popup instead
5686
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
5687
+ // INFO: When bareListFilterAsPopup is true, filters are shown in a popup instead.
5642
5688
  if ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareListFilterAsPopup)
5643
5689
  return null;
5690
+ // INFO: bareCompactMode keeps the list-view chrome to a single row —
5691
+ // tuck the additionalQuery selectors behind the funnel popup but
5692
+ // render the search input inline (last element of filterComponent
5693
+ // is the Search box from renderSearchFilterComponents). Use a
5694
+ // shrinkable fixed width so the search box stays on the same row
5695
+ // as the action icons at every viewport.
5696
+ if ((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareCompactMode) {
5697
+ if (filterComponent_1 &&
5698
+ Array.isArray(filterComponent_1) &&
5699
+ filterComponent_1.length > 0 &&
5700
+ !((_c = props.organise) === null || _c === void 0 ? void 0 : _c.hideSearch)) {
5701
+ var searchInput = filterComponent_1[filterComponent_1.length - 1];
5702
+ return (react_1.default.createElement("div", { className: "flex-1 sm:flex-none sm:w-64 min-w-0 mr-3" }, searchInput));
5703
+ }
5704
+ return null;
5705
+ }
5644
5706
  var filterElementList = [];
5645
- if (!((_b = props.organise) === null || _b === void 0 ? void 0 : _b.filterComponentNewRow)) {
5646
- if ((_c = props.organise) === null || _c === void 0 ? void 0 : _c.showGroupByFeature) {
5647
- filterElementList.push(react_1.default.createElement(select_1.Select, { label: "Group", options: (_j = (_f = (_e = (_d = props === null || props === void 0 ? void 0 : props.organise) === null || _d === void 0 ? void 0 : _d.renderGroupByOptions) === null || _e === void 0 ? void 0 : _e.call(_d)) !== null && _f !== void 0 ? _f : (_h = (_g = props === null || props === void 0 ? void 0 : props.organise) === null || _g === void 0 ? void 0 : _g.renderReferenceLabelOptions) === null || _h === void 0 ? void 0 : _h.call(_g, props.collectionId, true)) !== null && _j !== void 0 ? _j : [], value: groupId !== null && groupId !== void 0 ? groupId : "", onChange: function (value) { return setGroupId(value); } }));
5707
+ if (!((_d = props.organise) === null || _d === void 0 ? void 0 : _d.filterComponentNewRow)) {
5708
+ if ((_e = props.organise) === null || _e === void 0 ? void 0 : _e.showGroupByFeature) {
5709
+ filterElementList.push(react_1.default.createElement(select_1.Select, { label: "Group", options: (_l = (_h = (_g = (_f = props === null || props === void 0 ? void 0 : props.organise) === null || _f === void 0 ? void 0 : _f.renderGroupByOptions) === null || _g === void 0 ? void 0 : _g.call(_f)) !== null && _h !== void 0 ? _h : (_k = (_j = props === null || props === void 0 ? void 0 : props.organise) === null || _j === void 0 ? void 0 : _j.renderReferenceLabelOptions) === null || _k === void 0 ? void 0 : _k.call(_j, props.collectionId, true)) !== null && _l !== void 0 ? _l : [], value: groupId !== null && groupId !== void 0 ? groupId : "", onChange: function (value) { return setGroupId(value); } }));
5648
5710
  }
5649
5711
  if (filterComponent_1 &&
5650
5712
  Array.isArray(filterComponent_1) &&
@@ -5659,7 +5721,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
5659
5721
  return null;
5660
5722
  };
5661
5723
  var renderListActionElements = function () {
5662
- var _a, _b, _c, _d;
5724
+ var _a, _b, _c, _d, _e, _f, _g;
5663
5725
  var actionElementList = [];
5664
5726
  if (schemaPresent) {
5665
5727
  actionElementList.push(react_1.default.createElement(react_1.default.Fragment, null,
@@ -5677,25 +5739,35 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
5677
5739
  handleRefresh();
5678
5740
  }, bgColor: "bg-white" })));
5679
5741
  }
5680
- if (((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareListFilterAsPopup) &&
5742
+ if ((((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareListFilterAsPopup) ||
5743
+ ((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareCompactMode)) &&
5681
5744
  filterComponent_1 &&
5682
5745
  Array.isArray(filterComponent_1) &&
5683
5746
  filterComponent_1.length > 0) {
5684
- actionElementList.push(react_1.default.createElement(popUp_1.PopUp, { ctaComp: react_1.default.createElement(iconButton_1.IconButton, { icon: react_1.default.createElement(outline_1.FunnelIcon, { className: "h-7 w-7 text-primary-500" }), bgColor: "bg-white" }), renderComp: react_1.default.createElement("div", { className: "shadow-lg p-4 flex flex-col space-y-3 w-[calc(100vw-2rem)] max-w-[320px]" }, filterComponent_1.map(function (filterEl, index) { return (react_1.default.createElement("div", { key: index }, filterEl)); })), anchor: "right", excludePortalIds: ["datepicker-portal"], lib: { Transition: (_b = props === null || props === void 0 ? void 0 : props.lib) === null || _b === void 0 ? void 0 : _b.Transition } }));
5747
+ // INFO: in compact mode, the search input is rendered inline by
5748
+ // renderListFilterElements, so drop the trailing search element
5749
+ // from the popup to avoid duplication.
5750
+ var popupFilters = ((_c = props.bareSettings) === null || _c === void 0 ? void 0 : _c.bareCompactMode) &&
5751
+ !((_d = props.organise) === null || _d === void 0 ? void 0 : _d.hideSearch)
5752
+ ? filterComponent_1.slice(0, -1)
5753
+ : filterComponent_1;
5754
+ if (popupFilters.length > 0) {
5755
+ actionElementList.push(react_1.default.createElement(popUp_1.PopUp, { ctaComp: react_1.default.createElement(iconButton_1.IconButton, { icon: react_1.default.createElement(outline_1.FunnelIcon, { className: "h-7 w-7 text-primary-500" }), bgColor: "bg-white" }), renderComp: react_1.default.createElement("div", { className: "shadow-lg p-4 flex flex-col space-y-3 w-[calc(100vw-2rem)] max-w-[320px]" }, popupFilters.map(function (filterEl, index) { return (react_1.default.createElement("div", { key: index }, filterEl)); })), anchor: "right", excludePortalIds: ["datepicker-portal"], lib: { Transition: (_e = props === null || props === void 0 ? void 0 : props.lib) === null || _e === void 0 ? void 0 : _e.Transition } }));
5756
+ }
5685
5757
  }
5686
5758
  if (!isBottom) {
5687
5759
  var actionBtns = renderActionButtons(props.type);
5688
5760
  if (actionBtns)
5689
5761
  actionElementList.push(actionBtns);
5690
5762
  }
5691
- if (schemaPresent || ((_c = props.organise) === null || _c === void 0 ? void 0 : _c.showExport)) {
5763
+ if (schemaPresent || ((_f = props.organise) === null || _f === void 0 ? void 0 : _f.showExport)) {
5692
5764
  actionElementList.push(react_1.default.createElement(popUp_1.PopUp, { ctaComp: react_1.default.createElement(iconButton_1.IconButton, { className: "bg-primary-100", icon: react_1.default.createElement(solid_1.EllipsisVerticalIcon, { className: "h-7 w-7 text-primary-500" }), bgColor: "bg-white" }), renderComp: react_1.default.createElement("div", { className: "shadow-lg" }, moreButtonPopUp.map(function (eachPopup) { return (
5693
5765
  //TODO: Bug - Crash on Next Js
5694
5766
  // <Menu.Item>
5695
5767
  react_1.default.createElement("span", { className: "block w-40 py-3 text-sm text-center text-gray-700 cursor-pointer hover:bg-gray-100", onClick: eachPopup === null || eachPopup === void 0 ? void 0 : eachPopup.onClick }, eachPopup === null || eachPopup === void 0 ? void 0 : eachPopup.text)
5696
5768
  // </Menu.Item>
5697
5769
  ); })), lib: {
5698
- Transition: (_d = props === null || props === void 0 ? void 0 : props.lib) === null || _d === void 0 ? void 0 : _d.Transition,
5770
+ Transition: (_g = props === null || props === void 0 ? void 0 : props.lib) === null || _g === void 0 ? void 0 : _g.Transition,
5699
5771
  } }));
5700
5772
  }
5701
5773
  if (actionElementList.length > 0) {
@@ -5705,11 +5777,17 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
5705
5777
  return null;
5706
5778
  };
5707
5779
  var renderListNewRowFilterElements = function () {
5708
- var _a, _b, _c, _d, _e, _f, _g;
5780
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
5709
5781
  var filterElementList = [];
5710
- if ((_a = props.organise) === null || _a === void 0 ? void 0 : _a.filterComponentNewRow) {
5782
+ // INFO: bareCompactMode + bareListFilterAsPopup both tuck filters
5783
+ // behind the popup, so skip the new-row render path too.
5784
+ if (((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareListFilterAsPopup) ||
5785
+ ((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareCompactMode)) {
5786
+ return filterElementList;
5787
+ }
5788
+ if ((_c = props.organise) === null || _c === void 0 ? void 0 : _c.filterComponentNewRow) {
5711
5789
  if (props.organise.showGroupByFeature) {
5712
- filterElementList.push(react_1.default.createElement(select_1.Select, { label: "Group", options: (_g = (_d = (_c = (_b = props === null || props === void 0 ? void 0 : props.organise) === null || _b === void 0 ? void 0 : _b.renderGroupByOptions) === null || _c === void 0 ? void 0 : _c.call(_b)) !== null && _d !== void 0 ? _d : (_f = (_e = props === null || props === void 0 ? void 0 : props.organise) === null || _e === void 0 ? void 0 : _e.renderReferenceLabelOptions) === null || _f === void 0 ? void 0 : _f.call(_e, props.collectionId, true)) !== null && _g !== void 0 ? _g : [], value: groupId !== null && groupId !== void 0 ? groupId : "", onChange: function (value) { return setGroupId(value); } }));
5790
+ filterElementList.push(react_1.default.createElement(select_1.Select, { label: "Group", options: (_j = (_f = (_e = (_d = props === null || props === void 0 ? void 0 : props.organise) === null || _d === void 0 ? void 0 : _d.renderGroupByOptions) === null || _e === void 0 ? void 0 : _e.call(_d)) !== null && _f !== void 0 ? _f : (_h = (_g = props === null || props === void 0 ? void 0 : props.organise) === null || _g === void 0 ? void 0 : _g.renderReferenceLabelOptions) === null || _h === void 0 ? void 0 : _h.call(_g, props.collectionId, true)) !== null && _j !== void 0 ? _j : [], value: groupId !== null && groupId !== void 0 ? groupId : "", onChange: function (value) { return setGroupId(value); } }));
5713
5791
  }
5714
5792
  if (filterComponent_1 &&
5715
5793
  Array.isArray(filterComponent_1) &&
@@ -5730,15 +5808,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
5730
5808
  };
5731
5809
  return (react_1.default.createElement(react_1.default.Fragment, null,
5732
5810
  listReadQueryHOC,
5733
- react_1.default.createElement("div", { className: "flex flex-col py-2 md:items-end md:flex-row" },
5734
- react_1.default.createElement("div", { className: "flex flex-col" },
5735
- react_1.default.createElement("p", { className: "text-xl font-medium" }, props.title),
5736
- react_1.default.createElement("span", { className: "text-sm text-gray-500" }, props.description)),
5737
- react_1.default.createElement("div", { className: "grow" }),
5811
+ react_1.default.createElement("div", { className: "flex py-2 ".concat(((_23 = props.bareSettings) === null || _23 === void 0 ? void 0 : _23.bareCompactMode)
5812
+ ? "w-full flex-row items-end"
5813
+ : "flex-col md:items-end md:flex-row") },
5814
+ (props.title || props.description) && (react_1.default.createElement("div", { className: "flex flex-col" },
5815
+ props.title && (react_1.default.createElement("p", { className: "text-xl font-medium" }, props.title)),
5816
+ props.description && (react_1.default.createElement("span", { className: "text-sm text-gray-500" }, props.description)))),
5817
+ react_1.default.createElement("div", { className: ((_24 = props.bareSettings) === null || _24 === void 0 ? void 0 : _24.bareCompactMode)
5818
+ ? "hidden sm:block grow"
5819
+ : "grow" }),
5738
5820
  renderListFilterElements(),
5739
5821
  renderListActionElements()),
5740
5822
  renderListNewRowFilterElements(),
5741
- (schemaPresent || ((_23 = props.bareSettings) === null || _23 === void 0 ? void 0 : _23.bareReadListTabs)) && (react_1.default.createElement(tabs_1.Tabs, { tabs: tabs, selectedId: viewType, linkType: props.linkType, custom: props.custom, onClick: function (id) { return handleSelectTab(id); }, darkMode: (_24 = props.organise) === null || _24 === void 0 ? void 0 : _24.darkMode })),
5823
+ (schemaPresent || ((_25 = props.bareSettings) === null || _25 === void 0 ? void 0 : _25.bareReadListTabs)) && (react_1.default.createElement(tabs_1.Tabs, { tabs: tabs, selectedId: viewType, linkType: props.linkType, custom: props.custom, onClick: function (id) { return handleSelectTab(id); }, darkMode: (_26 = props.organise) === null || _26 === void 0 ? void 0 : _26.darkMode })),
5742
5824
  renderTabContent(tabs, props.type, viewType),
5743
5825
  isBottom && renderActionButtons(props.type, true)));
5744
5826
  default:
@@ -5989,20 +6071,48 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
5989
6071
  });
5990
6072
  return gridData;
5991
6073
  };
5992
- var renderCheckGridScroll = function () {
5993
- var tabs = renderTabs();
5994
- var selectedTabData = tabs.find(function (eachTab) {
5995
- if (eachTab.id === viewType) {
5996
- return eachTab;
5997
- }
5998
- else {
5999
- return null;
6000
- }
6001
- });
6002
- if (selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.infinityScroll)
6003
- return true;
6004
- else
6074
+ // INFO: paginationType is a DTW-level concern, not a per-tab concern.
6075
+ // Set `organise.paginationType` once and it applies to every tab (Table,
6076
+ // List, Feeds, Grid, etc.) inside this DataTemplate.
6077
+ var renderCheckScrollMode = function () {
6078
+ var _a;
6079
+ return ((_a = props.organise) === null || _a === void 0 ? void 0 : _a.paginationType) === "scroll";
6080
+ };
6081
+ var renderResolvedPaginationType = function () {
6082
+ var _a;
6083
+ if ((_a = props.organise) === null || _a === void 0 ? void 0 : _a.paginationType)
6084
+ return props.organise.paginationType;
6085
+ return isFirebase ? "cursor" : "page";
6086
+ };
6087
+ // INFO: post-fetch empty result is treated as exhausted to prevent an infinite
6088
+ // observer re-fire loop (sentinel stays visible against an empty list).
6089
+ var renderCheckScrollExhausted = function () {
6090
+ var hasFetched = !tableLoading;
6091
+ if (isFirebase) {
6092
+ if (!cursor && tableData.length > 0)
6093
+ return true;
6094
+ if (hasFetched && tableData.length === 0)
6095
+ return true;
6005
6096
  return false;
6097
+ }
6098
+ if (size > 0 && tableData.length >= size)
6099
+ return true;
6100
+ if (hasFetched && size === 0 && tableData.length === 0)
6101
+ return true;
6102
+ return false;
6103
+ };
6104
+ var renderScrollSentinel = function () {
6105
+ if (!renderCheckScrollMode())
6106
+ return null;
6107
+ if (renderCheckScrollExhausted())
6108
+ return null;
6109
+ // INFO: only show the append spinner once we already have rows. On the
6110
+ // first load the view's own empty-state spinner is enough — rendering
6111
+ // ours too would mean two spinners on screen at the same time.
6112
+ var showAppendSpinner = tableLoading && tableData.length > 0;
6113
+ return (react_1.default.createElement("div", { className: "w-full flex flex-col items-center py-4" },
6114
+ showAppendSpinner && react_1.default.createElement(loading_1.Loading, null),
6115
+ react_1.default.createElement("div", { ref: scrollSentinelRef, className: "h-1 w-full" })));
6006
6116
  };
6007
6117
  var renderTabs = function () {
6008
6118
  var _a, _b, _c, _d, _e;
@@ -6016,7 +6126,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6016
6126
  if (((_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs) &&
6017
6127
  ((_b = props.organise.extendedTabs) === null || _b === void 0 ? void 0 : _b.length) > 0) {
6018
6128
  (_c = props.organise) === null || _c === void 0 ? void 0 : _c.extendedTabs.map(function (eachTab) {
6019
- var _a, _b, _c, _d, _e, _f;
6129
+ var _a, _b, _c, _d, _e;
6020
6130
  var hrefPoint = "".concat(props.localURLEndpoint, "?type=").concat(props.type, "&collection=").concat(props.collectionId);
6021
6131
  if (props.id)
6022
6132
  hrefPoint += "&data=".concat(props.id);
@@ -6028,11 +6138,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6028
6138
  type: eachTab.type,
6029
6139
  viewType: eachTab.viewType,
6030
6140
  viewImage: eachTab.viewImage,
6031
- infinityScroll: (_a = eachTab.infinityScroll) !== null && _a !== void 0 ? _a : undefined,
6032
- gridContain: (_b = eachTab.gridContain) !== null && _b !== void 0 ? _b : undefined,
6033
- calendarSettings: (_c = eachTab.calendarSettings) !== null && _c !== void 0 ? _c : undefined,
6034
- feedsSettings: (_d = eachTab.feedsSettings) !== null && _d !== void 0 ? _d : undefined,
6035
- mapSettings: (_e = eachTab.mapSettings) !== null && _e !== void 0 ? _e : undefined,
6141
+ gridContain: (_a = eachTab.gridContain) !== null && _a !== void 0 ? _a : undefined,
6142
+ calendarSettings: (_b = eachTab.calendarSettings) !== null && _b !== void 0 ? _b : undefined,
6143
+ feedsSettings: (_c = eachTab.feedsSettings) !== null && _c !== void 0 ? _c : undefined,
6144
+ mapSettings: (_d = eachTab.mapSettings) !== null && _d !== void 0 ? _d : undefined,
6036
6145
  };
6037
6146
  if (eachTab.viewType === "iframe") {
6038
6147
  if (typeof eachTab.src === "string") {
@@ -6046,7 +6155,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6046
6155
  tabData["viewImage"] = eachTab.viewImage;
6047
6156
  }
6048
6157
  if (eachTab.type === props.type) {
6049
- tabs.push(__assign(__assign({}, tabData), (!((_f = props.edit) === null || _f === void 0 ? void 0 : _f.disabledTabsDeleteBtn) && {
6158
+ tabs.push(__assign(__assign({}, tabData), (!((_e = props.edit) === null || _e === void 0 ? void 0 : _e.disabledTabsDeleteBtn) && {
6050
6159
  del: (react_1.default.createElement(outline_1.XMarkIcon, { className: "h-4 w-4 ml-2 self-center text-red-600 hover:text-red-400 ", onClick: function (e) {
6051
6160
  e.stopPropagation();
6052
6161
  e.preventDefault();
@@ -6110,7 +6219,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6110
6219
  react_1.default.createElement("div", { className: "font-semibold text-md mt-5" },
6111
6220
  "Group By ",
6112
6221
  eachKey),
6113
- react_1.default.createElement(table_1.Table, { showId: showId, paginationType: isFirebase ? "cursor" : "page", data: filterTableData, spaceData: dataList !== null && dataList !== void 0 ? dataList : [], size: (_b = dataList.length) !== null && _b !== void 0 ? _b : 0, limit: 5, cursor: "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.disableSelectFullData) === null || _d === void 0 ? void 0 : _d.table, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
6222
+ react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: filterTableData, spaceData: dataList !== null && dataList !== void 0 ? dataList : [], size: (_b = dataList.length) !== null && _b !== void 0 ? _b : 0, limit: 5, cursor: "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.disableSelectFullData) === null || _d === void 0 ? void 0 : _d.table, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
6114
6223
  selectedIds.length > 0 &&
6115
6224
  !((_e = props.edit) === null || _e === void 0 ? void 0 : _e.disabledUpdate) &&
6116
6225
  !((_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
@@ -6192,7 +6301,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6192
6301
  }
6193
6302
  }
6194
6303
  else {
6195
- return (react_1.default.createElement(table_1.Table, { showId: showId, paginationType: isFirebase ? "cursor" : "page", data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.disableSelectFullData) === null || _b === void 0 ? void 0 : _b.table, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
6304
+ return (react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.disableSelectFullData) === null || _b === void 0 ? void 0 : _b.table, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
6196
6305
  selectedIds.length > 0 &&
6197
6306
  !((_c = props.edit) === null || _c === void 0 ? void 0 : _c.disabledUpdate) &&
6198
6307
  !((_d = props.bareSettings) === null || _d === void 0 ? void 0 : _d.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
@@ -6275,7 +6384,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6275
6384
  }
6276
6385
  };
6277
6386
  var renderTabContent = function (tabs, dataType, viewType) {
6278
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
6387
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11;
6279
6388
  var selectedTabData = tabs.find(function (eachTab) {
6280
6389
  if (eachTab.id === viewType) {
6281
6390
  return eachTab;
@@ -6338,6 +6447,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6338
6447
  }
6339
6448
  });
6340
6449
  sortedTabs.forEach(function (eachTab) {
6450
+ var _a, _b;
6341
6451
  var groups = groupedStructures_1[eachTab];
6342
6452
  var sortedGroups = Object.keys(groups).sort(function (a, b) {
6343
6453
  if (a === "Others")
@@ -6348,7 +6458,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6348
6458
  });
6349
6459
  var tabElement = [];
6350
6460
  sortedGroups.forEach(function (eachKey) {
6351
- var _a, _b;
6461
+ var _a, _b, _c;
6352
6462
  var listObjModels = groups[eachKey].filter(function (eachModel) {
6353
6463
  return eachModel.type === "listObject" && !eachModel.hideRead;
6354
6464
  });
@@ -6356,10 +6466,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6356
6466
  if ((Array.isArray(listData) && (listData === null || listData === void 0 ? void 0 : listData.length) > 0) ||
6357
6467
  listObjModels.length > 0) {
6358
6468
  tabElement.push(react_1.default.createElement("div", { key: "section-".concat(eachKey) },
6359
- Array.isArray(listData) && (listData === null || listData === void 0 ? void 0 : listData.length) > 0 && (react_1.default.createElement(detailList_1.DetailList, { model: groups[eachKey], referenceModel: referenceModelSchema, className: "mt-5 bg-white rounded-md", title: eachKey, list: listData, handleReferenceLink: !schemaPresent &&
6360
- ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareReadReferenceView)
6469
+ Array.isArray(listData) && (listData === null || listData === void 0 ? void 0 : listData.length) > 0 && (react_1.default.createElement(detailList_1.DetailList, { model: groups[eachKey], referenceModel: referenceModelSchema, className: "mt-5 bg-white rounded-md", title: eachKey, list: listData, size: ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareCompactMode)
6470
+ ? "compact"
6471
+ : "default", handleReferenceLink: !schemaPresent &&
6472
+ ((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareReadReferenceView)
6361
6473
  ? props.bareSettings.bareReadReferenceView
6362
- : undefined, splitView: (_b = props.organise) === null || _b === void 0 ? void 0 : _b.splitView })),
6474
+ : undefined, splitView: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.splitView })),
6363
6475
  listObjModels.length > 0 && (react_1.default.createElement("div", { className: "px-6" }, renderListObject("read", listObjModels.map(function (eachModel) { return eachModel.id; }))))));
6364
6476
  }
6365
6477
  });
@@ -6379,8 +6491,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6379
6491
  readElement_1.push(react_1.default.createElement("div", { key: "tab-section-".concat(eachTab), ref: function (el) {
6380
6492
  readTabSectionRefs.current[eachTab] = el;
6381
6493
  } },
6382
- hasTabs_1 && (react_1.default.createElement("div", { className: "bg-primary-500 p-4 rounded-lg mt-5" },
6383
- react_1.default.createElement("h2", { className: "text-white text-lg font-semibold" }, eachTab))),
6494
+ hasTabs_1 && (react_1.default.createElement("div", { className: "bg-primary-500 rounded-lg mt-5 ".concat(((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareCompactMode)
6495
+ ? "px-4 py-2"
6496
+ : "p-4") },
6497
+ react_1.default.createElement("h2", { className: "text-white font-semibold ".concat(((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareCompactMode)
6498
+ ? "text-base"
6499
+ : "text-lg") }, eachTab))),
6384
6500
  tabElement,
6385
6501
  allGanttCharts.length > 0 && (react_1.default.createElement("div", { className: "px-6" }, renderGanttChart("read", allGanttCharts.map(function (eachModel) { return eachModel.id; })))),
6386
6502
  allCanvas.length > 0 && (react_1.default.createElement("div", { className: "px-6" }, renderCanvas("read", allCanvas.map(function (eachModel) { return eachModel.id; }))))));
@@ -6422,9 +6538,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6422
6538
  }
6423
6539
  else {
6424
6540
  return (react_1.default.createElement(react_1.default.Fragment, null,
6425
- react_1.default.createElement(detailList_1.DetailList, { model: structure, referenceModel: referenceModelSchema, className: "mt-5 bg-white rounded-md", title: "General Details", list: renderDetailListData(structure), handleReferenceLink: !schemaPresent && ((_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareReadReferenceView)
6541
+ react_1.default.createElement(detailList_1.DetailList, { model: structure, referenceModel: referenceModelSchema, className: "mt-5 bg-white rounded-md", title: "General Details", list: renderDetailListData(structure), size: ((_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareCompactMode) ? "compact" : "default", handleReferenceLink: !schemaPresent && ((_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareReadReferenceView)
6426
6542
  ? props.bareSettings.bareReadReferenceView
6427
- : undefined, splitView: (_h = props.organise) === null || _h === void 0 ? void 0 : _h.splitView }),
6543
+ : undefined, splitView: (_j = props.organise) === null || _j === void 0 ? void 0 : _j.splitView }),
6428
6544
  react_1.default.createElement("div", { className: "mt-8" }, renderListAddress(dataType)),
6429
6545
  react_1.default.createElement("div", { className: "mt-8" }, renderListObject(dataType)),
6430
6546
  react_1.default.createElement("div", { className: "mt-8" }, renderGanttChart(dataType)),
@@ -6433,53 +6549,53 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6433
6549
  }
6434
6550
  }
6435
6551
  else if (selectedTabData) {
6436
- if ((_j = props.bareSettings) === null || _j === void 0 ? void 0 : _j.bareListComponent) {
6552
+ if ((_k = props.bareSettings) === null || _k === void 0 ? void 0 : _k.bareListComponent) {
6437
6553
  return (react_1.default.createElement(react_1.default.Fragment, null,
6438
6554
  props.bareSettings.bareListComponent(tableData, spaceTableData, tableLoading, pageIndex),
6439
- !((_k = props.organise) === null || _k === void 0 ? void 0 : _k.hidePagination) && (react_1.default.createElement(pagination_1.Pagination, { data: tableData, size: size, limit: limit, cursor: cursor, pageIndex: pageIndex, paginationType: isFirebase ? "cursor" : "page", handleUpdatePageIndex: function (value) {
6555
+ !((_l = props.organise) === null || _l === void 0 ? void 0 : _l.hidePagination) && (react_1.default.createElement(pagination_1.Pagination, { data: tableData, size: size, limit: limit, cursor: cursor, pageIndex: pageIndex, paginationType: renderResolvedPaginationType(), handleUpdatePageIndex: function (value) {
6440
6556
  handlePagination(value);
6441
- }, darkMode: (_l = props.organise) === null || _l === void 0 ? void 0 : _l.darkMode, customPaginationSize: customPaginationSize }))));
6557
+ }, darkMode: (_m = props.organise) === null || _m === void 0 ? void 0 : _m.darkMode, customPaginationSize: customPaginationSize }))));
6442
6558
  }
6443
6559
  else if (selectedTabData.viewType === "iframe") {
6444
6560
  if (selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.customComponent) {
6445
6561
  return selectedTabData.customComponent;
6446
6562
  }
6447
6563
  else {
6448
- return (react_1.default.createElement("iframe", { id: "blixify-iframe", className: "w-full mt-5", style: { height: "70vh" }, src: (_m = selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.iframeSrc) !== null && _m !== void 0 ? _m : "", title: (_o = selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.id) !== null && _o !== void 0 ? _o : "", onLoad: props.onLoadIframe }));
6564
+ return (react_1.default.createElement("iframe", { id: "blixify-iframe", className: "w-full mt-5", style: { height: "70vh" }, src: (_o = selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.iframeSrc) !== null && _o !== void 0 ? _o : "", title: (_p = selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.id) !== null && _p !== void 0 ? _p : "", onLoad: props.onLoadIframe }));
6449
6565
  }
6450
6566
  }
6451
6567
  else if (selectedTabData.viewType === "list") {
6452
6568
  return (react_1.default.createElement(react_1.default.Fragment, null,
6453
- react_1.default.createElement(list_1.List, { paginationType: isFirebase ? "cursor" : "page", list: renderGridAndListData(selectedTabData.viewImage, "list"), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: (_q = (_p = props.organise) === null || _p === void 0 ? void 0 : _p.disableSelectFullData) === null || _q === void 0 ? void 0 : _q.list, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? "from filter" : "", multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
6454
- selectedIds.length > 0 && !((_r = props.edit) === null || _r === void 0 ? void 0 : _r.disabledUpdate) && (react_1.default.createElement(react_1.default.Fragment, null,
6569
+ react_1.default.createElement(list_1.List, { paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list"), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: (_r = (_q = props.organise) === null || _q === void 0 ? void 0 : _q.disableSelectFullData) === null || _r === void 0 ? void 0 : _r.list, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? "from filter" : "", multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
6570
+ selectedIds.length > 0 && !((_s = props.edit) === null || _s === void 0 ? void 0 : _s.disabledUpdate) && (react_1.default.createElement(react_1.default.Fragment, null,
6455
6571
  react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Change to Draft", disable: loading, onClick: function () {
6456
6572
  handleBatchDraftData();
6457
6573
  } }),
6458
6574
  react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Clone Items", disable: loading, onClick: function () {
6459
6575
  handleCloneSelectedData();
6460
6576
  } }))),
6461
- ((_s = props.edit) === null || _s === void 0 ? void 0 : _s.deleteBtn) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm text-red-500 hover:text-red-600", text: "Delete", onClick: function () {
6577
+ ((_t = props.edit) === null || _t === void 0 ? void 0 : _t.deleteBtn) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm text-red-500 hover:text-red-600", text: "Delete", onClick: function () {
6462
6578
  handleGenerateDeletePasscode();
6463
6579
  setDeleteModal(true);
6464
6580
  } })),
6465
- !isFirebase && !((_t = props.edit) === null || _t === void 0 ? void 0 : _t.disabledUpdate) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
6581
+ !isFirebase && !((_u = props.edit) === null || _u === void 0 ? void 0 : _u.disabledUpdate) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
6466
6582
  setBatchUpdateModal(true);
6467
6583
  } }))), onClickRow: function (id) {
6468
6584
  var _a, _b;
6469
6585
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
6470
- }, linkType: props.linkType, custom: props.custom, newTabUrl: (_v = (_u = props.newTabUrl) === null || _u === void 0 ? void 0 : _u.default) !== null && _v !== void 0 ? _v : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_x = (_w = props.newTabUrl) === null || _w === void 0 ? void 0 : _w.addons) !== null && _x !== void 0 ? _x : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
6586
+ }, linkType: props.linkType, custom: props.custom, newTabUrl: (_w = (_v = props.newTabUrl) === null || _v === void 0 ? void 0 : _v.default) !== null && _w !== void 0 ? _w : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_y = (_x = props.newTabUrl) === null || _x === void 0 ? void 0 : _x.addons) !== null && _y !== void 0 ? _y : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
6471
6587
  handlePagination(value);
6472
- }, className: "mt-5", hidePagination: (_y = props.organise) === null || _y === void 0 ? void 0 : _y.hidePagination, customPaginationSize: customPaginationSize })));
6588
+ }, className: "mt-5", hidePagination: (_z = props.organise) === null || _z === void 0 ? void 0 : _z.hidePagination, customPaginationSize: customPaginationSize })));
6473
6589
  }
6474
6590
  else if (selectedTabData.viewType === "grid") {
6475
- var isGridScroll = renderCheckGridScroll();
6591
+ var isScrollMode = renderCheckScrollMode();
6476
6592
  return (react_1.default.createElement(react_1.default.Fragment, null,
6477
- react_1.default.createElement(grid_1.Grid, { paginationType: isGridScroll || isFirebase ? "cursor" : "page", data: renderGridAndListData(selectedTabData.viewImage, "grid"), size: size, limit: limit, cursor: cursor, loading: tableLoading, infinityScroll: isGridScroll, horizontalScroll: isGridScroll, pageIndex: pageIndex, onClickData: function (id) {
6593
+ react_1.default.createElement(grid_1.Grid, { paginationType: renderResolvedPaginationType(), data: renderGridAndListData(selectedTabData.viewImage, "grid"), size: size, limit: limit, cursor: cursor, loading: tableLoading, horizontalScroll: isScrollMode, pageIndex: pageIndex, onClickData: function (id) {
6478
6594
  var _a, _b;
6479
6595
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
6480
- }, linkType: props.linkType, custom: props.custom, newTabUrl: (_0 = (_z = props.newTabUrl) === null || _z === void 0 ? void 0 : _z.default) !== null && _0 !== void 0 ? _0 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_2 = (_1 = props.newTabUrl) === null || _1 === void 0 ? void 0 : _1.addons) !== null && _2 !== void 0 ? _2 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
6596
+ }, linkType: props.linkType, custom: props.custom, newTabUrl: (_1 = (_0 = props.newTabUrl) === null || _0 === void 0 ? void 0 : _0.default) !== null && _1 !== void 0 ? _1 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_3 = (_2 = props.newTabUrl) === null || _2 === void 0 ? void 0 : _2.addons) !== null && _3 !== void 0 ? _3 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
6481
6597
  handlePagination(value);
6482
- }, imgContain: selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.gridContain, gridColClassName: (_3 = props.bareSettings) === null || _3 === void 0 ? void 0 : _3.bareListGridColClassName, className: "mt-5", hidePagination: (_4 = props.organise) === null || _4 === void 0 ? void 0 : _4.hidePagination, customPaginationSize: customPaginationSize })));
6598
+ }, imgContain: selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.gridContain, gridColClassName: (_4 = props.bareSettings) === null || _4 === void 0 ? void 0 : _4.bareListGridColClassName, className: "mt-5", hidePagination: (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.hidePagination, customPaginationSize: customPaginationSize })));
6483
6599
  }
6484
6600
  else if (selectedTabData.viewType === "calendar") {
6485
6601
  var calendarSettings_1 = selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.calendarSettings;
@@ -6573,7 +6689,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6573
6689
  }
6574
6690
  return eventAvailabilities;
6575
6691
  };
6576
- return (react_1.default.createElement("div", { className: "mt-4" }, tableLoading ? (react_1.default.createElement(loading_1.Loading, null)) : (react_1.default.createElement(calendar_1.Calendar, { currentDate: calendarTabMonth, calendarView: (_5 = calendarSettings_1 === null || calendarSettings_1 === void 0 ? void 0 : calendarSettings_1.defaultView) !== null && _5 !== void 0 ? _5 : calendarView, handleMonthChange: function (date) {
6692
+ return (react_1.default.createElement("div", { className: "mt-4" }, tableLoading ? (react_1.default.createElement(loading_1.Loading, null)) : (react_1.default.createElement(calendar_1.Calendar, { currentDate: calendarTabMonth, calendarView: (_6 = calendarSettings_1 === null || calendarSettings_1 === void 0 ? void 0 : calendarSettings_1.defaultView) !== null && _6 !== void 0 ? _6 : calendarView, handleMonthChange: function (date) {
6577
6693
  var startOfMonth = (0, dayjs_1.default)(calendarTabMonth).startOf("month");
6578
6694
  var endOfMonth = (0, dayjs_1.default)(calendarTabMonth).endOf("month");
6579
6695
  if (!(0, dayjs_1.default)(date).isBetween(startOfMonth, endOfMonth)) {
@@ -6591,7 +6707,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6591
6707
  else if (selectedTabData.viewType === "feeds") {
6592
6708
  var contentList_1 = [];
6593
6709
  var feedsSettings_1 = selectedTabData.feedsSettings;
6594
- var customFeedsData = (_6 = feedsSettings_1 === null || feedsSettings_1 === void 0 ? void 0 : feedsSettings_1.customFeedsData) === null || _6 === void 0 ? void 0 : _6.call(feedsSettings_1, tableData, spaceTableData);
6710
+ var customFeedsData = (_7 = feedsSettings_1 === null || feedsSettings_1 === void 0 ? void 0 : feedsSettings_1.customFeedsData) === null || _7 === void 0 ? void 0 : _7.call(feedsSettings_1, tableData, spaceTableData);
6595
6711
  if (customFeedsData && customFeedsData.length > 0) {
6596
6712
  customFeedsData.map(function (eachData) {
6597
6713
  var _a, _b, _c, _d;
@@ -6632,11 +6748,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6632
6748
  });
6633
6749
  }
6634
6750
  return (react_1.default.createElement("div", { className: "mt-4" }, tableLoading ? (react_1.default.createElement(loading_1.Loading, null)) : (react_1.default.createElement("div", { className: "p-4 bg-white rounded-lg" },
6635
- react_1.default.createElement(feeds_1.Feeds, { bold: true, content: contentList_1, darkMode: (_7 = props.organise) === null || _7 === void 0 ? void 0 : _7.darkMode }),
6751
+ react_1.default.createElement(feeds_1.Feeds, { bold: true, content: contentList_1, darkMode: (_8 = props.organise) === null || _8 === void 0 ? void 0 : _8.darkMode }),
6636
6752
  react_1.default.createElement("div", { className: "my-10" }),
6637
- contentList_1.length > 0 && !((_8 = props.organise) === null || _8 === void 0 ? void 0 : _8.hidePagination) && (react_1.default.createElement(pagination_1.Pagination, { data: tableData, size: size, limit: limit, cursor: cursor, pageIndex: pageIndex, paginationType: isFirebase ? "cursor" : "page", handleUpdatePageIndex: function (value) {
6753
+ contentList_1.length > 0 && !((_9 = props.organise) === null || _9 === void 0 ? void 0 : _9.hidePagination) && (react_1.default.createElement(pagination_1.Pagination, { data: tableData, size: size, limit: limit, cursor: cursor, pageIndex: pageIndex, paginationType: renderResolvedPaginationType(), handleUpdatePageIndex: function (value) {
6638
6754
  handlePagination(value);
6639
- }, darkMode: (_9 = props.organise) === null || _9 === void 0 ? void 0 : _9.darkMode, customPaginationSize: customPaginationSize }))))));
6755
+ }, darkMode: (_10 = props.organise) === null || _10 === void 0 ? void 0 : _10.darkMode, customPaginationSize: customPaginationSize }))))));
6640
6756
  }
6641
6757
  else if (selectedTabData.viewType === "map") {
6642
6758
  var mapSettings_1 = selectedTabData.mapSettings;
@@ -6735,7 +6851,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6735
6851
  }
6736
6852
  else if (selectedTabData.viewType === "kanban") {
6737
6853
  var kanbanSettings = selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.kanbanSettings;
6738
- var kanbanTitle_2 = (_10 = kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.title) !== null && _10 !== void 0 ? _10 : "";
6854
+ var kanbanTitle_2 = (_11 = kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.title) !== null && _11 !== void 0 ? _11 : "";
6739
6855
  var nullColumn_1 = false;
6740
6856
  var groupBy_1 = [];
6741
6857
  var groupLabel_1 = [];
@@ -7323,6 +7439,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7323
7439
  setActivityModal(false);
7324
7440
  setActivityId("");
7325
7441
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) })),
7326
- renderContent()));
7442
+ renderContent(),
7443
+ renderScrollSentinel()));
7327
7444
  });
7328
7445
  //# sourceMappingURL=index.js.map