blixify-ui-web 1.2.59 → 1.2.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/index.tsx"],"names":[],"mappings":"AAkCA,OAAO,KASN,MAAM,OAAO,CAAC;AAqFf,OAAO,EACL,iBAAiB,EAKlB,MAAM,kBAAkB,CAAC;AAmD1B,eAAO,MAAM,YAAY,mFAq6WvB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/index.tsx"],"names":[],"mappings":"AAkCA,OAAO,KASN,MAAM,OAAO,CAAC;AAqFf,OAAO,EACL,iBAAiB,EAKlB,MAAM,kBAAkB,CAAC;AAmD1B,eAAO,MAAM,YAAY,mFA08WvB,CAAC"}
@@ -405,25 +405,26 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
405
405
  var _136 = (0, react_1.useState)(false), referenceLoading = _136[0], setReferenceLoading = _136[1];
406
406
  var _137 = (0, react_1.useState)({}), referencesOptions = _137[0], setReferencesOptions = _137[1];
407
407
  var _138 = (0, react_1.useState)({}), referencesDetails = _138[0], setReferencesDetails = _138[1];
408
- var _139 = (0, react_1.useState)({}), referenceDeleteTableData = _139[0], setReferenceDeleteTableData = _139[1];
409
- var _140 = (0, react_1.useState)(0), referenceDeleteIndex = _140[0], setReferenceDeleteIndex = _140[1];
410
- var _141 = (0, react_1.useState)({
408
+ var _139 = (0, react_1.useState)({}), listReferencesOptions = _139[0], setListReferencesOptions = _139[1];
409
+ var _140 = (0, react_1.useState)({}), referenceDeleteTableData = _140[0], setReferenceDeleteTableData = _140[1];
410
+ var _141 = (0, react_1.useState)(0), referenceDeleteIndex = _141[0], setReferenceDeleteIndex = _141[1];
411
+ var _142 = (0, react_1.useState)({
411
412
  id: "",
412
413
  name: "",
413
414
  type: "string",
414
- }), referenceCreationModal = _141[0], setReferenceCreationModal = _141[1];
415
- var _142 = (0, react_1.useState)({}), referenceModelSchema = _142[0], setReferenceSchema = _142[1];
416
- var _143 = (0, react_1.useState)([]), kanbanChecked = _143[0], setKanbanChecked = _143[1];
415
+ }), referenceCreationModal = _142[0], setReferenceCreationModal = _142[1];
416
+ var _143 = (0, react_1.useState)({}), referenceModelSchema = _143[0], setReferenceSchema = _143[1];
417
+ var _144 = (0, react_1.useState)([]), kanbanChecked = _144[0], setKanbanChecked = _144[1];
417
418
  //INFO : Offline
418
- var _144 = (0, react_1.useState)(0), offlineDataLength = _144[0], setOfflineDataLength = _144[1];
419
- var _145 = (0, react_1.useState)(false), offlineModal = _145[0], setOfflineModal = _145[1];
419
+ var _145 = (0, react_1.useState)(0), offlineDataLength = _145[0], setOfflineDataLength = _145[1];
420
+ var _146 = (0, react_1.useState)(false), offlineModal = _146[0], setOfflineModal = _146[1];
420
421
  // INFO: live-stream state — driven by socket connection and navigator.onLine
421
- var _146 = (0, react_1.useState)(false), isLive = _146[0], setIsLive = _146[1];
422
- var _147 = (0, react_1.useState)(false), isLiveOffline = _147[0], setIsLiveOffline = _147[1];
422
+ var _147 = (0, react_1.useState)(false), isLive = _147[0], setIsLive = _147[1];
423
+ var _148 = (0, react_1.useState)(false), isLiveOffline = _148[0], setIsLiveOffline = _148[1];
423
424
  // INFO: true when navigator is offline — used to switch ReadQueryHoc between
424
425
  // server reads (online, full pagination) and IndexedDB reads (offline, cached data).
425
426
  // Independent of SSE status so it works even when bareSocketName is not set.
426
- var _148 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _148[0], setIsNetworkOffline = _148[1];
427
+ var _149 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _149[0], setIsNetworkOffline = _149[1];
427
428
  var previousType = (0, react_1.useRef)(null);
428
429
  var previousSelectedData = (0, react_1.useRef)(null);
429
430
  var scrollSentinelRef = (0, react_1.useRef)(null);
@@ -1554,7 +1555,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1554
1555
  (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);
1555
1556
  return tempData;
1556
1557
  })];
1557
- 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)];
1558
+ 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, undefined, handleSeedListReferenceOptions)];
1558
1559
  }
1559
1560
  });
1560
1561
  }); };
@@ -1939,6 +1940,31 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1939
1940
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, props.type, props.id, id);
1940
1941
  }
1941
1942
  };
1943
+ // INFO: the list already fetches every referenced document once per page to
1944
+ // print labels. Re-shaping those docs into Select options and handing them
1945
+ // to the table renderers lets an inline-editable reference cell show its
1946
+ // current label immediately — otherwise the cell's Select has no options
1947
+ // until the user types into it, and renders blank.
1948
+ var handleSeedListReferenceOptions = function (details) {
1949
+ var seeded = {};
1950
+ Object.entries(details !== null && details !== void 0 ? details : {}).forEach(function (_a) {
1951
+ var eachKey = _a[0], eachDocs = _a[1];
1952
+ var model = structure.find(function (eachModel) { return eachModel.id === eachKey; });
1953
+ if (!model || !Array.isArray(eachDocs))
1954
+ return;
1955
+ seeded[eachKey] = eachDocs.map(function (eachDoc) {
1956
+ var _a, _b, _c;
1957
+ var option = {
1958
+ key: eachDoc[serverId],
1959
+ label: (_b = eachDoc[(_a = model.referenceLabel) !== null && _a !== void 0 ? _a : ""]) !== null && _b !== void 0 ? _b : (0, moduleUtils_1.renderReferenceStringAttribute)(eachDoc),
1960
+ };
1961
+ if (model.referenceSecondaryLabel)
1962
+ option.secondaryLabel = (_c = eachDoc[model.referenceSecondaryLabel]) !== null && _c !== void 0 ? _c : "-";
1963
+ return option;
1964
+ });
1965
+ });
1966
+ setListReferencesOptions(function (prev) { return (__assign(__assign({}, prev), seeded)); });
1967
+ };
1942
1968
  var handleSetListData = function (newTableData, newSpaceTableData) {
1943
1969
  var _a, _b, _c, _d, _e;
1944
1970
  setTableData(newTableData);
@@ -1995,7 +2021,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1995
2021
  });
1996
2022
  prettierDataList = dummyPrettierDataList_1;
1997
2023
  return [3 /*break*/, 5];
1998
- case 3: return [4 /*yield*/, (0, listModule_1.handleListDataBasedOnModel)(responseData === null || responseData === void 0 ? void 0 : responseData.data, props.devSettings, (_b = props.lib) === null || _b === void 0 ? void 0 : _b.axios, structure, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.handleNavigate, ((_d = props.organise) === null || _d === void 0 ? void 0 : _d.viewId) === "general", setActivityModal, setActivityId, isActivityLog ? (_e = props.edit) === null || _e === void 0 ? void 0 : _e.activityLog : undefined, (_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareListActionBtns, (_g = props.edit) === null || _g === void 0 ? void 0 : _g.disabledUpdate)];
2024
+ case 3: return [4 /*yield*/, (0, listModule_1.handleListDataBasedOnModel)(responseData === null || responseData === void 0 ? void 0 : responseData.data, props.devSettings, (_b = props.lib) === null || _b === void 0 ? void 0 : _b.axios, structure, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.handleNavigate, ((_d = props.organise) === null || _d === void 0 ? void 0 : _d.viewId) === "general", setActivityModal, setActivityId, isActivityLog ? (_e = props.edit) === null || _e === void 0 ? void 0 : _e.activityLog : undefined, (_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareListActionBtns, (_g = props.edit) === null || _g === void 0 ? void 0 : _g.disabledUpdate, undefined, handleSeedListReferenceOptions)];
1999
2025
  case 4:
2000
2026
  prettierDataList = _o.sent();
2001
2027
  if (props.groupId) {
@@ -7569,7 +7595,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7569
7595
  react_1.default.createElement("div", { className: "font-semibold text-md mt-5" },
7570
7596
  "Group By ",
7571
7597
  eachKey),
7572
- react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: filterTableData, spaceData: dataList !== null && dataList !== void 0 ? dataList : [], size: (_b = dataList.length) !== null && _b !== void 0 ? _b : 0, limit: 5, cursor: "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.disableSelectFullData) === null || _d === void 0 ? void 0 : _d.table, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
7598
+ react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: filterTableData, spaceData: dataList !== null && dataList !== void 0 ? dataList : [], referencesOptions: listReferencesOptions, size: (_b = dataList.length) !== null && _b !== void 0 ? _b : 0, limit: 5, cursor: "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.disableSelectFullData) === null || _d === void 0 ? void 0 : _d.table, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
7573
7599
  selectedIds.length > 0 &&
7574
7600
  !((_e = props.edit) === null || _e === void 0 ? void 0 : _e.disabledUpdate) &&
7575
7601
  !((_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
@@ -7655,7 +7681,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7655
7681
  else {
7656
7682
  // INFO: when bareNewDTW is enabled, render NewTable instead of legacy Table
7657
7683
  if ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareNewDTW) {
7658
- 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, maxSelectedCount: (_d = props.bareSettings) === null || _d === void 0 ? void 0 : _d.bareListMaxSelectedCount, mobileView: (_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareListMobileView, mobileTooltip: (_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareMobileTooltip, multiActionFloatingBtns: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], (!((_g = props.edit) === null || _g === void 0 ? void 0 : _g.disabledUpdate) &&
7684
+ return (react_1.default.createElement(newTable_1.NewTable, { showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], referencesOptions: listReferencesOptions, size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.disableSelectFullData) === null || _c === void 0 ? void 0 : _c.table, maxSelectedCount: (_d = props.bareSettings) === null || _d === void 0 ? void 0 : _d.bareListMaxSelectedCount, mobileView: (_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareListMobileView, mobileTooltip: (_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareMobileTooltip, multiActionFloatingBtns: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], (!((_g = props.edit) === null || _g === void 0 ? void 0 : _g.disabledUpdate) &&
7659
7685
  !((_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareHideTableExtraMultipleAction)
7660
7686
  ? [
7661
7687
  {
@@ -7759,7 +7785,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7759
7785
  }); },
7760
7786
  }, 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 }));
7761
7787
  }
7762
- 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" },
7788
+ return (react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], referencesOptions: listReferencesOptions, size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_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" },
7763
7789
  selectedIds.length > 0 &&
7764
7790
  !((_9 = props.edit) === null || _9 === void 0 ? void 0 : _9.disabledUpdate) &&
7765
7791
  !((_10 = props.bareSettings) === null || _10 === void 0 ? void 0 : _10.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,