blixify-ui-web 1.2.98 → 1.2.100

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.
@@ -160,6 +160,7 @@ var referenceModal_1 = require("./referenceModal");
160
160
  var settingsModal_1 = require("./settingsModal");
161
161
  var flexFilter_1 = require("../flexFilter");
162
162
  var viewStatePersistence_1 = require("./viewStatePersistence");
163
+ var permissions_1 = require("./permissions");
163
164
  // INFO: builds the notification message for a failed write. Callers must gate on
164
165
  // `err.response` alone, never on a specific status — a catch that only handles 400 shows
165
166
  // the user nothing at all for any other status, so a write silently disappears. A 5xx is
@@ -619,6 +620,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
619
620
  setPersistedSort(value);
620
621
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeSort) === null || _b === void 0 ? void 0 : _b.call(_a, value);
621
622
  };
623
+ var _180 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _180.canUpdateRecord, canInlineUpdate = _180.canInlineUpdate, canSubmitUpdate = _180.canSubmitUpdate, canBatchUpdate = _180.canBatchUpdate, canDeleteRecord = _180.canDeleteRecord;
622
624
  var isEditor = ((_12 = props.edit) === null || _12 === void 0 ? void 0 : _12.allEditable) ? true : false;
623
625
  var isOffline = (_13 = props.bareSettings) === null || _13 === void 0 ? void 0 : _13.bareOffline;
624
626
  // INFO: when bareOfflineNetworkAware is true, the save path is also gated on
@@ -1033,18 +1035,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1033
1035
  persistSaveInitialised.current = true;
1034
1036
  return;
1035
1037
  }
1038
+ var activeFlexFilters = flexFiltersDebounced.filter(function (eachFilter) {
1039
+ return (0, flexFilter_1.isFlexFilterActive)(eachFilter, structure);
1040
+ });
1036
1041
  handleSaveView({
1037
1042
  filterSearchParams: filterSearchParams,
1038
1043
  filterSelection: filterSelection,
1039
1044
  filterReference: filterReference,
1040
1045
  filterReferenceDate: (0, viewStatePersistence_1.serializeDateFilterState)(filterReferenceDate),
1041
- flexFilters: flexFiltersDebounced.some(function (eachFilter) {
1042
- return eachFilter.columnId && eachFilter.operator && eachFilter.value;
1043
- })
1044
- ? flexFiltersDebounced.filter(function (eachFilter) {
1045
- return eachFilter.columnId && eachFilter.operator && eachFilter.value;
1046
- })
1047
- : undefined,
1046
+ flexFilters: activeFlexFilters.length ? activeFlexFilters : undefined,
1048
1047
  sort: persistedSort !== null && persistedSort !== void 0 ? persistedSort : (_a = props.organise) === null || _a === void 0 ? void 0 : _a.sort,
1049
1048
  // INFO: scroll mode always starts from page 0 on reload — persisting
1050
1049
  // a mid-scroll pageIndex would skip rows on next hydration.
@@ -1423,6 +1422,23 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1423
1422
  setLastCursor("");
1424
1423
  setTableLoading(true);
1425
1424
  handleSetListData([], []);
1425
+ /**
1426
+ * INFO: the list is fetched by ReadQueryHoc, which only refetches when its
1427
+ * cond JSON changes. A view switch frequently leaves cond identical — a
1428
+ * kanban tab grouped on a list column adds no query of its own, and the
1429
+ * page/cursor resets above are no-ops when the list was already on page one
1430
+ * — so nothing refetched, tableLoading was never cleared, and the view span
1431
+ * indefinitely on an empty dataset. Ask for the read explicitly.
1432
+ *
1433
+ * Deferred a tick so the resets above are applied first, and left to the
1434
+ * HOC's own inflight guard: an identical request already in flight collapses
1435
+ * into one call plus a single trailing refetch rather than two reads.
1436
+ */
1437
+ var handleRefetchForView = setTimeout(function () {
1438
+ var _a;
1439
+ (_a = listRQueryHocRef.current) === null || _a === void 0 ? void 0 : _a.handleRefresh();
1440
+ }, 0);
1441
+ return function () { return clearTimeout(handleRefetchForView); };
1426
1442
  // eslint-disable-next-line react-hooks/exhaustive-deps
1427
1443
  }, [viewType, resolvedType]);
1428
1444
  (0, react_1.useEffect)(function () {
@@ -1794,21 +1810,21 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1794
1810
  if (!isListView) return [3 /*break*/, 13];
1795
1811
  prettifyRecords = function (records) { return __awaiter(void 0, void 0, void 0, function () {
1796
1812
  var resolved;
1797
- var _a, _b, _c, _d, _e;
1798
- return __generator(this, function (_f) {
1799
- switch (_f.label) {
1813
+ var _a, _b, _c, _d;
1814
+ return __generator(this, function (_e) {
1815
+ switch (_e.label) {
1800
1816
  case 0:
1801
1817
  if (!isOffline) return [3 /*break*/, 2];
1802
1818
  return [4 /*yield*/, handleResolveOfflineReferences(records)];
1803
1819
  case 1:
1804
- resolved = _f.sent();
1820
+ resolved = _e.sent();
1805
1821
  return [2 /*return*/, resolved.map(function (eachData) {
1806
1822
  var _a, _b;
1807
1823
  var tempData = __assign({}, eachData);
1808
- (0, listModule_1.handleDataEditButton)(tempData, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate, (_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareListActionBtns);
1824
+ (0, listModule_1.handleDataEditButton)(tempData, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate, (_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareListActionBtns, undefined, undefined, undefined, !canUpdateRecord);
1809
1825
  return tempData;
1810
1826
  })];
1811
- case 2: return [2 /*return*/, (0, listModule_1.handleListDataBasedOnModel)(records, props.devSettings, (_a = props.lib) === null || _a === void 0 ? void 0 : _a.axios, structure, (_b = props.organise) === null || _b === void 0 ? void 0 : _b.handleNavigate, setActivityModal, setActivityId, isActivityLog ? (_c = props.edit) === null || _c === void 0 ? void 0 : _c.activityLog : undefined, (_d = props.bareSettings) === null || _d === void 0 ? void 0 : _d.bareListActionBtns, (_e = props.edit) === null || _e === void 0 ? void 0 : _e.disabledUpdate, undefined, handleSeedListReferenceOptions)];
1827
+ case 2: return [2 /*return*/, (0, listModule_1.handleListDataBasedOnModel)(records, props.devSettings, (_a = props.lib) === null || _a === void 0 ? void 0 : _a.axios, structure, (_b = props.organise) === null || _b === void 0 ? void 0 : _b.handleNavigate, setActivityModal, setActivityId, isActivityLog ? (_c = props.edit) === null || _c === void 0 ? void 0 : _c.activityLog : undefined, (_d = props.bareSettings) === null || _d === void 0 ? void 0 : _d.bareListActionBtns, !canUpdateRecord, undefined, handleSeedListReferenceOptions)];
1812
1828
  }
1813
1829
  });
1814
1830
  }); };
@@ -2261,15 +2277,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2261
2277
  };
2262
2278
  var handleGetListData = function (responseData, type, rowId) { return __awaiter(void 0, void 0, void 0, function () {
2263
2279
  var dataList, prettierDataList, clonedTableData, clonedSpaceTableData, dummyPrettierDataList_1, resolvedData, selectedIndex_1, isScrollMode, newTableData, newPrettierTableData, isExists, cursorResp, lastDataId, err_1;
2264
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
2265
- return __generator(this, function (_m) {
2266
- switch (_m.label) {
2280
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
2281
+ return __generator(this, function (_l) {
2282
+ switch (_l.label) {
2267
2283
  case 0:
2268
2284
  dataList = [];
2269
2285
  prettierDataList = [];
2270
- _m.label = 1;
2286
+ _l.label = 1;
2271
2287
  case 1:
2272
- _m.trys.push([1, 7, , 8]);
2288
+ _l.trys.push([1, 7, , 8]);
2273
2289
  clonedTableData = __spreadArray([], tableData, true);
2274
2290
  clonedSpaceTableData = __spreadArray([], spaceTableData, true);
2275
2291
  if (!(responseData === null || responseData === void 0 ? void 0 : responseData.data)) return [3 /*break*/, 6];
@@ -2277,19 +2293,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2277
2293
  dummyPrettierDataList_1 = [];
2278
2294
  return [4 /*yield*/, handleResolveOfflineReferences(responseData.data)];
2279
2295
  case 2:
2280
- resolvedData = _m.sent();
2296
+ resolvedData = _l.sent();
2281
2297
  resolvedData.map(function (eachData) {
2282
2298
  var _a, _b;
2283
2299
  var tempData = eachData;
2284
- (0, listModule_1.handleDataEditButton)(tempData, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate, (_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareListActionBtns);
2300
+ (0, listModule_1.handleDataEditButton)(tempData, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate, (_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareListActionBtns, undefined, undefined, undefined, !canUpdateRecord);
2285
2301
  dummyPrettierDataList_1.push(tempData);
2286
2302
  return null;
2287
2303
  });
2288
2304
  prettierDataList = dummyPrettierDataList_1;
2289
2305
  return [3 /*break*/, 5];
2290
- case 3: return [4 /*yield*/, (0, listModule_1.handleListDataBasedOnModel)(responseData === null || responseData === void 0 ? void 0 : responseData.data, props.devSettings, (_b = props.lib) === null || _b === void 0 ? void 0 : _b.axios, structure, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.handleNavigate, setActivityModal, setActivityId, isActivityLog ? (_d = props.edit) === null || _d === void 0 ? void 0 : _d.activityLog : undefined, (_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareListActionBtns, (_f = props.edit) === null || _f === void 0 ? void 0 : _f.disabledUpdate, undefined, handleSeedListReferenceOptions)];
2306
+ case 3: return [4 /*yield*/, (0, listModule_1.handleListDataBasedOnModel)(responseData === null || responseData === void 0 ? void 0 : responseData.data, props.devSettings, (_b = props.lib) === null || _b === void 0 ? void 0 : _b.axios, structure, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.handleNavigate, setActivityModal, setActivityId, isActivityLog ? (_d = props.edit) === null || _d === void 0 ? void 0 : _d.activityLog : undefined, (_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareListActionBtns, !canUpdateRecord, undefined, handleSeedListReferenceOptions)];
2291
2307
  case 4:
2292
- prettierDataList = _m.sent();
2308
+ prettierDataList = _l.sent();
2293
2309
  if (props.groupId) {
2294
2310
  prettierDataList.forEach(function (item, idx) {
2295
2311
  var _a, _b;
@@ -2298,9 +2314,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2298
2314
  }
2299
2315
  });
2300
2316
  }
2301
- _m.label = 5;
2317
+ _l.label = 5;
2302
2318
  case 5:
2303
- (_g = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _g === void 0 ? void 0 : _g.map(function (eachData, eachIndex) {
2319
+ (_f = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _f === void 0 ? void 0 : _f.map(function (eachData, eachIndex) {
2304
2320
  if (eachData["_id"]) {
2305
2321
  eachData["id"] = eachData["_id"];
2306
2322
  delete eachData["_id"];
@@ -2324,7 +2340,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2324
2340
  return null;
2325
2341
  });
2326
2342
  dataList = responseData.data;
2327
- _m.label = 6;
2343
+ _l.label = 6;
2328
2344
  case 6:
2329
2345
  if (type === "update" || type === "create") {
2330
2346
  try {
@@ -2336,12 +2352,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2336
2352
  return null;
2337
2353
  });
2338
2354
  if (selectedIndex_1 > -1) {
2339
- clonedTableData[selectedIndex_1] = (_h = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _h === void 0 ? void 0 : _h[0];
2355
+ clonedTableData[selectedIndex_1] = (_g = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _g === void 0 ? void 0 : _g[0];
2340
2356
  clonedSpaceTableData[selectedIndex_1] = prettierDataList === null || prettierDataList === void 0 ? void 0 : prettierDataList[0];
2341
2357
  }
2342
2358
  }
2343
2359
  else {
2344
- clonedTableData.push((_j = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _j === void 0 ? void 0 : _j[0]);
2360
+ clonedTableData.push((_h = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _h === void 0 ? void 0 : _h[0]);
2345
2361
  clonedSpaceTableData.push(prettierDataList === null || prettierDataList === void 0 ? void 0 : prettierDataList[0]);
2346
2362
  }
2347
2363
  handleSetListData(clonedTableData, clonedSpaceTableData);
@@ -2352,7 +2368,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2352
2368
  isScrollMode = renderCheckScrollMode();
2353
2369
  if (!isScrollMode && !isFirebase) {
2354
2370
  handleSetListData(dataList, prettierDataList);
2355
- setSize((_k = responseData.count) !== null && _k !== void 0 ? _k : 0);
2371
+ setSize((_j = responseData.count) !== null && _j !== void 0 ? _j : 0);
2356
2372
  }
2357
2373
  else {
2358
2374
  newTableData = [];
@@ -2390,13 +2406,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2390
2406
  }
2391
2407
  setCursor(cursorResp);
2392
2408
  if (isScrollMode && !isFirebase) {
2393
- setSize((_l = responseData.count) !== null && _l !== void 0 ? _l : 0);
2409
+ setSize((_k = responseData.count) !== null && _k !== void 0 ? _k : 0);
2394
2410
  }
2395
2411
  }
2396
2412
  }
2397
2413
  return [3 /*break*/, 8];
2398
2414
  case 7:
2399
- err_1 = _m.sent();
2415
+ err_1 = _l.sent();
2400
2416
  return [3 /*break*/, 8];
2401
2417
  case 8:
2402
2418
  setTableLoading(false);
@@ -3984,7 +4000,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3984
4000
  return __generator(this, function (_a) {
3985
4001
  switch (_a.label) {
3986
4002
  case 0:
3987
- _a.trys.push([0, 4, , 5]);
4003
+ if (!canBatchUpdate)
4004
+ return [2 /*return*/];
4005
+ _a.label = 1;
4006
+ case 1:
4007
+ _a.trys.push([1, 5, , 6]);
3988
4008
  setLoading(true);
3989
4009
  return [4 /*yield*/, readServerQuery.call({
3990
4010
  type: "list",
@@ -3997,9 +4017,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3997
4017
  ],
3998
4018
  stopLimit: true,
3999
4019
  })];
4000
- case 1:
4020
+ case 2:
4001
4021
  responseData = _a.sent();
4002
- if (!(responseData === null || responseData === void 0 ? void 0 : responseData.data)) return [3 /*break*/, 3];
4022
+ if (!(responseData === null || responseData === void 0 ? void 0 : responseData.data)) return [3 /*break*/, 4];
4003
4023
  newDataList_1 = [];
4004
4024
  responseData.data.map(function (eachData) {
4005
4025
  var _a;
@@ -4010,16 +4030,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4010
4030
  return [4 /*yield*/, writeServerQuery.call("batchCreate", {
4011
4031
  data: newDataList_1,
4012
4032
  })];
4013
- case 2:
4033
+ case 3:
4014
4034
  res = _a.sent();
4015
4035
  if (res)
4016
4036
  handleRefresh(false, true);
4017
- _a.label = 3;
4018
- case 3: return [3 /*break*/, 5];
4019
- case 4:
4020
- err_15 = _a.sent();
4021
- return [3 /*break*/, 5];
4037
+ _a.label = 4;
4038
+ case 4: return [3 /*break*/, 6];
4022
4039
  case 5:
4040
+ err_15 = _a.sent();
4041
+ return [3 /*break*/, 6];
4042
+ case 6:
4023
4043
  setLoading(false);
4024
4044
  return [2 /*return*/];
4025
4045
  }
@@ -4030,7 +4050,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4030
4050
  return __generator(this, function (_a) {
4031
4051
  switch (_a.label) {
4032
4052
  case 0:
4033
- _a.trys.push([0, 2, , 3]);
4053
+ if (!canBatchUpdate)
4054
+ return [2 /*return*/];
4055
+ _a.label = 1;
4056
+ case 1:
4057
+ _a.trys.push([1, 3, , 4]);
4034
4058
  setLoading(true);
4035
4059
  return [4 /*yield*/, writeServerQuery.call("batchUpdate", {
4036
4060
  query: [
@@ -4044,15 +4068,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4044
4068
  baseDraft: true,
4045
4069
  },
4046
4070
  })];
4047
- case 1:
4071
+ case 2:
4048
4072
  res = _a.sent();
4049
4073
  if (res)
4050
4074
  handleRefresh(false, true);
4051
- return [3 /*break*/, 3];
4052
- case 2:
4053
- err_16 = _a.sent();
4054
- return [3 /*break*/, 3];
4075
+ return [3 /*break*/, 4];
4055
4076
  case 3:
4077
+ err_16 = _a.sent();
4078
+ return [3 /*break*/, 4];
4079
+ case 4:
4056
4080
  setLoading(false);
4057
4081
  return [2 /*return*/];
4058
4082
  }
@@ -4063,14 +4087,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4063
4087
  return __generator(this, function (_a) {
4064
4088
  switch (_a.label) {
4065
4089
  case 0:
4066
- _a.trys.push([0, 7, , 8]);
4090
+ if (!canBatchUpdate)
4091
+ return [2 /*return*/];
4092
+ _a.label = 1;
4093
+ case 1:
4094
+ _a.trys.push([1, 8, , 9]);
4067
4095
  setLoading(true);
4068
4096
  setModalVisible(true);
4069
4097
  model_1 = structure.find(function (eachModel) { return eachModel.id === batchUpdateData.columnId; });
4070
4098
  columnId_1 = batchUpdateData.columnId;
4071
4099
  dataToSubmit_1 = batchUpdateData.columnData;
4072
4100
  isFile = (model_1 === null || model_1 === void 0 ? void 0 : model_1.type) === "image" || (model_1 === null || model_1 === void 0 ? void 0 : model_1.type) === "file";
4073
- if (!(isFile && dataToSubmit_1[columnId_1])) return [3 /*break*/, 2];
4101
+ if (!(isFile && dataToSubmit_1[columnId_1])) return [3 /*break*/, 3];
4074
4102
  return [4 /*yield*/, Promise.all(selectedIds.map(function (eachId) { return __awaiter(void 0, void 0, void 0, function () {
4075
4103
  return __generator(this, function (_a) {
4076
4104
  switch (_a.label) {
@@ -4079,16 +4107,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4079
4107
  }
4080
4108
  });
4081
4109
  }); }))];
4082
- case 1:
4110
+ case 2:
4083
4111
  res = _a.sent();
4084
4112
  if (res) {
4085
4113
  setLoading(false);
4086
4114
  setModalVisible(false);
4087
4115
  setBatchUpdateModal(false);
4088
4116
  }
4089
- return [3 /*break*/, 6];
4090
- case 2:
4091
- if (!(isFile && !dataToSubmit_1[columnId_1])) return [3 /*break*/, 4];
4117
+ return [3 /*break*/, 7];
4118
+ case 3:
4119
+ if (!(isFile && !dataToSubmit_1[columnId_1])) return [3 /*break*/, 5];
4092
4120
  return [4 /*yield*/, Promise.all(selectedIds.map(function (eachId) { return __awaiter(void 0, void 0, void 0, function () {
4093
4121
  var _a, _b, _c;
4094
4122
  return __generator(this, function (_d) {
@@ -4100,10 +4128,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4100
4128
  }
4101
4129
  });
4102
4130
  }); }))];
4103
- case 3:
4104
- _a.sent();
4105
- _a.label = 4;
4106
4131
  case 4:
4132
+ _a.sent();
4133
+ _a.label = 5;
4134
+ case 5:
4107
4135
  updateQuery = renderImpSearchFilterConditions();
4108
4136
  selectAllQuery = updateQuery
4109
4137
  ? updateQuery
@@ -4133,14 +4161,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4133
4161
  batchUpdateConfig["data"] = dataToSubmit_1;
4134
4162
  }
4135
4163
  return [4 /*yield*/, writeServerQuery.call("batchUpdate", batchUpdateConfig)];
4136
- case 5:
4164
+ case 6:
4137
4165
  res = _a.sent();
4138
4166
  if (res) {
4139
4167
  handleRefresh(false, true);
4140
4168
  }
4141
- _a.label = 6;
4142
- case 6: return [3 /*break*/, 8];
4143
- case 7:
4169
+ _a.label = 7;
4170
+ case 7: return [3 /*break*/, 9];
4171
+ case 8:
4144
4172
  err_17 = _a.sent();
4145
4173
  if (err_17.response) {
4146
4174
  setNotification({
@@ -4149,8 +4177,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4149
4177
  msg: handleGetWriteErrorMessage(err_17.response),
4150
4178
  });
4151
4179
  }
4152
- return [3 /*break*/, 8];
4153
- case 8:
4180
+ return [3 /*break*/, 9];
4181
+ case 9:
4154
4182
  setBatchUpdateData({ columnId: "", columnData: {} });
4155
4183
  return [2 /*return*/];
4156
4184
  }
@@ -4193,7 +4221,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4193
4221
  updateDataRes = _g.sent();
4194
4222
  updateDataList = (_b = updateDataRes === null || updateDataRes === void 0 ? void 0 : updateDataRes.data) !== null && _b !== void 0 ? _b : [];
4195
4223
  _loop_1 = function (i) {
4196
- var eachOfflineData, offlineDataId, storedBaseline, serverDoc, preComplete, isUpdate, res, err_19;
4224
+ var eachOfflineData, offlineDataId, storedBaseline, serverDoc, isUpdate, preComplete, res, err_19;
4197
4225
  var _h;
4198
4226
  return __generator(this, function (_j) {
4199
4227
  switch (_j.label) {
@@ -4232,6 +4260,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4232
4260
  if (hasValue)
4233
4261
  dirtyFieldsRef.current.add(key);
4234
4262
  });
4263
+ isUpdate = !!serverDoc;
4235
4264
  if (!((_d = props.bareSettings) === null || _d === void 0 ? void 0 : _d.bareUpdateHandlePreComplete)) return [3 /*break*/, 3];
4236
4265
  return [4 /*yield*/, props.bareSettings.bareUpdateHandlePreComplete(eachOfflineData)];
4237
4266
  case 2:
@@ -4239,9 +4268,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4239
4268
  if (!preComplete)
4240
4269
  return [2 /*return*/, "continue"]; // Skip this item
4241
4270
  _j.label = 3;
4242
- case 3:
4243
- isUpdate = !!serverDoc;
4244
- return [4 /*yield*/, handleSubmitData(undefined, undefined, undefined, eachOfflineData, offlineDataId, isUpdate)];
4271
+ case 3: return [4 /*yield*/, handleSubmitData(undefined, undefined, undefined, eachOfflineData, offlineDataId, isUpdate)];
4245
4272
  case 4:
4246
4273
  res = _j.sent();
4247
4274
  if (!res) return [3 /*break*/, 8];
@@ -4342,6 +4369,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4342
4369
  selectedId = offlineId;
4343
4370
  id = offlineId;
4344
4371
  }
4372
+ // INFO: an explicit list update is a reader-reachable write — an inline
4373
+ // cell or a dragged card — so it must carry the permission that drew that
4374
+ // control. A form or offline submit is the consumer's own call and is not
4375
+ // gated here; the consumer decides whether to render a write form at all.
4376
+ if (type === "update" && !canSubmitUpdate)
4377
+ return [2 /*return*/, ""];
4345
4378
  if (!(isOffline &&
4346
4379
  !(isOfflineNetworkListener && !isNetworkOffline) &&
4347
4380
  !offlineId)) return [3 /*break*/, 2];
@@ -4998,16 +5031,28 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4998
5031
  });
4999
5032
  }); };
5000
5033
  var handleUpdateKanbanChecked = function (id, columnId, value) { return __awaiter(void 0, void 0, void 0, function () {
5034
+ var err_24;
5001
5035
  var _a;
5002
5036
  return __generator(this, function (_b) {
5003
- try {
5004
- writeServerQuery.call("update", {
5005
- id: id,
5006
- data: (_a = {}, _a[columnId] = value, _a),
5007
- });
5037
+ switch (_b.label) {
5038
+ case 0:
5039
+ if (!canInlineUpdate)
5040
+ return [2 /*return*/];
5041
+ _b.label = 1;
5042
+ case 1:
5043
+ _b.trys.push([1, 3, , 4]);
5044
+ return [4 /*yield*/, writeServerQuery.call("update", {
5045
+ id: id,
5046
+ data: (_a = {}, _a[columnId] = value, _a),
5047
+ })];
5048
+ case 2:
5049
+ _b.sent();
5050
+ return [3 /*break*/, 4];
5051
+ case 3:
5052
+ err_24 = _b.sent();
5053
+ return [3 /*break*/, 4];
5054
+ case 4: return [2 /*return*/];
5008
5055
  }
5009
- catch (err) { }
5010
- return [2 /*return*/];
5011
5056
  });
5012
5057
  }); };
5013
5058
  var handleRetrieveSelectedData = function (responseData) { return __awaiter(void 0, void 0, void 0, function () {
@@ -5367,7 +5412,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
5367
5412
  handleUpdateChangeData(clonedData);
5368
5413
  };
5369
5414
  var handleOnChangeSelect = function (id, value) { return __awaiter(void 0, void 0, void 0, function () {
5370
- var _a, data, model, clonedData, refetchReference, currentSchema, allowedWatchedColumnTypes_1, watchedColumns, _i, watchedColumns_1, eachWatched, dependency, referenceRQ, valueRes, err_24;
5415
+ var _a, data, model, clonedData, refetchReference, currentSchema, allowedWatchedColumnTypes_1, watchedColumns, _i, watchedColumns_1, eachWatched, dependency, referenceRQ, valueRes, err_25;
5371
5416
  return __generator(this, function (_b) {
5372
5417
  switch (_b.label) {
5373
5418
  case 0:
@@ -5430,7 +5475,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
5430
5475
  return [3 /*break*/, 3];
5431
5476
  case 6: return [3 /*break*/, 8];
5432
5477
  case 7:
5433
- err_24 = _b.sent();
5478
+ err_25 = _b.sent();
5434
5479
  return [3 /*break*/, 8];
5435
5480
  case 8:
5436
5481
  clonedData[id] = value;
@@ -5508,7 +5553,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
5508
5553
  }
5509
5554
  };
5510
5555
  var handleStepCSV = function () { return __awaiter(void 0, void 0, void 0, function () {
5511
- var csvList_1, _loop_2, _i, _a, _b, eachKey, eachValue, valid_1, errorValue_1, excelFormData, updateFields, response, open_1, err_25;
5556
+ var csvList_1, _loop_2, _i, _a, _b, eachKey, eachValue, valid_1, errorValue_1, excelFormData, updateFields, response, open_1, err_26;
5512
5557
  var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
5513
5558
  return __generator(this, function (_p) {
5514
5559
  switch (_p.label) {
@@ -5655,12 +5700,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
5655
5700
  _p.label = 5;
5656
5701
  case 5: return [3 /*break*/, 7];
5657
5702
  case 6:
5658
- err_25 = _p.sent();
5703
+ err_26 = _p.sent();
5659
5704
  setLoading(false);
5660
5705
  setNotification({
5661
5706
  type: false,
5662
5707
  title: "Import Error",
5663
- msg: err_25.message,
5708
+ msg: err_26.message,
5664
5709
  });
5665
5710
  return [3 /*break*/, 7];
5666
5711
  case 7: return [2 /*return*/];
@@ -5668,7 +5713,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
5668
5713
  });
5669
5714
  }); };
5670
5715
  var handleExportCSVData = function (downloadLinkOnly, printOnly) { return __awaiter(void 0, void 0, void 0, function () {
5671
- var exportQueryList, baseUrl, apiEndpoint, reqData, res, dataList, csvDownloadLink, notificaitonMsg, err_26;
5716
+ var exportQueryList, baseUrl, apiEndpoint, reqData, res, dataList, csvDownloadLink, notificaitonMsg, err_27;
5672
5717
  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;
5673
5718
  return __generator(this, function (_1) {
5674
5719
  switch (_1.label) {
@@ -5742,7 +5787,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
5742
5787
  setExportCSVEmail((_0 = (_z = props.devSettings.currentUser) === null || _z === void 0 ? void 0 : _z.userEmail) !== null && _0 !== void 0 ? _0 : "");
5743
5788
  return [3 /*break*/, 6];
5744
5789
  case 5:
5745
- err_26 = _1.sent();
5790
+ err_27 = _1.sent();
5746
5791
  setNotification({
5747
5792
  type: true,
5748
5793
  title: "Export Failed",
@@ -5798,7 +5843,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
5798
5843
  });
5799
5844
  }); };
5800
5845
  var handleExportReadPDF = function () { return __awaiter(void 0, void 0, void 0, function () {
5801
- var elementToExport, dimensionsConfig, headerConfig_1, isMobile, scale, html2canvasOptions, originalStyles, captureWidth, captureHeight, canvas, pageWidth, pageHeight, orientation_1, pdf, pixelsToMm, elementWidthMm, elementHeightMm, pageSize, margin, headerHeight, imageDataURL, imageWidth_1, imageHeight_1, hasImage, hasText, img_1, err_27, textHeight, usableWidth, imgHeight, usableHeight, currentY, imgX, imgY, imgW, imgH, finalX, textY, textX, heightLeft, page, currentY, imgX, imgY, imgW, imgH, finalX, textY, textX, sourceY, sourceHeight, pageCanvas, ctx, pageData, pdfBlob, err_28;
5846
+ var elementToExport, dimensionsConfig, headerConfig_1, isMobile, scale, html2canvasOptions, originalStyles, captureWidth, captureHeight, canvas, pageWidth, pageHeight, orientation_1, pdf, pixelsToMm, elementWidthMm, elementHeightMm, pageSize, margin, headerHeight, imageDataURL, imageWidth_1, imageHeight_1, hasImage, hasText, img_1, err_28, textHeight, usableWidth, imgHeight, usableHeight, currentY, imgX, imgY, imgW, imgH, finalX, textY, textX, heightLeft, page, currentY, imgX, imgY, imgW, imgH, finalX, textY, textX, sourceY, sourceHeight, pageCanvas, ctx, pageData, pdfBlob, err_29;
5802
5847
  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;
5803
5848
  return __generator(this, function (_4) {
5804
5849
  switch (_4.label) {
@@ -5969,8 +6014,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
5969
6014
  headerHeight = imageHeight_1 + 2;
5970
6015
  return [3 /*break*/, 13];
5971
6016
  case 12:
5972
- err_27 = _4.sent();
5973
- console.error("Failed to load PDF header image:", err_27);
6017
+ err_28 = _4.sent();
6018
+ console.error("Failed to load PDF header image:", err_28);
5974
6019
  console.error("Image source:", headerConfig_1.image.src);
5975
6020
  return [3 /*break*/, 13];
5976
6021
  case 13:
@@ -6111,8 +6156,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6111
6156
  }
6112
6157
  return [3 /*break*/, 17];
6113
6158
  case 15:
6114
- err_28 = _4.sent();
6115
- console.error("PDF export error:", err_28);
6159
+ err_29 = _4.sent();
6160
+ console.error("PDF export error:", err_29);
6116
6161
  setNotification({
6117
6162
  type: false,
6118
6163
  title: "Error",
@@ -6205,7 +6250,6 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6205
6250
  var handleDeleteModal = function () {
6206
6251
  if ((selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.viewType) !== "feeds") {
6207
6252
  if (resolvedType === "read" &&
6208
- isEditor &&
6209
6253
  props.id &&
6210
6254
  props.id !== "new") {
6211
6255
  setDeleteModal(true);
@@ -6454,7 +6498,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6454
6498
  : "".concat(dividerColor, " ").concat(labelColor)), onClick: function () { return handleChangePageLimit(eachOption); } }, eachOption)); })))));
6455
6499
  };
6456
6500
  var renderTableHeader = function () {
6457
- var _a, _b;
6501
+ var _a;
6458
6502
  var tableHeader = [];
6459
6503
  var activeUserHiddenColumnIds = getActiveUserHiddenColumnIds();
6460
6504
  structure.map(function (eachAttribute) {
@@ -6472,8 +6516,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6472
6516
  tableHeader.push(__assign(__assign({}, eachAttribute), { key: eachAttribute.id, title: eachAttribute.name, width: eachAttribute.tableColWidth }));
6473
6517
  return null;
6474
6518
  });
6475
- if (!((_a = props.edit) === null || _a === void 0 ? void 0 : _a.disabledUpdate) ||
6476
- ((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareListMultipleSelectAddtionalActions))
6519
+ if (canUpdateRecord ||
6520
+ ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareListMultipleSelectAddtionalActions))
6477
6521
  tableHeader.push({
6478
6522
  key: "update",
6479
6523
  title: "Update",
@@ -6822,7 +6866,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6822
6866
  return "sticky ".concat(offset, " z-20 -mx-2 ").concat(layout, " rounded-2xl border ").concat(surface, " px-3 py-2 shadow-lg sm:mx-0 sm:px-4");
6823
6867
  };
6824
6868
  var renderStepBar = function (uniqueTabIds) {
6825
- var _a, _b, _c, _d, _e, _f, _g, _h;
6869
+ var _a, _b, _c, _d, _e, _f;
6826
6870
  var hasTabAlign = ((_a = props.organise) === null || _a === void 0 ? void 0 : _a.tabAlign) || ((_b = props.space) === null || _b === void 0 ? void 0 : _b.tabAlign);
6827
6871
  if (resolvedType !== "update")
6828
6872
  return null;
@@ -6858,7 +6902,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6858
6902
  var bareActionComponent = (_e = (_d = (_c = props.bareSettings) === null || _c === void 0 ? void 0 : _c.bareUpdateActionComponent) === null || _d === void 0 ? void 0 : _d.call(_c, selectedData, formRef)) !== null && _e !== void 0 ? _e : undefined;
6859
6903
  var hasCustomActions = !!bareActionComponent && !handleIsEmptyElement(bareActionComponent);
6860
6904
  var hasActions = bareActionComponent ? hasCustomActions : true;
6861
- var showDelete = !!((_f = props.edit) === null || _f === void 0 ? void 0 : _f.deleteBtn) && isEditor && props.id !== "new";
6905
+ var showDelete = canDeleteRecord && props.id !== "new";
6862
6906
  if (!isTabbed && !hasActions && !showDelete)
6863
6907
  return null;
6864
6908
  return (
@@ -6886,7 +6930,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6886
6930
  : "bg-white border border-gray-300 hover:bg-gray-50", icon: react_1.default.createElement(HeroIcons.ChevronRightIcon, { className: "w-5 h-5 ".concat(isLast ? "text-gray-400" : "text-gray-700") }), disabled: isLast, onClick: function () { return handleMoveTab(1); } }))),
6887
6931
  react_1.default.createElement("div", { className: "flex-1" }),
6888
6932
  react_1.default.createElement("div", { className: "flex flex-row items-center gap-2" },
6889
- ((_g = props.edit) === null || _g === void 0 ? void 0 : _g.deleteBtn) && isEditor && props.id !== "new" && (react_1.default.createElement(react_1.default.Fragment, null,
6933
+ canDeleteRecord && props.id !== "new" && (react_1.default.createElement(react_1.default.Fragment, null,
6890
6934
  react_1.default.createElement("div", { className: "sm:hidden" },
6891
6935
  react_1.default.createElement(iconButton_1.IconButton, { testId: "dtw-delete-icon", background: "bg-white border border-red-200 hover:bg-red-50", icon: react_1.default.createElement(HeroIcons.TrashIcon, { className: "w-5 h-5 text-red-600" }), onClick: function () {
6892
6936
  setDeleteModal(true);
@@ -6896,7 +6940,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6896
6940
  setDeleteModal(true);
6897
6941
  } })))),
6898
6942
  hasCustomActions && bareActionComponent,
6899
- !bareActionComponent && ((_h = props.edit) === null || _h === void 0 ? void 0 : _h.enableUpdateDraft) && (react_1.default.createElement(button_1.Button, { id: "dtw-step-save", text: "Save", type: "light", size: "small", onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
6943
+ !bareActionComponent && ((_f = props.edit) === null || _f === void 0 ? void 0 : _f.enableUpdateDraft) && (react_1.default.createElement(button_1.Button, { id: "dtw-step-save", text: "Save", type: "light", size: "small", onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
6900
6944
  return __generator(this, function (_a) {
6901
6945
  switch (_a.label) {
6902
6946
  case 0: return [4 /*yield*/, handleFormSaveDraft()];
@@ -6920,14 +6964,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6920
6964
  // INFO: the read view's floating bar — the same pill as the update form,
6921
6965
  // carrying Update (or the caller's own component), Export PDF and Log
6922
6966
  var renderReadBar = function () {
6923
- var _a, _b, _c, _d, _e, _f, _g, _h;
6967
+ var _a, _b, _c, _d, _e;
6924
6968
  if (resolvedType !== "read")
6925
6969
  return null;
6926
6970
  var bareActionComponent = (_c = (_b = (_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareUpdateActionComponent) === null || _b === void 0 ? void 0 : _b.call(_a, selectedData, formRef)) !== null && _c !== void 0 ? _c : undefined;
6927
6971
  var hasCustomActions = !!bareActionComponent && !handleIsEmptyElement(bareActionComponent);
6928
- var showUpdate = !bareActionComponent && !((_d = props.edit) === null || _d === void 0 ? void 0 : _d.disabledUpdate);
6929
- var showExport = !!((_f = (_e = props.organise) === null || _e === void 0 ? void 0 : _e.exportSettings) === null || _f === void 0 ? void 0 : _f.enableExportReadPDF);
6930
- var showDelete = !!((_g = props.edit) === null || _g === void 0 ? void 0 : _g.deleteBtn) && isEditor && props.id !== "new";
6972
+ var showUpdate = !bareActionComponent && canUpdateRecord;
6973
+ var showExport = !!((_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.exportSettings) === null || _e === void 0 ? void 0 : _e.enableExportReadPDF);
6974
+ var showDelete = canDeleteRecord && props.id !== "new";
6931
6975
  if (!hasCustomActions &&
6932
6976
  !showUpdate &&
6933
6977
  !showExport &&
@@ -6935,7 +6979,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6935
6979
  !showDelete)
6936
6980
  return null;
6937
6981
  return (react_1.default.createElement("div", { "data-testid": "dtw-read-bar", className: handleActionBarClassName(true) },
6938
- ((_h = props.edit) === null || _h === void 0 ? void 0 : _h.deleteBtn) && isEditor && props.id !== "new" && (react_1.default.createElement(react_1.default.Fragment, null,
6982
+ canDeleteRecord && props.id !== "new" && (react_1.default.createElement(react_1.default.Fragment, null,
6939
6983
  react_1.default.createElement("div", { className: "sm:hidden" },
6940
6984
  react_1.default.createElement(iconButton_1.IconButton, { testId: "dtw-delete-icon", background: "bg-white border border-red-200 hover:bg-red-50", icon: react_1.default.createElement(HeroIcons.TrashIcon, { className: "w-5 h-5 text-red-600" }), onClick: function () {
6941
6985
  setDeleteModal(true);
@@ -7474,11 +7518,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7474
7518
  var filterComponent_1 = renderSearchContent();
7475
7519
  var dataComponent = renderTabContent(tabs, resolvedType, viewType);
7476
7520
  var actionComponent = renderActionButtons(resolvedType);
7477
- // INFO: Active flex filter count — used by both the filter icon badge and floating search bar
7521
+ // INFO: active flex filter count for the icon badge + floating search.
7522
+ // Counts query output so the badge matches what's actually filtered.
7478
7523
  var activeFlexFilterCount_1 = ((_27 = props.bareSettings) === null || _27 === void 0 ? void 0 : _27.bareFlexFilters)
7479
- ? flexFilters.filter(function (eachFilter) {
7480
- return eachFilter.columnId && eachFilter.operator && eachFilter.value;
7481
- }).length
7524
+ ? (0, listModule_1.renderFlexFilterConditions)(flexFilters, structure).length
7482
7525
  : 0;
7483
7526
  var listReadQueryHOC = (react_1.default.createElement(readQueryHoc_1.ReadQueryHoc, { ref: listRQueryHocRef, database: {
7484
7527
  dbModule: dbModule,
@@ -7808,11 +7851,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7808
7851
  }, { signing: signatureSigning, setSigning: setSignatureSigning }, props.onComplete ? true : false, (_j = props.bareSettings) === null || _j === void 0 ? void 0 : _j.bareOffline, (_l = (_k = props.bareSettings) === null || _k === void 0 ? void 0 : _k.bareUpdateColumnType) !== null && _l !== void 0 ? _l : "two", (_m = props.bareSettings) === null || _m === void 0 ? void 0 : _m.bareUpdateIndividualComponent, (_o = props.bareSettings) === null || _o === void 0 ? void 0 : _o.bareUpdateMobileView);
7809
7852
  };
7810
7853
  var renderGridAndListData = function (imageTag, type, kanbanGroupId, useColumnName) {
7811
- var _a, _b;
7812
7854
  var gridData = [];
7813
7855
  var isKanban = (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.viewType) === "kanban";
7814
- var isListEditable = (_a = props.edit) === null || _a === void 0 ? void 0 : _a.listEditable;
7815
- var disableUpdate = (_b = props.edit) === null || _b === void 0 ? void 0 : _b.disabledUpdate;
7856
+ var isListEditable = canInlineUpdate;
7816
7857
  var activeUserHiddenColumnIds = getActiveUserHiddenColumnIds();
7817
7858
  var titleKey = "";
7818
7859
  // INFO: titleModel ignores user hides so the card title stays stable
@@ -7870,8 +7911,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7870
7911
  if (isKanban &&
7871
7912
  isListEditable &&
7872
7913
  selectedModel.type === "boolean" &&
7873
- selectedModel.enableCheckbox &&
7874
- !disableUpdate) {
7914
+ selectedModel.enableCheckbox) {
7875
7915
  return null;
7876
7916
  }
7877
7917
  if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.showBaseUpdatedAt) && eachKey === "baseUpdatedAt") {
@@ -7919,8 +7959,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7919
7959
  });
7920
7960
  if (booleanModels.length &&
7921
7961
  isKanban &&
7922
- isListEditable &&
7923
- !disableUpdate) {
7962
+ isListEditable) {
7924
7963
  booleanModels.map(function (eachModel) {
7925
7964
  return listDescArray.push(react_1.default.createElement("div", { className: "flex space-x-1 items-center", key: "kanban-checkbox-".concat(eachModel.id) },
7926
7965
  react_1.default.createElement("p", null,
@@ -8204,7 +8243,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8204
8243
  return groups;
8205
8244
  };
8206
8245
  var renderGroupTable = function (multipleSelect) {
8207
- 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, _27, _28, _29, _30, _31, _32, _33, _34, _35;
8246
+ 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, _27;
8208
8247
  if (groupId && !((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareNewDTW)) {
8209
8248
  var groupAttributeDS_1 = structure.find(function (eachDS) { return eachDS.id === groupId; });
8210
8249
  var groupedSpaceTableData = spaceTableData.reduce(function (acc, eachData) {
@@ -8232,7 +8271,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8232
8271
  }
8233
8272
  else {
8234
8273
  return Object.entries(groupedSpaceTableData).map(function (_a) {
8235
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
8274
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
8236
8275
  var eachKey = _a[0], eachValue = _a[1];
8237
8276
  var dataList = eachValue;
8238
8277
  var ids = (dataList === null || dataList === void 0 ? void 0 : dataList.map(function (eachData) { return eachData._id; })) || [];
@@ -8245,23 +8284,23 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8245
8284
  eachKey),
8246
8285
  react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: filterTableData, spaceData: dataList !== null && dataList !== void 0 ? dataList : [], referencesOptions: listReferencesOptions, 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" },
8247
8286
  selectedIds.length > 0 &&
8248
- !((_e = props.edit) === null || _e === void 0 ? void 0 : _e.disabledUpdate) &&
8249
- !((_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
8287
+ canBatchUpdate &&
8288
+ !((_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
8250
8289
  react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Change to Draft", disable: loading, onClick: function () {
8251
8290
  handleBatchDraftData();
8252
8291
  } }),
8253
8292
  react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Clone Items", disable: loading, onClick: function () {
8254
8293
  handleCloneSelectedData();
8255
8294
  } }))),
8256
- ((_g = props.edit) === null || _g === void 0 ? void 0 : _g.deleteBtn) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm text-red-500 hover:text-red-600", text: "Delete", onClick: function () {
8295
+ canDeleteRecord && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm text-red-500 hover:text-red-600", text: "Delete", onClick: function () {
8257
8296
  handleGenerateDeletePasscode();
8258
8297
  setDeleteModal(true);
8259
8298
  } })),
8260
- !isFirebase && !((_h = props.edit) === null || _h === void 0 ? void 0 : _h.disableBatchUpdate) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
8299
+ !isFirebase && canBatchUpdate && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
8261
8300
  setBatchUpdateModal(true);
8262
8301
  } })),
8263
- ((_j = props.bareSettings) === null || _j === void 0 ? void 0 : _j.bareListMultipleSelectAddtionalActions) &&
8264
- ((_l = (_k = props.bareSettings) === null || _k === void 0 ? void 0 : _k.bareListMultipleSelectAddtionalActions) === null || _l === void 0 ? void 0 : _l.map(function (eachButton) {
8302
+ ((_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareListMultipleSelectAddtionalActions) &&
8303
+ ((_h = (_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareListMultipleSelectAddtionalActions) === null || _h === void 0 ? void 0 : _h.map(function (eachButton) {
8265
8304
  return (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm ".concat(eachButton.className), text: eachButton.text, onClick: function () {
8266
8305
  var _a, _b;
8267
8306
  (_a = eachButton.onClick) === null || _a === void 0 ? void 0 : _a.call(eachButton, selectedIds, selectAll, (_b = renderImpSearchFilterConditions()) !== null && _b !== void 0 ? _b : []);
@@ -8269,15 +8308,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8269
8308
  }))), handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, header: renderTableHeader(), onClickRow: function (id) {
8270
8309
  var _a, _b;
8271
8310
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
8272
- }, linkType: props.linkType, custom: props.custom, newTabUrl: (_o = (_m = props.newTabUrl) === null || _m === void 0 ? void 0 : _m.default) !== null && _o !== void 0 ? _o : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_q = (_p = props.newTabUrl) === null || _p === void 0 ? void 0 : _p.addons) !== null && _q !== void 0 ? _q : "&type=read&collection=".concat(props.collectionId, "&view=general"), className: "mt-5", lib: { axios: (_r = props.lib) === null || _r === void 0 ? void 0 : _r.axios }, devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_s = props.organise) === null || _s === void 0 ? void 0 : _s.fixedPagination, advSettings: {
8273
- addColumnEnabled: (_t = props.organise) === null || _t === void 0 ? void 0 : _t.addColumnEnabled,
8311
+ }, linkType: props.linkType, custom: props.custom, newTabUrl: (_k = (_j = props.newTabUrl) === null || _j === void 0 ? void 0 : _j.default) !== null && _k !== void 0 ? _k : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_m = (_l = props.newTabUrl) === null || _l === void 0 ? void 0 : _l.addons) !== null && _m !== void 0 ? _m : "&type=read&collection=".concat(props.collectionId, "&view=general"), className: "mt-5", lib: { axios: (_o = props.lib) === null || _o === void 0 ? void 0 : _o.axios }, devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_p = props.organise) === null || _p === void 0 ? void 0 : _p.fixedPagination, advSettings: {
8312
+ addColumnEnabled: (_q = props.organise) === null || _q === void 0 ? void 0 : _q.addColumnEnabled,
8274
8313
  renderAddColumnElements: renderAddMathColumn,
8275
8314
  dragEnabled: isViewSettingsEnabled,
8276
8315
  sortEnabled: isViewSettingsEnabled,
8277
8316
  // INFO: per-column header filter is replaced by the flex filters
8278
8317
  filterEnabled: false,
8279
8318
  sortId: activeSortId,
8280
- sortOptions: (_w = (_v = (_u = props.organise) === null || _u === void 0 ? void 0 : _u.renderReferenceLabelOptions) === null || _v === void 0 ? void 0 : _v.call(_u)) !== null && _w !== void 0 ? _w : (isViewSettingsEnabled
8319
+ sortOptions: (_t = (_s = (_r = props.organise) === null || _r === void 0 ? void 0 : _r.renderReferenceLabelOptions) === null || _s === void 0 ? void 0 : _s.call(_r)) !== null && _t !== void 0 ? _t : (isViewSettingsEnabled
8281
8320
  ? getViewSettingsColumns().map(function (eachColumn) {
8282
8321
  var _a;
8283
8322
  return ({
@@ -8306,9 +8345,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8306
8345
  return renderSearchContent(newQuery);
8307
8346
  },
8308
8347
  }, editable: {
8309
- active: ((_x = props.edit) === null || _x === void 0 ? void 0 : _x.listEditable) && !props.edit.disabledUpdate
8310
- ? true
8311
- : false,
8348
+ active: canInlineUpdate ? true : false,
8312
8349
  onUpdateData: function (rowId, columnId, data) { return __awaiter(void 0, void 0, void 0, function () {
8313
8350
  return __generator(this, function (_a) {
8314
8351
  switch (_a.label) {
@@ -8320,7 +8357,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8320
8357
  });
8321
8358
  }); },
8322
8359
  }, onObjectEdit: handleObjectCellEdit, addable: {
8323
- active: ((_y = props.edit) === null || _y === void 0 ? void 0 : _y.listAddable) ? true : false,
8360
+ active: ((_u = props.edit) === null || _u === void 0 ? void 0 : _u.listAddable) ? true : false,
8324
8361
  onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
8325
8362
  return __generator(this, function (_a) {
8326
8363
  switch (_a.label) {
@@ -8331,15 +8368,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8331
8368
  }
8332
8369
  });
8333
8370
  }); },
8334
- }, darkMode: (_z = props.organise) === null || _z === void 0 ? void 0 : _z.darkMode, hidePagination: true, disableEllipsisOnLongWord: (_0 = props.organise) === null || _0 === void 0 ? void 0 : _0.disableEllipsisOnLongWord })));
8371
+ }, darkMode: (_v = props.organise) === null || _v === void 0 ? void 0 : _v.darkMode, hidePagination: true, disableEllipsisOnLongWord: (_w = props.organise) === null || _w === void 0 ? void 0 : _w.disableEllipsisOnLongWord })));
8335
8372
  });
8336
8373
  }
8337
8374
  }
8338
8375
  else {
8339
8376
  // INFO: when bareNewDTW is enabled, render NewTable instead of legacy Table
8340
8377
  if ((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareNewDTW) {
8341
- return (react_1.default.createElement(newTable_1.NewTable, { darkModeBg: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkModeBg, showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], referencesOptions: listReferencesOptions, groups: handleBuildNewTableGroups(), 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: (_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.disableSelectFullData) === null || _e === void 0 ? void 0 : _e.table, maxSelectedCount: (_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareListMaxSelectedCount, mobileView: (_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareListMobileView, mobileTooltip: (_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareMobileTooltip, multiActionFloatingBtns: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], (!((_j = props.edit) === null || _j === void 0 ? void 0 : _j.disabledUpdate) &&
8342
- !((_k = props.bareSettings) === null || _k === void 0 ? void 0 : _k.bareHideTableExtraMultipleAction)
8378
+ return (react_1.default.createElement(newTable_1.NewTable, { darkModeBg: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkModeBg, showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], referencesOptions: listReferencesOptions, groups: handleBuildNewTableGroups(), 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: (_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.disableSelectFullData) === null || _e === void 0 ? void 0 : _e.table, maxSelectedCount: (_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareListMaxSelectedCount, mobileView: (_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareListMobileView, mobileTooltip: (_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareMobileTooltip, multiActionFloatingBtns: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], (canBatchUpdate &&
8379
+ !((_j = props.bareSettings) === null || _j === void 0 ? void 0 : _j.bareHideTableExtraMultipleAction)
8343
8380
  ? [
8344
8381
  {
8345
8382
  id: "draft",
@@ -8354,7 +8391,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8354
8391
  hide: selectedIds.length === 0,
8355
8392
  },
8356
8393
  ]
8357
- : []), true), (((_l = props.edit) === null || _l === void 0 ? void 0 : _l.deleteBtn)
8394
+ : []), true), (canDeleteRecord
8358
8395
  ? [
8359
8396
  {
8360
8397
  id: "delete",
@@ -8365,7 +8402,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8365
8402
  },
8366
8403
  },
8367
8404
  ]
8368
- : []), true), (!isFirebase && !((_m = props.edit) === null || _m === void 0 ? void 0 : _m.disableBatchUpdate)
8405
+ : []), true), (!isFirebase && canBatchUpdate
8369
8406
  ? [
8370
8407
  {
8371
8408
  id: "update",
@@ -8373,7 +8410,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8373
8410
  onClick: function () { return setBatchUpdateModal(true); },
8374
8411
  },
8375
8412
  ]
8376
- : []), true), (((_o = props.bareSettings) === null || _o === void 0 ? void 0 : _o.bareListMultipleSelectAddtionalActions)
8413
+ : []), true), (((_k = props.bareSettings) === null || _k === void 0 ? void 0 : _k.bareListMultipleSelectAddtionalActions)
8377
8414
  ? props.bareSettings.bareListMultipleSelectAddtionalActions.map(function (eachButton) { return ({
8378
8415
  id: "dt-list-multi-action-btn-" + eachButton.text,
8379
8416
  btnText: eachButton.text,
@@ -8382,37 +8419,37 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8382
8419
  return (_a = eachButton.onClick) === null || _a === void 0 ? void 0 : _a.call(eachButton, selectedIds, selectAll, (_b = renderImpSearchFilterConditions()) !== null && _b !== void 0 ? _b : []);
8383
8420
  },
8384
8421
  }); })
8385
- : []), true), multiActionFloatingOffset: (_p = props.bareSettings) === null || _p === void 0 ? void 0 : _p.bareListFloatingActionOffset, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, header: renderTableHeader(), pageIndex: pageIndex !== null && pageIndex !== void 0 ? pageIndex : 0, onClickRow: function (id) {
8422
+ : []), true), multiActionFloatingOffset: (_l = props.bareSettings) === null || _l === void 0 ? void 0 : _l.bareListFloatingActionOffset, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, header: renderTableHeader(), pageIndex: pageIndex !== null && pageIndex !== void 0 ? pageIndex : 0, onClickRow: function (id) {
8386
8423
  var _a, _b;
8387
8424
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
8388
- }, linkType: props.linkType, custom: props.custom, newTabUrl: (_r = (_q = props.newTabUrl) === null || _q === void 0 ? void 0 : _q.default) !== null && _r !== void 0 ? _r : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_t = (_s = props.newTabUrl) === null || _s === void 0 ? void 0 : _s.addons) !== null && _t !== void 0 ? _t : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
8425
+ }, linkType: props.linkType, custom: props.custom, newTabUrl: (_o = (_m = props.newTabUrl) === null || _m === void 0 ? void 0 : _m.default) !== null && _o !== void 0 ? _o : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_q = (_p = props.newTabUrl) === null || _p === void 0 ? void 0 : _p.addons) !== null && _q !== void 0 ? _q : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
8389
8426
  handlePagination(value);
8390
- }, className: "mt-5", devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_u = props.organise) === null || _u === void 0 ? void 0 : _u.fixedPagination, advSettings: {
8427
+ }, className: "mt-5", devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_r = props.organise) === null || _r === void 0 ? void 0 : _r.fixedPagination, advSettings: {
8391
8428
  // INFO: bareAddColumns routes the + to the name/type popup; without
8392
8429
  // it the flag behaves as it always did and opens the formula builder
8393
- flat: (_v = props.bareSettings) === null || _v === void 0 ? void 0 : _v.bareFlatTable,
8394
- addColumnEnabled: ((_w = props.bareSettings) === null || _w === void 0 ? void 0 : _w.bareAddColumns) ||
8395
- ((_x = props.organise) === null || _x === void 0 ? void 0 : _x.addColumnEnabled),
8396
- onAddColumn: ((_y = props.bareSettings) === null || _y === void 0 ? void 0 : _y.bareAddColumns)
8430
+ flat: (_s = props.bareSettings) === null || _s === void 0 ? void 0 : _s.bareFlatTable,
8431
+ addColumnEnabled: ((_t = props.bareSettings) === null || _t === void 0 ? void 0 : _t.bareAddColumns) ||
8432
+ ((_u = props.organise) === null || _u === void 0 ? void 0 : _u.addColumnEnabled),
8433
+ onAddColumn: ((_v = props.bareSettings) === null || _v === void 0 ? void 0 : _v.bareAddColumns)
8397
8434
  ? handleAddPlainColumn
8398
8435
  : undefined,
8399
- onDeleteColumn: ((_z = props.bareSettings) === null || _z === void 0 ? void 0 : _z.bareAddColumns)
8436
+ onDeleteColumn: ((_w = props.bareSettings) === null || _w === void 0 ? void 0 : _w.bareAddColumns)
8400
8437
  ? handleDeletePlainColumn
8401
8438
  : undefined,
8402
- renderAddColumnElements: ((_0 = props.bareSettings) === null || _0 === void 0 ? void 0 : _0.bareAddColumns)
8439
+ renderAddColumnElements: ((_x = props.bareSettings) === null || _x === void 0 ? void 0 : _x.bareAddColumns)
8403
8440
  ? undefined
8404
8441
  : renderAddMathColumn,
8405
8442
  // INFO: the popup's reference pickers read from the same providers
8406
8443
  // the schema editor uses — without them a reference column would be
8407
8444
  // created with no target and resolve nothing
8408
- renderReferenceSpaceOptions: (_1 = props.organise) === null || _1 === void 0 ? void 0 : _1.renderReferenceSpaceOptions,
8409
- renderReferenceLabelOptions: (_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.renderReferenceLabelOptions,
8445
+ renderReferenceSpaceOptions: (_y = props.organise) === null || _y === void 0 ? void 0 : _y.renderReferenceSpaceOptions,
8446
+ renderReferenceLabelOptions: (_z = props.organise) === null || _z === void 0 ? void 0 : _z.renderReferenceLabelOptions,
8410
8447
  dragEnabled: isViewSettingsEnabled,
8411
8448
  sortEnabled: isViewSettingsEnabled,
8412
8449
  // INFO: per-column header filter is replaced by the flex filters
8413
8450
  filterEnabled: false,
8414
8451
  sortId: activeSortId,
8415
- sortOptions: (_5 = (_4 = (_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.renderReferenceLabelOptions) === null || _4 === void 0 ? void 0 : _4.call(_3)) !== null && _5 !== void 0 ? _5 : (isViewSettingsEnabled
8452
+ sortOptions: (_2 = (_1 = (_0 = props.organise) === null || _0 === void 0 ? void 0 : _0.renderReferenceLabelOptions) === null || _1 === void 0 ? void 0 : _1.call(_0)) !== null && _2 !== void 0 ? _2 : (isViewSettingsEnabled
8416
8453
  ? getViewSettingsColumns().map(function (eachColumn) {
8417
8454
  var _a;
8418
8455
  return ({
@@ -8444,9 +8481,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8444
8481
  return renderSearchContent(newQuery);
8445
8482
  },
8446
8483
  }, editable: {
8447
- active: ((_6 = props.edit) === null || _6 === void 0 ? void 0 : _6.listEditable) && !props.edit.disabledUpdate
8448
- ? true
8449
- : false,
8484
+ active: canInlineUpdate ? true : false,
8450
8485
  onUpdateData: function (rowId, columnId, data) { return __awaiter(void 0, void 0, void 0, function () {
8451
8486
  return __generator(this, function (_a) {
8452
8487
  switch (_a.label) {
@@ -8458,7 +8493,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8458
8493
  });
8459
8494
  }); },
8460
8495
  }, onObjectEdit: handleObjectCellEdit, addable: {
8461
- active: ((_7 = props.edit) === null || _7 === void 0 ? void 0 : _7.listAddable) ? true : false,
8496
+ active: ((_3 = props.edit) === null || _3 === void 0 ? void 0 : _3.listAddable) ? true : false,
8462
8497
  onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
8463
8498
  return __generator(this, function (_a) {
8464
8499
  switch (_a.label) {
@@ -8469,27 +8504,27 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8469
8504
  }
8470
8505
  });
8471
8506
  }); },
8472
- }, darkMode: (_8 = props.organise) === null || _8 === void 0 ? void 0 : _8.darkMode, hidePagination: (_9 = props.organise) === null || _9 === void 0 ? void 0 : _9.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_10 = props.organise) === null || _10 === void 0 ? void 0 : _10.disableEllipsisOnLongWord, pinColumns: (_11 = props.bareSettings) === null || _11 === void 0 ? void 0 : _11.bareListTablePinColumns }));
8507
+ }, darkMode: (_4 = props.organise) === null || _4 === void 0 ? void 0 : _4.darkMode, hidePagination: (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.disableEllipsisOnLongWord, pinColumns: (_7 = props.bareSettings) === null || _7 === void 0 ? void 0 : _7.bareListTablePinColumns }));
8473
8508
  }
8474
- return (react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], referencesOptions: listReferencesOptions, 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: (_13 = (_12 = props.organise) === null || _12 === void 0 ? void 0 : _12.disableSelectFullData) === null || _13 === void 0 ? void 0 : _13.table, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
8509
+ return (react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], referencesOptions: listReferencesOptions, 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: (_9 = (_8 = props.organise) === null || _8 === void 0 ? void 0 : _8.disableSelectFullData) === null || _9 === void 0 ? void 0 : _9.table, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
8475
8510
  selectedIds.length > 0 &&
8476
- !((_14 = props.edit) === null || _14 === void 0 ? void 0 : _14.disabledUpdate) &&
8477
- !((_15 = props.bareSettings) === null || _15 === void 0 ? void 0 : _15.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
8511
+ canBatchUpdate &&
8512
+ !((_10 = props.bareSettings) === null || _10 === void 0 ? void 0 : _10.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
8478
8513
  react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Change to Draft", disable: loading, onClick: function () {
8479
8514
  handleBatchDraftData();
8480
8515
  } }),
8481
8516
  react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Clone Items", disable: loading, onClick: function () {
8482
8517
  handleCloneSelectedData();
8483
8518
  } }))),
8484
- ((_16 = props.edit) === null || _16 === void 0 ? void 0 : _16.deleteBtn) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm text-red-500 hover:text-red-600", text: "Delete", onClick: function () {
8519
+ canDeleteRecord && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm text-red-500 hover:text-red-600", text: "Delete", onClick: function () {
8485
8520
  handleGenerateDeletePasscode();
8486
8521
  setDeleteModal(true);
8487
8522
  } })),
8488
- !isFirebase && !((_17 = props.edit) === null || _17 === void 0 ? void 0 : _17.disableBatchUpdate) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
8523
+ !isFirebase && canBatchUpdate && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
8489
8524
  setBatchUpdateModal(true);
8490
8525
  } })),
8491
- ((_18 = props.bareSettings) === null || _18 === void 0 ? void 0 : _18.bareListMultipleSelectAddtionalActions) &&
8492
- ((_20 = (_19 = props.bareSettings) === null || _19 === void 0 ? void 0 : _19.bareListMultipleSelectAddtionalActions) === null || _20 === void 0 ? void 0 : _20.map(function (eachButton) {
8526
+ ((_11 = props.bareSettings) === null || _11 === void 0 ? void 0 : _11.bareListMultipleSelectAddtionalActions) &&
8527
+ ((_13 = (_12 = props.bareSettings) === null || _12 === void 0 ? void 0 : _12.bareListMultipleSelectAddtionalActions) === null || _13 === void 0 ? void 0 : _13.map(function (eachButton) {
8493
8528
  return (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm ".concat(eachButton.className), text: eachButton.text, onClick: function () {
8494
8529
  var _a, _b;
8495
8530
  (_a = eachButton.onClick) === null || _a === void 0 ? void 0 : _a.call(eachButton, selectedIds, selectAll, (_b = renderImpSearchFilterConditions()) !== null && _b !== void 0 ? _b : []);
@@ -8497,17 +8532,17 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8497
8532
  }))), handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, header: renderTableHeader(), pageIndex: pageIndex !== null && pageIndex !== void 0 ? pageIndex : 0, onClickRow: function (id) {
8498
8533
  var _a, _b;
8499
8534
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
8500
- }, linkType: props.linkType, custom: props.custom, newTabUrl: (_22 = (_21 = props.newTabUrl) === null || _21 === void 0 ? void 0 : _21.default) !== null && _22 !== void 0 ? _22 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_24 = (_23 = props.newTabUrl) === null || _23 === void 0 ? void 0 : _23.addons) !== null && _24 !== void 0 ? _24 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
8535
+ }, linkType: props.linkType, custom: props.custom, newTabUrl: (_15 = (_14 = props.newTabUrl) === null || _14 === void 0 ? void 0 : _14.default) !== null && _15 !== void 0 ? _15 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_17 = (_16 = props.newTabUrl) === null || _16 === void 0 ? void 0 : _16.addons) !== null && _17 !== void 0 ? _17 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
8501
8536
  handlePagination(value);
8502
- }, className: "mt-5", lib: { axios: (_25 = props.lib) === null || _25 === void 0 ? void 0 : _25.axios }, devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_26 = props.organise) === null || _26 === void 0 ? void 0 : _26.fixedPagination, advSettings: {
8503
- addColumnEnabled: (_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.addColumnEnabled,
8537
+ }, className: "mt-5", lib: { axios: (_18 = props.lib) === null || _18 === void 0 ? void 0 : _18.axios }, devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_19 = props.organise) === null || _19 === void 0 ? void 0 : _19.fixedPagination, advSettings: {
8538
+ addColumnEnabled: (_20 = props.organise) === null || _20 === void 0 ? void 0 : _20.addColumnEnabled,
8504
8539
  renderAddColumnElements: renderAddMathColumn,
8505
8540
  dragEnabled: isViewSettingsEnabled,
8506
8541
  sortEnabled: isViewSettingsEnabled,
8507
8542
  // INFO: per-column header filter is replaced by the flex filters
8508
8543
  filterEnabled: false,
8509
8544
  sortId: activeSortId,
8510
- sortOptions: (_30 = (_29 = (_28 = props.organise) === null || _28 === void 0 ? void 0 : _28.renderReferenceLabelOptions) === null || _29 === void 0 ? void 0 : _29.call(_28)) !== null && _30 !== void 0 ? _30 : (isViewSettingsEnabled
8545
+ sortOptions: (_23 = (_22 = (_21 = props.organise) === null || _21 === void 0 ? void 0 : _21.renderReferenceLabelOptions) === null || _22 === void 0 ? void 0 : _22.call(_21)) !== null && _23 !== void 0 ? _23 : (isViewSettingsEnabled
8511
8546
  ? getViewSettingsColumns().map(function (eachColumn) {
8512
8547
  var _a;
8513
8548
  return ({
@@ -8536,9 +8571,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8536
8571
  return renderSearchContent(newQuery);
8537
8572
  },
8538
8573
  }, editable: {
8539
- active: ((_31 = props.edit) === null || _31 === void 0 ? void 0 : _31.listEditable) && !props.edit.disabledUpdate
8540
- ? true
8541
- : false,
8574
+ active: canInlineUpdate ? true : false,
8542
8575
  onUpdateData: function (rowId, columnId, data) { return __awaiter(void 0, void 0, void 0, function () {
8543
8576
  return __generator(this, function (_a) {
8544
8577
  switch (_a.label) {
@@ -8550,7 +8583,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8550
8583
  });
8551
8584
  }); },
8552
8585
  }, onObjectEdit: handleObjectCellEdit, addable: {
8553
- active: ((_32 = props.edit) === null || _32 === void 0 ? void 0 : _32.listAddable) ? true : false,
8586
+ active: ((_24 = props.edit) === null || _24 === void 0 ? void 0 : _24.listAddable) ? true : false,
8554
8587
  onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
8555
8588
  return __generator(this, function (_a) {
8556
8589
  switch (_a.label) {
@@ -8561,11 +8594,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8561
8594
  }
8562
8595
  });
8563
8596
  }); },
8564
- }, darkMode: (_33 = props.organise) === null || _33 === void 0 ? void 0 : _33.darkMode, hidePagination: (_34 = props.organise) === null || _34 === void 0 ? void 0 : _34.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_35 = props.organise) === null || _35 === void 0 ? void 0 : _35.disableEllipsisOnLongWord }));
8597
+ }, darkMode: (_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.darkMode, hidePagination: (_26 = props.organise) === null || _26 === void 0 ? void 0 : _26.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.disableEllipsisOnLongWord }));
8565
8598
  }
8566
8599
  };
8567
8600
  var renderTabContent = function (tabs, dataType, requestedViewType) {
8568
- 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, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60;
8601
+ 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, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52;
8569
8602
  var matchedTab = tabs.find(function (eachTab) { return eachTab.id === requestedViewType; });
8570
8603
  /**
8571
8604
  * INFO: a list tab must not supply the content of a read view. The selected
@@ -8581,14 +8614,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8581
8614
  var isRefusedListTab = dataType === "read" && (matchedTab === null || matchedTab === void 0 ? void 0 : matchedTab.type) === "list";
8582
8615
  var viewType = isRefusedListTab ? "general" : requestedViewType;
8583
8616
  var selectedTabData = isRefusedListTab ? undefined : matchedTab;
8584
- var multipleSelect = false;
8585
- if (!((_a = props.edit) === null || _a === void 0 ? void 0 : _a.disableBatchUpdate))
8586
- multipleSelect = true;
8587
- if ((_b = props.edit) === null || _b === void 0 ? void 0 : _b.deleteBtn)
8588
- multipleSelect = true;
8589
- if ((_c = props.bareSettings) === null || _c === void 0 ? void 0 : _c.bareListMultipleSelectAddtionalActions)
8590
- multipleSelect = true;
8591
- if ((_d = props.organise) === null || _d === void 0 ? void 0 : _d.disableMulti)
8617
+ var multipleSelect = canBatchUpdate ||
8618
+ canDeleteRecord ||
8619
+ !!((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareListMultipleSelectAddtionalActions);
8620
+ if ((_b = props.organise) === null || _b === void 0 ? void 0 : _b.disableMulti)
8592
8621
  multipleSelect = false;
8593
8622
  if (viewType === "general" || (selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.viewType) === "report") {
8594
8623
  if (dataType === "list" || dataType === "union") {
@@ -8613,7 +8642,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8613
8642
  }
8614
8643
  if (shouldGroup && Object.keys(groupedStructures_1).length > 0) {
8615
8644
  var readElement_1 = [];
8616
- var sortedTabs = ((_e = props.organise) === null || _e === void 0 ? void 0 : _e.sortGroupByAlphabetically)
8645
+ var sortedTabs = ((_c = props.organise) === null || _c === void 0 ? void 0 : _c.sortGroupByAlphabetically)
8617
8646
  ? Object.keys(groupedStructures_1).sort(function (a, b) {
8618
8647
  if (a === "Others")
8619
8648
  return 1;
@@ -8693,7 +8722,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8693
8722
  allCanvas.length > 0 && (react_1.default.createElement("div", { className: "mt-5 rounded-md px-4 pb-4 sm:px-6 ".concat(((_b = props.organise) === null || _b === void 0 ? void 0 : _b.darkMode) ? "bg-white/5" : "bg-white") }, renderCanvas("read", allCanvas.map(function (eachModel) { return eachModel.id; }))))));
8694
8723
  }
8695
8724
  });
8696
- var showReadFloatingNav_1 = ((_f = props.organise) === null || _f === void 0 ? void 0 : _f.showReadFloatingNav) && allTabSections_1.length > 1;
8725
+ var showReadFloatingNav_1 = ((_d = props.organise) === null || _d === void 0 ? void 0 : _d.showReadFloatingNav) && allTabSections_1.length > 1;
8697
8726
  var handleTabSectionClick_1 = function (tabKey) {
8698
8727
  setReadTabSection(tabKey);
8699
8728
  var element = readTabSectionRefs.current[tabKey];
@@ -8729,11 +8758,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8729
8758
  }
8730
8759
  else {
8731
8760
  return (react_1.default.createElement(react_1.default.Fragment, null,
8732
- react_1.default.createElement(detailList_1.DetailList, { darkMode: (_g = props.organise) === null || _g === void 0 ? void 0 : _g.darkMode, darkModeBg: (_h = props.organise) === null || _h === void 0 ? void 0 : _h.darkModeBg, model: structure, referenceModel: referenceModelSchema, className: "mt-5 rounded-md ".concat(((_j = props.organise) === null || _j === void 0 ? void 0 : _j.darkMode)
8733
- ? ((_l = (_k = props.organise) === null || _k === void 0 ? void 0 : _k.darkModeBg) !== null && _l !== void 0 ? _l : "bg-gray-900")
8734
- : "bg-white"), title: "General Details", list: renderDetailListData(structure), size: ((_m = props.bareSettings) === null || _m === void 0 ? void 0 : _m.bareCompactMode) ? "compact" : "default", handleReferenceLink: !schemaPresent && ((_o = props.bareSettings) === null || _o === void 0 ? void 0 : _o.bareReadReferenceView)
8761
+ react_1.default.createElement(detailList_1.DetailList, { darkMode: (_e = props.organise) === null || _e === void 0 ? void 0 : _e.darkMode, darkModeBg: (_f = props.organise) === null || _f === void 0 ? void 0 : _f.darkModeBg, model: structure, referenceModel: referenceModelSchema, className: "mt-5 rounded-md ".concat(((_g = props.organise) === null || _g === void 0 ? void 0 : _g.darkMode)
8762
+ ? ((_j = (_h = props.organise) === null || _h === void 0 ? void 0 : _h.darkModeBg) !== null && _j !== void 0 ? _j : "bg-gray-900")
8763
+ : "bg-white"), title: "General Details", list: renderDetailListData(structure), size: ((_k = props.bareSettings) === null || _k === void 0 ? void 0 : _k.bareCompactMode) ? "compact" : "default", handleReferenceLink: !schemaPresent && ((_l = props.bareSettings) === null || _l === void 0 ? void 0 : _l.bareReadReferenceView)
8735
8764
  ? props.bareSettings.bareReadReferenceView
8736
- : undefined, splitView: (_p = props.organise) === null || _p === void 0 ? void 0 : _p.splitView }),
8765
+ : undefined, splitView: (_m = props.organise) === null || _m === void 0 ? void 0 : _m.splitView }),
8737
8766
  react_1.default.createElement("div", { className: "mt-8" }, renderListAddress(dataType)),
8738
8767
  react_1.default.createElement("div", { className: "mt-8" }, renderListObject(dataType)),
8739
8768
  react_1.default.createElement("div", { className: "mt-8" }, renderGanttChart(dataType)),
@@ -8742,66 +8771,66 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8742
8771
  }
8743
8772
  }
8744
8773
  else if (selectedTabData) {
8745
- if ((_q = props.bareSettings) === null || _q === void 0 ? void 0 : _q.bareListComponent) {
8774
+ if ((_o = props.bareSettings) === null || _o === void 0 ? void 0 : _o.bareListComponent) {
8746
8775
  return (react_1.default.createElement(react_1.default.Fragment, null,
8747
8776
  props.bareSettings.bareListComponent(tableData, spaceTableData, tableLoading, pageIndex),
8748
- !((_r = props.organise) === null || _r === void 0 ? void 0 : _r.hidePagination) && (react_1.default.createElement(pagination_1.Pagination, { data: tableData, size: size, limit: limit, cursor: cursor, pageIndex: pageIndex, paginationType: renderResolvedPaginationType(), handleUpdatePageIndex: function (value) {
8777
+ !((_p = props.organise) === null || _p === void 0 ? void 0 : _p.hidePagination) && (react_1.default.createElement(pagination_1.Pagination, { data: tableData, size: size, limit: limit, cursor: cursor, pageIndex: pageIndex, paginationType: renderResolvedPaginationType(), handleUpdatePageIndex: function (value) {
8749
8778
  handlePagination(value);
8750
- }, darkMode: (_s = props.organise) === null || _s === void 0 ? void 0 : _s.darkMode, customPaginationSize: customPaginationSize }))));
8779
+ }, darkMode: (_q = props.organise) === null || _q === void 0 ? void 0 : _q.darkMode, customPaginationSize: customPaginationSize }))));
8751
8780
  }
8752
8781
  else if (selectedTabData.viewType === "iframe") {
8753
8782
  if (selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.customComponent) {
8754
8783
  return selectedTabData.customComponent;
8755
8784
  }
8756
8785
  else {
8757
- return (react_1.default.createElement("iframe", { id: "blixify-iframe", className: "w-full mt-5", style: { height: "70vh" }, src: (_t = selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.iframeSrc) !== null && _t !== void 0 ? _t : "", title: (_u = selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.id) !== null && _u !== void 0 ? _u : "", onLoad: props.onLoadIframe }));
8786
+ return (react_1.default.createElement("iframe", { id: "blixify-iframe", className: "w-full mt-5", style: { height: "70vh" }, src: (_r = selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.iframeSrc) !== null && _r !== void 0 ? _r : "", title: (_s = selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.id) !== null && _s !== void 0 ? _s : "", onLoad: props.onLoadIframe }));
8758
8787
  }
8759
8788
  }
8760
8789
  else if (selectedTabData.viewType === "list") {
8761
8790
  // INFO: when bareNewDTW is enabled, render NewList instead of legacy List
8762
- if ((_v = props.bareSettings) === null || _v === void 0 ? void 0 : _v.bareNewDTW) {
8763
- return (react_1.default.createElement(newList_1.NewList, { darkModeBg: (_w = props.organise) === null || _w === void 0 ? void 0 : _w.darkModeBg, paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list", undefined, true), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: (_y = (_x = props.organise) === null || _x === void 0 ? void 0 : _x.disableSelectFullData) === null || _y === void 0 ? void 0 : _y.list, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? "from filter" : "", maxSelectedCount: (_z = props.bareSettings) === null || _z === void 0 ? void 0 : _z.bareListMaxSelectedCount, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
8764
- selectedIds.length > 0 && !((_0 = props.edit) === null || _0 === void 0 ? void 0 : _0.disabledUpdate) && (react_1.default.createElement(react_1.default.Fragment, null,
8791
+ if ((_t = props.bareSettings) === null || _t === void 0 ? void 0 : _t.bareNewDTW) {
8792
+ return (react_1.default.createElement(newList_1.NewList, { darkModeBg: (_u = props.organise) === null || _u === void 0 ? void 0 : _u.darkModeBg, paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list", undefined, true), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: (_w = (_v = props.organise) === null || _v === void 0 ? void 0 : _v.disableSelectFullData) === null || _w === void 0 ? void 0 : _w.list, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? "from filter" : "", maxSelectedCount: (_x = props.bareSettings) === null || _x === void 0 ? void 0 : _x.bareListMaxSelectedCount, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
8793
+ selectedIds.length > 0 && canBatchUpdate && (react_1.default.createElement(react_1.default.Fragment, null,
8765
8794
  react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Change to Draft", disable: loading, onClick: function () {
8766
8795
  handleBatchDraftData();
8767
8796
  } }),
8768
8797
  react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Clone Items", disable: loading, onClick: function () {
8769
8798
  handleCloneSelectedData();
8770
8799
  } }))),
8771
- ((_1 = props.edit) === null || _1 === void 0 ? void 0 : _1.deleteBtn) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm text-red-500 hover:text-red-600", text: "Delete", onClick: function () {
8800
+ canDeleteRecord && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm text-red-500 hover:text-red-600", text: "Delete", onClick: function () {
8772
8801
  handleGenerateDeletePasscode();
8773
8802
  setDeleteModal(true);
8774
8803
  } })),
8775
- !isFirebase && !((_2 = props.edit) === null || _2 === void 0 ? void 0 : _2.disabledUpdate) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
8804
+ !isFirebase && canBatchUpdate && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
8776
8805
  setBatchUpdateModal(true);
8777
8806
  } }))), onClickRow: function (id) {
8778
8807
  var _a, _b;
8779
8808
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
8780
- }, linkType: props.linkType, custom: props.custom, newTabUrl: (_4 = (_3 = props.newTabUrl) === null || _3 === void 0 ? void 0 : _3.default) !== null && _4 !== void 0 ? _4 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_6 = (_5 = props.newTabUrl) === null || _5 === void 0 ? void 0 : _5.addons) !== null && _6 !== void 0 ? _6 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
8809
+ }, linkType: props.linkType, custom: props.custom, newTabUrl: (_z = (_y = props.newTabUrl) === null || _y === void 0 ? void 0 : _y.default) !== null && _z !== void 0 ? _z : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_1 = (_0 = props.newTabUrl) === null || _0 === void 0 ? void 0 : _0.addons) !== null && _1 !== void 0 ? _1 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
8781
8810
  handlePagination(value);
8782
- }, darkMode: (_7 = props.organise) === null || _7 === void 0 ? void 0 : _7.darkMode, className: "mt-5", hidePagination: (_8 = props.organise) === null || _8 === void 0 ? void 0 : _8.hidePagination, customPaginationSize: customPaginationSize, mobileTooltip: (_9 = props.bareSettings) === null || _9 === void 0 ? void 0 : _9.bareListMobileTooltip }));
8811
+ }, darkMode: (_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.darkMode, className: "mt-5", hidePagination: (_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.hidePagination, customPaginationSize: customPaginationSize, mobileTooltip: (_4 = props.bareSettings) === null || _4 === void 0 ? void 0 : _4.bareListMobileTooltip }));
8783
8812
  }
8784
8813
  return (react_1.default.createElement(react_1.default.Fragment, null,
8785
- react_1.default.createElement(list_1.List, { darkModeBg: (_10 = props.organise) === null || _10 === void 0 ? void 0 : _10.darkModeBg, paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list", undefined, true), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: (_12 = (_11 = props.organise) === null || _11 === void 0 ? void 0 : _11.disableSelectFullData) === null || _12 === void 0 ? void 0 : _12.list, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? "from filter" : "", multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
8786
- selectedIds.length > 0 && !((_13 = props.edit) === null || _13 === void 0 ? void 0 : _13.disabledUpdate) && (react_1.default.createElement(react_1.default.Fragment, null,
8814
+ react_1.default.createElement(list_1.List, { darkModeBg: (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.darkModeBg, paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list", undefined, true), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: (_7 = (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.disableSelectFullData) === null || _7 === void 0 ? void 0 : _7.list, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? "from filter" : "", multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
8815
+ selectedIds.length > 0 && canBatchUpdate && (react_1.default.createElement(react_1.default.Fragment, null,
8787
8816
  react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Change to Draft", disable: loading, onClick: function () {
8788
8817
  handleBatchDraftData();
8789
8818
  } }),
8790
8819
  react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Clone Items", disable: loading, onClick: function () {
8791
8820
  handleCloneSelectedData();
8792
8821
  } }))),
8793
- ((_14 = props.edit) === null || _14 === void 0 ? void 0 : _14.deleteBtn) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm text-red-500 hover:text-red-600", text: "Delete", onClick: function () {
8822
+ canDeleteRecord && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm text-red-500 hover:text-red-600", text: "Delete", onClick: function () {
8794
8823
  handleGenerateDeletePasscode();
8795
8824
  setDeleteModal(true);
8796
8825
  } })),
8797
- !isFirebase && !((_15 = props.edit) === null || _15 === void 0 ? void 0 : _15.disabledUpdate) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
8826
+ !isFirebase && canBatchUpdate && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
8798
8827
  setBatchUpdateModal(true);
8799
8828
  } }))), onClickRow: function (id) {
8800
8829
  var _a, _b;
8801
8830
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
8802
- }, linkType: props.linkType, custom: props.custom, newTabUrl: (_17 = (_16 = props.newTabUrl) === null || _16 === void 0 ? void 0 : _16.default) !== null && _17 !== void 0 ? _17 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_19 = (_18 = props.newTabUrl) === null || _18 === void 0 ? void 0 : _18.addons) !== null && _19 !== void 0 ? _19 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
8831
+ }, linkType: props.linkType, custom: props.custom, newTabUrl: (_9 = (_8 = props.newTabUrl) === null || _8 === void 0 ? void 0 : _8.default) !== null && _9 !== void 0 ? _9 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_11 = (_10 = props.newTabUrl) === null || _10 === void 0 ? void 0 : _10.addons) !== null && _11 !== void 0 ? _11 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
8803
8832
  handlePagination(value);
8804
- }, className: "mt-5", hidePagination: (_20 = props.organise) === null || _20 === void 0 ? void 0 : _20.hidePagination, customPaginationSize: customPaginationSize })));
8833
+ }, className: "mt-5", hidePagination: (_12 = props.organise) === null || _12 === void 0 ? void 0 : _12.hidePagination, customPaginationSize: customPaginationSize })));
8805
8834
  }
8806
8835
  else if (selectedTabData.viewType === "file" &&
8807
8836
  resolvedType === "list") {
@@ -8816,9 +8845,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8816
8845
  * exactly the context they came for. The filename inside the tile is
8817
8846
  * still a direct link for when the file itself is the point.
8818
8847
  */
8819
- var columnId_2 = (_22 = (_21 = selectedTabData.fileSettings) === null || _21 === void 0 ? void 0 : _21.columnId) !== null && _22 !== void 0 ? _22 : "";
8848
+ var columnId_2 = (_14 = (_13 = selectedTabData.fileSettings) === null || _13 === void 0 ? void 0 : _13.columnId) !== null && _14 !== void 0 ? _14 : "";
8820
8849
  var fileColumn_1 = structure.find(function (eachModel) { return eachModel.id === columnId_2; });
8821
- var fileImageEndpoint_1 = ((_23 = props.devSettings) === null || _23 === void 0 ? void 0 : _23.imageEndpoint) || devSettings.imageEndpoint;
8850
+ var fileImageEndpoint_1 = ((_15 = props.devSettings) === null || _15 === void 0 ? void 0 : _15.imageEndpoint) || devSettings.imageEndpoint;
8822
8851
  /**
8823
8852
  * INFO: a stored file is not a url. A single file/image column holds
8824
8853
  * the download TOKEN — the file's name lives on the column
@@ -8878,7 +8907,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8878
8907
  // INFO: the same surface the other list views sit on, so
8879
8908
  // switching tabs does not change the shape of the page around
8880
8909
  // the content.
8881
- react_1.default.createElement("div", { className: "grid grid-cols-2 gap-4 rounded-lg p-4 sm:grid-cols-3 lg:grid-cols-4 ".concat(((_24 = props.organise) === null || _24 === void 0 ? void 0 : _24.darkMode) ? "bg-white/5" : "bg-white") }, tableData.map(function (eachRow, eachIndex) {
8910
+ react_1.default.createElement("div", { className: "grid grid-cols-2 gap-4 rounded-lg p-4 sm:grid-cols-3 lg:grid-cols-4 ".concat(((_16 = props.organise) === null || _16 === void 0 ? void 0 : _16.darkMode) ? "bg-white/5" : "bg-white") }, tableData.map(function (eachRow, eachIndex) {
8882
8911
  var _a, _b;
8883
8912
  return (react_1.default.createElement(filePreview_1.FilePreview, { key: "".concat((_b = (_a = eachRow === null || eachRow === void 0 ? void 0 : eachRow.id) !== null && _a !== void 0 ? _a : eachRow === null || eachRow === void 0 ? void 0 : eachRow._id) !== null && _b !== void 0 ? _b : eachIndex, "-").concat(eachIndex), variant: "tile", file: handleResolveTileFile_1(eachRow), onClick: function () {
8884
8913
  var _a, _b, _c, _d;
@@ -8892,24 +8921,24 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8892
8921
  }))),
8893
8922
  react_1.default.createElement(pagination_1.Pagination, { data: tableData, size: size, limit: limit, cursor: cursor, pageIndex: pageIndex, paginationType: renderResolvedPaginationType(), handleUpdatePageIndex: function (value) {
8894
8923
  handlePagination(value);
8895
- }, darkMode: (_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.darkMode, customPaginationSize: customPaginationSize })));
8924
+ }, darkMode: (_17 = props.organise) === null || _17 === void 0 ? void 0 : _17.darkMode, customPaginationSize: customPaginationSize })));
8896
8925
  }
8897
8926
  else if (selectedTabData.viewType === "grid") {
8898
8927
  var isScrollMode = renderCheckScrollMode();
8899
8928
  return (react_1.default.createElement(react_1.default.Fragment, null,
8900
- react_1.default.createElement(grid_1.Grid, { darkMode: (_26 = props.organise) === null || _26 === void 0 ? void 0 : _26.darkMode, darkModeBg: (_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.darkModeBg, paginationType: renderResolvedPaginationType(), data: renderGridAndListData(selectedTabData.viewImage, "grid"), size: size, limit: limit, cursor: cursor, loading: tableLoading, horizontalScroll: isScrollMode, pageIndex: pageIndex, onClickData: function (id) {
8929
+ react_1.default.createElement(grid_1.Grid, { darkMode: (_18 = props.organise) === null || _18 === void 0 ? void 0 : _18.darkMode, darkModeBg: (_19 = props.organise) === null || _19 === void 0 ? void 0 : _19.darkModeBg, paginationType: renderResolvedPaginationType(), data: renderGridAndListData(selectedTabData.viewImage, "grid"), size: size, limit: limit, cursor: cursor, loading: tableLoading, horizontalScroll: isScrollMode, pageIndex: pageIndex, onClickData: function (id) {
8901
8930
  var _a, _b;
8902
8931
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
8903
- }, linkType: props.linkType, custom: props.custom, newTabUrl: (_29 = (_28 = props.newTabUrl) === null || _28 === void 0 ? void 0 : _28.default) !== null && _29 !== void 0 ? _29 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_31 = (_30 = props.newTabUrl) === null || _30 === void 0 ? void 0 : _30.addons) !== null && _31 !== void 0 ? _31 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
8932
+ }, linkType: props.linkType, custom: props.custom, newTabUrl: (_21 = (_20 = props.newTabUrl) === null || _20 === void 0 ? void 0 : _20.default) !== null && _21 !== void 0 ? _21 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_23 = (_22 = props.newTabUrl) === null || _22 === void 0 ? void 0 : _22.addons) !== null && _23 !== void 0 ? _23 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
8904
8933
  handlePagination(value);
8905
- }, imgContain: selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.gridContain, gridColClassName: (_32 = props.bareSettings) === null || _32 === void 0 ? void 0 : _32.bareListGridColClassName, className: "mt-5",
8934
+ }, imgContain: selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.gridContain, gridColClassName: (_24 = props.bareSettings) === null || _24 === void 0 ? void 0 : _24.bareListGridColClassName, className: "mt-5",
8906
8935
  // INFO: under the new DTW the grid keeps the same footer as the
8907
8936
  // table and list views instead of its own legacy page buttons
8908
- hidePagination: ((_33 = props.organise) === null || _33 === void 0 ? void 0 : _33.hidePagination) ||
8909
- !!((_34 = props.bareSettings) === null || _34 === void 0 ? void 0 : _34.bareNewDTW), customPaginationSize: customPaginationSize }),
8910
- ((_35 = props.bareSettings) === null || _35 === void 0 ? void 0 : _35.bareNewDTW) &&
8911
- !((_36 = props.organise) === null || _36 === void 0 ? void 0 : _36.hidePagination) && (react_1.default.createElement(newPagination_1.NewPagination, { paginationType: renderResolvedPaginationType(), pageIndex: pageIndex, limit: limit, size: size, cursor: cursor, resultCount: renderGridAndListData(selectedTabData.viewImage, "grid")
8912
- .length, customPaginationSize: customPaginationSize, darkMode: (_37 = props.organise) === null || _37 === void 0 ? void 0 : _37.darkMode, darkModeBg: (_38 = props.organise) === null || _38 === void 0 ? void 0 : _38.darkModeBg, handleUpdatePageIndex: function (value) {
8937
+ hidePagination: ((_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.hidePagination) ||
8938
+ !!((_26 = props.bareSettings) === null || _26 === void 0 ? void 0 : _26.bareNewDTW), customPaginationSize: customPaginationSize }),
8939
+ ((_27 = props.bareSettings) === null || _27 === void 0 ? void 0 : _27.bareNewDTW) &&
8940
+ !((_28 = props.organise) === null || _28 === void 0 ? void 0 : _28.hidePagination) && (react_1.default.createElement(newPagination_1.NewPagination, { paginationType: renderResolvedPaginationType(), pageIndex: pageIndex, limit: limit, size: size, cursor: cursor, resultCount: renderGridAndListData(selectedTabData.viewImage, "grid")
8941
+ .length, customPaginationSize: customPaginationSize, darkMode: (_29 = props.organise) === null || _29 === void 0 ? void 0 : _29.darkMode, darkModeBg: (_30 = props.organise) === null || _30 === void 0 ? void 0 : _30.darkModeBg, handleUpdatePageIndex: function (value) {
8913
8942
  handlePagination(value);
8914
8943
  } }))));
8915
8944
  }
@@ -9011,7 +9040,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9011
9040
  return eventAvailabilities;
9012
9041
  };
9013
9042
  // INFO: when bareNewDTW is enabled, render NewCalendar instead of legacy Calendar
9014
- if ((_39 = props.bareSettings) === null || _39 === void 0 ? void 0 : _39.bareNewDTW) {
9043
+ if ((_31 = props.bareSettings) === null || _31 === void 0 ? void 0 : _31.bareNewDTW) {
9015
9044
  var newCalendarEvents = renderEventAvailabilities().map(function (ev) {
9016
9045
  var _a, _b, _c, _d;
9017
9046
  return ({
@@ -9031,13 +9060,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9031
9060
  // INFO: viewSwitch — optional Month/Week/Agenda toggle. The range
9032
9061
  // query follows via calendarView ("dayGridMonth" ↔ "timeGridWeek");
9033
9062
  // agenda lists the fetched month chronologically.
9034
- var viewSwitchOptions = (_40 = calendarSettings_1 === null || calendarSettings_1 === void 0 ? void 0 : calendarSettings_1.viewSwitch) !== null && _40 !== void 0 ? _40 : [];
9063
+ var viewSwitchOptions = (_32 = calendarSettings_1 === null || calendarSettings_1 === void 0 ? void 0 : calendarSettings_1.viewSwitch) !== null && _32 !== void 0 ? _32 : [];
9035
9064
  var VIEW_VARIANT_MAP = {
9036
9065
  month: "fullMonth",
9037
9066
  week: "weekTimeGrid",
9038
9067
  agenda: "agenda",
9039
9068
  };
9040
- var activeVariant = (_41 = VIEW_VARIANT_MAP[newCalendarViewMode]) !== null && _41 !== void 0 ? _41 : "fullMonth";
9069
+ var activeVariant = (_33 = VIEW_VARIANT_MAP[newCalendarViewMode]) !== null && _33 !== void 0 ? _33 : "fullMonth";
9041
9070
  return (react_1.default.createElement("div", { className: "mt-4" },
9042
9071
  viewSwitchOptions.length > 1 && (react_1.default.createElement("div", { className: "mb-2 flex justify-end" },
9043
9072
  react_1.default.createElement("div", { className: "inline-flex rounded-lg border border-gray-200 bg-white p-0.5" }, viewSwitchOptions.map(function (view) { return (react_1.default.createElement("button", { key: view, type: "button", onClick: function () {
@@ -9079,9 +9108,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9079
9108
  var _a, _b;
9080
9109
  if (event.id)
9081
9110
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", event.id, "general");
9082
- }, darkMode: (_42 = props.organise) === null || _42 === void 0 ? void 0 : _42.darkMode, className: "w-full" }))));
9111
+ }, darkMode: (_34 = props.organise) === null || _34 === void 0 ? void 0 : _34.darkMode, className: "w-full" }))));
9083
9112
  }
9084
- 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: (_43 = calendarSettings_1 === null || calendarSettings_1 === void 0 ? void 0 : calendarSettings_1.defaultView) !== null && _43 !== void 0 ? _43 : calendarView, handleMonthChange: function (date) {
9113
+ 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: (_35 = calendarSettings_1 === null || calendarSettings_1 === void 0 ? void 0 : calendarSettings_1.defaultView) !== null && _35 !== void 0 ? _35 : calendarView, handleMonthChange: function (date) {
9085
9114
  var startOfMonth = (0, dayjs_1.default)(calendarTabMonth).startOf("month");
9086
9115
  var endOfMonth = (0, dayjs_1.default)(calendarTabMonth).endOf("month");
9087
9116
  if (!(0, dayjs_1.default)(date).isBetween(startOfMonth, endOfMonth)) {
@@ -9099,7 +9128,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9099
9128
  else if (selectedTabData.viewType === "feeds") {
9100
9129
  var contentList_1 = [];
9101
9130
  var feedsSettings_1 = selectedTabData.feedsSettings;
9102
- var customFeedsData = (_44 = feedsSettings_1 === null || feedsSettings_1 === void 0 ? void 0 : feedsSettings_1.customFeedsData) === null || _44 === void 0 ? void 0 : _44.call(feedsSettings_1, tableData, spaceTableData);
9131
+ var customFeedsData = (_36 = feedsSettings_1 === null || feedsSettings_1 === void 0 ? void 0 : feedsSettings_1.customFeedsData) === null || _36 === void 0 ? void 0 : _36.call(feedsSettings_1, tableData, spaceTableData);
9103
9132
  if (customFeedsData && customFeedsData.length > 0) {
9104
9133
  customFeedsData.map(function (eachData) {
9105
9134
  var _a, _b, _c, _d;
@@ -9144,21 +9173,21 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9144
9173
  return (react_1.default.createElement("div", { className: "mt-4" }, tableLoading ? (react_1.default.createElement(loading_1.Loading, null)) : (react_1.default.createElement("div", {
9145
9174
  // INFO: NewFeeds is already a card like the table and list, so the new
9146
9175
  // DTW renders it bare; the legacy feed still needs its own surface
9147
- className: ((_45 = props.bareSettings) === null || _45 === void 0 ? void 0 : _45.bareNewDTW)
9176
+ className: ((_37 = props.bareSettings) === null || _37 === void 0 ? void 0 : _37.bareNewDTW)
9148
9177
  ? ""
9149
- : "p-4 rounded-lg ".concat(((_46 = props.organise) === null || _46 === void 0 ? void 0 : _46.darkMode) ? "bg-white/5" : "bg-white") },
9150
- ((_47 = props.bareSettings) === null || _47 === void 0 ? void 0 : _47.bareNewDTW) ? (react_1.default.createElement(newFeeds_1.NewFeeds, { bold: true, content: contentList_1, darkMode: (_48 = props.organise) === null || _48 === void 0 ? void 0 : _48.darkMode, onClickItem: function (id) { var _a, _b; return (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general"); } })) : (react_1.default.createElement(feeds_1.Feeds, { bold: true, content: contentList_1, darkMode: (_49 = props.organise) === null || _49 === void 0 ? void 0 : _49.darkMode })),
9178
+ : "p-4 rounded-lg ".concat(((_38 = props.organise) === null || _38 === void 0 ? void 0 : _38.darkMode) ? "bg-white/5" : "bg-white") },
9179
+ ((_39 = props.bareSettings) === null || _39 === void 0 ? void 0 : _39.bareNewDTW) ? (react_1.default.createElement(newFeeds_1.NewFeeds, { bold: true, content: contentList_1, darkMode: (_40 = props.organise) === null || _40 === void 0 ? void 0 : _40.darkMode, onClickItem: function (id) { var _a, _b; return (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general"); } })) : (react_1.default.createElement(feeds_1.Feeds, { bold: true, content: contentList_1, darkMode: (_41 = props.organise) === null || _41 === void 0 ? void 0 : _41.darkMode })),
9151
9180
  react_1.default.createElement("div", { className: "my-10" }),
9152
9181
  contentList_1.length > 0 &&
9153
- !((_50 = props.organise) === null || _50 === void 0 ? void 0 : _50.hidePagination) &&
9154
- ((_51 = props.bareSettings) === null || _51 === void 0 ? void 0 : _51.bareNewDTW) && (react_1.default.createElement(newPagination_1.NewPagination, { paginationType: renderResolvedPaginationType(), pageIndex: pageIndex, limit: limit, size: size, cursor: cursor, resultCount: tableData.length, customPaginationSize: customPaginationSize, darkMode: (_52 = props.organise) === null || _52 === void 0 ? void 0 : _52.darkMode, darkModeBg: (_53 = props.organise) === null || _53 === void 0 ? void 0 : _53.darkModeBg, handleUpdatePageIndex: function (value) {
9182
+ !((_42 = props.organise) === null || _42 === void 0 ? void 0 : _42.hidePagination) &&
9183
+ ((_43 = props.bareSettings) === null || _43 === void 0 ? void 0 : _43.bareNewDTW) && (react_1.default.createElement(newPagination_1.NewPagination, { paginationType: renderResolvedPaginationType(), pageIndex: pageIndex, limit: limit, size: size, cursor: cursor, resultCount: tableData.length, customPaginationSize: customPaginationSize, darkMode: (_44 = props.organise) === null || _44 === void 0 ? void 0 : _44.darkMode, darkModeBg: (_45 = props.organise) === null || _45 === void 0 ? void 0 : _45.darkModeBg, handleUpdatePageIndex: function (value) {
9155
9184
  handlePagination(value);
9156
9185
  } })),
9157
9186
  contentList_1.length > 0 &&
9158
- !((_54 = props.organise) === null || _54 === void 0 ? void 0 : _54.hidePagination) &&
9159
- !((_55 = props.bareSettings) === null || _55 === void 0 ? void 0 : _55.bareNewDTW) && (react_1.default.createElement(pagination_1.Pagination, { data: tableData, size: size, limit: limit, cursor: cursor, pageIndex: pageIndex, paginationType: renderResolvedPaginationType(), handleUpdatePageIndex: function (value) {
9187
+ !((_46 = props.organise) === null || _46 === void 0 ? void 0 : _46.hidePagination) &&
9188
+ !((_47 = props.bareSettings) === null || _47 === void 0 ? void 0 : _47.bareNewDTW) && (react_1.default.createElement(pagination_1.Pagination, { data: tableData, size: size, limit: limit, cursor: cursor, pageIndex: pageIndex, paginationType: renderResolvedPaginationType(), handleUpdatePageIndex: function (value) {
9160
9189
  handlePagination(value);
9161
- }, darkMode: (_56 = props.organise) === null || _56 === void 0 ? void 0 : _56.darkMode, customPaginationSize: customPaginationSize }))))));
9190
+ }, darkMode: (_48 = props.organise) === null || _48 === void 0 ? void 0 : _48.darkMode, customPaginationSize: customPaginationSize }))))));
9162
9191
  }
9163
9192
  else if (selectedTabData.viewType === "map") {
9164
9193
  var mapSettings_1 = selectedTabData.mapSettings;
@@ -9247,17 +9276,21 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9247
9276
  return null;
9248
9277
  });
9249
9278
  return (react_1.default.createElement("div", { className: "w-full h-[700px]" },
9250
- react_1.default.createElement(mapView_1.MapView, { ref: mapViewRef, markerList: mapMarkerList_1, enableMapControl: true, enablePolygonSelect: true, infoWindowComponent: infoWindowContent, infoWindowHeaderComponent: infoWindowHeaderComponent, handleSelectPolygon: function (ids) { return setSelectedIds(ids); }, handleUpdateOnClick: function () { return setBatchUpdateModal(true); }, handleDeleteOnClick: function () {
9251
- handleGenerateDeletePasscode();
9252
- setDeleteModal(true);
9253
- } })));
9279
+ react_1.default.createElement(mapView_1.MapView, { ref: mapViewRef, markerList: mapMarkerList_1, enableMapControl: true, enablePolygonSelect: canBatchUpdate || canDeleteRecord, infoWindowComponent: infoWindowContent, infoWindowHeaderComponent: infoWindowHeaderComponent, handleSelectPolygon: canBatchUpdate || canDeleteRecord
9280
+ ? function (ids) { return setSelectedIds(ids); }
9281
+ : undefined, handleUpdateOnClick: canBatchUpdate ? function () { return setBatchUpdateModal(true); } : undefined, handleDeleteOnClick: canDeleteRecord
9282
+ ? function () {
9283
+ handleGenerateDeletePasscode();
9284
+ setDeleteModal(true);
9285
+ }
9286
+ : undefined })));
9254
9287
  }
9255
9288
  else
9256
9289
  return react_1.default.createElement(react_1.default.Fragment, null);
9257
9290
  }
9258
9291
  else if (selectedTabData.viewType === "kanban") {
9259
9292
  var kanbanSettings = selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.kanbanSettings;
9260
- var kanbanTitle_2 = (_57 = kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.title) !== null && _57 !== void 0 ? _57 : "";
9293
+ var kanbanTitle_2 = (_49 = kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.title) !== null && _49 !== void 0 ? _49 : "";
9261
9294
  var nullColumn_1 = false;
9262
9295
  var groupBy_1 = [];
9263
9296
  var groupLabel_1 = [];
@@ -9278,38 +9311,61 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9278
9311
  });
9279
9312
  var kanbanData = renderGridAndListData("", "kanban", kanbanTitle_2, kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.useColumnName);
9280
9313
  // INFO: when bareNewDTW is enabled, render NewKanban instead of legacy Kanban
9281
- if ((_58 = props.bareSettings) === null || _58 === void 0 ? void 0 : _58.bareNewDTW) {
9314
+ if ((_50 = props.bareSettings) === null || _50 === void 0 ? void 0 : _50.bareNewDTW) {
9282
9315
  return (react_1.default.createElement(newKanban_1.NewKanban, { className: "inline-flex", 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
9283
9316
  ? "Data has exceeded limit, please apply filters"
9284
- : "", groupCluster: kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.groupCluster, draggable: true, droppable: kanbanDroppable, mobileView: (_59 = props.bareSettings) === null || _59 === void 0 ? void 0 : _59.bareListMobileView, onUpdateData: function (cardId, _fromCol, toCol) {
9285
- var _a;
9286
- setKanbanDroppable(false);
9287
- handleSubmitData("update", cardId, kanbanTitle_2, (_a = {},
9288
- _a[kanbanTitle_2] = toCol,
9289
- _a)).then(function () { return setKanbanDroppable(true); });
9290
- }, onClickData: function (id) {
9317
+ : "", groupCluster: kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.groupCluster, draggable: canUpdateRecord, droppable: canUpdateRecord && kanbanDroppable, mobileView: (_51 = props.bareSettings) === null || _51 === void 0 ? void 0 : _51.bareListMobileView, onUpdateData: canUpdateRecord
9318
+ ? function (cardId, _fromCol, toCol) { return __awaiter(void 0, void 0, void 0, function () {
9319
+ var _a;
9320
+ return __generator(this, function (_b) {
9321
+ switch (_b.label) {
9322
+ case 0:
9323
+ setKanbanDroppable(false);
9324
+ _b.label = 1;
9325
+ case 1:
9326
+ _b.trys.push([1, , 3, 4]);
9327
+ return [4 /*yield*/, handleSubmitData("update", cardId, kanbanTitle_2, (_a = {}, _a[kanbanTitle_2] = toCol, _a))];
9328
+ case 2:
9329
+ _b.sent();
9330
+ return [3 /*break*/, 4];
9331
+ case 3:
9332
+ setKanbanDroppable(true);
9333
+ return [7 /*endfinally*/];
9334
+ case 4: return [2 /*return*/];
9335
+ }
9336
+ });
9337
+ }); }
9338
+ : undefined, onClickData: function (id) {
9291
9339
  var _a, _b;
9292
9340
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
9293
- }, darkMode: (_60 = props.organise) === null || _60 === void 0 ? void 0 : _60.darkMode }));
9341
+ }, darkMode: (_52 = props.organise) === null || _52 === void 0 ? void 0 : _52.darkMode }));
9294
9342
  }
9295
9343
  return (react_1.default.createElement(kanban_1.Kanban, { className: "inline-flex", 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
9296
9344
  ? "Data has exceeded limit, please apply filters"
9297
- : "", groupCluster: kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.groupCluster, draggable: true, droppable: kanbanDroppable, onUpdateData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
9298
- var _a;
9299
- return __generator(this, function (_b) {
9300
- switch (_b.label) {
9301
- case 0:
9302
- setKanbanDroppable(false);
9303
- return [4 /*yield*/, handleSubmitData("update", data.id, kanbanTitle_2, (_a = {},
9304
- _a[kanbanTitle_2] = data[kanbanTitle_2],
9305
- _a))];
9306
- case 1:
9307
- _b.sent();
9308
- setKanbanDroppable(true);
9309
- return [2 /*return*/];
9310
- }
9311
- });
9312
- }); }, onClickData: function (id) {
9345
+ : "", groupCluster: kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.groupCluster, draggable: canUpdateRecord, droppable: canUpdateRecord && kanbanDroppable, onUpdateData: canUpdateRecord
9346
+ ? function (data) { return __awaiter(void 0, void 0, void 0, function () {
9347
+ var _a;
9348
+ return __generator(this, function (_b) {
9349
+ switch (_b.label) {
9350
+ case 0:
9351
+ setKanbanDroppable(false);
9352
+ _b.label = 1;
9353
+ case 1:
9354
+ _b.trys.push([1, , 3, 4]);
9355
+ return [4 /*yield*/, handleSubmitData("update", data.id, kanbanTitle_2, (_a = {},
9356
+ _a[kanbanTitle_2] = data[kanbanTitle_2],
9357
+ _a))];
9358
+ case 2:
9359
+ _b.sent();
9360
+ return [3 /*break*/, 4];
9361
+ case 3:
9362
+ setKanbanDroppable(true);
9363
+ return [7 /*endfinally*/];
9364
+ case 4: return [2 /*return*/];
9365
+ }
9366
+ });
9367
+ }); }
9368
+ : undefined, onClickData: function (id) {
9313
9369
  var _a, _b;
9314
9370
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
9315
9371
  } }));
@@ -9768,9 +9824,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9768
9824
  return "";
9769
9825
  };
9770
9826
  var renderFeedsActionBtn = function (id, description) {
9771
- var _a, _b, _c;
9772
9827
  return (react_1.default.createElement("div", { className: "w-full flex justify-end gap-4 ".concat(description && "mt-2") },
9773
- !((_a = props.edit) === null || _a === void 0 ? void 0 : _a.disabledUpdate) && (react_1.default.createElement(outline_1.PencilSquareIcon, { className: "h-5 w-5 text-primary-500 hover:cursor-pointer", onClick: function (event) {
9828
+ canUpdateRecord && (react_1.default.createElement(outline_1.PencilSquareIcon, { className: "h-5 w-5 text-primary-500 hover:cursor-pointer", onClick: function (event) {
9774
9829
  var _a, _b;
9775
9830
  event.preventDefault();
9776
9831
  event.stopPropagation();
@@ -9782,7 +9837,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9782
9837
  setActivityModal === null || setActivityModal === void 0 ? void 0 : setActivityModal(true);
9783
9838
  setActivityId === null || setActivityId === void 0 ? void 0 : setActivityId(id);
9784
9839
  } })),
9785
- ((_b = props.edit) === null || _b === void 0 ? void 0 : _b.allEditable) && ((_c = props.edit) === null || _c === void 0 ? void 0 : _c.deleteBtn) && (react_1.default.createElement(outline_1.TrashIcon, { className: "h-5 w-5 text-red-500 hover:cursor-pointer", onClick: function (event) {
9840
+ canDeleteRecord && (react_1.default.createElement(outline_1.TrashIcon, { className: "h-5 w-5 text-red-500 hover:cursor-pointer", onClick: function (event) {
9786
9841
  event.preventDefault();
9787
9842
  event.stopPropagation();
9788
9843
  setDeleteModal(true);