blixify-ui-web 1.2.153 → 1.2.156

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 (41) hide show
  1. package/lib/components/data/dataGraph/index.d.ts.map +1 -1
  2. package/lib/components/data/dataGraph/index.js +47 -14
  3. package/lib/components/data/dataGraph/index.js.map +1 -1
  4. package/lib/components/data/dataTemplate/chartEmoji.d.ts +11 -0
  5. package/lib/components/data/dataTemplate/chartEmoji.d.ts.map +1 -0
  6. package/lib/components/data/dataTemplate/chartEmoji.js +53 -0
  7. package/lib/components/data/dataTemplate/chartEmoji.js.map +1 -0
  8. package/lib/components/data/dataTemplate/chartEmojiPicker.d.ts +15 -0
  9. package/lib/components/data/dataTemplate/chartEmojiPicker.d.ts.map +1 -0
  10. package/lib/components/data/dataTemplate/chartEmojiPicker.js +153 -0
  11. package/lib/components/data/dataTemplate/chartEmojiPicker.js.map +1 -0
  12. package/lib/components/data/dataTemplate/chartView.d.ts +19 -0
  13. package/lib/components/data/dataTemplate/chartView.d.ts.map +1 -0
  14. package/lib/components/data/dataTemplate/chartView.js +391 -0
  15. package/lib/components/data/dataTemplate/chartView.js.map +1 -0
  16. package/lib/components/data/dataTemplate/dataStateModel.d.ts +0 -1
  17. package/lib/components/data/dataTemplate/dataStateModel.d.ts.map +1 -1
  18. package/lib/components/data/dataTemplate/dataStateModel.js.map +1 -1
  19. package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
  20. package/lib/components/data/dataTemplate/index.js +53 -21
  21. package/lib/components/data/dataTemplate/index.js.map +1 -1
  22. package/lib/components/data/dataTemplate/settingsModal.d.ts +2 -1
  23. package/lib/components/data/dataTemplate/settingsModal.d.ts.map +1 -1
  24. package/lib/components/data/dataTemplate/settingsModal.js +10 -1
  25. package/lib/components/data/dataTemplate/settingsModal.js.map +1 -1
  26. package/lib/components/data/dataTemplate/spaceModel.d.ts +7 -2
  27. package/lib/components/data/dataTemplate/spaceModel.d.ts.map +1 -1
  28. package/lib/components/data/dataTemplate/unionPagination.d.ts +1 -2
  29. package/lib/components/data/dataTemplate/unionPagination.d.ts.map +1 -1
  30. package/lib/components/data/dataTemplate/unionPagination.js +1 -2
  31. package/lib/components/data/dataTemplate/unionPagination.js.map +1 -1
  32. package/lib/components/data/readQueryHoc/index.d.ts +1 -1
  33. package/lib/components/data/readQueryHoc/index.d.ts.map +1 -1
  34. package/lib/components/data/readQueryHoc/index.js +13 -4
  35. package/lib/components/data/readQueryHoc/index.js.map +1 -1
  36. package/lib/components/navigation/leftNav/index.d.ts +1 -0
  37. package/lib/components/navigation/leftNav/index.d.ts.map +1 -1
  38. package/lib/components/navigation/leftNav/index.js +8 -2
  39. package/lib/components/navigation/leftNav/index.js.map +1 -1
  40. package/lib/tail.css +2 -2
  41. package/package.json +3 -1
@@ -160,6 +160,7 @@ var newPagination_1 = require("../../display/newPagination");
160
160
  var pagination_1 = require("./pagination");
161
161
  var referenceModal_1 = require("./referenceModal");
162
162
  var settingsModal_1 = require("./settingsModal");
163
+ var chartView_1 = require("./chartView");
163
164
  var flexFilter_1 = require("../flexFilter");
164
165
  var viewStatePersistence_1 = require("./viewStatePersistence");
165
166
  var permissions_1 = require("./permissions");
@@ -2374,7 +2375,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2374
2375
  return sort;
2375
2376
  };
2376
2377
  var handleReadQueryHocCond = function () {
2377
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
2378
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
2378
2379
  var query = (_a = renderImpSearchFilterConditions()) !== null && _a !== void 0 ? _a : [];
2379
2380
  var calendarSettings = false;
2380
2381
  if (selectedTab && selectedTab.viewType === "calendar") {
@@ -2395,7 +2396,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2395
2396
  startDate = (0, dayjs_1.default)(calendarTabMonth).startOf("isoWeek").toDate();
2396
2397
  endDate = (0, dayjs_1.default)(calendarTabMonth).endOf("isoWeek").toDate();
2397
2398
  if ((_d = selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.calendarSettings) === null || _d === void 0 ? void 0 : _d.customView) {
2398
- var _w = (_e = selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.calendarSettings) === null || _e === void 0 ? void 0 : _e.customView, view = _w.view, duration = _w.duration;
2399
+ var _v = (_e = selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.calendarSettings) === null || _e === void 0 ? void 0 : _e.customView, view = _v.view, duration = _v.duration;
2399
2400
  if (view &&
2400
2401
  duration &&
2401
2402
  view === "week" &&
@@ -2518,11 +2519,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2518
2519
  cond.limit = undefined;
2519
2520
  cond.stopLimit = true;
2520
2521
  }
2521
- else if (((_t = props.organise) === null || _t === void 0 ? void 0 : _t.unionPagination) &&
2522
- ((_v = (_u = props.organise) === null || _u === void 0 ? void 0 : _u.unionCollections) === null || _v === void 0 ? void 0 : _v.length)) {
2523
- // INFO: opt-in union paging — see Organise.unionPagination. A union request only
2524
- // carries `skip`, so the page offset goes there, and `_id` keeps the order stable
2525
- // between page requests.
2522
+ else if ((_u = (_t = props.organise) === null || _t === void 0 ? void 0 : _t.unionCollections) === null || _u === void 0 ? void 0 : _u.length) {
2523
+ // INFO: a union request only carries `skip`, so the page offset goes there, and
2524
+ // `_id` keeps the order stable between page requests
2526
2525
  cond.skip = (0, unionPagination_1.handleGetUnionPageSkip)(pageIndex, limit);
2527
2526
  cond.sort = (0, unionPagination_1.handleBuildUnionPageSort)(handleReadQueryHocSort(query));
2528
2527
  }
@@ -2655,8 +2654,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2655
2654
  }
2656
2655
  }
2657
2656
  };
2658
- var handleGetListData = function (responseData, type, rowId) { return __awaiter(void 0, void 0, void 0, function () {
2659
- var dataList, prettierDataList, clonedTableData, clonedSpaceTableData, dummyPrettierDataList_1, resolvedData, selectedIndex_1, isScrollMode, newTableData, newPrettierTableData, isExists, cursorResp, lastDataId, err_1;
2657
+ var handleGetListData = function (responseData, type, rowId, requestCond) { return __awaiter(void 0, void 0, void 0, function () {
2658
+ var dataList, prettierDataList, clonedTableData, clonedSpaceTableData, dummyPrettierDataList_1, resolvedData, selectedIndex_1, isScrollMode, newTableData, newPrettierTableData, isFirstPage, listedIds_1, newIndexes, isExists, cursorResp, lastDataId, err_1;
2660
2659
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
2661
2660
  return __generator(this, function (_l) {
2662
2661
  switch (_l.label) {
@@ -2753,9 +2752,24 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2753
2752
  else {
2754
2753
  newTableData = [];
2755
2754
  newPrettierTableData = [];
2756
- // INFO: Replace (not append) when any filter is active and we're at
2757
- // the start of the result set — covers search, reference, and flex filters.
2758
- if ((Object.values(filterSearchParams).some(function (eachValue) { return eachValue && eachValue.length > 0; }) ||
2755
+ if (!isFirebase && requestCond) {
2756
+ isFirstPage = !requestCond.cursor && !requestCond.skip;
2757
+ if (isFirstPage) {
2758
+ newTableData = dataList;
2759
+ newPrettierTableData = prettierDataList;
2760
+ }
2761
+ else {
2762
+ listedIds_1 = new Set(tableData.map(function (eachData) { return eachData.id; }));
2763
+ newIndexes = dataList
2764
+ .map(function (eachData, eachIndex) {
2765
+ return listedIds_1.has(eachData.id) ? -1 : eachIndex;
2766
+ })
2767
+ .filter(function (eachIndex) { return eachIndex > -1; });
2768
+ newTableData = tableData.concat(newIndexes.map(function (eachIndex) { return dataList[eachIndex]; }));
2769
+ newPrettierTableData = spaceTableData.concat(newIndexes.map(function (eachIndex) { return prettierDataList[eachIndex]; }));
2770
+ }
2771
+ }
2772
+ else if ((Object.values(filterSearchParams).some(function (eachValue) { return eachValue && eachValue.length > 0; }) ||
2759
2773
  Object.values(filterReference).some(function (eachValue) { return eachValue && eachValue.length > 0; }) ||
2760
2774
  flexFiltersDebounced.some(function (eachFilter) {
2761
2775
  return eachFilter.columnId &&
@@ -7928,8 +7942,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7928
7942
  dbEndpoint: devSettings.dbEndpoint,
7929
7943
  dbAPIToken: devSettings.dbAPIToken,
7930
7944
  dbUserToken: devSettings.dbUserToken,
7931
- }, cond: handleReadQueryHocCond(), offline: ((_28 = props.bareSettings) === null || _28 === void 0 ? void 0 : _28.bareOffline) && isNetworkOffline, onChangeData: function (data) {
7932
- handleGetListData(data, "", "");
7945
+ }, cond: handleReadQueryHocCond(), offline: ((_28 = props.bareSettings) === null || _28 === void 0 ? void 0 : _28.bareOffline) && isNetworkOffline, onChangeData: function (data, cond) {
7946
+ handleGetListData(data, "", "", cond);
7933
7947
  }, onError: handleGetItemError }));
7934
7948
  if ((_29 = props.renderSettings) === null || _29 === void 0 ? void 0 : _29.renderListUI) {
7935
7949
  return (react_1.default.createElement(react_1.default.Fragment, null,
@@ -8068,7 +8082,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8068
8082
  var _a;
8069
8083
  return (react_1.default.createElement("div", { className: "relative w-fit h-fit" },
8070
8084
  flexFilterLength_1 > 0 && (react_1.default.createElement("div", { className: "absolute top-0 right-0 translate-x-1/4 -translate-y-1/4 z-[1] rounded-full bg-primary-500 text-white flex items-center justify-center w-5 h-5 text-[10px]" }, flexFilterLength_1)),
8071
- react_1.default.createElement(iconButton_1.IconButton, { icon: react_1.default.createElement(outline_1.FunnelIcon, { className: "h-7 w-7 text-primary-500" }), bgColor: ((_a = props.organise) === null || _a === void 0 ? void 0 : _a.darkMode) ? "bg-white/10" : "bg-white", onClick: mobile ? function () { return setFlexFilterModalOpen(true); } : undefined })));
8085
+ react_1.default.createElement(iconButton_1.IconButton, { testId: mobile
8086
+ ? "dtw-flex-filter-btn-mobile"
8087
+ : "dtw-flex-filter-btn", icon: react_1.default.createElement(outline_1.FunnelIcon, { className: "h-7 w-7 text-primary-500" }), bgColor: ((_a = props.organise) === null || _a === void 0 ? void 0 : _a.darkMode) ? "bg-white/10" : "bg-white", onClick: mobile ? function () { return setFlexFilterModalOpen(true); } : undefined })));
8072
8088
  };
8073
8089
  // INFO: Desktop — PopUp (hidden on mobile)
8074
8090
  actionElementList.push(react_1.default.createElement("div", { className: "hidden md:block" },
@@ -8493,7 +8509,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8493
8509
  if (((_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs) &&
8494
8510
  ((_b = props.organise.extendedTabs) === null || _b === void 0 ? void 0 : _b.length) > 0) {
8495
8511
  (_c = props.organise) === null || _c === void 0 ? void 0 : _c.extendedTabs.map(function (eachTab) {
8496
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
8512
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
8497
8513
  var hrefPoint = "".concat(props.localURLEndpoint, "?type=").concat(resolvedType, "&collection=").concat(props.collectionId);
8498
8514
  if (props.id)
8499
8515
  hrefPoint += "&data=".concat(props.id);
@@ -8518,6 +8534,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8518
8534
  // still unwound the column (it reads the raw extendedTabs) while
8519
8535
  // the tile had no column to read and every file said "Attachment".
8520
8536
  fileSettings: (_f = eachTab.fileSettings) !== null && _f !== void 0 ? _f : undefined,
8537
+ chartSettings: (_g = eachTab.chartSettings) !== null && _g !== void 0 ? _g : undefined,
8521
8538
  };
8522
8539
  if (eachTab.viewType === "iframe") {
8523
8540
  if (typeof eachTab.src === "string") {
@@ -8532,7 +8549,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8532
8549
  }
8533
8550
  if (eachTab.type === resolvedType) {
8534
8551
  tabs.push(__assign(__assign(__assign({}, tabData), (isEditor &&
8535
- ((_g = props.organise) === null || _g === void 0 ? void 0 : _g.onChangeTabs) && {
8552
+ ((_h = props.organise) === null || _h === void 0 ? void 0 : _h.onChangeTabs) && {
8536
8553
  action: (react_1.default.createElement("span", { role: "button", "data-testid": "tab-default-".concat(tabData.id), "aria-label": eachTab.defaultTab
8537
8554
  ? "Opens by default"
8538
8555
  : "Open this tab by default", className: "ml-2 self-center ".concat(eachTab.defaultTab
@@ -8542,8 +8559,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8542
8559
  e.preventDefault();
8543
8560
  handleToggleDefaultTab(eachTab.name);
8544
8561
  } }, 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" })))),
8545
- })), (!((_h = props.edit) === null || _h === void 0 ? void 0 : _h.disabledTabsDeleteBtn) &&
8546
- ((_j = props.organise) === null || _j === void 0 ? void 0 : _j.onChangeTabs) && {
8562
+ })), (!((_j = props.edit) === null || _j === void 0 ? void 0 : _j.disabledTabsDeleteBtn) &&
8563
+ ((_k = props.organise) === null || _k === void 0 ? void 0 : _k.onChangeTabs) && {
8547
8564
  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) {
8548
8565
  e.stopPropagation();
8549
8566
  e.preventDefault();
@@ -8598,6 +8615,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8598
8615
  var nextTabs = ((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs) !== null && _b !== void 0 ? _b : []).map(function (eachTab) { return (__assign(__assign({}, eachTab), { defaultTab: eachTab.name === name ? !eachTab.defaultTab : false })); });
8599
8616
  (_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.onChangeTabs) === null || _d === void 0 ? void 0 : _d.call(_c, nextTabs);
8600
8617
  };
8618
+ var handleChangeTabCharts = function (tabName, charts) {
8619
+ var _a, _b, _c, _d;
8620
+ var nextTabs = ((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs) !== null && _b !== void 0 ? _b : []).map(function (eachTab) {
8621
+ return eachTab.name === tabName
8622
+ ? __assign(__assign({}, eachTab), { chartSettings: charts }) : eachTab;
8623
+ });
8624
+ (_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.onChangeTabs) === null || _d === void 0 ? void 0 : _d.call(_c, nextTabs);
8625
+ };
8601
8626
  var renderAddMathColumn = function (id, onClose) {
8602
8627
  var _a, _b, _c;
8603
8628
  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 }));
@@ -9083,7 +9108,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9083
9108
  renderTabContent(tabs, dataType, requestedViewType),
9084
9109
  react_1.default.createElement("span", { ref: scrollScopeEndRef, hidden: true, "aria-hidden": "true" }))); };
9085
9110
  var renderTabContent = function (tabs, dataType, requestedViewType) {
9086
- 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;
9111
+ 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, _61, _62, _63, _64;
9087
9112
  var matchedTab = tabs.find(function (eachTab) { return eachTab.id === requestedViewType; });
9088
9113
  /**
9089
9114
  * INFO: a list tab must not supply the content of a read view. The selected
@@ -10002,6 +10027,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
10002
10027
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
10003
10028
  } }));
10004
10029
  }
10030
+ else if (selectedTabData.viewType === "chart") {
10031
+ return (react_1.default.createElement(chartView_1.ChartView, { charts: (_60 = selectedTabData.chartSettings) !== null && _60 !== void 0 ? _60 : [], structure: structure, collectionId: props.collectionId, devSettings: props.devSettings, filterQuery: (_61 = renderImpSearchFilterConditions()) !== null && _61 !== void 0 ? _61 : [], editable: isEditor, darkMode: (_62 = props.organise) === null || _62 === void 0 ? void 0 : _62.darkMode, darkModeBg: (_63 = props.organise) === null || _63 === void 0 ? void 0 : _63.darkModeBg, onChangeCharts: ((_64 = props.organise) === null || _64 === void 0 ? void 0 : _64.onChangeTabs)
10032
+ ? function (charts) {
10033
+ return handleChangeTabCharts(selectedTabData.name, charts);
10034
+ }
10035
+ : undefined }));
10036
+ }
10005
10037
  else if (selectedTabData.renderComp) {
10006
10038
  return react_1.default.createElement(react_1.default.Fragment, null, selectedTabData.renderComp());
10007
10039
  }
@@ -10127,7 +10159,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
10127
10159
  } }))))));
10128
10160
  }
10129
10161
  else if (addTabModal) {
10130
- return (react_1.default.createElement(settingsModal_1.TabModal, { type: resolvedType, tabs: (_u = props.organise) === null || _u === void 0 ? void 0 : _u.extendedTabs, onChangeTabs: (_v = props.organise) === null || _v === void 0 ? void 0 : _v.onChangeTabs, model: structure, renderReferenceLabelOptions: (_w = props.organise) === null || _w === void 0 ? void 0 : _w.renderReferenceLabelOptions, onClose: function () {
10162
+ return (react_1.default.createElement(settingsModal_1.TabModal, { type: resolvedType, tabs: (_u = props.organise) === null || _u === void 0 ? void 0 : _u.extendedTabs, onChangeTabs: (_v = props.organise) === null || _v === void 0 ? void 0 : _v.onChangeTabs, model: structure, collectionId: props.collectionId, renderReferenceLabelOptions: (_w = props.organise) === null || _w === void 0 ? void 0 : _w.renderReferenceLabelOptions, onClose: function () {
10131
10163
  handlePopUpModal(false);
10132
10164
  } }));
10133
10165
  }