blixify-ui-web 1.2.22 → 1.2.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
  2. package/lib/components/data/dataTemplate/index.js +529 -287
  3. package/lib/components/data/dataTemplate/index.js.map +1 -1
  4. package/lib/components/data/dataTemplate/model.d.ts +18 -0
  5. package/lib/components/data/dataTemplate/model.d.ts.map +1 -1
  6. package/lib/components/data/listModule.d.ts.map +1 -1
  7. package/lib/components/data/listModule.js +5 -9
  8. package/lib/components/data/listModule.js.map +1 -1
  9. package/lib/components/display/newKanban/index.d.ts +10 -0
  10. package/lib/components/display/newKanban/index.d.ts.map +1 -1
  11. package/lib/components/display/newKanban/index.js +134 -54
  12. package/lib/components/display/newKanban/index.js.map +1 -1
  13. package/lib/components/display/newList/index.d.ts +48 -5
  14. package/lib/components/display/newList/index.d.ts.map +1 -1
  15. package/lib/components/display/newList/index.js +453 -31
  16. package/lib/components/display/newList/index.js.map +1 -1
  17. package/lib/components/display/newTable/index.d.ts +14 -0
  18. package/lib/components/display/newTable/index.d.ts.map +1 -1
  19. package/lib/components/display/newTable/index.js +118 -40
  20. package/lib/components/display/newTable/index.js.map +1 -1
  21. package/lib/components/display/table/index.d.ts +3 -0
  22. package/lib/components/display/table/index.d.ts.map +1 -1
  23. package/lib/components/display/table/index.js +30 -22
  24. package/lib/components/display/table/index.js.map +1 -1
  25. package/lib/components/index.d.ts +2 -0
  26. package/lib/components/index.d.ts.map +1 -1
  27. package/lib/components/index.js.map +1 -1
  28. package/lib/components/input/address/index.d.ts.map +1 -1
  29. package/lib/components/input/address/index.js.map +1 -1
  30. package/lib/components/input/textInput/index.d.ts.map +1 -1
  31. package/lib/components/input/textInput/index.js.map +1 -1
  32. package/lib/tail.css +2 -2
  33. package/package.json +1 -1
@@ -117,6 +117,10 @@ var modal_1 = require("../../display/modal");
117
117
  var notification_1 = require("../../display/notification");
118
118
  var stepper_1 = require("../../display/stepper");
119
119
  var table_1 = require("../../display/table");
120
+ var newTable_1 = require("../../display/newTable");
121
+ var newList_1 = require("../../display/newList");
122
+ var newKanban_1 = require("../../display/newKanban");
123
+ var newCalendar_1 = require("../../display/newCalendar");
120
124
  var address_1 = require("../../input/address");
121
125
  var canvas_1 = require("../../input/canvas");
122
126
  var form_1 = require("../../input/form");
@@ -149,7 +153,7 @@ var settingsModal_1 = require("./settingsModal");
149
153
  var flexFilterModel_1 = require("./flexFilterModel");
150
154
  var flexFilterModule_1 = require("./flexFilterModule");
151
155
  exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
152
- 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;
156
+ 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;
153
157
  var intialiseDefaultFilterValues = function () {
154
158
  var _a;
155
159
  var initialFilterSearch = {};
@@ -210,143 +214,143 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
210
214
  initialFilterReferenceDate: initialFilterReferenceDate,
211
215
  };
212
216
  };
213
- var _45 = intialiseDefaultFilterValues(), initialFilterSearch = _45.initialFilterSearch, initialFilterSearchParams = _45.initialFilterSearchParams, initialFilterSelection = _45.initialFilterSelection, initialFilterReference = _45.initialFilterReference, initialFilterReferenceDate = _45.initialFilterReferenceDate;
214
- var _46 = (0, react_1.useState)(false), loading = _46[0], setLoading = _46[1];
215
- var _47 = (0, react_1.useState)(), notification = _47[0], setNotification = _47[1];
217
+ var _46 = intialiseDefaultFilterValues(), initialFilterSearch = _46.initialFilterSearch, initialFilterSearchParams = _46.initialFilterSearchParams, initialFilterSelection = _46.initialFilterSelection, initialFilterReference = _46.initialFilterReference, initialFilterReferenceDate = _46.initialFilterReferenceDate;
218
+ var _47 = (0, react_1.useState)(false), loading = _47[0], setLoading = _47[1];
219
+ var _48 = (0, react_1.useState)(), notification = _48[0], setNotification = _48[1];
216
220
  //INFO : Used by List
217
- var _48 = (0, react_1.useState)(initialFilterSearch), filterSearch = _48[0], setFilterSearch = _48[1];
218
- var _49 = (0, react_1.useState)(initialFilterSearchParams), filterSearchParams = _49[0], setFilterSearchParams = _49[1];
219
- var _50 = (0, react_1.useState)(initialFilterSelection), filterSelection = _50[0], setFilterSelection = _50[1];
220
- var _51 = (0, react_1.useState)(initialFilterReference), filterReference = _51[0], setFilterReference = _51[1];
221
- var _52 = (0, react_1.useState)({}), filterReferenceSearch = _52[0], setFilterReferenceSearch = _52[1];
222
- var _53 = (0, react_1.useState)({}), filterReferenceList = _53[0], setFilterReferenceList = _53[1];
223
- var _54 = (0, react_1.useState)(initialFilterReferenceDate), filterReferenceDate = _54[0], setFilterReferenceDate = _54[1];
224
- var _55 = (0, react_1.useState)(true), tableLoading = _55[0], setTableLoading = _55[1];
225
- var _56 = (0, react_1.useState)(""), cursor = _56[0], setCursor = _56[1];
226
- var _57 = (0, react_1.useState)(""), lastCursor = _57[0], setLastCursor = _57[1];
227
- var _58 = (0, react_1.useState)([]), tableData = _58[0], setTableData = _58[1];
228
- var _59 = (0, react_1.useState)([]), spaceTableData = _59[0], setSpaceTableData = _59[1];
229
- var _60 = (0, react_1.useState)(0), size = _60[0], setSize = _60[1];
230
- var _61 = (0, react_1.useState)((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.pageIndex) !== null && _b !== void 0 ? _b : 0), pageIndex = _61[0], setPageIndex = _61[1];
231
- var _62 = (0, react_1.useState)([]), selectedIds = _62[0], setSelectedIds = _62[1];
232
- var _63 = (0, react_1.useState)(false), selectAll = _63[0], setSelectAll = _63[1];
233
- var _64 = (0, react_1.useState)(""), deletePasscode = _64[0], setDeletePasscode = _64[1];
234
- var _65 = (0, react_1.useState)(""), deletePasscodeInput = _65[0], setDeletePasscodeInput = _65[1];
235
- var _66 = (0, react_1.useState)(""), deleteFeedId = _66[0], setDeleteFeedId = _66[1];
221
+ var _49 = (0, react_1.useState)(initialFilterSearch), filterSearch = _49[0], setFilterSearch = _49[1];
222
+ var _50 = (0, react_1.useState)(initialFilterSearchParams), filterSearchParams = _50[0], setFilterSearchParams = _50[1];
223
+ var _51 = (0, react_1.useState)(initialFilterSelection), filterSelection = _51[0], setFilterSelection = _51[1];
224
+ var _52 = (0, react_1.useState)(initialFilterReference), filterReference = _52[0], setFilterReference = _52[1];
225
+ var _53 = (0, react_1.useState)({}), filterReferenceSearch = _53[0], setFilterReferenceSearch = _53[1];
226
+ var _54 = (0, react_1.useState)({}), filterReferenceList = _54[0], setFilterReferenceList = _54[1];
227
+ var _55 = (0, react_1.useState)(initialFilterReferenceDate), filterReferenceDate = _55[0], setFilterReferenceDate = _55[1];
228
+ var _56 = (0, react_1.useState)(true), tableLoading = _56[0], setTableLoading = _56[1];
229
+ var _57 = (0, react_1.useState)(""), cursor = _57[0], setCursor = _57[1];
230
+ var _58 = (0, react_1.useState)(""), lastCursor = _58[0], setLastCursor = _58[1];
231
+ var _59 = (0, react_1.useState)([]), tableData = _59[0], setTableData = _59[1];
232
+ var _60 = (0, react_1.useState)([]), spaceTableData = _60[0], setSpaceTableData = _60[1];
233
+ var _61 = (0, react_1.useState)(0), size = _61[0], setSize = _61[1];
234
+ var _62 = (0, react_1.useState)((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.pageIndex) !== null && _b !== void 0 ? _b : 0), pageIndex = _62[0], setPageIndex = _62[1];
235
+ var _63 = (0, react_1.useState)([]), selectedIds = _63[0], setSelectedIds = _63[1];
236
+ var _64 = (0, react_1.useState)(false), selectAll = _64[0], setSelectAll = _64[1];
237
+ var _65 = (0, react_1.useState)(""), deletePasscode = _65[0], setDeletePasscode = _65[1];
238
+ var _66 = (0, react_1.useState)(""), deletePasscodeInput = _66[0], setDeletePasscodeInput = _66[1];
239
+ var _67 = (0, react_1.useState)(""), deleteFeedId = _67[0], setDeleteFeedId = _67[1];
236
240
  //INFO : Used by List Organise
237
- var _67 = (0, react_1.useState)(false), sortModal = _67[0], setSortModal = _67[1];
238
- var _68 = (0, react_1.useState)(false), filterModal = _68[0], setFilterModal = _68[1];
239
- var _69 = (0, react_1.useState)(false), filterDraft = _69[0], setFilterDraft = _69[1];
240
- var _70 = (0, react_1.useState)(false), addTabModal = _70[0], setAddTabModal = _70[1];
241
- var _71 = (0, react_1.useState)(false), overviewModal = _71[0], setOverviewModal = _71[1];
242
- var _72 = (0, react_1.useState)(props.defaultTab
241
+ var _68 = (0, react_1.useState)(false), sortModal = _68[0], setSortModal = _68[1];
242
+ var _69 = (0, react_1.useState)(false), filterModal = _69[0], setFilterModal = _69[1];
243
+ var _70 = (0, react_1.useState)(false), filterDraft = _70[0], setFilterDraft = _70[1];
244
+ var _71 = (0, react_1.useState)(false), addTabModal = _71[0], setAddTabModal = _71[1];
245
+ var _72 = (0, react_1.useState)(false), overviewModal = _72[0], setOverviewModal = _72[1];
246
+ var _73 = (0, react_1.useState)(props.defaultTab
243
247
  ? (0, listModule_1.renderSelectedRefreshTab)(props.localURLEndpoint, props.type, props.collectionId, props.id, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.extendedTabs, (_d = props.organise) === null || _d === void 0 ? void 0 : _d.viewId)
244
- : ""), selectedTab = _72[0], setSelectedTab = _72[1];
245
- var _73 = (0, react_1.useState)("dayGridMonth"), calendarView = _73[0], setCalendarView = _73[1];
246
- var _74 = (0, react_1.useState)(new Date()), calendarTabMonth = _74[0], setCalendarTabMonth = _74[1];
247
- var _75 = (0, react_1.useState)(true), kanbanDroppable = _75[0], setKanbanDroppable = _75[1];
248
- var _76 = (0, react_1.useState)([]), kanbanOptions = _76[0], setKanbanOptions = _76[1];
249
- var _77 = (0, react_1.useState)(false), queryForm = _77[0], setQueryForm = _77[1];
250
- var _78 = (0, react_1.useState)(false), batchUpdateModal = _78[0], setBatchUpdateModal = _78[1];
251
- var _79 = (0, react_1.useState)({
248
+ : ""), selectedTab = _73[0], setSelectedTab = _73[1];
249
+ var _74 = (0, react_1.useState)("dayGridMonth"), calendarView = _74[0], setCalendarView = _74[1];
250
+ var _75 = (0, react_1.useState)(new Date()), calendarTabMonth = _75[0], setCalendarTabMonth = _75[1];
251
+ var _76 = (0, react_1.useState)(true), kanbanDroppable = _76[0], setKanbanDroppable = _76[1];
252
+ var _77 = (0, react_1.useState)([]), kanbanOptions = _77[0], setKanbanOptions = _77[1];
253
+ var _78 = (0, react_1.useState)(false), queryForm = _78[0], setQueryForm = _78[1];
254
+ var _79 = (0, react_1.useState)(false), batchUpdateModal = _79[0], setBatchUpdateModal = _79[1];
255
+ var _80 = (0, react_1.useState)({
252
256
  columnId: "",
253
257
  columnData: {},
254
- }), batchUpdateData = _79[0], setBatchUpdateData = _79[1];
255
- var _80 = (0, react_1.useState)((props === null || props === void 0 ? void 0 : props.model) || []), structure = _80[0], setStructure = _80[1];
256
- var _81 = (0, react_1.useState)(((_e = props === null || props === void 0 ? void 0 : props.organise) === null || _e === void 0 ? void 0 : _e.additionalQuery) || []), additionalQuery = _81[0], setAdditionalQuery = _81[1];
258
+ }), batchUpdateData = _80[0], setBatchUpdateData = _80[1];
259
+ var _81 = (0, react_1.useState)((props === null || props === void 0 ? void 0 : props.model) || []), structure = _81[0], setStructure = _81[1];
260
+ var _82 = (0, react_1.useState)(((_e = props === null || props === void 0 ? void 0 : props.organise) === null || _e === void 0 ? void 0 : _e.additionalQuery) || []), additionalQuery = _82[0], setAdditionalQuery = _82[1];
257
261
  // INFO: State for user-configurable flex filters (Monday.com-style)
258
262
  // INFO: Initialize with one empty row so users see inputs immediately without clicking "Add Filter"
259
- var _82 = (0, react_1.useState)([
263
+ var _83 = (0, react_1.useState)([
260
264
  {
261
265
  id: "flex-filter-init-row",
262
266
  columnId: "",
263
267
  operator: "=",
264
268
  value: undefined,
265
269
  },
266
- ]), flexFilters = _82[0], setFlexFilters = _82[1];
267
- var _83 = (0, react_1.useState)({}), flexFilterReferenceOptions = _83[0], setFlexFilterReferenceOptions = _83[1];
268
- var _84 = (0, react_1.useState)({}), flexFilterReferenceSearch = _84[0], setFlexFilterReferenceSearch = _84[1];
269
- var _85 = (0, react_1.useState)(false), flexFilterModalOpen = _85[0], setFlexFilterModalOpen = _85[1];
270
+ ]), flexFilters = _83[0], setFlexFilters = _83[1];
271
+ var _84 = (0, react_1.useState)({}), flexFilterReferenceOptions = _84[0], setFlexFilterReferenceOptions = _84[1];
272
+ var _85 = (0, react_1.useState)({}), flexFilterReferenceSearch = _85[0], setFlexFilterReferenceSearch = _85[1];
273
+ var _86 = (0, react_1.useState)(false), flexFilterModalOpen = _86[0], setFlexFilterModalOpen = _86[1];
270
274
  //INFO : Used by Auth
271
- var _86 = (0, react_1.useState)({
275
+ var _87 = (0, react_1.useState)({
272
276
  email: "",
273
277
  google: "",
274
278
  phone: "",
275
279
  disabled: false,
276
280
  create: false,
277
- }), authMethods = _86[0], setAuthMethods = _86[1];
278
- var _87 = (0, react_1.useState)(""), selectedAuthMethod = _87[0], setSelectedAuthMethod = _87[1];
281
+ }), authMethods = _87[0], setAuthMethods = _87[1];
282
+ var _88 = (0, react_1.useState)(""), selectedAuthMethod = _88[0], setSelectedAuthMethod = _88[1];
279
283
  // INFO: Used by Activity Log
280
- var _88 = (0, react_1.useState)(false), activityModal = _88[0], setActivityModal = _88[1];
281
- var _89 = (0, react_1.useState)(""), activityId = _89[0], setActivityId = _89[1];
284
+ var _89 = (0, react_1.useState)(false), activityModal = _89[0], setActivityModal = _89[1];
285
+ var _90 = (0, react_1.useState)(""), activityId = _90[0], setActivityId = _90[1];
282
286
  //INFO : Used by Export
283
- var _90 = (0, react_1.useState)(null), csvFile = _90[0], setCSVFile = _90[1];
284
- var _91 = (0, react_1.useState)([]), csvFileData = _91[0], setCSVFileData = _91[1];
285
- var _92 = (0, react_1.useState)(0), stepCSVIndex = _92[0], setStepCSVIndex = _92[1];
286
- var _93 = (0, react_1.useState)({}), listCSVMapAttribute = _93[0], setListCSVMapAttribute = _93[1];
287
- var _94 = (0, react_1.useState)({}), listCSVObjAttribute = _94[0], setListCSVObjAttribute = _94[1];
288
- var _95 = (0, react_1.useState)([]), csvAPIAttribute = _95[0], setCSVAPIAttribute = _95[1];
289
- var _96 = (0, react_1.useState)(((_f = props.devSettings.currentUser) === null || _f === void 0 ? void 0 : _f.userEmail) || ""), exportCSVEmail = _96[0], setExportCSVEmail = _96[1];
290
- var _97 = (0, react_1.useState)(((_h = (_g = props.organise) === null || _g === void 0 ? void 0 : _g.exportSettings) === null || _h === void 0 ? void 0 : _h.defaultExportPDFName) || ""), exportPDFTitle = _97[0], setExportPDFTitle = _97[1];
291
- var _98 = (0, react_1.useState)(false), exportPDFLoading = _98[0], setExportPDFLoading = _98[1];
292
- var _99 = (0, react_1.useState)(false), exportReadPDFLoading = _99[0], setExportReadPDFLoading = _99[1];
293
- var _100 = (0, react_1.useState)((_l = (_k = (_j = props.organise) === null || _j === void 0 ? void 0 : _j.exportSettings) === null || _k === void 0 ? void 0 : _k.sumColumnId) !== null && _l !== void 0 ? _l : []), exportSumAttributeIds = _100[0], setExportSumAttributeIds = _100[1];
294
- var _101 = (0, react_1.useState)((_p = (_o = (_m = props.organise) === null || _m === void 0 ? void 0 : _m.exportSettings) === null || _o === void 0 ? void 0 : _o.hideSubItems) !== null && _p !== void 0 ? _p : false), hideSubItems = _101[0], setHideSubItems = _101[1];
295
- var _102 = (0, react_1.useState)([]), importTableData = _102[0], setImportTableData = _102[1];
296
- var _103 = (0, react_1.useState)([]), queryList = _103[0], setQueryList = _103[1];
297
- var _104 = (0, react_1.useState)(undefined), allQueryList = _104[0], setAllQueryList = _104[1];
298
- var _105 = (0, react_1.useState)(-1), queryIndex = _105[0], setQueryIndex = _105[1];
299
- var _106 = (0, react_1.useState)((_q = props.organise) === null || _q === void 0 ? void 0 : _q.groupBy), groupId = _106[0], setGroupId = _106[1];
300
- var _107 = (0, react_1.useState)(""), readTabSection = _107[0], setReadTabSection = _107[1];
301
- var _108 = (0, react_1.useState)(false), readFloatingNav = _108[0], setReadFloatingNav = _108[1];
287
+ var _91 = (0, react_1.useState)(null), csvFile = _91[0], setCSVFile = _91[1];
288
+ var _92 = (0, react_1.useState)([]), csvFileData = _92[0], setCSVFileData = _92[1];
289
+ var _93 = (0, react_1.useState)(0), stepCSVIndex = _93[0], setStepCSVIndex = _93[1];
290
+ var _94 = (0, react_1.useState)({}), listCSVMapAttribute = _94[0], setListCSVMapAttribute = _94[1];
291
+ var _95 = (0, react_1.useState)({}), listCSVObjAttribute = _95[0], setListCSVObjAttribute = _95[1];
292
+ var _96 = (0, react_1.useState)([]), csvAPIAttribute = _96[0], setCSVAPIAttribute = _96[1];
293
+ var _97 = (0, react_1.useState)(((_f = props.devSettings.currentUser) === null || _f === void 0 ? void 0 : _f.userEmail) || ""), exportCSVEmail = _97[0], setExportCSVEmail = _97[1];
294
+ var _98 = (0, react_1.useState)(((_h = (_g = props.organise) === null || _g === void 0 ? void 0 : _g.exportSettings) === null || _h === void 0 ? void 0 : _h.defaultExportPDFName) || ""), exportPDFTitle = _98[0], setExportPDFTitle = _98[1];
295
+ var _99 = (0, react_1.useState)(false), exportPDFLoading = _99[0], setExportPDFLoading = _99[1];
296
+ var _100 = (0, react_1.useState)(false), exportReadPDFLoading = _100[0], setExportReadPDFLoading = _100[1];
297
+ var _101 = (0, react_1.useState)((_l = (_k = (_j = props.organise) === null || _j === void 0 ? void 0 : _j.exportSettings) === null || _k === void 0 ? void 0 : _k.sumColumnId) !== null && _l !== void 0 ? _l : []), exportSumAttributeIds = _101[0], setExportSumAttributeIds = _101[1];
298
+ var _102 = (0, react_1.useState)((_p = (_o = (_m = props.organise) === null || _m === void 0 ? void 0 : _m.exportSettings) === null || _o === void 0 ? void 0 : _o.hideSubItems) !== null && _p !== void 0 ? _p : false), hideSubItems = _102[0], setHideSubItems = _102[1];
299
+ var _103 = (0, react_1.useState)([]), importTableData = _103[0], setImportTableData = _103[1];
300
+ var _104 = (0, react_1.useState)([]), queryList = _104[0], setQueryList = _104[1];
301
+ var _105 = (0, react_1.useState)(undefined), allQueryList = _105[0], setAllQueryList = _105[1];
302
+ var _106 = (0, react_1.useState)(-1), queryIndex = _106[0], setQueryIndex = _106[1];
303
+ var _107 = (0, react_1.useState)((_q = props.organise) === null || _q === void 0 ? void 0 : _q.groupBy), groupId = _107[0], setGroupId = _107[1];
304
+ var _108 = (0, react_1.useState)(""), readTabSection = _108[0], setReadTabSection = _108[1];
305
+ var _109 = (0, react_1.useState)(false), readFloatingNav = _109[0], setReadFloatingNav = _109[1];
302
306
  var readTabSectionRefs = (0, react_1.useRef)({});
303
307
  //INFO : Used by Read
304
308
  //INFO : Used by Update
305
- var _109 = (0, react_1.useState)(false), modalVisible = _109[0], setModalVisible = _109[1];
306
- var _110 = (0, react_1.useState)(false), deleteModal = _110[0], setDeleteModal = _110[1];
307
- var _111 = (0, react_1.useState)(false), excelModal = _111[0], setExcelModal = _111[1];
308
- var _112 = (0, react_1.useState)(false), exportExcel = _112[0], setExportExcel = _112[1];
309
- var _113 = (0, react_1.useState)(""), exportType = _113[0], setExportType = _113[1];
310
- var _114 = (0, react_1.useState)(false), exportQR = _114[0], setExportQR = _114[1];
311
- var _115 = (0, react_1.useState)(function () {
309
+ var _110 = (0, react_1.useState)(false), modalVisible = _110[0], setModalVisible = _110[1];
310
+ var _111 = (0, react_1.useState)(false), deleteModal = _111[0], setDeleteModal = _111[1];
311
+ var _112 = (0, react_1.useState)(false), excelModal = _112[0], setExcelModal = _112[1];
312
+ var _113 = (0, react_1.useState)(false), exportExcel = _113[0], setExportExcel = _113[1];
313
+ var _114 = (0, react_1.useState)(""), exportType = _114[0], setExportType = _114[1];
314
+ var _115 = (0, react_1.useState)(false), exportQR = _115[0], setExportQR = _115[1];
315
+ var _116 = (0, react_1.useState)(function () {
312
316
  var _a, _b;
313
317
  var firstTabId = (_b = (_a = structure.find(function (item) { return item.tabId; })) === null || _a === void 0 ? void 0 : _a.tabId) !== null && _b !== void 0 ? _b : "";
314
318
  return firstTabId;
315
- }), activeTab = _115[0], setActiveTab = _115[1];
316
- var _116 = (0, react_1.useState)(false), signatureSigning = _116[0], setSignatureSigning = _116[1];
317
- var _117 = (0, react_1.useState)({}), selectedData = _117[0], setSelectedData = _117[1];
318
- var _118 = (0, react_1.useState)(""), selectedObjectStructureId = _118[0], setSelectedObjectStructureId = _118[1];
319
- var _119 = (0, react_1.useState)(""), selectedObjectId = _119[0], setSelectedObjectId = _119[1];
320
- var _120 = (0, react_1.useState)(""), selectedListAddressId = _120[0], setSelectedListAddressId = _120[1];
321
- var _121 = (0, react_1.useState)(-1), selectedListAddressIndex = _121[0], setSelectedListAddressIndex = _121[1];
322
- var _122 = (0, react_1.useState)({
319
+ }), activeTab = _116[0], setActiveTab = _116[1];
320
+ var _117 = (0, react_1.useState)(false), signatureSigning = _117[0], setSignatureSigning = _117[1];
321
+ var _118 = (0, react_1.useState)({}), selectedData = _118[0], setSelectedData = _118[1];
322
+ var _119 = (0, react_1.useState)(""), selectedObjectStructureId = _119[0], setSelectedObjectStructureId = _119[1];
323
+ var _120 = (0, react_1.useState)(""), selectedObjectId = _120[0], setSelectedObjectId = _120[1];
324
+ var _121 = (0, react_1.useState)(""), selectedListAddressId = _121[0], setSelectedListAddressId = _121[1];
325
+ var _122 = (0, react_1.useState)(-1), selectedListAddressIndex = _122[0], setSelectedListAddressIndex = _122[1];
326
+ var _123 = (0, react_1.useState)({
323
327
  lat: 0,
324
328
  lng: 0,
325
329
  name: "",
326
- }), selectedListAddress = _122[0], setSelectedListAddress = _122[1];
327
- var _123 = (0, react_1.useState)({}), selectedObjectData = _123[0], setSelectedObjectData = _123[1];
328
- var _124 = (0, react_1.useState)(false), referenceLoading = _124[0], setReferenceLoading = _124[1];
329
- var _125 = (0, react_1.useState)({}), referencesOptions = _125[0], setReferencesOptions = _125[1];
330
- var _126 = (0, react_1.useState)({}), referencesDetails = _126[0], setReferencesDetails = _126[1];
331
- var _127 = (0, react_1.useState)({}), referenceDeleteTableData = _127[0], setReferenceDeleteTableData = _127[1];
332
- var _128 = (0, react_1.useState)(0), referenceDeleteIndex = _128[0], setReferenceDeleteIndex = _128[1];
333
- var _129 = (0, react_1.useState)({
330
+ }), selectedListAddress = _123[0], setSelectedListAddress = _123[1];
331
+ var _124 = (0, react_1.useState)({}), selectedObjectData = _124[0], setSelectedObjectData = _124[1];
332
+ var _125 = (0, react_1.useState)(false), referenceLoading = _125[0], setReferenceLoading = _125[1];
333
+ var _126 = (0, react_1.useState)({}), referencesOptions = _126[0], setReferencesOptions = _126[1];
334
+ var _127 = (0, react_1.useState)({}), referencesDetails = _127[0], setReferencesDetails = _127[1];
335
+ var _128 = (0, react_1.useState)({}), referenceDeleteTableData = _128[0], setReferenceDeleteTableData = _128[1];
336
+ var _129 = (0, react_1.useState)(0), referenceDeleteIndex = _129[0], setReferenceDeleteIndex = _129[1];
337
+ var _130 = (0, react_1.useState)({
334
338
  id: "",
335
339
  name: "",
336
340
  type: "string",
337
- }), referenceCreationModal = _129[0], setReferenceCreationModal = _129[1];
338
- var _130 = (0, react_1.useState)({}), referenceModelSchema = _130[0], setReferenceSchema = _130[1];
339
- var _131 = (0, react_1.useState)([]), kanbanChecked = _131[0], setKanbanChecked = _131[1];
341
+ }), referenceCreationModal = _130[0], setReferenceCreationModal = _130[1];
342
+ var _131 = (0, react_1.useState)({}), referenceModelSchema = _131[0], setReferenceSchema = _131[1];
343
+ var _132 = (0, react_1.useState)([]), kanbanChecked = _132[0], setKanbanChecked = _132[1];
340
344
  //INFO : Offline
341
- var _132 = (0, react_1.useState)(0), offlineDataLength = _132[0], setOfflineDataLength = _132[1];
342
- var _133 = (0, react_1.useState)(false), offlineModal = _133[0], setOfflineModal = _133[1];
345
+ var _133 = (0, react_1.useState)(0), offlineDataLength = _133[0], setOfflineDataLength = _133[1];
346
+ var _134 = (0, react_1.useState)(false), offlineModal = _134[0], setOfflineModal = _134[1];
343
347
  // INFO: live-stream state — driven by socket connection and navigator.onLine
344
- var _134 = (0, react_1.useState)(false), isLive = _134[0], setIsLive = _134[1];
345
- var _135 = (0, react_1.useState)(false), isLiveOffline = _135[0], setIsLiveOffline = _135[1];
348
+ var _135 = (0, react_1.useState)(false), isLive = _135[0], setIsLive = _135[1];
349
+ var _136 = (0, react_1.useState)(false), isLiveOffline = _136[0], setIsLiveOffline = _136[1];
346
350
  // INFO: true when navigator is offline — used to switch ReadQueryHoc between
347
351
  // server reads (online, full pagination) and IndexedDB reads (offline, cached data).
348
352
  // Independent of SSE status so it works even when bareSocketName is not set.
349
- var _136 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _136[0], setIsNetworkOffline = _136[1];
353
+ var _137 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _137[0], setIsNetworkOffline = _137[1];
350
354
  var previousType = (0, react_1.useRef)(null);
351
355
  var previousSelectedData = (0, react_1.useRef)(null);
352
356
  var scrollSentinelRef = (0, react_1.useRef)(null);
@@ -426,29 +430,33 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
426
430
  var limit = props.limit ? props.limit : 10;
427
431
  var isEditor = ((_v = props.edit) === null || _v === void 0 ? void 0 : _v.allEditable) ? true : false;
428
432
  var isOffline = (_w = props.bareSettings) === null || _w === void 0 ? void 0 : _w.bareOffline;
429
- var showId = (_x = props.space) === null || _x === void 0 ? void 0 : _x.showId;
433
+ // INFO: when bareOfflineNetworkAware is true, the save path is also gated on
434
+ // the live network state — online saves go to the server even if bareOffline
435
+ // is true, offline saves go to IDB as normal.
436
+ var isOfflineNetworkListener = isOffline && ((_x = props.bareSettings) === null || _x === void 0 ? void 0 : _x.bareOfflineNetworkListener);
437
+ var showId = (_y = props.space) === null || _y === void 0 ? void 0 : _y.showId;
430
438
  var remainId = showId || selectedObjectStructureId ? true : false;
431
- var idField = ((_y = props.space) === null || _y === void 0 ? void 0 : _y.idField) || ((_z = props.organise) === null || _z === void 0 ? void 0 : _z.idField);
432
- var pipeline = (_0 = props === null || props === void 0 ? void 0 : props.space) === null || _0 === void 0 ? void 0 : _0.pipeline;
433
- if ((_1 = props.bareSettings) === null || _1 === void 0 ? void 0 : _1.bareListPipeline) {
439
+ var idField = ((_z = props.space) === null || _z === void 0 ? void 0 : _z.idField) || ((_0 = props.organise) === null || _0 === void 0 ? void 0 : _0.idField);
440
+ var pipeline = (_1 = props === null || props === void 0 ? void 0 : props.space) === null || _1 === void 0 ? void 0 : _1.pipeline;
441
+ if ((_2 = props.bareSettings) === null || _2 === void 0 ? void 0 : _2.bareListPipeline) {
434
442
  pipeline = pipeline
435
443
  ? __spreadArray(__spreadArray([], pipeline, true), props.bareSettings.bareListPipeline, true) : props.bareSettings.bareListPipeline;
436
444
  }
437
- var hasNavigation = ((_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.handleNavigate) ? true : false;
438
- var columnType = (_4 = (_3 = props.bareSettings) === null || _3 === void 0 ? void 0 : _3.bareUpdateColumnType) !== null && _4 !== void 0 ? _4 : "two";
445
+ var hasNavigation = ((_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.handleNavigate) ? true : false;
446
+ var columnType = (_5 = (_4 = props.bareSettings) === null || _4 === void 0 ? void 0 : _4.bareUpdateColumnType) !== null && _5 !== void 0 ? _5 : "two";
439
447
  var formColumn = columnType === "one" ? "grid-cols-2" : "grid-cols-4";
440
- var useMobileView = (_6 = (_5 = props.bareSettings) === null || _5 === void 0 ? void 0 : _5.bareUpdateMobileView) !== null && _6 !== void 0 ? _6 : false;
448
+ var useMobileView = (_7 = (_6 = props.bareSettings) === null || _6 === void 0 ? void 0 : _6.bareUpdateMobileView) !== null && _7 !== void 0 ? _7 : false;
441
449
  var gridGap = useMobileView ? "gap-x-6 gap-y-2 md:gap-y-6" : "gap-6";
442
- var isActivityLog = (((_8 = (_7 = props.edit) === null || _7 === void 0 ? void 0 : _7.activityLog) === null || _8 === void 0 ? void 0 : _8.enableComments) &&
443
- ((_9 = props.edit) === null || _9 === void 0 ? void 0 : _9.activityLog.commentCollectionId)) ||
444
- (((_11 = (_10 = props.edit) === null || _10 === void 0 ? void 0 : _10.activityLog) === null || _11 === void 0 ? void 0 : _11.enableLogs) &&
445
- ((_12 = props.edit) === null || _12 === void 0 ? void 0 : _12.activityLog.logsCollectionId));
446
- var customPaginationSize = ((_13 = props.organise) === null || _13 === void 0 ? void 0 : _13.customPaginationCount)
450
+ var isActivityLog = (((_9 = (_8 = props.edit) === null || _8 === void 0 ? void 0 : _8.activityLog) === null || _9 === void 0 ? void 0 : _9.enableComments) &&
451
+ ((_10 = props.edit) === null || _10 === void 0 ? void 0 : _10.activityLog.commentCollectionId)) ||
452
+ (((_12 = (_11 = props.edit) === null || _11 === void 0 ? void 0 : _11.activityLog) === null || _12 === void 0 ? void 0 : _12.enableLogs) &&
453
+ ((_13 = props.edit) === null || _13 === void 0 ? void 0 : _13.activityLog.logsCollectionId));
454
+ var customPaginationSize = ((_14 = props.organise) === null || _14 === void 0 ? void 0 : _14.customPaginationCount)
447
455
  ? props.organise.customPaginationCount(size)
448
456
  : undefined;
449
457
  //TODO : Code - Pass ...devSettings, search dbEndpoint:
450
458
  var writeServerQuery = new writeQuery_1.WriteQuery({
451
- dbModule: (_14 = props.lib) === null || _14 === void 0 ? void 0 : _14.axios,
459
+ dbModule: (_15 = props.lib) === null || _15 === void 0 ? void 0 : _15.axios,
452
460
  dbType: devSettings.server,
453
461
  dbCollection: props.collectionId,
454
462
  dbEndpoint: devSettings.dbEndpoint,
@@ -456,7 +464,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
456
464
  dbUserToken: devSettings.dbUserToken,
457
465
  });
458
466
  var readServerQuery = new readQuery_1.ReadQuery({
459
- dbModule: (_15 = props.lib) === null || _15 === void 0 ? void 0 : _15.axios,
467
+ dbModule: (_16 = props.lib) === null || _16 === void 0 ? void 0 : _16.axios,
460
468
  dbType: devSettings.server,
461
469
  dbCollection: props.collectionId,
462
470
  dbEndpoint: devSettings.dbEndpoint,
@@ -464,9 +472,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
464
472
  dbUserToken: devSettings.dbUserToken,
465
473
  });
466
474
  var moreButtonPopUp = [
467
- ((_16 = props.edit) === null || _16 === void 0 ? void 0 : _16.allEditable) &&
475
+ ((_17 = props.edit) === null || _17 === void 0 ? void 0 : _17.allEditable) &&
468
476
  !isFirebase &&
469
- !((_18 = (_17 = props.organise) === null || _17 === void 0 ? void 0 : _17.exportSettings) === null || _18 === void 0 ? void 0 : _18.hideImportCSV)
477
+ !((_19 = (_18 = props.organise) === null || _18 === void 0 ? void 0 : _18.exportSettings) === null || _19 === void 0 ? void 0 : _19.hideImportCSV)
470
478
  ? {
471
479
  text: "Import Excel",
472
480
  onClick: function () {
@@ -475,7 +483,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
475
483
  },
476
484
  }
477
485
  : null,
478
- !((_20 = (_19 = props.organise) === null || _19 === void 0 ? void 0 : _19.exportSettings) === null || _20 === void 0 ? void 0 : _20.hideExportCSV)
486
+ !((_21 = (_20 = props.organise) === null || _20 === void 0 ? void 0 : _20.exportSettings) === null || _21 === void 0 ? void 0 : _21.hideExportCSV)
479
487
  ? {
480
488
  text: "Export CSV",
481
489
  onClick: function () {
@@ -485,7 +493,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
485
493
  },
486
494
  }
487
495
  : null,
488
- !((_22 = (_21 = props.organise) === null || _21 === void 0 ? void 0 : _21.exportSettings) === null || _22 === void 0 ? void 0 : _22.hideExportExcel)
496
+ !((_23 = (_22 = props.organise) === null || _22 === void 0 ? void 0 : _22.exportSettings) === null || _23 === void 0 ? void 0 : _23.hideExportExcel)
489
497
  ? {
490
498
  text: "Export Excel",
491
499
  onClick: function () {
@@ -495,7 +503,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
495
503
  },
496
504
  }
497
505
  : null,
498
- !((_24 = (_23 = props.organise) === null || _23 === void 0 ? void 0 : _23.exportSettings) === null || _24 === void 0 ? void 0 : _24.hideExportPDF)
506
+ !((_25 = (_24 = props.organise) === null || _24 === void 0 ? void 0 : _24.exportSettings) === null || _25 === void 0 ? void 0 : _25.hideExportPDF)
499
507
  ? {
500
508
  text: "Export PDF",
501
509
  onClick: function () {
@@ -505,7 +513,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
505
513
  },
506
514
  }
507
515
  : null,
508
- !((_26 = (_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.exportSettings) === null || _26 === void 0 ? void 0 : _26.hideExportQR)
516
+ !((_27 = (_26 = props.organise) === null || _26 === void 0 ? void 0 : _26.exportSettings) === null || _27 === void 0 ? void 0 : _27.hideExportQR)
509
517
  ? {
510
518
  text: "Export QR",
511
519
  onClick: function () {
@@ -515,7 +523,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
515
523
  },
516
524
  }
517
525
  : null,
518
- !((_28 = (_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.exportSettings) === null || _28 === void 0 ? void 0 : _28.hideExportQR)
526
+ !((_29 = (_28 = props.organise) === null || _28 === void 0 ? void 0 : _28.exportSettings) === null || _29 === void 0 ? void 0 : _29.hideExportQR)
519
527
  ? {
520
528
  text: "Export QR(Data)",
521
529
  onClick: function () {
@@ -525,7 +533,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
525
533
  },
526
534
  }
527
535
  : null,
528
- !((_30 = (_29 = props.organise) === null || _29 === void 0 ? void 0 : _29.exportSettings) === null || _30 === void 0 ? void 0 : _30.hideExportPrint)
536
+ !((_31 = (_30 = props.organise) === null || _30 === void 0 ? void 0 : _30.exportSettings) === null || _31 === void 0 ? void 0 : _31.hideExportPrint)
529
537
  ? {
530
538
  text: "Print",
531
539
  onClick: function () {
@@ -535,7 +543,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
535
543
  },
536
544
  }
537
545
  : null,
538
- !((_32 = (_31 = props.organise) === null || _31 === void 0 ? void 0 : _31.exportSettings) === null || _32 === void 0 ? void 0 : _32.hideExportDraft)
546
+ !((_33 = (_32 = props.organise) === null || _32 === void 0 ? void 0 : _32.exportSettings) === null || _33 === void 0 ? void 0 : _33.hideExportDraft)
539
547
  ? {
540
548
  text: filterDraft ? "Show All Items" : "Filter Draft",
541
549
  onClick: function () {
@@ -544,7 +552,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
544
552
  }
545
553
  : null,
546
554
  ].filter(Boolean);
547
- if ((_33 = props.organise) === null || _33 === void 0 ? void 0 : _33.moreSettings)
555
+ if ((_34 = props.organise) === null || _34 === void 0 ? void 0 : _34.moreSettings)
548
556
  moreButtonPopUp = moreButtonPopUp.concat(props.organise.moreSettings);
549
557
  //=====================================================================================
550
558
  //SECTION: Flex Filter Handlers
@@ -667,7 +675,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
667
675
  (0, react_1.useEffect)(function () {
668
676
  handleOfflinePrefetch();
669
677
  /* eslint-disable */
670
- }, [props.collectionId, (_34 = props.bareSettings) === null || _34 === void 0 ? void 0 : _34.bareOffline]);
678
+ }, [props.collectionId, (_35 = props.bareSettings) === null || _35 === void 0 ? void 0 : _35.bareOffline]);
671
679
  /* eslint-enable */
672
680
  // INFO: MRQ polling — calls handleRefresh every N ms (e.g. 1500) as a fallback.
673
681
  // Calls through handleRefreshRef so the interval always dispatches the latest
@@ -687,7 +695,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
687
695
  }, interval);
688
696
  return function () { return clearInterval(timer); };
689
697
  /* eslint-disable */
690
- }, [(_35 = props.bareSettings) === null || _35 === void 0 ? void 0 : _35.barePollingInterval, isLive, isNetworkOffline]);
698
+ }, [(_36 = props.bareSettings) === null || _36 === void 0 ? void 0 : _36.barePollingInterval, isLive, isNetworkOffline]);
691
699
  /* eslint-enable */
692
700
  // INFO: Pub/Sub → SSE live-stream — driven by bareSettings.bareSocketName
693
701
  // EventSource URL: {sseEndpoint}/{room}?bm_apiToken={token}
@@ -729,7 +737,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
729
737
  };
730
738
  /* eslint-disable */
731
739
  }, [
732
- (_36 = props.bareSettings) === null || _36 === void 0 ? void 0 : _36.bareSocketName,
740
+ (_37 = props.bareSettings) === null || _37 === void 0 ? void 0 : _37.bareSocketName,
733
741
  props.collectionId,
734
742
  props.devSettings.sseEndpoint,
735
743
  props.devSettings.dbAPIToken,
@@ -958,10 +966,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
958
966
  props.collectionId,
959
967
  props.model,
960
968
  props.localURLEndpoint,
961
- (_37 = props.organise) === null || _37 === void 0 ? void 0 : _37.extendedTabs,
962
- (_38 = props.organise) === null || _38 === void 0 ? void 0 : _38.viewId,
963
- (_39 = props.organise) === null || _39 === void 0 ? void 0 : _39.additionalQuery,
964
- (_40 = props.organise) === null || _40 === void 0 ? void 0 : _40.groupBy,
969
+ (_38 = props.organise) === null || _38 === void 0 ? void 0 : _38.extendedTabs,
970
+ (_39 = props.organise) === null || _39 === void 0 ? void 0 : _39.viewId,
971
+ (_40 = props.organise) === null || _40 === void 0 ? void 0 : _40.additionalQuery,
972
+ (_41 = props.organise) === null || _41 === void 0 ? void 0 : _41.groupBy,
965
973
  props.type,
966
974
  ]);
967
975
  (0, react_1.useEffect)(function () {
@@ -1051,7 +1059,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1051
1059
  };
1052
1060
  }, 100);
1053
1061
  return function () { return clearTimeout(timeoutId); };
1054
- }, [(_41 = props.organise) === null || _41 === void 0 ? void 0 : _41.showReadFloatingNav, props.type, props.id, loading]);
1062
+ }, [(_42 = props.organise) === null || _42 === void 0 ? void 0 : _42.showReadFloatingNav, props.type, props.id, loading]);
1055
1063
  (0, react_1.useEffect)(function () {
1056
1064
  if (props.type !== "read")
1057
1065
  return;
@@ -1324,81 +1332,128 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1324
1332
  // list → mutate tableData row(s) in-place; drive IndexedDB offline store
1325
1333
  // read / update → push update into selectedData; on delete navigate back to list
1326
1334
  var handleApplyEnvelope = function (envelope) { return __awaiter(void 0, void 0, void 0, function () {
1327
- var isListView, _a, record_1, record_2, record, deletedId_1, snapData_1, record_3, safeFields_1, record, record;
1335
+ var isListView, prettifyRecords, _a, record_1, rawRecord, prettyRecord, record_2, idx, mergedRaw, prettyRecord, newTableData, newSpaceTableData, record, deletedId_1, newTableData, newSpaceTableData, snapData, rawMap_1, changedRecords_1, prettyMap_1, prettyChanged, newTableData, newSpaceTableData, record_3, safeFields_1, record, record;
1328
1336
  var _b;
1329
1337
  return __generator(this, function (_c) {
1330
1338
  switch (_c.label) {
1331
1339
  case 0:
1332
1340
  isListView = props.type === "list";
1333
- if (!isListView) return [3 /*break*/, 10];
1341
+ if (!isListView) return [3 /*break*/, 13];
1342
+ prettifyRecords = function (records) { return __awaiter(void 0, void 0, void 0, function () {
1343
+ var resolved;
1344
+ var _a, _b, _c, _d, _e, _f;
1345
+ return __generator(this, function (_g) {
1346
+ switch (_g.label) {
1347
+ case 0:
1348
+ if (!isOffline) return [3 /*break*/, 2];
1349
+ return [4 /*yield*/, handleResolveOfflineReferences(records)];
1350
+ case 1:
1351
+ resolved = _g.sent();
1352
+ return [2 /*return*/, resolved.map(function (eachData) {
1353
+ var _a, _b;
1354
+ var tempData = __assign({}, eachData);
1355
+ (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);
1356
+ return tempData;
1357
+ })];
1358
+ 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, ((_c = props.organise) === null || _c === void 0 ? void 0 : _c.viewId) === "general", 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)];
1359
+ }
1360
+ });
1361
+ }); };
1334
1362
  _a = envelope.type;
1335
1363
  switch (_a) {
1336
1364
  case "insert": return [3 /*break*/, 1];
1337
- case "update": return [3 /*break*/, 3];
1338
- case "delete": return [3 /*break*/, 5];
1339
- case "snapshot": return [3 /*break*/, 7];
1365
+ case "update": return [3 /*break*/, 4];
1366
+ case "delete": return [3 /*break*/, 7];
1367
+ case "snapshot": return [3 /*break*/, 9];
1340
1368
  }
1341
- return [3 /*break*/, 9];
1369
+ return [3 /*break*/, 12];
1342
1370
  case 1:
1343
1371
  record_1 = envelope.payload;
1344
- setTableData(function (prev) {
1345
- if (prev.some(function (r) { return r._id === record_1._id; }))
1346
- return prev;
1347
- return __spreadArray([record_1], prev, true); // INFO: prepend — newest row at top
1348
- });
1349
- return [4 /*yield*/, indexedDb_1.indexedDb.handleUpsertLive(props.collectionId, record_1)];
1372
+ // INFO: skip if this record is already present (dedup)
1373
+ if (tableData.some(function (r) { return r._id === record_1._id; }))
1374
+ return [3 /*break*/, 12];
1375
+ rawRecord = __assign({}, record_1);
1376
+ if (rawRecord["_id"] && !rawRecord["id"]) {
1377
+ rawRecord["id"] = rawRecord["_id"];
1378
+ }
1379
+ return [4 /*yield*/, prettifyRecords([rawRecord])];
1350
1380
  case 2:
1351
- _c.sent();
1352
- return [3 /*break*/, 9];
1381
+ prettyRecord = (_c.sent())[0];
1382
+ // INFO: prepend to both lists so the newest row appears at the top,
1383
+ // keeping tableData and spaceTableData positionally identical.
1384
+ handleSetListData(__spreadArray([rawRecord], tableData, true), __spreadArray([prettyRecord], spaceTableData, true));
1385
+ return [4 /*yield*/, indexedDb_1.indexedDb.handleUpsertLive(props.collectionId, record_1)];
1353
1386
  case 3:
1387
+ _c.sent();
1388
+ return [3 /*break*/, 12];
1389
+ case 4:
1354
1390
  record_2 = envelope.payload;
1355
- setTableData(function (prev) {
1356
- var idx = prev.findIndex(function (r) { return r._id === record_2._id; });
1357
- if (idx < 0)
1358
- return prev; // INFO: row not in current page — skip
1359
- var next = __spreadArray([], prev, true);
1360
- next[idx] = __assign(__assign({}, next[idx]), record_2);
1361
- return next;
1362
- });
1391
+ idx = tableData.findIndex(function (r) { return r._id === record_2._id; });
1392
+ if (idx < 0)
1393
+ return [3 /*break*/, 12]; // INFO: row not in current page — skip
1394
+ mergedRaw = __assign(__assign({}, tableData[idx]), record_2);
1395
+ if (mergedRaw["_id"] && !mergedRaw["id"]) {
1396
+ mergedRaw["id"] = mergedRaw["_id"];
1397
+ }
1398
+ return [4 /*yield*/, prettifyRecords([mergedRaw])];
1399
+ case 5:
1400
+ prettyRecord = (_c.sent())[0];
1401
+ newTableData = __spreadArray([], tableData, true);
1402
+ newSpaceTableData = __spreadArray([], spaceTableData, true);
1403
+ newTableData[idx] = mergedRaw;
1404
+ newSpaceTableData[idx] = prettyRecord;
1405
+ handleSetListData(newTableData, newSpaceTableData);
1363
1406
  return [4 /*yield*/, indexedDb_1.indexedDb.handleUpsertLive(props.collectionId, record_2)];
1364
- case 4:
1407
+ case 6:
1365
1408
  _c.sent();
1366
- return [3 /*break*/, 9];
1367
- case 5:
1409
+ return [3 /*break*/, 12];
1410
+ case 7:
1368
1411
  record = envelope.payload;
1369
1412
  deletedId_1 = record._id;
1370
- setTableData(function (prev) {
1371
- return prev.filter(function (r) { return r._id !== deletedId_1; });
1372
- });
1413
+ newTableData = tableData.filter(function (r) { return r._id !== deletedId_1; });
1414
+ newSpaceTableData = spaceTableData.filter(function (_, i) { var _a; return ((_a = tableData[i]) === null || _a === void 0 ? void 0 : _a._id) !== deletedId_1; });
1415
+ handleSetListData(newTableData, newSpaceTableData);
1373
1416
  return [4 /*yield*/, indexedDb_1.indexedDb.handleDeleteLive(props.collectionId, deletedId_1)];
1374
- case 6:
1417
+ case 8:
1375
1418
  _c.sent();
1376
- return [3 /*break*/, 9];
1377
- case 7:
1378
- snapData_1 = Array.isArray(envelope.payload)
1419
+ return [3 /*break*/, 12];
1420
+ case 9:
1421
+ snapData = Array.isArray(envelope.payload)
1379
1422
  ? envelope.payload
1380
1423
  : [envelope.payload];
1381
- setTableData(function (prev) {
1382
- var map = new Map(prev.map(function (r) { return [r._id, r]; }));
1383
- snapData_1.forEach(function (r) {
1384
- return map.set(r._id, __assign(__assign({}, map.get(r._id)), r));
1385
- });
1386
- return Array.from(map.values());
1424
+ rawMap_1 = new Map(tableData.map(function (r) { return [r._id, r]; }));
1425
+ changedRecords_1 = [];
1426
+ snapData.forEach(function (r) {
1427
+ var merged = __assign(__assign({}, rawMap_1.get(r._id)), r);
1428
+ if (merged["_id"] && !merged["id"])
1429
+ merged["id"] = merged["_id"];
1430
+ rawMap_1.set(r._id, merged);
1431
+ changedRecords_1.push(merged);
1432
+ });
1433
+ prettyMap_1 = new Map(tableData.map(function (r, i) { return [r._id, spaceTableData[i]]; }));
1434
+ return [4 /*yield*/, prettifyRecords(changedRecords_1)];
1435
+ case 10:
1436
+ prettyChanged = _c.sent();
1437
+ prettyChanged.forEach(function (pretty, i) {
1438
+ prettyMap_1.set(changedRecords_1[i]._id, pretty);
1387
1439
  });
1440
+ newTableData = Array.from(rawMap_1.values());
1441
+ newSpaceTableData = newTableData.map(function (r) { var _a; return (_a = prettyMap_1.get(r._id)) !== null && _a !== void 0 ? _a : r; });
1442
+ handleSetListData(newTableData, newSpaceTableData);
1388
1443
  // INFO: persist reconciled docs to IndexedDB so offline mode stays
1389
1444
  // consistent after a snapshot — mirrors what insert/update/delete do
1390
1445
  // via handleUpsertLive.
1391
- return [4 /*yield*/, Promise.all(snapData_1.map(function (r) {
1446
+ return [4 /*yield*/, Promise.all(snapData.map(function (r) {
1392
1447
  return indexedDb_1.indexedDb.handleUpsertLive(props.collectionId, r);
1393
1448
  }))];
1394
- case 8:
1449
+ case 11:
1395
1450
  // INFO: persist reconciled docs to IndexedDB so offline mode stays
1396
1451
  // consistent after a snapshot — mirrors what insert/update/delete do
1397
1452
  // via handleUpsertLive.
1398
1453
  _c.sent();
1399
- return [3 /*break*/, 9];
1400
- case 9: return [3 /*break*/, 11];
1401
- case 10:
1454
+ return [3 /*break*/, 12];
1455
+ case 12: return [3 /*break*/, 14];
1456
+ case 13:
1402
1457
  // INFO: read / update view — push update into form; navigate away on delete
1403
1458
  switch (envelope.type) {
1404
1459
  case "update": {
@@ -1459,8 +1514,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1459
1514
  // handle collection-level rooms that may broadcast all event types.
1460
1515
  break;
1461
1516
  }
1462
- _c.label = 11;
1463
- case 11: return [2 /*return*/];
1517
+ _c.label = 14;
1518
+ case 14: return [2 /*return*/];
1464
1519
  }
1465
1520
  });
1466
1521
  }); };
@@ -2548,8 +2603,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2548
2603
  }); }))];
2549
2604
  case 2:
2550
2605
  _c.sent();
2551
- hadValidEntries = uploadedData_1.length > 0 ||
2552
- selectedField["upload"].length === 0;
2606
+ hadValidEntries = uploadedData_1.length > 0 || selectedField["upload"].length === 0;
2553
2607
  if (!hadValidEntries)
2554
2608
  return [2 /*return*/, selectedField];
2555
2609
  return [2 /*return*/, selectedField["data"].concat(uploadedData_1)];
@@ -3719,17 +3773,17 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3719
3773
  });
3720
3774
  }); };
3721
3775
  var handleSubmitData = function (type, rowId, columnId, data, offlineId, isOfflineUpdate, isDraft) { return __awaiter(void 0, void 0, void 0, function () {
3722
- var selectedId, id, createSelectedData_1, uniqueDataStructure, uniqueColumnId, res, offlineDataResp, offlineData, clonedForOffline, tempData, selectedIndex_3, err_20, isExistingDoc, newRecordData_1, changedAttributeIds, baseDraftValue, hasBaseDraftChange, offlineDataResp, clonedForOffline, tempData, selectedIndex_4, offlineData, err_21, dataToSubmit_2, changedAttributeIds, baseDraftValue, hasBaseDraftChange, operationType, selectedIndex_5, dataId, err_22, offlineDataResp, offlineData, clonedForOffline, tempData, selectedIndex_6, _a;
3723
- var _b, _c;
3724
- var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
3725
- return __generator(this, function (_w) {
3726
- switch (_w.label) {
3776
+ var selectedId, id, createSelectedData_1, uniqueDataStructure, uniqueColumnId, res, offlineDataResp, offlineData, clonedForOffline, tempData, selectedIndex_3, err_20, isExistingDoc, newRecordData_1, changedAttributeIds, baseDraftValue, hasBaseDraftChange, offlineDataResp, clonedForOffline, tempData, selectedIndex_4, offlineData, err_21, dataToSubmit_2, changedAttributeIds, baseDraftValue, hasBaseDraftChange, operationType, selectedIndex_5, wentToServer, dataId, err_22, offlineDataResp, offlineData, clonedForOffline, tempData, selectedIndex_6, _a;
3777
+ var _b, _c, _d;
3778
+ var _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
3779
+ return __generator(this, function (_y) {
3780
+ switch (_y.label) {
3727
3781
  case 0:
3728
3782
  selectedId = "";
3729
3783
  id = "";
3730
- _w.label = 1;
3784
+ _y.label = 1;
3731
3785
  case 1:
3732
- _w.trys.push([1, 37, , 43]);
3786
+ _y.trys.push([1, 39, , 45]);
3733
3787
  if (type === "update")
3734
3788
  selectedId = rowId !== null && rowId !== void 0 ? rowId : "";
3735
3789
  else if (type === "create")
@@ -3747,24 +3801,26 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3747
3801
  id = (0, uuid_1.v4)();
3748
3802
  }
3749
3803
  else
3750
- id = (_d = props.id) !== null && _d !== void 0 ? _d : "";
3804
+ id = (_e = props.id) !== null && _e !== void 0 ? _e : "";
3751
3805
  if (offlineId) {
3752
3806
  selectedId = offlineId;
3753
3807
  id = offlineId;
3754
3808
  }
3755
- if (!(isOffline && !offlineId)) return [3 /*break*/, 2];
3809
+ if (!(isOffline &&
3810
+ !(isOfflineNetworkListener && !isNetworkOffline) &&
3811
+ !offlineId)) return [3 /*break*/, 2];
3756
3812
  createSelectedData_1 = selectedData;
3757
3813
  return [3 /*break*/, 4];
3758
3814
  case 2: return [4 /*yield*/, handleUploadImage(id, data)];
3759
3815
  case 3:
3760
- createSelectedData_1 = _w.sent();
3761
- _w.label = 4;
3816
+ createSelectedData_1 = _y.sent();
3817
+ _y.label = 4;
3762
3818
  case 4:
3763
3819
  uniqueDataStructure = structure.filter(function (eachStructure) {
3764
3820
  return eachStructure.unique;
3765
3821
  });
3766
3822
  uniqueColumnId = uniqueDataStructure.length > 0 ? uniqueDataStructure[0].id : undefined;
3767
- if ((_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareUpdatePrefill) {
3823
+ if ((_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareUpdatePrefill) {
3768
3824
  props.bareSettings.bareUpdatePrefill(selectedData).map(function (eachField) {
3769
3825
  var key = eachField.key, value = eachField.value;
3770
3826
  createSelectedData_1[key] = value;
@@ -3778,13 +3834,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3778
3834
  if (isDraft)
3779
3835
  createSelectedData_1["baseDraft"] = true;
3780
3836
  if (!isOffline) return [3 /*break*/, 10];
3781
- _w.label = 5;
3837
+ _y.label = 5;
3782
3838
  case 5:
3783
- _w.trys.push([5, 8, , 9]);
3839
+ _y.trys.push([5, 8, , 9]);
3784
3840
  return [4 /*yield*/, indexedDb_1.indexedDb.getValue("local", props.collectionId)];
3785
3841
  case 6:
3786
- offlineDataResp = _w.sent();
3787
- offlineData = (_f = offlineDataResp === null || offlineDataResp === void 0 ? void 0 : offlineDataResp.data) !== null && _f !== void 0 ? _f : [];
3842
+ offlineDataResp = _y.sent();
3843
+ offlineData = (_g = offlineDataResp === null || offlineDataResp === void 0 ? void 0 : offlineDataResp.data) !== null && _g !== void 0 ? _g : [];
3788
3844
  clonedForOffline = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server, true, showId);
3789
3845
  tempData = (0, updateModule_1.handleParseOfflineWrite)(clonedForOffline, structure);
3790
3846
  // INFO: Stamp the _id on the offline entry so subsequent saves can find and update it
@@ -3827,22 +3883,22 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3827
3883
  type: props.collectionId,
3828
3884
  })];
3829
3885
  case 7:
3830
- _w.sent();
3886
+ _y.sent();
3831
3887
  res = true;
3832
3888
  return [3 /*break*/, 9];
3833
3889
  case 8:
3834
- err_20 = _w.sent();
3890
+ err_20 = _y.sent();
3835
3891
  return [3 /*break*/, 9];
3836
3892
  case 9: return [3 /*break*/, 16];
3837
3893
  case 10:
3838
3894
  if (!((idField && selectedData[idField]) ||
3839
- ((_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareUpsertPartialUpdate))) return [3 /*break*/, 12];
3840
- isExistingDoc = ((_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareUpsertPartialUpdate) &&
3895
+ ((_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareUpsertPartialUpdate))) return [3 /*break*/, 12];
3896
+ isExistingDoc = ((_j = props.bareSettings) === null || _j === void 0 ? void 0 : _j.bareUpsertPartialUpdate) &&
3841
3897
  loadedSelectedData.current != null;
3842
3898
  if (isExistingDoc) {
3843
3899
  changedAttributeIds = (0, updateModule_1.compareUpdatedFields)(loadedSelectedData.current, createSelectedData_1).changedAttributeIds;
3844
3900
  baseDraftValue = isDraft ? true : false;
3845
- hasBaseDraftChange = ((_k = (_j = loadedSelectedData.current) === null || _j === void 0 ? void 0 : _j["baseDraft"]) !== null && _k !== void 0 ? _k : false) !==
3901
+ hasBaseDraftChange = ((_l = (_k = loadedSelectedData.current) === null || _k === void 0 ? void 0 : _k["baseDraft"]) !== null && _l !== void 0 ? _l : false) !==
3846
3902
  baseDraftValue;
3847
3903
  // INFO: if nothing changed (including baseDraft), skip the write
3848
3904
  if (changedAttributeIds.length === 0 && !hasBaseDraftChange)
@@ -3893,7 +3949,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3893
3949
  upsert: true,
3894
3950
  })];
3895
3951
  case 11:
3896
- res = _w.sent();
3952
+ res = _y.sent();
3897
3953
  return [3 /*break*/, 16];
3898
3954
  case 12:
3899
3955
  // INFO: stepper create guard — if a create is already in-flight, queue this
@@ -3913,7 +3969,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3913
3969
  })];
3914
3970
  case 13:
3915
3971
  //INFO: [CREATE] Create new data
3916
- res = _w.sent();
3972
+ res = _y.sent();
3917
3973
  if (!(selectedId === "new")) return [3 /*break*/, 16];
3918
3974
  isCreatingRef.current = false;
3919
3975
  if (!pendingDraftSaveRef.current) return [3 /*break*/, 15];
@@ -3925,21 +3981,23 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3925
3981
  })];
3926
3982
  case 14:
3927
3983
  // INFO: replay as update — inflightIdRef.current holds the real _id
3928
- _w.sent();
3929
- _w.label = 15;
3984
+ _y.sent();
3985
+ _y.label = 15;
3930
3986
  case 15:
3931
3987
  inflightIdRef.current = "";
3932
- _w.label = 16;
3988
+ _y.label = 16;
3933
3989
  case 16: return [3 /*break*/, 25];
3934
3990
  case 17:
3935
3991
  if (!selectedId) return [3 /*break*/, 25];
3936
- if (!(isOffline && !offlineId)) return [3 /*break*/, 23];
3937
- _w.label = 18;
3992
+ if (!(isOffline &&
3993
+ !(isOfflineNetworkListener && !isNetworkOffline) &&
3994
+ !offlineId)) return [3 /*break*/, 23];
3995
+ _y.label = 18;
3938
3996
  case 18:
3939
- _w.trys.push([18, 21, , 22]);
3997
+ _y.trys.push([18, 21, , 22]);
3940
3998
  return [4 /*yield*/, indexedDb_1.indexedDb.getValue("local", props.collectionId)];
3941
3999
  case 19:
3942
- offlineDataResp = _w.sent();
4000
+ offlineDataResp = _y.sent();
3943
4001
  clonedForOffline = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server, true, showId);
3944
4002
  tempData = (0, updateModule_1.handleParseOfflineWrite)(clonedForOffline, structure);
3945
4003
  tempData[serverId] = selectedId;
@@ -3951,7 +4009,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3951
4009
  tempData.syncStatus = "pending";
3952
4010
  tempData.baseOnline = true; // INFO: existing server doc, updated offline
3953
4011
  selectedIndex_4 = -1;
3954
- offlineData = (_l = offlineDataResp === null || offlineDataResp === void 0 ? void 0 : offlineDataResp.data) !== null && _l !== void 0 ? _l : [];
4012
+ offlineData = (_m = offlineDataResp === null || offlineDataResp === void 0 ? void 0 : offlineDataResp.data) !== null && _m !== void 0 ? _m : [];
3955
4013
  offlineData.map(function (eachOfflineData, index) {
3956
4014
  var offlineDataId = eachOfflineData[serverId];
3957
4015
  if (selectedId === offlineDataId)
@@ -3981,11 +4039,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3981
4039
  type: props.collectionId,
3982
4040
  })];
3983
4041
  case 20:
3984
- _w.sent();
4042
+ _y.sent();
3985
4043
  res = true;
3986
4044
  return [3 /*break*/, 22];
3987
4045
  case 21:
3988
- err_21 = _w.sent();
4046
+ err_21 = _y.sent();
3989
4047
  return [3 /*break*/, 22];
3990
4048
  case 22: return [3 /*break*/, 25];
3991
4049
  case 23:
@@ -3994,10 +4052,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3994
4052
  _b[columnId] = createSelectedData_1[columnId],
3995
4053
  _b);
3996
4054
  }
3997
- else if ((_m = props.bareSettings) === null || _m === void 0 ? void 0 : _m.bareUpsertPartialUpdate) {
3998
- changedAttributeIds = (0, updateModule_1.compareUpdatedFields)((_o = loadedSelectedData.current) !== null && _o !== void 0 ? _o : {}, createSelectedData_1).changedAttributeIds;
4055
+ else if ((_o = props.bareSettings) === null || _o === void 0 ? void 0 : _o.bareUpsertPartialUpdate) {
4056
+ changedAttributeIds = (0, updateModule_1.compareUpdatedFields)((_p = loadedSelectedData.current) !== null && _p !== void 0 ? _p : {}, createSelectedData_1).changedAttributeIds;
3999
4057
  baseDraftValue = isDraft ? true : false;
4000
- hasBaseDraftChange = ((_q = (_p = loadedSelectedData.current) === null || _p === void 0 ? void 0 : _p["baseDraft"]) !== null && _q !== void 0 ? _q : false) !==
4058
+ hasBaseDraftChange = ((_r = (_q = loadedSelectedData.current) === null || _q === void 0 ? void 0 : _q["baseDraft"]) !== null && _r !== void 0 ? _r : false) !==
4001
4059
  baseDraftValue;
4002
4060
  // INFO: if nothing changed (including baseDraft), skip the write entirely
4003
4061
  if (changedAttributeIds.length === 0 && !hasBaseDraftChange)
@@ -4066,13 +4124,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4066
4124
  // doesn't exist yet (covers deterministicId passed directly as props.id).
4067
4125
  // Also applies to offline upload path so the doc is created if it was
4068
4126
  // deleted between the existence check and the write call.
4069
- upsert: ((_r = props.bareSettings) === null || _r === void 0 ? void 0 : _r.bareUpsertPartialUpdate) && !isOfflineUpdate
4127
+ upsert: ((_s = props.bareSettings) === null || _s === void 0 ? void 0 : _s.bareUpsertPartialUpdate) && !isOfflineUpdate
4070
4128
  ? true
4071
4129
  : undefined,
4072
4130
  })];
4073
4131
  case 24:
4074
- res = _w.sent();
4075
- _w.label = 25;
4132
+ res = _y.sent();
4133
+ _y.label = 25;
4076
4134
  case 25:
4077
4135
  if (!(type === "update" || type === "create")) return [3 /*break*/, 33];
4078
4136
  if (!res) return [3 /*break*/, 32];
@@ -4088,28 +4146,37 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4088
4146
  });
4089
4147
  return [4 /*yield*/, handleGetListData({ data: tableData[selectedIndex_5] }, "update", rowId)];
4090
4148
  case 26:
4091
- _w.sent();
4092
- _w.label = 27;
4149
+ _y.sent();
4150
+ _y.label = 27;
4093
4151
  case 27: return [3 /*break*/, 30];
4094
4152
  case 28: return [4 /*yield*/, handleGetListData({ data: [createSelectedData_1] }, "create")];
4095
4153
  case 29:
4096
- _w.sent();
4097
- _w.label = 30;
4154
+ _y.sent();
4155
+ _y.label = 30;
4098
4156
  case 30:
4099
- if (!((_s = props.bareSettings) === null || _s === void 0 ? void 0 : _s.bareUpdateHandlePostComplete)) return [3 /*break*/, 32];
4157
+ if (!((_t = props.bareSettings) === null || _t === void 0 ? void 0 : _t.bareUpdateHandlePostComplete)) return [3 /*break*/, 32];
4100
4158
  return [4 /*yield*/, props.bareSettings.bareUpdateHandlePostComplete(__assign((_c = {}, _c[serverId] = id, _c), createSelectedData_1))];
4101
4159
  case 31:
4102
- _w.sent();
4103
- _w.label = 32;
4104
- case 32: return [3 /*break*/, 36];
4160
+ _y.sent();
4161
+ _y.label = 32;
4162
+ case 32: return [3 /*break*/, 38];
4105
4163
  case 33:
4106
4164
  createSelectedData_1[serverId] = id;
4107
4165
  if (!!isOffline) return [3 /*break*/, 35];
4108
4166
  return [4 /*yield*/, handleGetListData({ data: [createSelectedData_1] }, selectedId === "new" ? "create" : "update", id)];
4109
4167
  case 34:
4110
- _w.sent();
4111
- _w.label = 35;
4168
+ _y.sent();
4169
+ _y.label = 35;
4112
4170
  case 35:
4171
+ wentToServer = res &&
4172
+ !offlineId &&
4173
+ (!isOffline || (isOfflineNetworkListener && !isNetworkOffline));
4174
+ if (!(wentToServer && ((_u = props.bareSettings) === null || _u === void 0 ? void 0 : _u.bareUpdateHandlePostComplete))) return [3 /*break*/, 37];
4175
+ return [4 /*yield*/, props.bareSettings.bareUpdateHandlePostComplete(__assign((_d = {}, _d[serverId] = id, _d), createSelectedData_1))];
4176
+ case 36:
4177
+ _y.sent();
4178
+ _y.label = 37;
4179
+ case 37:
4113
4180
  setNotification({
4114
4181
  type: true,
4115
4182
  title: props.id === "new"
@@ -4119,12 +4186,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4119
4186
  ? "Data sucessfully created"
4120
4187
  : "Data sucessfully updated",
4121
4188
  });
4122
- _w.label = 36;
4123
- case 36:
4189
+ _y.label = 38;
4190
+ case 38:
4124
4191
  dataId = res ? id : "";
4125
4192
  return [2 /*return*/, dataId];
4126
- case 37:
4127
- err_22 = _w.sent();
4193
+ case 39:
4194
+ err_22 = _y.sent();
4128
4195
  console.log("error", err_22);
4129
4196
  // INFO: clear in-flight guard on failure so the next save retries as a create
4130
4197
  if (isCreatingRef.current) {
@@ -4132,18 +4199,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4132
4199
  pendingDraftSaveRef.current = false;
4133
4200
  inflightIdRef.current = "";
4134
4201
  }
4135
- if (!(((_t = props.bareSettings) === null || _t === void 0 ? void 0 : _t.bareOffline) &&
4202
+ if (!(((_v = props.bareSettings) === null || _v === void 0 ? void 0 : _v.bareOffline) &&
4136
4203
  id &&
4137
4204
  !offlineId &&
4138
4205
  !isOfflineUpdate &&
4139
- !err_22.response)) return [3 /*break*/, 42];
4140
- _w.label = 38;
4141
- case 38:
4142
- _w.trys.push([38, 41, , 42]);
4206
+ !err_22.response)) return [3 /*break*/, 44];
4207
+ _y.label = 40;
4208
+ case 40:
4209
+ _y.trys.push([40, 43, , 44]);
4143
4210
  return [4 /*yield*/, indexedDb_1.indexedDb.getValue("local", props.collectionId)];
4144
- case 39:
4145
- offlineDataResp = _w.sent();
4146
- offlineData = (_u = offlineDataResp === null || offlineDataResp === void 0 ? void 0 : offlineDataResp.data) !== null && _u !== void 0 ? _u : [];
4211
+ case 41:
4212
+ offlineDataResp = _y.sent();
4213
+ offlineData = (_w = offlineDataResp === null || offlineDataResp === void 0 ? void 0 : offlineDataResp.data) !== null && _w !== void 0 ? _w : [];
4147
4214
  clonedForOffline = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server, true, showId);
4148
4215
  tempData = (0, updateModule_1.handleParseOfflineWrite)(clonedForOffline, structure);
4149
4216
  if (!tempData[serverId])
@@ -4179,8 +4246,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4179
4246
  data: offlineData,
4180
4247
  type: props.collectionId,
4181
4248
  })];
4182
- case 40:
4183
- _w.sent();
4249
+ case 42:
4250
+ _y.sent();
4184
4251
  setNotification({
4185
4252
  type: false,
4186
4253
  title: selectedId === "new"
@@ -4191,12 +4258,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4191
4258
  handleCheckOfflineDataLength();
4192
4259
  // INFO: return id so handleSubmit can navigate as if the save succeeded
4193
4260
  return [2 /*return*/, id];
4194
- case 41:
4195
- _a = _w.sent();
4196
- return [3 /*break*/, 42];
4197
- case 42:
4261
+ case 43:
4262
+ _a = _y.sent();
4263
+ return [3 /*break*/, 44];
4264
+ case 44:
4198
4265
  if (err_22.response && err_22.response.status === 400) {
4199
- if (typeof ((_v = err_22.response.data) === null || _v === void 0 ? void 0 : _v.err) === "string")
4266
+ if (typeof ((_x = err_22.response.data) === null || _x === void 0 ? void 0 : _x.err) === "string")
4200
4267
  setNotification({
4201
4268
  type: false,
4202
4269
  title: "Error",
@@ -4209,8 +4276,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4209
4276
  msg: "Please contact our administrator for assistance or try your request again later. We apologize for any inconvenience",
4210
4277
  });
4211
4278
  }
4212
- return [3 /*break*/, 43];
4213
- case 43: return [2 /*return*/];
4279
+ return [3 /*break*/, 45];
4280
+ case 45: return [2 /*return*/];
4214
4281
  }
4215
4282
  });
4216
4283
  }); };
@@ -7147,7 +7214,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7147
7214
  return (react_1.default.createElement(settingsModal_1.ExpressionModal, { selectedId: id, model: structure, renderReferenceLabelOptions: (_a = props.organise) === null || _a === void 0 ? void 0 : _a.renderReferenceLabelOptions, renderReferenceSpaceOptions: (_b = props.organise) === null || _b === void 0 ? void 0 : _b.renderReferenceSpaceOptions, onAddModelSchema: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.onAddColumns, onClose: onClose }));
7148
7215
  };
7149
7216
  var renderGroupTable = function (multipleSelect) {
7150
- 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;
7217
+ 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;
7151
7218
  if (groupId) {
7152
7219
  var groupAttributeDS_1 = structure.find(function (eachDS) { return eachDS.id === groupId; });
7153
7220
  var groupedSpaceTableData = spaceTableData.reduce(function (acc, eachData) {
@@ -7270,25 +7337,131 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7270
7337
  }
7271
7338
  }
7272
7339
  else {
7273
- return (react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.disableSelectFullData) === null || _b === void 0 ? void 0 : _b.table, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
7340
+ // INFO: when bareNewDTW is enabled, render NewTable instead of legacy Table
7341
+ if ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareNewDTW) {
7342
+ return (react_1.default.createElement(newTable_1.NewTable, { showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.disableSelectFullData) === null || _c === void 0 ? void 0 : _c.table, mobileView: (_d = props.bareSettings) === null || _d === void 0 ? void 0 : _d.bareListMobileView, mobileTooltip: (_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareMobileTooltip, multiActionFloatingBtns: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], (!((_f = props.edit) === null || _f === void 0 ? void 0 : _f.disabledUpdate) &&
7343
+ !((_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareHideTableExtraMultipleAction)
7344
+ ? [
7345
+ {
7346
+ id: "draft",
7347
+ btnText: "Change to Draft",
7348
+ onClick: function () { return handleBatchDraftData(); },
7349
+ hide: selectedIds.length === 0,
7350
+ },
7351
+ {
7352
+ id: "clone",
7353
+ btnText: "Clone Items",
7354
+ onClick: function () { return handleCloneSelectedData(); },
7355
+ hide: selectedIds.length === 0,
7356
+ },
7357
+ ]
7358
+ : []), true), (((_h = props.edit) === null || _h === void 0 ? void 0 : _h.deleteBtn)
7359
+ ? [
7360
+ {
7361
+ id: "delete",
7362
+ btnText: "Delete",
7363
+ onClick: function () {
7364
+ handleGenerateDeletePasscode();
7365
+ setDeleteModal(true);
7366
+ },
7367
+ },
7368
+ ]
7369
+ : []), true), (!isFirebase && !((_j = props.edit) === null || _j === void 0 ? void 0 : _j.disableBatchUpdate)
7370
+ ? [
7371
+ {
7372
+ id: "update",
7373
+ btnText: "Update",
7374
+ onClick: function () { return setBatchUpdateModal(true); },
7375
+ },
7376
+ ]
7377
+ : []), true), (((_k = props.bareSettings) === null || _k === void 0 ? void 0 : _k.bareListMultipleSelectAddtionalActions)
7378
+ ? props.bareSettings.bareListMultipleSelectAddtionalActions.map(function (eachButton) { return ({
7379
+ id: "dt-list-multi-action-btn-" + eachButton.text,
7380
+ btnText: eachButton.text,
7381
+ onClick: function () {
7382
+ var _a, _b;
7383
+ return (_a = eachButton.onClick) === null || _a === void 0 ? void 0 : _a.call(eachButton, selectedIds, selectAll, (_b = renderImpSearchFilterConditions()) !== null && _b !== void 0 ? _b : []);
7384
+ },
7385
+ }); })
7386
+ : []), true), handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, header: renderTableHeader(), pageIndex: pageIndex !== null && pageIndex !== void 0 ? pageIndex : 0, onClickRow: function (id) {
7387
+ var _a, _b;
7388
+ (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
7389
+ }, linkType: props.linkType, custom: props.custom, newTabUrl: (_m = (_l = props.newTabUrl) === null || _l === void 0 ? void 0 : _l.default) !== null && _m !== void 0 ? _m : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_p = (_o = props.newTabUrl) === null || _o === void 0 ? void 0 : _o.addons) !== null && _p !== void 0 ? _p : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
7390
+ handlePagination(value);
7391
+ }, className: "mt-5", devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_q = props.organise) === null || _q === void 0 ? void 0 : _q.fixedPagination, advSettings: {
7392
+ addColumnEnabled: (_r = props.organise) === null || _r === void 0 ? void 0 : _r.addColumnEnabled,
7393
+ renderAddColumnElements: renderAddMathColumn,
7394
+ dragEnabled: (_s = props.organise) === null || _s === void 0 ? void 0 : _s.advDragEnabled,
7395
+ sortEnabled: (_t = props.organise) === null || _t === void 0 ? void 0 : _t.advSortEnabled,
7396
+ filterEnabled: ((_u = props.bareSettings) === null || _u === void 0 ? void 0 : _u.bareFlexFilters)
7397
+ ? false
7398
+ : (_v = props.organise) === null || _v === void 0 ? void 0 : _v.advFilterEnabled,
7399
+ sortId: (_w = props.organise) === null || _w === void 0 ? void 0 : _w.sort,
7400
+ sortOptions: (_y = (_x = props.organise) === null || _x === void 0 ? void 0 : _x.renderReferenceLabelOptions) === null || _y === void 0 ? void 0 : _y.call(_x),
7401
+ onSortColumn: (_z = props.organise) === null || _z === void 0 ? void 0 : _z.onChangeSort,
7402
+ onDragColumn: (_0 = props.organise) === null || _0 === void 0 ? void 0 : _0.onChangeDrag,
7403
+ filterOptions: additionalQuery === null || additionalQuery === void 0 ? void 0 : additionalQuery.map(function (eachQuery) {
7404
+ var _a;
7405
+ return {
7406
+ key: eachQuery.value,
7407
+ label: (_a = eachQuery.label) !== null && _a !== void 0 ? _a : "",
7408
+ };
7409
+ }),
7410
+ renderFilterElements: function (id) {
7411
+ var selectedQuery = additionalQuery === null || additionalQuery === void 0 ? void 0 : additionalQuery.filter(function (eachQuery) {
7412
+ return eachQuery.value === id;
7413
+ });
7414
+ var selectedModelList = structure.filter(function (eachModel) { return eachModel.id === id; });
7415
+ var newQuery = (0, listModule_1.renderSearchAdditionalQueries)(selectedModelList, selectedQuery);
7416
+ return renderSearchContent(newQuery);
7417
+ },
7418
+ }, editable: {
7419
+ active: ((_1 = props.edit) === null || _1 === void 0 ? void 0 : _1.listEditable) && !props.edit.disabledUpdate
7420
+ ? true
7421
+ : false,
7422
+ onUpdateData: function (rowId, columnId, data) { return __awaiter(void 0, void 0, void 0, function () {
7423
+ return __generator(this, function (_a) {
7424
+ switch (_a.label) {
7425
+ case 0: return [4 /*yield*/, handleSubmitData("update", rowId, columnId, data)];
7426
+ case 1:
7427
+ _a.sent();
7428
+ return [2 /*return*/];
7429
+ }
7430
+ });
7431
+ }); },
7432
+ }, addable: {
7433
+ active: ((_2 = props.edit) === null || _2 === void 0 ? void 0 : _2.listAddable) ? true : false,
7434
+ onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
7435
+ return __generator(this, function (_a) {
7436
+ switch (_a.label) {
7437
+ case 0: return [4 /*yield*/, handleSubmitData("create", "", "", data)];
7438
+ case 1:
7439
+ _a.sent();
7440
+ return [2 /*return*/];
7441
+ }
7442
+ });
7443
+ }); },
7444
+ }, darkMode: (_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.darkMode, hidePagination: (_4 = props.organise) === null || _4 === void 0 ? void 0 : _4.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.disableEllipsisOnLongWord, pinColumns: (_6 = props.bareSettings) === null || _6 === void 0 ? void 0 : _6.bareListTablePinColumns }));
7445
+ }
7446
+ return (react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_8 = (_7 = props.organise) === null || _7 === void 0 ? void 0 : _7.disableSelectFullData) === null || _8 === void 0 ? void 0 : _8.table, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
7274
7447
  selectedIds.length > 0 &&
7275
- !((_c = props.edit) === null || _c === void 0 ? void 0 : _c.disabledUpdate) &&
7276
- !((_d = props.bareSettings) === null || _d === void 0 ? void 0 : _d.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
7448
+ !((_9 = props.edit) === null || _9 === void 0 ? void 0 : _9.disabledUpdate) &&
7449
+ !((_10 = props.bareSettings) === null || _10 === void 0 ? void 0 : _10.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
7277
7450
  react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Change to Draft", disable: loading, onClick: function () {
7278
7451
  handleBatchDraftData();
7279
7452
  } }),
7280
7453
  react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Clone Items", disable: loading, onClick: function () {
7281
7454
  handleCloneSelectedData();
7282
7455
  } }))),
7283
- ((_e = props.edit) === null || _e === void 0 ? void 0 : _e.deleteBtn) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm text-red-500 hover:text-red-600", text: "Delete", onClick: function () {
7456
+ ((_11 = props.edit) === null || _11 === void 0 ? void 0 : _11.deleteBtn) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm text-red-500 hover:text-red-600", text: "Delete", onClick: function () {
7284
7457
  handleGenerateDeletePasscode();
7285
7458
  setDeleteModal(true);
7286
7459
  } })),
7287
- !isFirebase && !((_f = props.edit) === null || _f === void 0 ? void 0 : _f.disableBatchUpdate) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
7460
+ !isFirebase && !((_12 = props.edit) === null || _12 === void 0 ? void 0 : _12.disableBatchUpdate) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
7288
7461
  setBatchUpdateModal(true);
7289
7462
  } })),
7290
- ((_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareListMultipleSelectAddtionalActions) &&
7291
- ((_j = (_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareListMultipleSelectAddtionalActions) === null || _j === void 0 ? void 0 : _j.map(function (eachButton) {
7463
+ ((_13 = props.bareSettings) === null || _13 === void 0 ? void 0 : _13.bareListMultipleSelectAddtionalActions) &&
7464
+ ((_15 = (_14 = props.bareSettings) === null || _14 === void 0 ? void 0 : _14.bareListMultipleSelectAddtionalActions) === null || _15 === void 0 ? void 0 : _15.map(function (eachButton) {
7292
7465
  return (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm ".concat(eachButton.className), text: eachButton.text, onClick: function () {
7293
7466
  var _a, _b;
7294
7467
  (_a = eachButton.onClick) === null || _a === void 0 ? void 0 : _a.call(eachButton, selectedIds, selectAll, (_b = renderImpSearchFilterConditions()) !== null && _b !== void 0 ? _b : []);
@@ -7296,20 +7469,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7296
7469
  }))), handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, header: renderTableHeader(), pageIndex: pageIndex !== null && pageIndex !== void 0 ? pageIndex : 0, onClickRow: function (id) {
7297
7470
  var _a, _b;
7298
7471
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
7299
- }, linkType: props.linkType, custom: props.custom, newTabUrl: (_l = (_k = props.newTabUrl) === null || _k === void 0 ? void 0 : _k.default) !== null && _l !== void 0 ? _l : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_o = (_m = props.newTabUrl) === null || _m === void 0 ? void 0 : _m.addons) !== null && _o !== void 0 ? _o : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
7472
+ }, 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) {
7300
7473
  handlePagination(value);
7301
- }, className: "mt-5", lib: { axios: (_p = props.lib) === null || _p === void 0 ? void 0 : _p.axios }, devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_q = props.organise) === null || _q === void 0 ? void 0 : _q.fixedPagination, advSettings: {
7302
- addColumnEnabled: (_r = props.organise) === null || _r === void 0 ? void 0 : _r.addColumnEnabled,
7474
+ }, className: "mt-5", lib: { axios: (_20 = props.lib) === null || _20 === void 0 ? void 0 : _20.axios }, devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_21 = props.organise) === null || _21 === void 0 ? void 0 : _21.fixedPagination, advSettings: {
7475
+ addColumnEnabled: (_22 = props.organise) === null || _22 === void 0 ? void 0 : _22.addColumnEnabled,
7303
7476
  renderAddColumnElements: renderAddMathColumn,
7304
- dragEnabled: (_s = props.organise) === null || _s === void 0 ? void 0 : _s.advDragEnabled,
7305
- sortEnabled: (_t = props.organise) === null || _t === void 0 ? void 0 : _t.advSortEnabled,
7306
- filterEnabled: ((_u = props.bareSettings) === null || _u === void 0 ? void 0 : _u.bareFlexFilters)
7477
+ dragEnabled: (_23 = props.organise) === null || _23 === void 0 ? void 0 : _23.advDragEnabled,
7478
+ sortEnabled: (_24 = props.organise) === null || _24 === void 0 ? void 0 : _24.advSortEnabled,
7479
+ filterEnabled: ((_25 = props.bareSettings) === null || _25 === void 0 ? void 0 : _25.bareFlexFilters)
7307
7480
  ? false
7308
- : (_v = props.organise) === null || _v === void 0 ? void 0 : _v.advFilterEnabled,
7309
- sortId: (_w = props.organise) === null || _w === void 0 ? void 0 : _w.sort,
7310
- sortOptions: (_y = (_x = props.organise) === null || _x === void 0 ? void 0 : _x.renderReferenceLabelOptions) === null || _y === void 0 ? void 0 : _y.call(_x),
7311
- onSortColumn: (_z = props.organise) === null || _z === void 0 ? void 0 : _z.onChangeSort,
7312
- onDragColumn: (_0 = props.organise) === null || _0 === void 0 ? void 0 : _0.onChangeDrag,
7481
+ : (_26 = props.organise) === null || _26 === void 0 ? void 0 : _26.advFilterEnabled,
7482
+ sortId: (_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.sort,
7483
+ sortOptions: (_29 = (_28 = props.organise) === null || _28 === void 0 ? void 0 : _28.renderReferenceLabelOptions) === null || _29 === void 0 ? void 0 : _29.call(_28),
7484
+ onSortColumn: (_30 = props.organise) === null || _30 === void 0 ? void 0 : _30.onChangeSort,
7485
+ onDragColumn: (_31 = props.organise) === null || _31 === void 0 ? void 0 : _31.onChangeDrag,
7313
7486
  filterOptions: additionalQuery === null || additionalQuery === void 0 ? void 0 : additionalQuery.map(function (eachQuery) {
7314
7487
  var _a;
7315
7488
  return {
@@ -7326,7 +7499,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7326
7499
  return renderSearchContent(newQuery);
7327
7500
  },
7328
7501
  }, editable: {
7329
- active: ((_1 = props.edit) === null || _1 === void 0 ? void 0 : _1.listEditable) && !props.edit.disabledUpdate
7502
+ active: ((_32 = props.edit) === null || _32 === void 0 ? void 0 : _32.listEditable) && !props.edit.disabledUpdate
7330
7503
  ? true
7331
7504
  : false,
7332
7505
  onUpdateData: function (rowId, columnId, data) { return __awaiter(void 0, void 0, void 0, function () {
@@ -7340,7 +7513,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7340
7513
  });
7341
7514
  }); },
7342
7515
  }, addable: {
7343
- active: ((_2 = props.edit) === null || _2 === void 0 ? void 0 : _2.listAddable) ? true : false,
7516
+ active: ((_33 = props.edit) === null || _33 === void 0 ? void 0 : _33.listAddable) ? true : false,
7344
7517
  onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
7345
7518
  return __generator(this, function (_a) {
7346
7519
  switch (_a.label) {
@@ -7351,11 +7524,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7351
7524
  }
7352
7525
  });
7353
7526
  }); },
7354
- }, darkMode: (_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.darkMode, hidePagination: (_4 = props.organise) === null || _4 === void 0 ? void 0 : _4.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.disableEllipsisOnLongWord }));
7527
+ }, darkMode: (_34 = props.organise) === null || _34 === void 0 ? void 0 : _34.darkMode, hidePagination: (_35 = props.organise) === null || _35 === void 0 ? void 0 : _35.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_36 = props.organise) === null || _36 === void 0 ? void 0 : _36.disableEllipsisOnLongWord }));
7355
7528
  }
7356
7529
  };
7357
7530
  var renderTabContent = function (tabs, dataType, viewType) {
7358
- 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;
7531
+ 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;
7359
7532
  var selectedTabData = tabs.find(function (eachTab) {
7360
7533
  if (eachTab.id === viewType) {
7361
7534
  return eachTab;
@@ -7536,27 +7709,50 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7536
7709
  }
7537
7710
  }
7538
7711
  else if (selectedTabData.viewType === "list") {
7712
+ // INFO: when bareNewDTW is enabled, render NewList instead of legacy List
7713
+ if ((_q = props.bareSettings) === null || _q === void 0 ? void 0 : _q.bareNewDTW) {
7714
+ return (react_1.default.createElement(newList_1.NewList, { paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list"), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: (_s = (_r = props.organise) === null || _r === void 0 ? void 0 : _r.disableSelectFullData) === null || _s === void 0 ? void 0 : _s.list, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? "from filter" : "", multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
7715
+ selectedIds.length > 0 && !((_t = props.edit) === null || _t === void 0 ? void 0 : _t.disabledUpdate) && (react_1.default.createElement(react_1.default.Fragment, null,
7716
+ react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Change to Draft", disable: loading, onClick: function () {
7717
+ handleBatchDraftData();
7718
+ } }),
7719
+ react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Clone Items", disable: loading, onClick: function () {
7720
+ handleCloneSelectedData();
7721
+ } }))),
7722
+ ((_u = props.edit) === null || _u === void 0 ? void 0 : _u.deleteBtn) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm text-red-500 hover:text-red-600", text: "Delete", onClick: function () {
7723
+ handleGenerateDeletePasscode();
7724
+ setDeleteModal(true);
7725
+ } })),
7726
+ !isFirebase && !((_v = props.edit) === null || _v === void 0 ? void 0 : _v.disabledUpdate) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
7727
+ setBatchUpdateModal(true);
7728
+ } }))), onClickRow: function (id) {
7729
+ var _a, _b;
7730
+ (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
7731
+ }, linkType: props.linkType, custom: props.custom, newTabUrl: (_x = (_w = props.newTabUrl) === null || _w === void 0 ? void 0 : _w.default) !== null && _x !== void 0 ? _x : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_z = (_y = props.newTabUrl) === null || _y === void 0 ? void 0 : _y.addons) !== null && _z !== void 0 ? _z : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
7732
+ handlePagination(value);
7733
+ }, darkMode: (_0 = props.organise) === null || _0 === void 0 ? void 0 : _0.darkMode, className: "mt-5", hidePagination: (_1 = props.organise) === null || _1 === void 0 ? void 0 : _1.hidePagination, customPaginationSize: customPaginationSize, mobileTooltip: (_2 = props.bareSettings) === null || _2 === void 0 ? void 0 : _2.bareListMobileTooltip }));
7734
+ }
7539
7735
  return (react_1.default.createElement(react_1.default.Fragment, null,
7540
- react_1.default.createElement(list_1.List, { paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list"), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: (_r = (_q = props.organise) === null || _q === void 0 ? void 0 : _q.disableSelectFullData) === null || _r === void 0 ? void 0 : _r.list, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? "from filter" : "", multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
7541
- selectedIds.length > 0 && !((_s = props.edit) === null || _s === void 0 ? void 0 : _s.disabledUpdate) && (react_1.default.createElement(react_1.default.Fragment, null,
7736
+ react_1.default.createElement(list_1.List, { paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list"), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: (_4 = (_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.disableSelectFullData) === null || _4 === void 0 ? void 0 : _4.list, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? "from filter" : "", multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
7737
+ selectedIds.length > 0 && !((_5 = props.edit) === null || _5 === void 0 ? void 0 : _5.disabledUpdate) && (react_1.default.createElement(react_1.default.Fragment, null,
7542
7738
  react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Change to Draft", disable: loading, onClick: function () {
7543
7739
  handleBatchDraftData();
7544
7740
  } }),
7545
7741
  react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Clone Items", disable: loading, onClick: function () {
7546
7742
  handleCloneSelectedData();
7547
7743
  } }))),
7548
- ((_t = props.edit) === null || _t === void 0 ? void 0 : _t.deleteBtn) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm text-red-500 hover:text-red-600", text: "Delete", onClick: function () {
7744
+ ((_6 = props.edit) === null || _6 === void 0 ? void 0 : _6.deleteBtn) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm text-red-500 hover:text-red-600", text: "Delete", onClick: function () {
7549
7745
  handleGenerateDeletePasscode();
7550
7746
  setDeleteModal(true);
7551
7747
  } })),
7552
- !isFirebase && !((_u = props.edit) === null || _u === void 0 ? void 0 : _u.disabledUpdate) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
7748
+ !isFirebase && !((_7 = props.edit) === null || _7 === void 0 ? void 0 : _7.disabledUpdate) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
7553
7749
  setBatchUpdateModal(true);
7554
7750
  } }))), onClickRow: function (id) {
7555
7751
  var _a, _b;
7556
7752
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
7557
- }, linkType: props.linkType, custom: props.custom, newTabUrl: (_w = (_v = props.newTabUrl) === null || _v === void 0 ? void 0 : _v.default) !== null && _w !== void 0 ? _w : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_y = (_x = props.newTabUrl) === null || _x === void 0 ? void 0 : _x.addons) !== null && _y !== void 0 ? _y : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
7753
+ }, 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) {
7558
7754
  handlePagination(value);
7559
- }, className: "mt-5", hidePagination: (_z = props.organise) === null || _z === void 0 ? void 0 : _z.hidePagination, customPaginationSize: customPaginationSize })));
7755
+ }, className: "mt-5", hidePagination: (_12 = props.organise) === null || _12 === void 0 ? void 0 : _12.hidePagination, customPaginationSize: customPaginationSize })));
7560
7756
  }
7561
7757
  else if (selectedTabData.viewType === "grid") {
7562
7758
  var isScrollMode = renderCheckScrollMode();
@@ -7564,9 +7760,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7564
7760
  react_1.default.createElement(grid_1.Grid, { paginationType: renderResolvedPaginationType(), data: renderGridAndListData(selectedTabData.viewImage, "grid"), size: size, limit: limit, cursor: cursor, loading: tableLoading, horizontalScroll: isScrollMode, pageIndex: pageIndex, onClickData: function (id) {
7565
7761
  var _a, _b;
7566
7762
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
7567
- }, linkType: props.linkType, custom: props.custom, newTabUrl: (_1 = (_0 = props.newTabUrl) === null || _0 === void 0 ? void 0 : _0.default) !== null && _1 !== void 0 ? _1 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_3 = (_2 = props.newTabUrl) === null || _2 === void 0 ? void 0 : _2.addons) !== null && _3 !== void 0 ? _3 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
7763
+ }, linkType: props.linkType, custom: props.custom, newTabUrl: (_14 = (_13 = props.newTabUrl) === null || _13 === void 0 ? void 0 : _13.default) !== null && _14 !== void 0 ? _14 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_16 = (_15 = props.newTabUrl) === null || _15 === void 0 ? void 0 : _15.addons) !== null && _16 !== void 0 ? _16 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
7568
7764
  handlePagination(value);
7569
- }, imgContain: selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.gridContain, gridColClassName: (_4 = props.bareSettings) === null || _4 === void 0 ? void 0 : _4.bareListGridColClassName, className: "mt-5", hidePagination: (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.hidePagination, customPaginationSize: customPaginationSize })));
7765
+ }, imgContain: selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.gridContain, gridColClassName: (_17 = props.bareSettings) === null || _17 === void 0 ? void 0 : _17.bareListGridColClassName, className: "mt-5", hidePagination: (_18 = props.organise) === null || _18 === void 0 ? void 0 : _18.hidePagination, customPaginationSize: customPaginationSize })));
7570
7766
  }
7571
7767
  else if (selectedTabData.viewType === "calendar") {
7572
7768
  var calendarSettings_1 = selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.calendarSettings;
@@ -7660,7 +7856,38 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7660
7856
  }
7661
7857
  return eventAvailabilities;
7662
7858
  };
7663
- return (react_1.default.createElement("div", { className: "mt-4" }, tableLoading ? (react_1.default.createElement(loading_1.Loading, null)) : (react_1.default.createElement(calendar_1.Calendar, { currentDate: calendarTabMonth, calendarView: (_6 = calendarSettings_1 === null || calendarSettings_1 === void 0 ? void 0 : calendarSettings_1.defaultView) !== null && _6 !== void 0 ? _6 : calendarView, handleMonthChange: function (date) {
7859
+ // INFO: when bareNewDTW is enabled, render NewCalendar instead of legacy Calendar
7860
+ if ((_19 = props.bareSettings) === null || _19 === void 0 ? void 0 : _19.bareNewDTW) {
7861
+ var newCalendarEvents = renderEventAvailabilities().map(function (ev) {
7862
+ var _a, _b, _c, _d;
7863
+ return ({
7864
+ id: (_a = ev.id) !== null && _a !== void 0 ? _a : "",
7865
+ title: (_b = ev.title) !== null && _b !== void 0 ? _b : "",
7866
+ start: (_d = (_c = ev.start) !== null && _c !== void 0 ? _c : ev.date) !== null && _d !== void 0 ? _d : new Date(),
7867
+ end: ev.end,
7868
+ type: ev.status,
7869
+ color: ev.bgColor,
7870
+ bgColor: ev.bgColor,
7871
+ hoverColor: ev.hoverColor,
7872
+ textColor: ev.textColor,
7873
+ status: ev.status,
7874
+ date: ev.date,
7875
+ });
7876
+ });
7877
+ return (react_1.default.createElement("div", { className: "mt-4" }, tableLoading ? (react_1.default.createElement(loading_1.Loading, null)) : (react_1.default.createElement(newCalendar_1.NewCalendar, { variant: "fullMonth", events: newCalendarEvents, selectedDate: calendarTabMonth, onSelectDate: function (date) {
7878
+ var startOfMonth = (0, dayjs_1.default)(calendarTabMonth).startOf("month");
7879
+ var endOfMonth = (0, dayjs_1.default)(calendarTabMonth).endOf("month");
7880
+ if (!(0, dayjs_1.default)(date).isBetween(startOfMonth, endOfMonth)) {
7881
+ setTableLoading(true);
7882
+ }
7883
+ setCalendarTabMonth(date);
7884
+ }, onClickEvent: function (event) {
7885
+ var _a, _b;
7886
+ if (event.id)
7887
+ (_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");
7888
+ }, darkMode: (_20 = props.organise) === null || _20 === void 0 ? void 0 : _20.darkMode, className: "w-full" }))));
7889
+ }
7890
+ 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: (_21 = calendarSettings_1 === null || calendarSettings_1 === void 0 ? void 0 : calendarSettings_1.defaultView) !== null && _21 !== void 0 ? _21 : calendarView, handleMonthChange: function (date) {
7664
7891
  var startOfMonth = (0, dayjs_1.default)(calendarTabMonth).startOf("month");
7665
7892
  var endOfMonth = (0, dayjs_1.default)(calendarTabMonth).endOf("month");
7666
7893
  if (!(0, dayjs_1.default)(date).isBetween(startOfMonth, endOfMonth)) {
@@ -7678,7 +7905,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7678
7905
  else if (selectedTabData.viewType === "feeds") {
7679
7906
  var contentList_1 = [];
7680
7907
  var feedsSettings_1 = selectedTabData.feedsSettings;
7681
- var customFeedsData = (_7 = feedsSettings_1 === null || feedsSettings_1 === void 0 ? void 0 : feedsSettings_1.customFeedsData) === null || _7 === void 0 ? void 0 : _7.call(feedsSettings_1, tableData, spaceTableData);
7908
+ var customFeedsData = (_22 = feedsSettings_1 === null || feedsSettings_1 === void 0 ? void 0 : feedsSettings_1.customFeedsData) === null || _22 === void 0 ? void 0 : _22.call(feedsSettings_1, tableData, spaceTableData);
7682
7909
  if (customFeedsData && customFeedsData.length > 0) {
7683
7910
  customFeedsData.map(function (eachData) {
7684
7911
  var _a, _b, _c, _d;
@@ -7719,11 +7946,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7719
7946
  });
7720
7947
  }
7721
7948
  return (react_1.default.createElement("div", { className: "mt-4" }, tableLoading ? (react_1.default.createElement(loading_1.Loading, null)) : (react_1.default.createElement("div", { className: "p-4 bg-white rounded-lg" },
7722
- react_1.default.createElement(feeds_1.Feeds, { bold: true, content: contentList_1, darkMode: (_8 = props.organise) === null || _8 === void 0 ? void 0 : _8.darkMode }),
7949
+ react_1.default.createElement(feeds_1.Feeds, { bold: true, content: contentList_1, darkMode: (_23 = props.organise) === null || _23 === void 0 ? void 0 : _23.darkMode }),
7723
7950
  react_1.default.createElement("div", { className: "my-10" }),
7724
- contentList_1.length > 0 && !((_9 = props.organise) === null || _9 === void 0 ? void 0 : _9.hidePagination) && (react_1.default.createElement(pagination_1.Pagination, { data: tableData, size: size, limit: limit, cursor: cursor, pageIndex: pageIndex, paginationType: renderResolvedPaginationType(), handleUpdatePageIndex: function (value) {
7951
+ contentList_1.length > 0 && !((_24 = props.organise) === null || _24 === void 0 ? void 0 : _24.hidePagination) && (react_1.default.createElement(pagination_1.Pagination, { data: tableData, size: size, limit: limit, cursor: cursor, pageIndex: pageIndex, paginationType: renderResolvedPaginationType(), handleUpdatePageIndex: function (value) {
7725
7952
  handlePagination(value);
7726
- }, darkMode: (_10 = props.organise) === null || _10 === void 0 ? void 0 : _10.darkMode, customPaginationSize: customPaginationSize }))))));
7953
+ }, darkMode: (_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.darkMode, customPaginationSize: customPaginationSize }))))));
7727
7954
  }
7728
7955
  else if (selectedTabData.viewType === "map") {
7729
7956
  var mapSettings_1 = selectedTabData.mapSettings;
@@ -7822,7 +8049,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7822
8049
  }
7823
8050
  else if (selectedTabData.viewType === "kanban") {
7824
8051
  var kanbanSettings = selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.kanbanSettings;
7825
- var kanbanTitle_2 = (_11 = kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.title) !== null && _11 !== void 0 ? _11 : "";
8052
+ var kanbanTitle_2 = (_26 = kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.title) !== null && _26 !== void 0 ? _26 : "";
7826
8053
  var nullColumn_1 = false;
7827
8054
  var groupBy_1 = [];
7828
8055
  var groupLabel_1 = [];
@@ -7842,6 +8069,21 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7842
8069
  return null;
7843
8070
  });
7844
8071
  var kanbanData = renderGridAndListData("", "kanban", kanbanTitle_2, kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.useColumnName);
8072
+ // INFO: when bareNewDTW is enabled, render NewKanban instead of legacy Kanban
8073
+ if ((_27 = props.bareSettings) === null || _27 === void 0 ? void 0 : _27.bareNewDTW) {
8074
+ 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
8075
+ ? "Data has exceeded limit, please apply filters"
8076
+ : "", groupCluster: kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.groupCluster, draggable: true, droppable: kanbanDroppable, mobileView: (_28 = props.bareSettings) === null || _28 === void 0 ? void 0 : _28.bareListMobileView, onUpdateData: function (cardId, _fromCol, toCol) {
8077
+ var _a;
8078
+ setKanbanDroppable(false);
8079
+ handleSubmitData("update", cardId, kanbanTitle_2, (_a = {},
8080
+ _a[kanbanTitle_2] = toCol,
8081
+ _a)).then(function () { return setKanbanDroppable(true); });
8082
+ }, onClickData: function (id) {
8083
+ var _a, _b;
8084
+ (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
8085
+ }, darkMode: (_29 = props.organise) === null || _29 === void 0 ? void 0 : _29.darkMode }));
8086
+ }
7845
8087
  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
7846
8088
  ? "Data has exceeded limit, please apply filters"
7847
8089
  : "", 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 () {
@@ -8354,7 +8596,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8354
8596
  };
8355
8597
  return (react_1.default.createElement(react_1.default.Fragment, null,
8356
8598
  renderNotification("root"),
8357
- ((_43 = (_42 = props.renderSettings) === null || _42 === void 0 ? void 0 : _42.renderLoadingUI) === null || _43 === void 0 ? void 0 : _43.call(_42)) && loading ? ((_44 = props.renderSettings) === null || _44 === void 0 ? void 0 : _44.renderLoadingUI()) : (react_1.default.createElement(modal_1.Modal, { maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
8599
+ ((_44 = (_43 = props.renderSettings) === null || _43 === void 0 ? void 0 : _43.renderLoadingUI) === null || _44 === void 0 ? void 0 : _44.call(_43)) && loading ? ((_45 = props.renderSettings) === null || _45 === void 0 ? void 0 : _45.renderLoadingUI()) : (react_1.default.createElement(modal_1.Modal, { maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
8358
8600
  var _a, _b;
8359
8601
  if (loading)
8360
8602
  return;