blixify-ui-web 1.2.200 → 1.2.201

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 (29) hide show
  1. package/lib/components/data/dataTemplate/index.d.ts +1 -0
  2. package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
  3. package/lib/components/data/dataTemplate/index.js +92 -87
  4. package/lib/components/data/dataTemplate/index.js.map +1 -1
  5. package/lib/components/data/dataTemplate/settingsModal.d.ts.map +1 -1
  6. package/lib/components/data/dataTemplate/settingsModal.js +2 -7
  7. package/lib/components/data/dataTemplate/settingsModal.js.map +1 -1
  8. package/lib/components/display/newGrid/index.d.ts +2 -0
  9. package/lib/components/display/newGrid/index.d.ts.map +1 -1
  10. package/lib/components/display/newGrid/index.js +4 -1
  11. package/lib/components/display/newGrid/index.js.map +1 -1
  12. package/lib/components/display/newKanban/index.d.ts +2 -0
  13. package/lib/components/display/newKanban/index.d.ts.map +1 -1
  14. package/lib/components/display/newKanban/index.js +4 -1
  15. package/lib/components/display/newKanban/index.js.map +1 -1
  16. package/lib/components/display/newList/index.d.ts +2 -0
  17. package/lib/components/display/newList/index.d.ts.map +1 -1
  18. package/lib/components/display/newList/index.js +2 -0
  19. package/lib/components/display/newList/index.js.map +1 -1
  20. package/lib/components/display/newTable/index.d.ts +2 -0
  21. package/lib/components/display/newTable/index.d.ts.map +1 -1
  22. package/lib/components/display/newTable/index.js +21 -13
  23. package/lib/components/display/newTable/index.js.map +1 -1
  24. package/lib/components/display/recordActions/index.d.ts +10 -0
  25. package/lib/components/display/recordActions/index.d.ts.map +1 -0
  26. package/lib/components/display/recordActions/index.js +39 -0
  27. package/lib/components/display/recordActions/index.js.map +1 -0
  28. package/lib/tail.css +1 -1
  29. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import { DataTemplateProps } from "./dataStateModel";
3
3
  export declare const FORMULA_VIEW_MAX_ROWS = 5000;
4
+ export declare const handleCheckEmptyCardValue: (value: any) => boolean;
4
5
  export declare const DataTemplate: React.ForwardRefExoticComponent<DataTemplateProps & React.RefAttributes<unknown>>;
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -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;AA6Gf,OAAO,EACL,iBAAiB,EAIlB,MAAM,kBAAkB,CAAC;AA8G1B,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAsC1C,eAAO,MAAM,YAAY,mFAopevB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/index.tsx"],"names":[],"mappings":"AAqCA,OAAO,KASN,MAAM,OAAO,CAAC;AA6Gf,OAAO,EACL,iBAAiB,EAIlB,MAAM,kBAAkB,CAAC;AA8G1B,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAwC1C,eAAO,MAAM,yBAAyB,UAAW,GAAG,YAYnD,CAAC;AAEF,eAAO,MAAM,YAAY,mFA6nevB,CAAC"}
@@ -93,7 +93,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
93
93
  return (mod && mod.__esModule) ? mod : { "default": mod };
94
94
  };
95
95
  Object.defineProperty(exports, "__esModule", { value: true });
96
- exports.DataTemplate = exports.FORMULA_VIEW_MAX_ROWS = void 0;
96
+ exports.DataTemplate = exports.handleCheckEmptyCardValue = exports.FORMULA_VIEW_MAX_ROWS = void 0;
97
97
  var outline_1 = require("@heroicons/react/24/outline");
98
98
  var HeroIcons = __importStar(require("@heroicons/react/24/solid"));
99
99
  // INFO: the outline bookmark, for a tab that is not the default one. HeroIcons
@@ -221,6 +221,23 @@ var handleGetCalendarSwitchRange = function (date, view) {
221
221
  end: (0, dayjs_1.default)(date).endOf(unit).toDate(),
222
222
  };
223
223
  };
224
+ // INFO: " - " is what the list prints for a lookup it could not resolve, an
225
+ // empty reference list included
226
+ var handleCheckEmptyCardValue = function (value) {
227
+ if (value === undefined || value === null)
228
+ return true;
229
+ if (typeof value === "string")
230
+ return !value.trim() || value === " - ";
231
+ if (Array.isArray(value))
232
+ return value.every(function (eachValue) {
233
+ return eachValue === undefined ||
234
+ eachValue === null ||
235
+ eachValue === "" ||
236
+ eachValue === " - ";
237
+ });
238
+ return false;
239
+ };
240
+ exports.handleCheckEmptyCardValue = handleCheckEmptyCardValue;
224
241
  exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
225
242
  // INFO: props.type is what the caller asked for; resolvedType is what THIS
226
243
  // instance renders. They differ in exactly one case: readDrawer is on and the
@@ -7813,6 +7830,22 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7813
7830
  var newTableRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(tableData); }, [tableData, (_91 = props.bareSettings) === null || _91 === void 0 ? void 0 : _91.bareNewDTW]);
7814
7831
  var newTableSpaceRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(spaceTableData); }, [spaceTableData, (_92 = props.bareSettings) === null || _92 === void 0 ? void 0 : _92.bareNewDTW]);
7815
7832
  /* eslint-enable */
7833
+ // INFO: the pencil beside a record's title opens the same form the Update
7834
+ // column's pencil did, for whoever may update; the bubble beside it opens
7835
+ // comments and logs for anyone who can see the record
7836
+ var handleOpenRecordEdit = function (id) {
7837
+ var _a, _b;
7838
+ handleCaptureListScroll(id);
7839
+ (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "update", id, "general");
7840
+ };
7841
+ var handleOpenRecordActivity = function (id) {
7842
+ setActivityId(id);
7843
+ setActivityModal(true);
7844
+ };
7845
+ var recordEditAction = canUpdateRecord ? handleOpenRecordEdit : undefined;
7846
+ var recordActivityAction = isActivityLog
7847
+ ? handleOpenRecordActivity
7848
+ : undefined;
7816
7849
  // INFO: isNewTable — the new table opens a record from its title, edits in
7817
7850
  // the cell and carries the comment bubble beside the title, so its rows
7818
7851
  // drop the pencil and bubble column and keep only the host's own actions
@@ -9232,6 +9265,29 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9232
9265
  !eachModel.hide &&
9233
9266
  !eachModel.disabled;
9234
9267
  });
9268
+ // INFO: the columns the table shows for this view, in its column order —
9269
+ // an item's fields follow them, so a hidden column stays hidden and every
9270
+ // type the table draws is drawn here with the same cell renderer
9271
+ var visibleColumns = structure.filter(function (eachModel) {
9272
+ var _a;
9273
+ if (eachModel.id === "_id" ||
9274
+ eachModel.id === "id" ||
9275
+ eachModel.id === "baseDraft" ||
9276
+ eachModel.hide ||
9277
+ utils_1.NON_TABLE_COLUMN_DATA_TYPES.includes(eachModel.type) ||
9278
+ activeUserHiddenColumnIds.includes(eachModel.id))
9279
+ return false;
9280
+ if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.showBaseUpdatedAt) &&
9281
+ !isSystemColumnsEnabled &&
9282
+ eachModel.id === "baseUpdatedAt")
9283
+ return false;
9284
+ if (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.structure) {
9285
+ var modelInStructure = selectedTab.structure.find(function (model) { return model.id === eachModel.id; });
9286
+ if (!modelInStructure || modelInStructure.hide)
9287
+ return false;
9288
+ }
9289
+ return true;
9290
+ });
9235
9291
  spaceTableData.forEach(function (eachData, index) {
9236
9292
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
9237
9293
  var clonedEachData = JSON.parse(JSON.stringify(eachData));
@@ -9243,83 +9299,40 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9243
9299
  title = renderedTitle;
9244
9300
  }
9245
9301
  var listDescArray = [];
9246
- Object.entries(eachData).forEach(function (value) {
9247
- var _a, _b, _c;
9248
- var eachKey = value[0], eachValue = value[1];
9249
- var selectedModel = structure.find(function (eachModel) { return eachModel.id === eachKey; });
9250
- var modelInStructure;
9251
- var structurePresent = false;
9252
- if (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.structure) {
9253
- structurePresent = true;
9254
- modelInStructure = selectedTab.structure.find(function (model) { return model.id === eachKey; });
9255
- }
9256
- if (eachKey === "_id" ||
9257
- eachKey === "id" ||
9258
- eachKey === "baseDraft" ||
9259
- eachKey === "update" ||
9260
- !selectedModel ||
9261
- utils_1.OBJECT_DATA_TYPES.includes(selectedModel.type) ||
9262
- selectedModel.type === "file" ||
9263
- selectedModel.type === "multipleFile" ||
9264
- selectedModel.type === "ganttchart" ||
9265
- selectedModel.type === "canvas" ||
9266
- selectedModel.hide ||
9267
- activeUserHiddenColumnIds.includes(eachKey) ||
9268
- eachKey === imageTag ||
9269
- eachValue === title ||
9270
- (structurePresent && (!modelInStructure || modelInStructure.hide))) {
9271
- return null;
9272
- }
9302
+ visibleColumns.forEach(function (selectedModel) {
9303
+ var _a;
9304
+ var eachKey = selectedModel.id;
9305
+ var eachValue = eachData[eachKey];
9306
+ if (eachKey === titleKey || eachKey === imageTag)
9307
+ return;
9273
9308
  if (isKanban &&
9274
9309
  isListEditable &&
9275
9310
  selectedModel.type === "boolean" &&
9276
- selectedModel.enableCheckbox) {
9277
- return null;
9278
- }
9279
- if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.showBaseUpdatedAt) &&
9280
- !isSystemColumnsEnabled &&
9281
- eachKey === "baseUpdatedAt") {
9282
- return null;
9283
- }
9284
- if ((type === "grid" || type === "kanban") &&
9285
- (selectedModel.type === "multipleImage" ||
9286
- selectedModel.type === "markdown"))
9287
- return null;
9288
- // INFO: renderer key stays the field id so bareListDescription resolves;
9289
- // useColumnName only switches the label below, not this key.
9290
- var selectedKey = eachKey;
9291
- if (selectedModel.type === "markdown") {
9292
- listDescArray.push(react_1.default.createElement("div", { className: "flex flex-col" },
9293
- react_1.default.createElement("p", null,
9294
- useColumnName ? selectedModel.name : (0, utils_1.camelCaseToText)(eachKey),
9295
- " ",
9296
- ":",
9297
- " "),
9298
- react_1.default.createElement("div", { className: "bg-white rounded-lg border p-4 mb-2" }, (0, readModule_1.renderEachRowDataBasedOnDataType)(selectedKey, eachValue, props.bareSettings, true, (_b = props.organise) === null || _b === void 0 ? void 0 : _b.disableEllipsisOnLongWord))));
9299
- }
9300
- else {
9301
- var baseClassName = "my-1.5";
9302
- if (type === "grid")
9303
- baseClassName += " grid grid-cols-3 gap-x-1";
9304
- else
9305
- baseClassName += " flex flex-wrap items-center gap-x-1";
9306
- var keyClassName = "flex text-gray-500 font-normal";
9307
- if (type === "grid")
9308
- keyClassName += " justify-between items-start";
9309
- else
9310
- keyClassName += " items-center";
9311
- var valueClassName = "";
9312
- if (type === "grid" || type === "kanban")
9313
- valueClassName += "col-span-2 break-all";
9314
- listDescArray.push(react_1.default.createElement("div", { className: baseClassName },
9315
- react_1.default.createElement("div", { className: keyClassName },
9316
- react_1.default.createElement("p", null, useColumnName
9317
- ? selectedModel.name
9318
- : (0, utils_1.camelCaseToText)(eachKey)),
9319
- react_1.default.createElement("p", null, ":")),
9320
- react_1.default.createElement("div", { className: valueClassName }, (0, readModule_1.renderEachRowDataBasedOnDataType)(selectedKey, eachValue, props.bareSettings, true, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.disableEllipsisOnLongWord))));
9321
- }
9322
- return null;
9311
+ selectedModel.enableCheckbox)
9312
+ return;
9313
+ // INFO: an item shows what a record holds; a column with nothing in it
9314
+ // is left out rather than printed as an empty label. A button, timer
9315
+ // and rating are never empty — they are drawn to be used.
9316
+ if ((0, exports.handleCheckEmptyCardValue)(eachValue))
9317
+ return;
9318
+ var baseClassName = "my-1.5";
9319
+ if (type === "grid")
9320
+ baseClassName += " grid grid-cols-3 gap-x-1";
9321
+ else
9322
+ baseClassName += " flex flex-wrap items-center gap-x-1";
9323
+ var keyClassName = "flex text-gray-500 font-normal";
9324
+ if (type === "grid")
9325
+ keyClassName += " justify-between items-start";
9326
+ else
9327
+ keyClassName += " items-center";
9328
+ var valueClassName = "";
9329
+ if (type === "grid" || type === "kanban")
9330
+ valueClassName += "col-span-2 break-all";
9331
+ listDescArray.push(react_1.default.createElement("div", { key: eachKey, className: baseClassName, "data-testid": "dtw-card-field-".concat(eachKey) },
9332
+ react_1.default.createElement("div", { className: keyClassName },
9333
+ react_1.default.createElement("p", null, useColumnName ? selectedModel.name : (0, utils_1.camelCaseToText)(eachKey)),
9334
+ react_1.default.createElement("p", null, ":")),
9335
+ react_1.default.createElement("div", { className: valueClassName }, (0, readModule_1.renderEachRowDataBasedOnDataType)(eachKey, eachValue, props.bareSettings, true, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.disableEllipsisOnLongWord))));
9323
9336
  });
9324
9337
  if (booleanModels.length && isKanban && isListEditable) {
9325
9338
  booleanModels.map(function (eachModel) {
@@ -10036,15 +10049,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
10036
10049
  else {
10037
10050
  // INFO: when bareNewDTW is enabled, render NewTable instead of legacy Table
10038
10051
  if ((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareNewDTW) {
10039
- return (react_1.default.createElement(newTable_1.NewTable, { darkModeBg: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkModeBg, showId: showId, paginationType: renderResolvedPaginationType(), data: newTableRows, spaceData: newTableSpaceRows !== null && newTableSpaceRows !== void 0 ? newTableSpaceRows : [], referencesOptions: listReferencesOptions, groups: handleBuildNewTableGroups(),
10040
- // INFO: the bubble beside each record's title opens its comments and
10041
- // logs, for anyone who can see the row — not only those who can edit
10042
- onRowActivity: isActivityLog
10043
- ? function (id) {
10044
- setActivityId(id);
10045
- setActivityModal(true);
10046
- }
10047
- : undefined,
10052
+ return (react_1.default.createElement(newTable_1.NewTable, { darkModeBg: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkModeBg, showId: showId, paginationType: renderResolvedPaginationType(), data: newTableRows, spaceData: newTableSpaceRows !== null && newTableSpaceRows !== void 0 ? newTableSpaceRows : [], referencesOptions: listReferencesOptions, groups: handleBuildNewTableGroups(), onRowActivity: recordActivityAction, onRowEdit: recordEditAction,
10048
10053
  // INFO: per-group paging — scroll appends inside a band, page
10049
10054
  // mode gives each band its own pager; undefined = bands as before
10050
10055
  onGroupLoadMore: renderCheckGroupPaging() && renderCheckScrollMode()
@@ -10602,7 +10607,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
10602
10607
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
10603
10608
  }, linkType: props.linkType, custom: props.custom, newTabUrl: (_z = (_y = props.newTabUrl) === null || _y === void 0 ? void 0 : _y.default) !== null && _z !== void 0 ? _z : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_1 = (_0 = props.newTabUrl) === null || _0 === void 0 ? void 0 : _0.addons) !== null && _1 !== void 0 ? _1 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
10604
10609
  handlePagination(value);
10605
- }, darkMode: (_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.darkMode, className: "mt-5", hidePagination: (_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.hidePagination, customPaginationSize: customPaginationSize, mobileTooltip: (_4 = props.bareSettings) === null || _4 === void 0 ? void 0 : _4.bareListMobileTooltip }));
10610
+ }, darkMode: (_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.darkMode, className: "mt-5", hidePagination: (_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.hidePagination, customPaginationSize: customPaginationSize, mobileTooltip: (_4 = props.bareSettings) === null || _4 === void 0 ? void 0 : _4.bareListMobileTooltip, onRowEdit: recordEditAction, onRowActivity: recordActivityAction }));
10606
10611
  }
10607
10612
  return (react_1.default.createElement(react_1.default.Fragment, null,
10608
10613
  react_1.default.createElement(list_1.List, { darkModeBg: (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.darkModeBg, paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list", undefined, true), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: ((_7 = (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.disableSelectFullData) === null || _7 === void 0 ? void 0 : _7.list) || isFormulaView, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? "from filter" : "", multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
@@ -10729,7 +10734,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
10729
10734
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
10730
10735
  }, linkType: props.linkType, custom: props.custom, newTabUrl: (_22 = (_21 = props.newTabUrl) === null || _21 === void 0 ? void 0 : _21.default) !== null && _22 !== void 0 ? _22 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_24 = (_23 = props.newTabUrl) === null || _23 === void 0 ? void 0 : _23.addons) !== null && _24 !== void 0 ? _24 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
10731
10736
  handlePagination(value);
10732
- }, imgContain: selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.gridContain, gridColClassName: (_25 = props.bareSettings) === null || _25 === void 0 ? void 0 : _25.bareListGridColClassName, className: "mt-5", hidePagination: (_26 = props.organise) === null || _26 === void 0 ? void 0 : _26.hidePagination, customPaginationSize: customPaginationSize }));
10737
+ }, imgContain: selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.gridContain, gridColClassName: (_25 = props.bareSettings) === null || _25 === void 0 ? void 0 : _25.bareListGridColClassName, className: "mt-5", hidePagination: (_26 = props.organise) === null || _26 === void 0 ? void 0 : _26.hidePagination, customPaginationSize: customPaginationSize, onCardEdit: recordEditAction, onCardActivity: recordActivityAction }));
10733
10738
  }
10734
10739
  return (react_1.default.createElement(react_1.default.Fragment, null,
10735
10740
  react_1.default.createElement(grid_1.Grid, { darkMode: (_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.darkMode, darkModeBg: (_28 = props.organise) === null || _28 === void 0 ? void 0 : _28.darkModeBg, paginationType: renderResolvedPaginationType(), data: renderGridAndListData(selectedTabData.viewImage, "grid"), size: size, limit: limit, cursor: cursor, loading: tableLoading, horizontalScroll: isScrollMode, pageIndex: pageIndex, onClickData: function (id) {
@@ -11261,7 +11266,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
11261
11266
  var _a, _b;
11262
11267
  handleCaptureListScroll(id);
11263
11268
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
11264
- }, darkMode: (_58 = props.organise) === null || _58 === void 0 ? void 0 : _58.darkMode, darkModeBg: (_59 = props.organise) === null || _59 === void 0 ? void 0 : _59.darkModeBg })));
11269
+ }, onCardEdit: recordEditAction, onCardActivity: recordActivityAction, darkMode: (_58 = props.organise) === null || _58 === void 0 ? void 0 : _58.darkMode, darkModeBg: (_59 = props.organise) === null || _59 === void 0 ? void 0 : _59.darkModeBg })));
11265
11270
  }
11266
11271
  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
11267
11272
  ? "Data has exceeded limit, please apply filters"