blixify-ui-web 1.2.94 → 1.2.96

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 (32) hide show
  1. package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
  2. package/lib/components/data/dataTemplate/index.js +183 -40
  3. package/lib/components/data/dataTemplate/index.js.map +1 -1
  4. package/lib/components/data/dataTemplate/model.d.ts +2 -0
  5. package/lib/components/data/dataTemplate/model.d.ts.map +1 -1
  6. package/lib/components/data/dataTemplate/viewStatePersistence.d.ts +1 -1
  7. package/lib/components/data/dataTemplate/viewStatePersistence.d.ts.map +1 -1
  8. package/lib/components/data/dataWrapper/index.d.ts +3 -0
  9. package/lib/components/data/dataWrapper/index.d.ts.map +1 -1
  10. package/lib/components/data/dataWrapper/index.js +12 -0
  11. package/lib/components/data/dataWrapper/index.js.map +1 -1
  12. package/lib/components/data/flexFilter/index.d.ts +1 -7
  13. package/lib/components/data/flexFilter/index.d.ts.map +1 -1
  14. package/lib/components/data/flexFilter/index.js +3 -0
  15. package/lib/components/data/flexFilter/index.js.map +1 -1
  16. package/lib/components/data/flexFilter/model.d.ts +8 -0
  17. package/lib/components/data/flexFilter/model.d.ts.map +1 -0
  18. package/lib/components/data/flexFilter/model.js +6 -0
  19. package/lib/components/data/flexFilter/model.js.map +1 -0
  20. package/lib/components/display/detailList/index.d.ts +1 -0
  21. package/lib/components/display/detailList/index.d.ts.map +1 -1
  22. package/lib/components/display/detailList/index.js +9 -6
  23. package/lib/components/display/detailList/index.js.map +1 -1
  24. package/lib/components/display/filePreview/index.d.ts +10 -0
  25. package/lib/components/display/filePreview/index.d.ts.map +1 -1
  26. package/lib/components/display/filePreview/index.js +53 -2
  27. package/lib/components/display/filePreview/index.js.map +1 -1
  28. package/lib/components/index.d.ts +3 -2
  29. package/lib/components/index.d.ts.map +1 -1
  30. package/lib/components/index.js.map +1 -1
  31. package/lib/tail.css +1 -1
  32. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/index.tsx"],"names":[],"mappings":"AAqCA,OAAO,KASN,MAAM,OAAO,CAAC;AA0Ff,OAAO,EACL,iBAAiB,EAKlB,MAAM,kBAAkB,CAAC;AAwD1B,eAAO,MAAM,YAAY,mFA29YvB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/index.tsx"],"names":[],"mappings":"AAqCA,OAAO,KASN,MAAM,OAAO,CAAC;AA0Ff,OAAO,EACL,iBAAiB,EAKlB,MAAM,kBAAkB,CAAC;AA0D1B,eAAO,MAAM,YAAY,mFAkoZvB,CAAC"}
@@ -867,6 +867,31 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
867
867
  setFlexFiltersDebounced(updatedFilters);
868
868
  setPageIndex(0);
869
869
  };
870
+ // INFO: applies flex filters from a parent, merged by columnId (incoming
871
+ // replaces same-column rows so no contradictory AND; other columns kept).
872
+ var handleApplyFlexFilters = function (incoming) {
873
+ handleClearFlexFilterTypingTimeout();
874
+ var incomingColumnIds = new Set(incoming.map(function (f) { return f.columnId; }));
875
+ var retained = flexFilters.filter(function (f) { return f.columnId && !incomingColumnIds.has(f.columnId); });
876
+ var merged = __spreadArray(__spreadArray([], retained, true), incoming, true);
877
+ setFlexFilters(merged);
878
+ setFlexFiltersDebounced(merged);
879
+ setPageIndex(0);
880
+ };
881
+ // INFO: clears flex filters by columnId (other columns preserved), or all
882
+ // when called with no args. Falls back to a single empty row when none remain.
883
+ var handleClearFlexFilters = function (columnIds) {
884
+ handleClearFlexFilterTypingTimeout();
885
+ var remaining = columnIds && columnIds.length > 0
886
+ ? flexFilters.filter(function (f) { return f.columnId && !columnIds.includes(f.columnId); })
887
+ : [];
888
+ var updatedFilters = remaining.length > 0
889
+ ? remaining
890
+ : [{ id: (0, uuid_1.v4)(), columnId: "", operator: "=", value: undefined }];
891
+ setFlexFilters(updatedFilters);
892
+ setFlexFiltersDebounced(updatedFilters);
893
+ setPageIndex(0);
894
+ };
870
895
  var handleFlexFilterColumnChange = function (filterId, columnId) {
871
896
  var updatedFilters = flexFilters.map(function (f) {
872
897
  if (f.id !== filterId)
@@ -954,6 +979,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
954
979
  },
955
980
  handleFormSubmit: handleFormSubmit,
956
981
  handleFormCheck: handleFormCheck,
982
+ handleApplyFlexFilters: handleApplyFlexFilters,
983
+ handleClearFlexFilters: handleClearFlexFilters,
957
984
  handlePopUpModal: handlePopUpModal,
958
985
  handleDeleteModal: handleDeleteModal,
959
986
  handleUploadOfflineData: handleUploadOfflineData,
@@ -973,6 +1000,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
973
1000
  isLive: isLive,
974
1001
  isLiveOffline: isLiveOffline,
975
1002
  }); });
1003
+ // INFO: notify the consumer whenever the applied flex filters change, so a
1004
+ // parent can observe live filter state. Uses the debounced state so it fires
1005
+ // on committed changes, not every keystroke.
1006
+ (0, react_1.useEffect)(function () {
1007
+ var _a, _b;
1008
+ (_b = (_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareOnFlexFiltersChange) === null || _b === void 0 ? void 0 : _b.call(_a, flexFiltersDebounced);
1009
+ }, [flexFiltersDebounced]);
976
1010
  // INFO: Auto-save view state to storage whenever filters, sort, page index,
977
1011
  // or column visibility change. Active for both "persistent" and "session" modes.
978
1012
  var persistSaveInitialised = (0, react_1.useRef)(false);
@@ -1344,6 +1378,40 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1344
1378
  (_60 = props.organise) === null || _60 === void 0 ? void 0 : _60.groupBy,
1345
1379
  resolvedType,
1346
1380
  ]);
1381
+ /**
1382
+ * INFO: a list tab is a different list. Switching from a file view to the
1383
+ * table used to carry two things across: the PAGE, so a second page reached
1384
+ * on five files opened the next tab past its two and showed nothing; and
1385
+ * the ROWS, so the table rendered the unwound files — three rows sharing
1386
+ * one record id — for the moment before its own fetch landed, and React,
1387
+ * reconciling children with duplicate keys, left a stale row behind:
1388
+ * three records showed as four. The page resets and the rows clear the
1389
+ * instant the tab changes, and the fetch that follows starts clean.
1390
+ *
1391
+ * Only while a list is showing. Opening a record and coming back changes
1392
+ * the view type on the way out and in, and that must not lose the page.
1393
+ */
1394
+ var previousListViewRef = (0, react_1.useRef)(null);
1395
+ (0, react_1.useEffect)(function () {
1396
+ var _a, _b;
1397
+ if (resolvedType !== "list")
1398
+ return;
1399
+ if (previousListViewRef.current === null) {
1400
+ previousListViewRef.current = viewType;
1401
+ return;
1402
+ }
1403
+ if (previousListViewRef.current === viewType)
1404
+ return;
1405
+ previousListViewRef.current = viewType;
1406
+ if (pageIndex !== 0)
1407
+ (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangePagination) === null || _b === void 0 ? void 0 : _b.call(_a, 0);
1408
+ setPageIndex(0);
1409
+ setCursor("");
1410
+ setLastCursor("");
1411
+ setTableLoading(true);
1412
+ handleSetListData([], []);
1413
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1414
+ }, [viewType, resolvedType]);
1347
1415
  (0, react_1.useEffect)(function () {
1348
1416
  if (props.devSettings.schemaReference)
1349
1417
  setReferenceSchema(props.devSettings.schemaReference);
@@ -2219,11 +2287,27 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2219
2287
  }
2220
2288
  _m.label = 5;
2221
2289
  case 5:
2222
- (_g = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _g === void 0 ? void 0 : _g.map(function (eachData) {
2290
+ (_g = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _g === void 0 ? void 0 : _g.map(function (eachData, eachIndex) {
2223
2291
  if (eachData["_id"]) {
2224
2292
  eachData["id"] = eachData["_id"];
2225
2293
  delete eachData["_id"];
2226
2294
  }
2295
+ /**
2296
+ * INFO: an unwound row is a FILE, and three files of one record
2297
+ * share its id. Rows are keyed by id wherever they are rendered,
2298
+ * and React reconciling children with duplicate keys leaves stale
2299
+ * rows behind when the list changes under it — three records read
2300
+ * as four after a visit to the file view. So a file row gets an id
2301
+ * of its own, unique across pages, and keeps the record's id
2302
+ * beside it for the tile to open.
2303
+ */
2304
+ if (fileViewColumnId && eachData["id"] !== undefined) {
2305
+ eachData["recordId"] = eachData["id"];
2306
+ // INFO: limit is dropped for a grouped list, and every row then
2307
+ // arrives at once — the index alone keeps the id unique
2308
+ eachData["id"] =
2309
+ "".concat(eachData["id"], "#").concat((pageIndex !== null && pageIndex !== void 0 ? pageIndex : 0) * (limit !== null && limit !== void 0 ? limit : 0) + eachIndex);
2310
+ }
2227
2311
  return null;
2228
2312
  });
2229
2313
  dataList = responseData.data;
@@ -7957,7 +8041,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7957
8041
  if (((_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs) &&
7958
8042
  ((_b = props.organise.extendedTabs) === null || _b === void 0 ? void 0 : _b.length) > 0) {
7959
8043
  (_c = props.organise) === null || _c === void 0 ? void 0 : _c.extendedTabs.map(function (eachTab) {
7960
- var _a, _b, _c, _d, _e, _f;
8044
+ var _a, _b, _c, _d, _e, _f, _g;
7961
8045
  var hrefPoint = "".concat(props.localURLEndpoint, "?type=").concat(resolvedType, "&collection=").concat(props.collectionId);
7962
8046
  if (props.id)
7963
8047
  hrefPoint += "&data=".concat(props.id);
@@ -7973,6 +8057,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7973
8057
  calendarSettings: (_b = eachTab.calendarSettings) !== null && _b !== void 0 ? _b : undefined,
7974
8058
  feedsSettings: (_c = eachTab.feedsSettings) !== null && _c !== void 0 ? _c : undefined,
7975
8059
  mapSettings: (_d = eachTab.mapSettings) !== null && _d !== void 0 ? _d : undefined,
8060
+ // INFO: the file view reads its column from the tab it renders, so
8061
+ // the settings have to survive this copy. Without them the query
8062
+ // still unwound the column (it reads the raw extendedTabs) while
8063
+ // the tile had no column to read and every file said "Attachment".
8064
+ fileSettings: (_e = eachTab.fileSettings) !== null && _e !== void 0 ? _e : undefined,
7976
8065
  };
7977
8066
  if (eachTab.viewType === "iframe") {
7978
8067
  if (typeof eachTab.src === "string") {
@@ -7987,7 +8076,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7987
8076
  }
7988
8077
  if (eachTab.type === resolvedType) {
7989
8078
  tabs.push(__assign(__assign(__assign({}, tabData), (isEditor &&
7990
- ((_e = props.organise) === null || _e === void 0 ? void 0 : _e.onChangeTabs) && {
8079
+ ((_f = props.organise) === null || _f === void 0 ? void 0 : _f.onChangeTabs) && {
7991
8080
  action: (react_1.default.createElement("span", { role: "button", "data-testid": "tab-default-".concat(tabData.id), "aria-label": eachTab.defaultTab
7992
8081
  ? "Opens by default"
7993
8082
  : "Open this tab by default", className: "ml-2 self-center ".concat(eachTab.defaultTab
@@ -7997,7 +8086,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7997
8086
  e.preventDefault();
7998
8087
  handleToggleDefaultTab(eachTab.name);
7999
8088
  } }, eachTab.defaultTab ? (react_1.default.createElement(HeroIcons.BookmarkIcon, { className: "h-4 w-4" })) : (react_1.default.createElement(BookmarkIcon_1.default, { className: "h-4 w-4" })))),
8000
- })), (!((_f = props.edit) === null || _f === void 0 ? void 0 : _f.disabledTabsDeleteBtn) && {
8089
+ })), (!((_g = props.edit) === null || _g === void 0 ? void 0 : _g.disabledTabsDeleteBtn) && {
8001
8090
  del: (react_1.default.createElement(outline_1.XMarkIcon, { className: "h-4 w-4 ml-2 self-center text-red-600 hover:text-red-400 ", onClick: function (e) {
8002
8091
  e.stopPropagation();
8003
8092
  e.preventDefault();
@@ -8463,7 +8552,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8463
8552
  }
8464
8553
  };
8465
8554
  var renderTabContent = function (tabs, dataType, requestedViewType) {
8466
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59;
8555
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60;
8467
8556
  var matchedTab = tabs.find(function (eachTab) { return eachTab.id === requestedViewType; });
8468
8557
  /**
8469
8558
  * INFO: a list tab must not supply the content of a read view. The selected
@@ -8701,7 +8790,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8701
8790
  handlePagination(value);
8702
8791
  }, className: "mt-5", hidePagination: (_20 = props.organise) === null || _20 === void 0 ? void 0 : _20.hidePagination, customPaginationSize: customPaginationSize })));
8703
8792
  }
8704
- else if (selectedTabData.viewType === "file" && resolvedType === "list") {
8793
+ else if (selectedTabData.viewType === "file" &&
8794
+ resolvedType === "list") {
8705
8795
  /**
8706
8796
  * INFO: the rows are already files — the server unwound the column, so
8707
8797
  * each row is one element with its record's fields alongside it. The
@@ -8714,46 +8804,99 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8714
8804
  * still a direct link for when the file itself is the point.
8715
8805
  */
8716
8806
  var columnId_2 = (_22 = (_21 = selectedTabData.fileSettings) === null || _21 === void 0 ? void 0 : _21.columnId) !== null && _22 !== void 0 ? _22 : "";
8807
+ var fileColumn_1 = structure.find(function (eachModel) { return eachModel.id === columnId_2; });
8808
+ var fileImageEndpoint_1 = ((_23 = props.devSettings) === null || _23 === void 0 ? void 0 : _23.imageEndpoint) || devSettings.imageEndpoint;
8809
+ /**
8810
+ * INFO: a stored file is not a url. A single file/image column holds
8811
+ * the download TOKEN — the file's name lives on the column
8812
+ * (imageFileName) and its folder on imageCollectionName + row id — and
8813
+ * a multiple entry is { token, fileName } with the storage object
8814
+ * name. Handed raw, FilePreview had nothing to draw and nothing to
8815
+ * name, so every tile read "Attachment". The grid and read views
8816
+ * rebuild the url with renderImageUrlFromPath; the tile does the same.
8817
+ */
8818
+ /**
8819
+ * INFO: the type from the NAME we know, not from the url we build —
8820
+ * handleGuessMimeType, beside FilePreview, so the type decision stays
8821
+ * in one place. A storage url can end in something other than the
8822
+ * object name; the column's file name and a multiple entry's stored
8823
+ * name are the honest source.
8824
+ */
8825
+ var handleResolveTileFile_1 = function (eachRow) {
8826
+ var _a, _b, _c, _d, _e, _f, _g, _h;
8827
+ var value = eachRow === null || eachRow === void 0 ? void 0 : eachRow[columnId_2];
8828
+ var rowId = String((_c = (_b = (_a = eachRow === null || eachRow === void 0 ? void 0 : eachRow.recordId) !== null && _a !== void 0 ? _a : eachRow === null || eachRow === void 0 ? void 0 : eachRow.id) !== null && _b !== void 0 ? _b : eachRow === null || eachRow === void 0 ? void 0 : eachRow._id) !== null && _c !== void 0 ? _c : "");
8829
+ var folder = (_d = fileColumn_1 === null || fileColumn_1 === void 0 ? void 0 : fileColumn_1.imageCollectionName) !== null && _d !== void 0 ? _d : props.collectionId;
8830
+ var isUrl = function (text) {
8831
+ return typeof text === "string" && /^https?:\/\//i.test(text);
8832
+ };
8833
+ if (isUrl(value))
8834
+ return { fileName: value };
8835
+ if (typeof value === "string" && value) {
8836
+ var name_1 = (_e = fileColumn_1 === null || fileColumn_1 === void 0 ? void 0 : fileColumn_1.imageFileName) !== null && _e !== void 0 ? _e : "";
8837
+ return {
8838
+ fileName: (0, blobModule_1.renderImageUrlFromPath)(fileImageEndpoint_1, folder, rowId, name_1, value, devSettings.bucketName),
8839
+ label: name_1 || undefined,
8840
+ mimeType: (0, filePreview_1.handleGuessMimeType)(name_1),
8841
+ token: value,
8842
+ };
8843
+ }
8844
+ if (value && typeof value === "object") {
8845
+ var name_2 = (_f = value.fileName) !== null && _f !== void 0 ? _f : "";
8846
+ if (isUrl(name_2))
8847
+ return { fileName: name_2, label: value.label };
8848
+ return {
8849
+ fileName: name_2
8850
+ ? (0, blobModule_1.renderImageUrlFromPath)(fileImageEndpoint_1, folder, rowId, name_2, (_g = value.token) !== null && _g !== void 0 ? _g : "", devSettings.bucketName)
8851
+ : "",
8852
+ // INFO: a multiple entry is stored as <uuid>-<name> or
8853
+ // <uuid><imageFileName> so entries never collide — the uuid is
8854
+ // not something a person recognises
8855
+ label: name_2.replace(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}-?/i, "") || undefined,
8856
+ mimeType: (_h = value.mimeType) !== null && _h !== void 0 ? _h : (0, filePreview_1.handleGuessMimeType)(name_2),
8857
+ token: value.token,
8858
+ };
8859
+ }
8860
+ return { fileName: "" };
8861
+ };
8717
8862
  return (react_1.default.createElement("div", { className: "mt-4" },
8718
8863
  tableLoading ? (react_1.default.createElement("div", { className: "flex flex-col items-center py-10" },
8719
8864
  react_1.default.createElement(loading_1.Loading, null))) : tableData.length === 0 ? (react_1.default.createElement(emptyState_1.EmptyState, { text: "No files here yet", icon: react_1.default.createElement(HeroIcons.PaperClipIcon, { className: "h-10 w-10 text-gray-400" }) })) : (
8720
8865
  // INFO: the same surface the other list views sit on, so
8721
8866
  // switching tabs does not change the shape of the page around
8722
8867
  // the content.
8723
- react_1.default.createElement("div", { className: "grid grid-cols-2 gap-4 rounded-lg p-4 sm:grid-cols-3 lg:grid-cols-4 ".concat(((_23 = props.organise) === null || _23 === void 0 ? void 0 : _23.darkMode) ? "bg-white/5" : "bg-white") }, tableData.map(function (eachRow, eachIndex) {
8724
- var _a, _b, _c;
8725
- return (react_1.default.createElement(filePreview_1.FilePreview, { key: "".concat((_b = (_a = eachRow === null || eachRow === void 0 ? void 0 : eachRow.id) !== null && _a !== void 0 ? _a : eachRow === null || eachRow === void 0 ? void 0 : eachRow._id) !== null && _b !== void 0 ? _b : eachIndex, "-").concat(eachIndex), variant: "tile", file: typeof (eachRow === null || eachRow === void 0 ? void 0 : eachRow[columnId_2]) === "string"
8726
- ? { fileName: eachRow[columnId_2] }
8727
- : ((_c = eachRow === null || eachRow === void 0 ? void 0 : eachRow[columnId_2]) !== null && _c !== void 0 ? _c : { fileName: "" }), onClick: function () {
8728
- var _a, _b, _c;
8868
+ react_1.default.createElement("div", { className: "grid grid-cols-2 gap-4 rounded-lg p-4 sm:grid-cols-3 lg:grid-cols-4 ".concat(((_24 = props.organise) === null || _24 === void 0 ? void 0 : _24.darkMode) ? "bg-white/5" : "bg-white") }, tableData.map(function (eachRow, eachIndex) {
8869
+ var _a, _b;
8870
+ return (react_1.default.createElement(filePreview_1.FilePreview, { key: "".concat((_b = (_a = eachRow === null || eachRow === void 0 ? void 0 : eachRow.id) !== null && _a !== void 0 ? _a : eachRow === null || eachRow === void 0 ? void 0 : eachRow._id) !== null && _b !== void 0 ? _b : eachIndex, "-").concat(eachIndex), variant: "tile", file: handleResolveTileFile_1(eachRow), onClick: function () {
8871
+ var _a, _b, _c, _d;
8729
8872
  // INFO: `id`, not `_id`. handleGetListData renames
8730
8873
  // every row's _id to id on the way in, the same as the
8731
8874
  // other views navigate with — reading _id here handed
8732
8875
  // the read view no id at all, so General Details was
8733
8876
  // empty.
8734
- return (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", (_c = eachRow === null || eachRow === void 0 ? void 0 : eachRow.id) !== null && _c !== void 0 ? _c : eachRow === null || eachRow === void 0 ? void 0 : eachRow._id, "general");
8877
+ return (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", (_d = (_c = eachRow === null || eachRow === void 0 ? void 0 : eachRow.recordId) !== null && _c !== void 0 ? _c : eachRow === null || eachRow === void 0 ? void 0 : eachRow.id) !== null && _d !== void 0 ? _d : eachRow === null || eachRow === void 0 ? void 0 : eachRow._id, "general");
8735
8878
  } }));
8736
8879
  }))),
8737
8880
  react_1.default.createElement(pagination_1.Pagination, { data: tableData, size: size, limit: limit, cursor: cursor, pageIndex: pageIndex, paginationType: renderResolvedPaginationType(), handleUpdatePageIndex: function (value) {
8738
8881
  handlePagination(value);
8739
- }, darkMode: (_24 = props.organise) === null || _24 === void 0 ? void 0 : _24.darkMode, customPaginationSize: customPaginationSize })));
8882
+ }, darkMode: (_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.darkMode, customPaginationSize: customPaginationSize })));
8740
8883
  }
8741
8884
  else if (selectedTabData.viewType === "grid") {
8742
8885
  var isScrollMode = renderCheckScrollMode();
8743
8886
  return (react_1.default.createElement(react_1.default.Fragment, null,
8744
- react_1.default.createElement(grid_1.Grid, { darkMode: (_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.darkMode, darkModeBg: (_26 = props.organise) === null || _26 === void 0 ? void 0 : _26.darkModeBg, paginationType: renderResolvedPaginationType(), data: renderGridAndListData(selectedTabData.viewImage, "grid"), size: size, limit: limit, cursor: cursor, loading: tableLoading, horizontalScroll: isScrollMode, pageIndex: pageIndex, onClickData: function (id) {
8887
+ react_1.default.createElement(grid_1.Grid, { darkMode: (_26 = props.organise) === null || _26 === void 0 ? void 0 : _26.darkMode, darkModeBg: (_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.darkModeBg, paginationType: renderResolvedPaginationType(), data: renderGridAndListData(selectedTabData.viewImage, "grid"), size: size, limit: limit, cursor: cursor, loading: tableLoading, horizontalScroll: isScrollMode, pageIndex: pageIndex, onClickData: function (id) {
8745
8888
  var _a, _b;
8746
8889
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
8747
- }, linkType: props.linkType, custom: props.custom, newTabUrl: (_28 = (_27 = props.newTabUrl) === null || _27 === void 0 ? void 0 : _27.default) !== null && _28 !== void 0 ? _28 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_30 = (_29 = props.newTabUrl) === null || _29 === void 0 ? void 0 : _29.addons) !== null && _30 !== void 0 ? _30 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
8890
+ }, linkType: props.linkType, custom: props.custom, newTabUrl: (_29 = (_28 = props.newTabUrl) === null || _28 === void 0 ? void 0 : _28.default) !== null && _29 !== void 0 ? _29 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_31 = (_30 = props.newTabUrl) === null || _30 === void 0 ? void 0 : _30.addons) !== null && _31 !== void 0 ? _31 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
8748
8891
  handlePagination(value);
8749
- }, imgContain: selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.gridContain, gridColClassName: (_31 = props.bareSettings) === null || _31 === void 0 ? void 0 : _31.bareListGridColClassName, className: "mt-5",
8892
+ }, imgContain: selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.gridContain, gridColClassName: (_32 = props.bareSettings) === null || _32 === void 0 ? void 0 : _32.bareListGridColClassName, className: "mt-5",
8750
8893
  // INFO: under the new DTW the grid keeps the same footer as the
8751
8894
  // table and list views instead of its own legacy page buttons
8752
- hidePagination: ((_32 = props.organise) === null || _32 === void 0 ? void 0 : _32.hidePagination) ||
8753
- !!((_33 = props.bareSettings) === null || _33 === void 0 ? void 0 : _33.bareNewDTW), customPaginationSize: customPaginationSize }),
8754
- ((_34 = props.bareSettings) === null || _34 === void 0 ? void 0 : _34.bareNewDTW) &&
8755
- !((_35 = props.organise) === null || _35 === void 0 ? void 0 : _35.hidePagination) && (react_1.default.createElement(newPagination_1.NewPagination, { paginationType: renderResolvedPaginationType(), pageIndex: pageIndex, limit: limit, size: size, cursor: cursor, resultCount: renderGridAndListData(selectedTabData.viewImage, "grid")
8756
- .length, customPaginationSize: customPaginationSize, darkMode: (_36 = props.organise) === null || _36 === void 0 ? void 0 : _36.darkMode, darkModeBg: (_37 = props.organise) === null || _37 === void 0 ? void 0 : _37.darkModeBg, handleUpdatePageIndex: function (value) {
8895
+ hidePagination: ((_33 = props.organise) === null || _33 === void 0 ? void 0 : _33.hidePagination) ||
8896
+ !!((_34 = props.bareSettings) === null || _34 === void 0 ? void 0 : _34.bareNewDTW), customPaginationSize: customPaginationSize }),
8897
+ ((_35 = props.bareSettings) === null || _35 === void 0 ? void 0 : _35.bareNewDTW) &&
8898
+ !((_36 = props.organise) === null || _36 === void 0 ? void 0 : _36.hidePagination) && (react_1.default.createElement(newPagination_1.NewPagination, { paginationType: renderResolvedPaginationType(), pageIndex: pageIndex, limit: limit, size: size, cursor: cursor, resultCount: renderGridAndListData(selectedTabData.viewImage, "grid")
8899
+ .length, customPaginationSize: customPaginationSize, darkMode: (_37 = props.organise) === null || _37 === void 0 ? void 0 : _37.darkMode, darkModeBg: (_38 = props.organise) === null || _38 === void 0 ? void 0 : _38.darkModeBg, handleUpdatePageIndex: function (value) {
8757
8900
  handlePagination(value);
8758
8901
  } }))));
8759
8902
  }
@@ -8855,7 +8998,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8855
8998
  return eventAvailabilities;
8856
8999
  };
8857
9000
  // INFO: when bareNewDTW is enabled, render NewCalendar instead of legacy Calendar
8858
- if ((_38 = props.bareSettings) === null || _38 === void 0 ? void 0 : _38.bareNewDTW) {
9001
+ if ((_39 = props.bareSettings) === null || _39 === void 0 ? void 0 : _39.bareNewDTW) {
8859
9002
  var newCalendarEvents = renderEventAvailabilities().map(function (ev) {
8860
9003
  var _a, _b, _c, _d;
8861
9004
  return ({
@@ -8875,13 +9018,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8875
9018
  // INFO: viewSwitch — optional Month/Week/Agenda toggle. The range
8876
9019
  // query follows via calendarView ("dayGridMonth" ↔ "timeGridWeek");
8877
9020
  // agenda lists the fetched month chronologically.
8878
- var viewSwitchOptions = (_39 = calendarSettings_1 === null || calendarSettings_1 === void 0 ? void 0 : calendarSettings_1.viewSwitch) !== null && _39 !== void 0 ? _39 : [];
9021
+ var viewSwitchOptions = (_40 = calendarSettings_1 === null || calendarSettings_1 === void 0 ? void 0 : calendarSettings_1.viewSwitch) !== null && _40 !== void 0 ? _40 : [];
8879
9022
  var VIEW_VARIANT_MAP = {
8880
9023
  month: "fullMonth",
8881
9024
  week: "weekTimeGrid",
8882
9025
  agenda: "agenda",
8883
9026
  };
8884
- var activeVariant = (_40 = VIEW_VARIANT_MAP[newCalendarViewMode]) !== null && _40 !== void 0 ? _40 : "fullMonth";
9027
+ var activeVariant = (_41 = VIEW_VARIANT_MAP[newCalendarViewMode]) !== null && _41 !== void 0 ? _41 : "fullMonth";
8885
9028
  return (react_1.default.createElement("div", { className: "mt-4" },
8886
9029
  viewSwitchOptions.length > 1 && (react_1.default.createElement("div", { className: "mb-2 flex justify-end" },
8887
9030
  react_1.default.createElement("div", { className: "inline-flex rounded-lg border border-gray-200 bg-white p-0.5" }, viewSwitchOptions.map(function (view) { return (react_1.default.createElement("button", { key: view, type: "button", onClick: function () {
@@ -8923,9 +9066,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8923
9066
  var _a, _b;
8924
9067
  if (event.id)
8925
9068
  (_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");
8926
- }, darkMode: (_41 = props.organise) === null || _41 === void 0 ? void 0 : _41.darkMode, className: "w-full" }))));
9069
+ }, darkMode: (_42 = props.organise) === null || _42 === void 0 ? void 0 : _42.darkMode, className: "w-full" }))));
8927
9070
  }
8928
- 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: (_42 = calendarSettings_1 === null || calendarSettings_1 === void 0 ? void 0 : calendarSettings_1.defaultView) !== null && _42 !== void 0 ? _42 : calendarView, handleMonthChange: function (date) {
9071
+ return (react_1.default.createElement("div", { className: "mt-4" }, tableLoading ? (react_1.default.createElement(loading_1.Loading, null)) : (react_1.default.createElement(calendar_1.Calendar, { currentDate: calendarTabMonth, calendarView: (_43 = calendarSettings_1 === null || calendarSettings_1 === void 0 ? void 0 : calendarSettings_1.defaultView) !== null && _43 !== void 0 ? _43 : calendarView, handleMonthChange: function (date) {
8929
9072
  var startOfMonth = (0, dayjs_1.default)(calendarTabMonth).startOf("month");
8930
9073
  var endOfMonth = (0, dayjs_1.default)(calendarTabMonth).endOf("month");
8931
9074
  if (!(0, dayjs_1.default)(date).isBetween(startOfMonth, endOfMonth)) {
@@ -8943,7 +9086,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8943
9086
  else if (selectedTabData.viewType === "feeds") {
8944
9087
  var contentList_1 = [];
8945
9088
  var feedsSettings_1 = selectedTabData.feedsSettings;
8946
- var customFeedsData = (_43 = feedsSettings_1 === null || feedsSettings_1 === void 0 ? void 0 : feedsSettings_1.customFeedsData) === null || _43 === void 0 ? void 0 : _43.call(feedsSettings_1, tableData, spaceTableData);
9089
+ var customFeedsData = (_44 = feedsSettings_1 === null || feedsSettings_1 === void 0 ? void 0 : feedsSettings_1.customFeedsData) === null || _44 === void 0 ? void 0 : _44.call(feedsSettings_1, tableData, spaceTableData);
8947
9090
  if (customFeedsData && customFeedsData.length > 0) {
8948
9091
  customFeedsData.map(function (eachData) {
8949
9092
  var _a, _b, _c, _d;
@@ -8988,21 +9131,21 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8988
9131
  return (react_1.default.createElement("div", { className: "mt-4" }, tableLoading ? (react_1.default.createElement(loading_1.Loading, null)) : (react_1.default.createElement("div", {
8989
9132
  // INFO: NewFeeds is already a card like the table and list, so the new
8990
9133
  // DTW renders it bare; the legacy feed still needs its own surface
8991
- className: ((_44 = props.bareSettings) === null || _44 === void 0 ? void 0 : _44.bareNewDTW)
9134
+ className: ((_45 = props.bareSettings) === null || _45 === void 0 ? void 0 : _45.bareNewDTW)
8992
9135
  ? ""
8993
- : "p-4 rounded-lg ".concat(((_45 = props.organise) === null || _45 === void 0 ? void 0 : _45.darkMode) ? "bg-white/5" : "bg-white") },
8994
- ((_46 = props.bareSettings) === null || _46 === void 0 ? void 0 : _46.bareNewDTW) ? (react_1.default.createElement(newFeeds_1.NewFeeds, { bold: true, content: contentList_1, darkMode: (_47 = props.organise) === null || _47 === void 0 ? void 0 : _47.darkMode, onClickItem: function (id) { var _a, _b; return (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general"); } })) : (react_1.default.createElement(feeds_1.Feeds, { bold: true, content: contentList_1, darkMode: (_48 = props.organise) === null || _48 === void 0 ? void 0 : _48.darkMode })),
9136
+ : "p-4 rounded-lg ".concat(((_46 = props.organise) === null || _46 === void 0 ? void 0 : _46.darkMode) ? "bg-white/5" : "bg-white") },
9137
+ ((_47 = props.bareSettings) === null || _47 === void 0 ? void 0 : _47.bareNewDTW) ? (react_1.default.createElement(newFeeds_1.NewFeeds, { bold: true, content: contentList_1, darkMode: (_48 = props.organise) === null || _48 === void 0 ? void 0 : _48.darkMode, onClickItem: function (id) { var _a, _b; return (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general"); } })) : (react_1.default.createElement(feeds_1.Feeds, { bold: true, content: contentList_1, darkMode: (_49 = props.organise) === null || _49 === void 0 ? void 0 : _49.darkMode })),
8995
9138
  react_1.default.createElement("div", { className: "my-10" }),
8996
9139
  contentList_1.length > 0 &&
8997
- !((_49 = props.organise) === null || _49 === void 0 ? void 0 : _49.hidePagination) &&
8998
- ((_50 = props.bareSettings) === null || _50 === void 0 ? void 0 : _50.bareNewDTW) && (react_1.default.createElement(newPagination_1.NewPagination, { paginationType: renderResolvedPaginationType(), pageIndex: pageIndex, limit: limit, size: size, cursor: cursor, resultCount: tableData.length, customPaginationSize: customPaginationSize, darkMode: (_51 = props.organise) === null || _51 === void 0 ? void 0 : _51.darkMode, darkModeBg: (_52 = props.organise) === null || _52 === void 0 ? void 0 : _52.darkModeBg, handleUpdatePageIndex: function (value) {
9140
+ !((_50 = props.organise) === null || _50 === void 0 ? void 0 : _50.hidePagination) &&
9141
+ ((_51 = props.bareSettings) === null || _51 === void 0 ? void 0 : _51.bareNewDTW) && (react_1.default.createElement(newPagination_1.NewPagination, { paginationType: renderResolvedPaginationType(), pageIndex: pageIndex, limit: limit, size: size, cursor: cursor, resultCount: tableData.length, customPaginationSize: customPaginationSize, darkMode: (_52 = props.organise) === null || _52 === void 0 ? void 0 : _52.darkMode, darkModeBg: (_53 = props.organise) === null || _53 === void 0 ? void 0 : _53.darkModeBg, handleUpdatePageIndex: function (value) {
8999
9142
  handlePagination(value);
9000
9143
  } })),
9001
9144
  contentList_1.length > 0 &&
9002
- !((_53 = props.organise) === null || _53 === void 0 ? void 0 : _53.hidePagination) &&
9003
- !((_54 = props.bareSettings) === null || _54 === void 0 ? void 0 : _54.bareNewDTW) && (react_1.default.createElement(pagination_1.Pagination, { data: tableData, size: size, limit: limit, cursor: cursor, pageIndex: pageIndex, paginationType: renderResolvedPaginationType(), handleUpdatePageIndex: function (value) {
9145
+ !((_54 = props.organise) === null || _54 === void 0 ? void 0 : _54.hidePagination) &&
9146
+ !((_55 = props.bareSettings) === null || _55 === void 0 ? void 0 : _55.bareNewDTW) && (react_1.default.createElement(pagination_1.Pagination, { data: tableData, size: size, limit: limit, cursor: cursor, pageIndex: pageIndex, paginationType: renderResolvedPaginationType(), handleUpdatePageIndex: function (value) {
9004
9147
  handlePagination(value);
9005
- }, darkMode: (_55 = props.organise) === null || _55 === void 0 ? void 0 : _55.darkMode, customPaginationSize: customPaginationSize }))))));
9148
+ }, darkMode: (_56 = props.organise) === null || _56 === void 0 ? void 0 : _56.darkMode, customPaginationSize: customPaginationSize }))))));
9006
9149
  }
9007
9150
  else if (selectedTabData.viewType === "map") {
9008
9151
  var mapSettings_1 = selectedTabData.mapSettings;
@@ -9101,7 +9244,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9101
9244
  }
9102
9245
  else if (selectedTabData.viewType === "kanban") {
9103
9246
  var kanbanSettings = selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.kanbanSettings;
9104
- var kanbanTitle_2 = (_56 = kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.title) !== null && _56 !== void 0 ? _56 : "";
9247
+ var kanbanTitle_2 = (_57 = kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.title) !== null && _57 !== void 0 ? _57 : "";
9105
9248
  var nullColumn_1 = false;
9106
9249
  var groupBy_1 = [];
9107
9250
  var groupLabel_1 = [];
@@ -9122,10 +9265,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9122
9265
  });
9123
9266
  var kanbanData = renderGridAndListData("", "kanban", kanbanTitle_2, kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.useColumnName);
9124
9267
  // INFO: when bareNewDTW is enabled, render NewKanban instead of legacy Kanban
9125
- if ((_57 = props.bareSettings) === null || _57 === void 0 ? void 0 : _57.bareNewDTW) {
9268
+ if ((_58 = props.bareSettings) === null || _58 === void 0 ? void 0 : _58.bareNewDTW) {
9126
9269
  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
9127
9270
  ? "Data has exceeded limit, please apply filters"
9128
- : "", groupCluster: kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.groupCluster, draggable: true, droppable: kanbanDroppable, mobileView: (_58 = props.bareSettings) === null || _58 === void 0 ? void 0 : _58.bareListMobileView, onUpdateData: function (cardId, _fromCol, toCol) {
9271
+ : "", groupCluster: kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.groupCluster, draggable: true, droppable: kanbanDroppable, mobileView: (_59 = props.bareSettings) === null || _59 === void 0 ? void 0 : _59.bareListMobileView, onUpdateData: function (cardId, _fromCol, toCol) {
9129
9272
  var _a;
9130
9273
  setKanbanDroppable(false);
9131
9274
  handleSubmitData("update", cardId, kanbanTitle_2, (_a = {},
@@ -9134,7 +9277,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9134
9277
  }, onClickData: function (id) {
9135
9278
  var _a, _b;
9136
9279
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
9137
- }, darkMode: (_59 = props.organise) === null || _59 === void 0 ? void 0 : _59.darkMode }));
9280
+ }, darkMode: (_60 = props.organise) === null || _60 === void 0 ? void 0 : _60.darkMode }));
9138
9281
  }
9139
9282
  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
9140
9283
  ? "Data has exceeded limit, please apply filters"