blixify-ui-web 1.2.138 → 1.2.140
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.
- package/lib/components/data/dataTemplate/activityChanges.d.ts +8 -0
- package/lib/components/data/dataTemplate/activityChanges.d.ts.map +1 -0
- package/lib/components/data/dataTemplate/activityChanges.js +92 -0
- package/lib/components/data/dataTemplate/activityChanges.js.map +1 -0
- package/lib/components/data/dataTemplate/activityComposer.d.ts +17 -0
- package/lib/components/data/dataTemplate/activityComposer.d.ts.map +1 -0
- package/lib/components/data/dataTemplate/activityComposer.js +154 -0
- package/lib/components/data/dataTemplate/activityComposer.js.map +1 -0
- package/lib/components/data/dataTemplate/activityMentions.d.ts +4 -0
- package/lib/components/data/dataTemplate/activityMentions.d.ts.map +1 -0
- package/lib/components/data/dataTemplate/activityMentions.js +67 -0
- package/lib/components/data/dataTemplate/activityMentions.js.map +1 -0
- package/lib/components/data/dataTemplate/activityModal.d.ts +9 -24
- package/lib/components/data/dataTemplate/activityModal.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/activityModal.js +492 -392
- package/lib/components/data/dataTemplate/activityModal.js.map +1 -1
- package/lib/components/data/dataTemplate/activityRecords.d.ts +10 -0
- package/lib/components/data/dataTemplate/activityRecords.d.ts.map +1 -0
- package/lib/components/data/dataTemplate/activityRecords.js +165 -0
- package/lib/components/data/dataTemplate/activityRecords.js.map +1 -0
- package/lib/components/data/dataTemplate/dataStateModel.d.ts +22 -0
- package/lib/components/data/dataTemplate/dataStateModel.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/dataStateModel.js.map +1 -1
- package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/index.js +171 -154
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/updateModule.d.ts.map +1 -1
- package/lib/components/data/updateModule.js +15 -3
- package/lib/components/data/updateModule.js.map +1 -1
- package/lib/components/display/newTable/index.d.ts +2 -0
- package/lib/components/display/newTable/index.d.ts.map +1 -1
- package/lib/components/display/newTable/index.js +185 -156
- package/lib/components/display/newTable/index.js.map +1 -1
- package/lib/components/input/datePicker/index.d.ts.map +1 -1
- package/lib/components/input/datePicker/index.js +23 -10
- package/lib/components/input/datePicker/index.js.map +1 -1
- package/lib/components/input/select/index.d.ts.map +1 -1
- package/lib/components/input/select/index.js +16 -4
- package/lib/components/input/select/index.js.map +1 -1
- package/lib/components/input/textInput/index.d.ts.map +1 -1
- package/lib/components/input/textInput/index.js +15 -7
- package/lib/components/input/textInput/index.js.map +1 -1
- package/lib/tail.css +2 -2
- package/package.json +1 -1
|
@@ -248,7 +248,7 @@ var handleGetListColour = function (col, value) {
|
|
|
248
248
|
return column.listSelectionColour[index] || undefined;
|
|
249
249
|
};
|
|
250
250
|
var NewTable = function (props) {
|
|
251
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
251
|
+
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;
|
|
252
252
|
var columns = (_b = (_a = props.columns) !== null && _a !== void 0 ? _a : props.header) !== null && _b !== void 0 ? _b : [];
|
|
253
253
|
var defaultLimit = 10;
|
|
254
254
|
// INFO: flatten groupData columns so both mobile and desktop share the same
|
|
@@ -281,8 +281,14 @@ var NewTable = function (props) {
|
|
|
281
281
|
groupData.forEach(function (sub) { return groupedKeys.add("".concat(col.key, ".").concat(sub.key)); });
|
|
282
282
|
}
|
|
283
283
|
});
|
|
284
|
-
var
|
|
285
|
-
|
|
284
|
+
var activityPin = props.onRowActivity &&
|
|
285
|
+
!((_d = (_c = props.pinColumns) === null || _c === void 0 ? void 0 : _c.left) === null || _d === void 0 ? void 0 : _d.length) &&
|
|
286
|
+
flatColumns[0] &&
|
|
287
|
+
!((_f = (_e = props.pinColumns) === null || _e === void 0 ? void 0 : _e.right) === null || _f === void 0 ? void 0 : _f.includes(flatColumns[0].key))
|
|
288
|
+
? [flatColumns[0].key]
|
|
289
|
+
: [];
|
|
290
|
+
var leftPinned = (((_h = (_g = props.pinColumns) === null || _g === void 0 ? void 0 : _g.left) === null || _h === void 0 ? void 0 : _h.length) ? props.pinColumns.left : activityPin).filter(function (key) { return !groupedKeys.has(key); });
|
|
291
|
+
var rightPinned = ((_k = (_j = props.pinColumns) === null || _j === void 0 ? void 0 : _j.right) !== null && _k !== void 0 ? _k : []).filter(function (key) { return !groupedKeys.has(key); });
|
|
286
292
|
var hasPinColumns = leftPinned.length > 0 || rightPinned.length > 0;
|
|
287
293
|
// INFO: reorder flatColumns so left-pinned come first, right-pinned come last.
|
|
288
294
|
if (hasPinColumns) {
|
|
@@ -296,30 +302,30 @@ var NewTable = function (props) {
|
|
|
296
302
|
flatColumns.length = 0;
|
|
297
303
|
flatColumns.push.apply(flatColumns, __spreadArray(__spreadArray(__spreadArray([], leftCols, false), middleCols, false), rightCols, false));
|
|
298
304
|
}
|
|
299
|
-
var
|
|
305
|
+
var _3 = (0, react_2.useState)(props.fixedPagination ? true : false), isFixed = _3[0], setIsFixed = _3[1];
|
|
300
306
|
//=====================================================================================
|
|
301
307
|
// SECTION: Advanced Settings
|
|
302
308
|
//=====================================================================================
|
|
303
|
-
var
|
|
304
|
-
var
|
|
305
|
-
var
|
|
306
|
-
var
|
|
307
|
-
var
|
|
308
|
-
var
|
|
309
|
-
var
|
|
310
|
-
var
|
|
311
|
-
var
|
|
309
|
+
var _4 = (0, react_2.useState)(""), filterModal = _4[0], setFilterModal = _4[1];
|
|
310
|
+
var _5 = (0, react_2.useState)(""), addColumnModal = _5[0], setAddColumnModal = _5[1];
|
|
311
|
+
var _6 = (0, react_2.useState)(""), newColumnName = _6[0], setNewColumnName = _6[1];
|
|
312
|
+
var _7 = (0, react_2.useState)("string"), newColumnType = _7[0], setNewColumnType = _7[1];
|
|
313
|
+
var _8 = (0, react_2.useState)(""), newColumnRefSpace = _8[0], setNewColumnRefSpace = _8[1];
|
|
314
|
+
var _9 = (0, react_2.useState)(""), newColumnRefLabel = _9[0], setNewColumnRefLabel = _9[1];
|
|
315
|
+
var _10 = (0, react_2.useState)(""), newColumnOptions = _10[0], setNewColumnOptions = _10[1];
|
|
316
|
+
var _11 = (0, react_2.useState)(false), newColumnRequired = _11[0], setNewColumnRequired = _11[1];
|
|
317
|
+
var _12 = (0, react_2.useState)(false), addingColumn = _12[0], setAddingColumn = _12[1];
|
|
312
318
|
//=====================================================================================
|
|
313
319
|
// SECTION: Editable & Addable cells
|
|
314
320
|
//=====================================================================================
|
|
315
|
-
var
|
|
316
|
-
var
|
|
321
|
+
var _13 = (0, react_2.useState)(""), editDataRowId = _13[0], setEditDataRowId = _13[1];
|
|
322
|
+
var _14 = (0, react_2.useState)(""), editDataHeaderKey = _14[0], setEditDataHeaderKey = _14[1];
|
|
317
323
|
// INFO: an editable table used to mount an input in every cell — it read as a
|
|
318
324
|
// form, and a row click always landed on a child input. Only the hovered cell
|
|
319
325
|
// becomes its input now.
|
|
320
|
-
var
|
|
321
|
-
var
|
|
322
|
-
var
|
|
326
|
+
var _15 = (0, react_2.useState)(null), hoveredCell = _15[0], setHoveredCell = _15[1];
|
|
327
|
+
var _16 = (0, react_2.useState)(false), modalEditVisible = _16[0], setModalEditVisible = _16[1];
|
|
328
|
+
var _17 = (0, react_2.useState)([]), collapsedGroupIds = _17[0], setCollapsedGroupIds = _17[1];
|
|
323
329
|
// INFO: sheet-style row selection — Shift-click extends from the last
|
|
324
330
|
// clicked row, a mouse-down-and-drag down the checkbox column paints a
|
|
325
331
|
// range. The drag applies the start row itself, so the click that lands on
|
|
@@ -327,20 +333,20 @@ var NewTable = function (props) {
|
|
|
327
333
|
var lastSelectedRowRef = (0, react_2.useRef)(null);
|
|
328
334
|
var dragSelectRef = (0, react_2.useRef)(null);
|
|
329
335
|
var suppressNextClickRef = (0, react_2.useRef)(false);
|
|
330
|
-
var
|
|
331
|
-
var
|
|
332
|
-
var
|
|
333
|
-
var
|
|
334
|
-
var
|
|
335
|
-
var
|
|
336
|
-
var
|
|
336
|
+
var _18 = (0, react_2.useState)(false), isDragSelecting = _18[0], setIsDragSelecting = _18[1];
|
|
337
|
+
var _19 = (0, react_2.useState)(0), copiedCount = _19[0], setCopiedCount = _19[1];
|
|
338
|
+
var _20 = (0, react_2.useState)({}), editDataValue = _20[0], setEditDataValue = _20[1];
|
|
339
|
+
var _21 = (0, react_2.useState)(false), editDataIsLoading = _21[0], setEditDataIsLoading = _21[1];
|
|
340
|
+
var _22 = (0, react_2.useState)(false), addData = _22[0], setAddData = _22[1];
|
|
341
|
+
var _23 = (0, react_2.useState)({}), addDataValue = _23[0], setAddDataValue = _23[1];
|
|
342
|
+
var _24 = (0, react_2.useState)({}), referencesOptions = _24[0], setReferencesOptions = _24[1];
|
|
337
343
|
// INFO: seeded options sit under the local map so a cell's own search
|
|
338
344
|
// results still win per key
|
|
339
|
-
var mergedReferencesOptions = __assign(__assign({}, ((
|
|
340
|
-
var
|
|
341
|
-
var
|
|
345
|
+
var mergedReferencesOptions = __assign(__assign({}, ((_l = props.referencesOptions) !== null && _l !== void 0 ? _l : {})), referencesOptions);
|
|
346
|
+
var _25 = (0, react_2.useState)({}), referencesDetails = _25[0], setReferencesDetails = _25[1];
|
|
347
|
+
var _26 = (0, react_2.useState)(false), referenceLoading = _26[0], setReferenceLoading = _26[1];
|
|
342
348
|
// INFO: measured pixel widths for pinned columns without an explicit width.
|
|
343
|
-
var
|
|
349
|
+
var _27 = (0, react_2.useState)({}), measuredPinWidths = _27[0], setMeasuredPinWidths = _27[1];
|
|
344
350
|
var editDataValueRef = (0, react_2.useRef)({});
|
|
345
351
|
var editDataRowIdRef = (0, react_2.useRef)("");
|
|
346
352
|
var editDataHeaderKeyRef = (0, react_2.useRef)("");
|
|
@@ -359,7 +365,7 @@ var NewTable = function (props) {
|
|
|
359
365
|
var bgColor = props.darkMode
|
|
360
366
|
? props.darkModeBg || "bg-gray-900"
|
|
361
367
|
: "bg-white";
|
|
362
|
-
var isFlat = !!((
|
|
368
|
+
var isFlat = !!((_m = props.advSettings) === null || _m === void 0 ? void 0 : _m.flat);
|
|
363
369
|
var borderRadius = isFlat ? "" : "rounded-2xl";
|
|
364
370
|
var borderColor = props.darkMode ? "border-gray-700" : "border-gray-100";
|
|
365
371
|
var selectedRowBg = props.darkMode ? "bg-gray-700" : "bg-primary-50";
|
|
@@ -403,8 +409,8 @@ var NewTable = function (props) {
|
|
|
403
409
|
var errorFontColor = props.darkMode ? "text-red-300" : "text-red-500";
|
|
404
410
|
// INFO: an edit commits on blur, but navigating away unmounts the table
|
|
405
411
|
// without one — the cell was left dirty on screen and the value never sent.
|
|
406
|
-
var onUpdateDataRef = (0, react_2.useRef)((
|
|
407
|
-
onUpdateDataRef.current = (
|
|
412
|
+
var onUpdateDataRef = (0, react_2.useRef)((_o = props.editable) === null || _o === void 0 ? void 0 : _o.onUpdateData);
|
|
413
|
+
onUpdateDataRef.current = (_p = props.editable) === null || _p === void 0 ? void 0 : _p.onUpdateData;
|
|
408
414
|
(0, react_2.useEffect)(function () {
|
|
409
415
|
return function () {
|
|
410
416
|
var _a, _b;
|
|
@@ -766,7 +772,7 @@ var NewTable = function (props) {
|
|
|
766
772
|
// resize is a per-viewer preference and there is no storage for it yet.
|
|
767
773
|
// Tailwind cannot emit a runtime w-[Npx], so this drives an inline style and
|
|
768
774
|
// wins over the col.width class.
|
|
769
|
-
var
|
|
775
|
+
var _28 = (0, react_2.useState)({}), columnWidths = _28[0], setColumnWidths = _28[1];
|
|
770
776
|
var resizeRef = (0, react_2.useRef)(null);
|
|
771
777
|
// INFO: a consumer may deliberately set a column narrower than the default
|
|
772
778
|
// floor (a 40px icon column, say) — never force it wider than it was asked to
|
|
@@ -1351,6 +1357,16 @@ var NewTable = function (props) {
|
|
|
1351
1357
|
},
|
|
1352
1358
|
}))));
|
|
1353
1359
|
};
|
|
1360
|
+
var renderActivityButton = function (id, positioned) {
|
|
1361
|
+
if (positioned === void 0) { positioned = false; }
|
|
1362
|
+
return props.onRowActivity ? (react_2.default.createElement("button", { type: "button", "aria-label": "Open activity for ".concat(id), title: "Comments and activity", className: "".concat(positioned ? "absolute right-1 top-1/2 -translate-y-1/2 z-20" : "", " inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-transparent text-primary-500 hover:bg-primary-50 focus-visible:outline focus-visible:outline-2"), onClick: function (event) {
|
|
1363
|
+
var _a;
|
|
1364
|
+
event.preventDefault();
|
|
1365
|
+
event.stopPropagation();
|
|
1366
|
+
(_a = props.onRowActivity) === null || _a === void 0 ? void 0 : _a.call(props, id);
|
|
1367
|
+
} },
|
|
1368
|
+
react_2.default.createElement(outline_1.ChatBubbleOvalLeftEllipsisIcon, { className: "h-5 w-5", "aria-hidden": "true" }))) : null;
|
|
1369
|
+
};
|
|
1354
1370
|
var handleShowsActionColumn = function () { var _a; return !!((_a = props.deleteable) === null || _a === void 0 ? void 0 : _a.active) || (addData && handleValidateAddColumns()); };
|
|
1355
1371
|
var renderActionColumnHeader = function () {
|
|
1356
1372
|
if (handleShowsActionColumn()) {
|
|
@@ -1473,7 +1489,7 @@ var NewTable = function (props) {
|
|
|
1473
1489
|
};
|
|
1474
1490
|
// INFO: true when maxSelectedCount is set and the current selection has reached the limit
|
|
1475
1491
|
var isMaxReached = !!props.maxSelectedCount &&
|
|
1476
|
-
((
|
|
1492
|
+
((_r = (_q = props.selectedIds) === null || _q === void 0 ? void 0 : _q.length) !== null && _r !== void 0 ? _r : 0) >= props.maxSelectedCount;
|
|
1477
1493
|
// INFO: one desktop row. groupAccent carries the group's colour so member
|
|
1478
1494
|
// rows show the band's colour as a bar down their left edge.
|
|
1479
1495
|
var renderDesktopRow = function (row, index, groupAccent) {
|
|
@@ -1509,120 +1525,131 @@ var NewTable = function (props) {
|
|
|
1509
1525
|
? "opacity-50 cursor-not-allowed"
|
|
1510
1526
|
: ""))),
|
|
1511
1527
|
flatColumns.map(function (col, colIndex) {
|
|
1512
|
-
var _a, _b, _c
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
//
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1528
|
+
var _a, _b, _c;
|
|
1529
|
+
var renderDataCell = function () {
|
|
1530
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
1531
|
+
// INFO: a coloured list cell is this table's to render, so it takes
|
|
1532
|
+
// the raw value even when a display row is supplied. The list view
|
|
1533
|
+
// builds those rows and puts a Tag in for a coloured value — an
|
|
1534
|
+
// element, which the guard below then excludes from inline edit, so
|
|
1535
|
+
// the column came out as a pill that could not be edited in place.
|
|
1536
|
+
// Only the cell is redirected: the display rows still carry the Tag
|
|
1537
|
+
// for the read view, the kanban and the grid.
|
|
1538
|
+
var cellValue = spaceRow && !handleColumnShowsTags(col)
|
|
1539
|
+
? spaceRow[col.key]
|
|
1540
|
+
: resolveValue(row, col.key);
|
|
1541
|
+
// INFO: first col with type "string" is never made editable
|
|
1542
|
+
var resolvedColType = (_a = col.type) !== null && _a !== void 0 ? _a : "string";
|
|
1543
|
+
var isActionColumn = col.key === "update" && !col.type;
|
|
1544
|
+
// INFO: a cell whose value is already a React element (row action
|
|
1545
|
+
// buttons, a custom control) is rendered as-is even in an editable
|
|
1546
|
+
// table — wrapping it in an inline editor would swallow it
|
|
1547
|
+
var isElementCell = react_2.default.isValidElement(cellValue);
|
|
1548
|
+
// INFO: a column the schema marks disabled is read-only in the form,
|
|
1549
|
+
// so it stays read-only in an editable table too — without this an
|
|
1550
|
+
// admin-locked (often system-filled) column was editable on hover
|
|
1551
|
+
var isColumnLocked = !!col.disabled;
|
|
1552
|
+
var isModalEdit = ((_b = props.editable) === null || _b === void 0 ? void 0 : _b.active) &&
|
|
1553
|
+
!isColumnLocked &&
|
|
1554
|
+
!isActionColumn &&
|
|
1555
|
+
!isElementCell &&
|
|
1556
|
+
utils_1.supportedModalEditList.includes(resolvedColType);
|
|
1557
|
+
var isObjectEdit = ((_c = props.editable) === null || _c === void 0 ? void 0 : _c.active) &&
|
|
1558
|
+
!isColumnLocked &&
|
|
1559
|
+
!isActionColumn &&
|
|
1560
|
+
!isElementCell &&
|
|
1561
|
+
resolvedColType === "object" &&
|
|
1562
|
+
!!props.onObjectEdit;
|
|
1563
|
+
// INFO: the read cell renders an object, but a text field would show
|
|
1564
|
+
// [object Object] and commit that string over the real value
|
|
1565
|
+
var isUneditableShape = typeof cellValue === "object" &&
|
|
1566
|
+
cellValue !== null &&
|
|
1567
|
+
!(cellValue instanceof Date) &&
|
|
1568
|
+
utils_1.primitiveInlineEditList.includes(resolvedColType);
|
|
1569
|
+
var isEditable = ((_d = props.editable) === null || _d === void 0 ? void 0 : _d.active) &&
|
|
1570
|
+
!isColumnLocked &&
|
|
1571
|
+
!isActionColumn &&
|
|
1572
|
+
!isElementCell &&
|
|
1573
|
+
!isUneditableShape &&
|
|
1574
|
+
!(((_f = (_e = props.selectedIds) === null || _e === void 0 ? void 0 : _e.length) !== null && _f !== void 0 ? _f : 0) > 0 || props.selectAll) &&
|
|
1575
|
+
utils_1.supportedInlineEditList.includes(resolvedColType);
|
|
1576
|
+
var rowData = editDataRowId === row.id ? editDataValue : row;
|
|
1577
|
+
// INFO: a list column with a palette paints the whole cell —
|
|
1578
|
+
// a status column then reads like a heat map instead of a
|
|
1579
|
+
// row of chips. Editable tables open the palette on click.
|
|
1580
|
+
var rawListValue = resolveValue(row, col.key);
|
|
1581
|
+
var fillColour = resolvedColType === "list" && !isActionColumn
|
|
1582
|
+
? handleGetListColour(col, rawListValue)
|
|
1583
|
+
: undefined;
|
|
1584
|
+
// INFO: an editable table renders the coloured cell as its Select in
|
|
1585
|
+
// every row (filled while closed) so the control never swaps in and
|
|
1586
|
+
// out; the plain block is for read-only tables and locked columns
|
|
1587
|
+
if (fillColour && (!((_g = props.editable) === null || _g === void 0 ? void 0 : _g.active) || isColumnLocked)) {
|
|
1588
|
+
// INFO: a read-only table shows the same filled Select as an
|
|
1589
|
+
// editable one, just disabled — the cell looks identical in both
|
|
1590
|
+
// modes and the row click still navigates
|
|
1591
|
+
var readOnlyDS = __assign(__assign({}, col), { id: col.key, name: col.title, type: (_h = col.type) !== null && _h !== void 0 ? _h : "string", showTagSelections: handleColumnShowsTags(col), disabled: true });
|
|
1592
|
+
// INFO: navigate on click only for a genuinely read-only table. This
|
|
1593
|
+
// branch is ALSO entered for a locked column inside an EDITABLE
|
|
1594
|
+
// table (isColumnLocked) — there a click must leave the Select alone,
|
|
1595
|
+
// not navigate — so the overlay is gated on !editable.active.
|
|
1596
|
+
var shouldNavigateOnClick = !((_j = props.editable) === null || _j === void 0 ? void 0 : _j.active);
|
|
1597
|
+
return (react_2.default.createElement("td", { key: col.key, className: "p-0 align-middle ".concat((_l = (_k = getPinProps(col.key, false, rowBgClass, isRowHoverable)) === null || _k === void 0 ? void 0 : _k.className) !== null && _l !== void 0 ? _l : ""), style: (_m = getPinProps(col.key, false, rowBgClass, isRowHoverable)) === null || _m === void 0 ? void 0 : _m.style },
|
|
1598
|
+
react_2.default.createElement("div", { className: "relative w-max whitespace-nowrap p-[1px]" },
|
|
1599
|
+
renderFormCell(row, readOnlyDS, null, {
|
|
1600
|
+
active: true,
|
|
1601
|
+
readOnly: true,
|
|
1602
|
+
onBlur: function () { },
|
|
1603
|
+
}),
|
|
1604
|
+
shouldNavigateOnClick && props.onClickRow && (react_2.default.createElement("div", { "data-testid": "fill-cell-nav-".concat(col.key), className: "absolute inset-0 z-10 cursor-pointer", onClick: function (e) {
|
|
1605
|
+
var _a;
|
|
1606
|
+
e.preventDefault();
|
|
1607
|
+
e.stopPropagation();
|
|
1608
|
+
(_a = props.onClickRow) === null || _a === void 0 ? void 0 : _a.call(props, row.id, row, spaceRow);
|
|
1609
|
+
} })))));
|
|
1610
|
+
}
|
|
1611
|
+
if (isObjectEdit) {
|
|
1612
|
+
return (react_2.default.createElement("td", { key: col.key, className: "".concat(cellPadding, " text-sm ").concat(cellFontColor, " whitespace-nowrap") },
|
|
1613
|
+
react_2.default.createElement("div", { className: "cursor-pointer group/modaledit flex items-center gap-x-2 min-h-6", "data-testid": "table-object-edit-".concat(col.key), onClick: function (e) {
|
|
1587
1614
|
var _a;
|
|
1588
|
-
e.preventDefault();
|
|
1589
1615
|
e.stopPropagation();
|
|
1590
|
-
(_a = props.
|
|
1591
|
-
} }
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
//
|
|
1623
|
-
react_2.default.
|
|
1624
|
-
|
|
1625
|
-
|
|
1616
|
+
(_a = props.onObjectEdit) === null || _a === void 0 ? void 0 : _a.call(props, row.id, col.key, row);
|
|
1617
|
+
} },
|
|
1618
|
+
handleCheckModalEditEmpty(cellValue) ? (react_2.default.createElement("span", { className: "text-gray-400 italic" }, "Add")) : ((0, readModule_1.renderEachRowDataBasedOnDataType)(col.key, cellValue, props.bareSettings, true, props.disableEllipsisOnLongWord)),
|
|
1619
|
+
react_2.default.createElement(outline_1.PencilIcon, { className: "w-3.5 h-3.5 text-gray-400 opacity-0 group-hover/modaledit:opacity-100 flex-shrink-0" }))));
|
|
1620
|
+
}
|
|
1621
|
+
if (isModalEdit) {
|
|
1622
|
+
return (react_2.default.createElement("td", { key: col.key, className: "".concat(cellPadding, " text-sm ").concat(cellFontColor, " whitespace-nowrap") },
|
|
1623
|
+
react_2.default.createElement("div", { className: "cursor-pointer group/modaledit flex items-center gap-x-2 min-h-6", "data-testid": "table-modal-edit-".concat(col.key), onClick: function (e) {
|
|
1624
|
+
e.stopPropagation();
|
|
1625
|
+
handleModalEditOnClick(row.id, col.key, row);
|
|
1626
|
+
} },
|
|
1627
|
+
handleCheckModalEditEmpty(cellValue) ? (react_2.default.createElement("span", { className: "text-gray-400 italic" }, "Add")) : ((0, readModule_1.renderEachRowDataBasedOnDataType)(col.key, cellValue, props.bareSettings, true, props.disableEllipsisOnLongWord)),
|
|
1628
|
+
react_2.default.createElement(outline_1.PencilIcon, { className: "w-3.5 h-3.5 text-gray-400 opacity-0 group-hover/modaledit:opacity-100 flex-shrink-0" }))));
|
|
1629
|
+
}
|
|
1630
|
+
// INFO: falls through to the plain text cell below unless hovered or
|
|
1631
|
+
// mid-edit. Coloured list cells are exempt — read and edit are the same
|
|
1632
|
+
// filled pill, so there is nothing to swap to.
|
|
1633
|
+
if (isEditable &&
|
|
1634
|
+
(handleColumnShowsTags(col) || handleIsCellLive(row.id, col.key))) {
|
|
1635
|
+
var bareOverride = (_p = (_o = props.bareSettings) === null || _o === void 0 ? void 0 : _o.bareListDescription) === null || _p === void 0 ? void 0 : _p.call(_o, col.key, cellValue);
|
|
1636
|
+
if (!bareOverride)
|
|
1637
|
+
return renderEditDataInputs(colIndex, col, rowData, row.id, rowBgClass, isRowHoverable);
|
|
1638
|
+
}
|
|
1639
|
+
return (
|
|
1640
|
+
// INFO: pinned columns use whitespace-normal so text wraps within the fixed width
|
|
1641
|
+
react_2.default.createElement("td", __assign({ key: col.key }, (isEditable ? handleCellHoverProps(row.id, col.key) : {}), { "data-cell-key": col.key, "data-pin-key": leftPinned.includes(col.key) || rightPinned.includes(col.key)
|
|
1642
|
+
? col.key
|
|
1643
|
+
: undefined, className: "".concat(cellPadding, " ").concat(isEditable ? "".concat(editCellMinHeight, " align-middle ").concat(handleCellMinWidth(col.type)) : "", " text-sm ").concat(colIndex === 0 && props.onClickRow ? titleFontColor : cellFontColor, " ").concat(col.width ? "".concat(col.width, " flex-shrink-0") : getPinProps(col.key, false) ? "" : "whitespace-nowrap", " ").concat((_r = (_q = getPinProps(col.key, false, rowBgClass, isRowHoverable)) === null || _q === void 0 ? void 0 : _q.className) !== null && _r !== void 0 ? _r : ""), style: (_s = getPinProps(col.key, false, rowBgClass, isRowHoverable)) === null || _s === void 0 ? void 0 : _s.style }), props.newTabUrl && props.onClickRow ? (react_2.default.createElement(link_1.Link, { href: props.newTabUrl + row.id + ((_t = props.addNewTabUrl) !== null && _t !== void 0 ? _t : ""), className: "w-full block", linkType: props.linkType, custom: props.custom }, (0, readModule_1.renderEachRowDataBasedOnDataType)(col.key, cellValue, props.bareSettings, true, props.disableEllipsisOnLongWord))) : ((0, readModule_1.renderEachRowDataBasedOnDataType)(col.key, cellValue, props.bareSettings, true, props.disableEllipsisOnLongWord))));
|
|
1644
|
+
};
|
|
1645
|
+
var cell = renderDataCell();
|
|
1646
|
+
if (colIndex !== 0 || !props.onRowActivity)
|
|
1647
|
+
return cell;
|
|
1648
|
+
// Keep the action outside links and inline editors in every cell variant.
|
|
1649
|
+
return react_2.default.cloneElement(cell, {
|
|
1650
|
+
className: "".concat(cell.props.className, " ").concat((_b = (_a = getPinProps(col.key, false, rowBgClass, isRowHoverable)) === null || _a === void 0 ? void 0 : _a.className) !== null && _b !== void 0 ? _b : "", " !pr-12"),
|
|
1651
|
+
style: __assign(__assign(__assign({}, cell.props.style), (_c = getPinProps(col.key, false, rowBgClass, isRowHoverable)) === null || _c === void 0 ? void 0 : _c.style), { position: getPinProps(col.key, false) ? "sticky" : "relative" }),
|
|
1652
|
+
}, cell.props.children, renderActivityButton(row.id, true));
|
|
1626
1653
|
}),
|
|
1627
1654
|
renderAddColumnCell(),
|
|
1628
1655
|
renderActionColumnCell(row.id)));
|
|
@@ -1868,11 +1895,11 @@ var NewTable = function (props) {
|
|
|
1868
1895
|
var isIdLike_1 = function (c) {
|
|
1869
1896
|
return /^id$/i.test(c.key) || /^_id$/i.test(c.key);
|
|
1870
1897
|
};
|
|
1871
|
-
var titleCol_1 = (
|
|
1898
|
+
var titleCol_1 = (_s = flatColumns.find(function (c) { return !isIdLike_1(c); })) !== null && _s !== void 0 ? _s : flatColumns[0];
|
|
1872
1899
|
var expandHeaderBg_1 = props.darkMode ? "bg-gray-700" : "bg-gray-100";
|
|
1873
1900
|
var expandHeaderFontColor_1 = props.darkMode ? "text-white" : "";
|
|
1874
1901
|
var headerBgColor_1 = props.darkMode
|
|
1875
|
-
? ((
|
|
1902
|
+
? ((_t = props.darkModeBg) !== null && _t !== void 0 ? _t : "bg-gray-900")
|
|
1876
1903
|
: "";
|
|
1877
1904
|
var headerFontColor_1 = props.darkMode ? "text-white" : "";
|
|
1878
1905
|
// INFO: renders tag + trailing text adjacent to the Collapse title
|
|
@@ -1967,16 +1994,16 @@ var NewTable = function (props) {
|
|
|
1967
1994
|
})))));
|
|
1968
1995
|
};
|
|
1969
1996
|
return (react_2.default.createElement("div", null,
|
|
1970
|
-
react_2.default.createElement("div", { className: "w-full ".concat(((
|
|
1997
|
+
react_2.default.createElement("div", { className: "w-full ".concat(((_u = props.mobileTooltip) === null || _u === void 0 ? void 0 : _u.tooltip) ? "overflow-visible" : "overflow-hidden", " ").concat(isFlat
|
|
1971
1998
|
? ""
|
|
1972
|
-
: "border ".concat(borderRadius, " ").concat(borderColor, " ").concat(bgColor, " shadow-sm"), " divide-y ").concat(dividerColor, " ").concat((
|
|
1999
|
+
: "border ".concat(borderRadius, " ").concat(borderColor, " ").concat(bgColor, " shadow-sm"), " divide-y ").concat(dividerColor, " ").concat((_v = props.className) !== null && _v !== void 0 ? _v : "") },
|
|
1973
2000
|
react_2.default.createElement("div", { className: "p-3 flex justify-between" },
|
|
1974
2001
|
renderSelectAll(),
|
|
1975
2002
|
renderSelectedCount()),
|
|
1976
2003
|
props.loading &&
|
|
1977
2004
|
Array.from({ length: 3 }).map(function (_, i) { return (react_2.default.createElement("div", { key: "skeleton-".concat(i), className: "p-4" },
|
|
1978
2005
|
react_2.default.createElement("div", { className: "h-5 w-3/4 rounded-md animate-pulse ".concat(props.darkMode ? "bg-gray-700" : "bg-gray-200") }))); }),
|
|
1979
|
-
!props.loading && props.data.length === 0 && (react_2.default.createElement("p", { className: "p-4 text-center text-sm ".concat(cellFontColor) }, (
|
|
2006
|
+
!props.loading && props.data.length === 0 && (react_2.default.createElement("p", { className: "p-4 text-center text-sm ".concat(cellFontColor) }, (_w = props.emptyTitle) !== null && _w !== void 0 ? _w : "No items")),
|
|
1980
2007
|
!props.loading &&
|
|
1981
2008
|
props.data.map(function (row, index) {
|
|
1982
2009
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -2017,7 +2044,9 @@ var NewTable = function (props) {
|
|
|
2017
2044
|
});
|
|
2018
2045
|
}
|
|
2019
2046
|
return (react_2.default.createElement("div", { key: row.id, "data-dtw-record-id": row.id, className: "relative group/tooltip" },
|
|
2020
|
-
react_2.default.createElement(collapse_1.Collapse, { title: cardTitle, titleClassName: "text-sm font-medium !p-0 ".concat(props.onClickRow ? titleFontColor : ""), icon: props.checkbox ? renderCheckbox(isSelected, function () { }, function (e) { return handleSelectRow(row.id, e); }, "w-4 h-4 ".concat(isMaxReached && !isSelected ? "opacity-50 cursor-not-allowed" : "cursor-pointer")) : (react_2.default.createElement(solid_2.ListBulletIcon, { className: "w-4 h-4 ".concat(props.darkMode ? "text-gray-400" : "text-gray-500") })), defaultValue: false, additionalComp:
|
|
2047
|
+
react_2.default.createElement(collapse_1.Collapse, { title: cardTitle, titleClassName: "text-sm font-medium !p-0 ".concat(props.onClickRow ? titleFontColor : ""), icon: props.checkbox ? renderCheckbox(isSelected, function () { }, function (e) { return handleSelectRow(row.id, e); }, "w-4 h-4 ".concat(isMaxReached && !isSelected ? "opacity-50 cursor-not-allowed" : "cursor-pointer")) : (react_2.default.createElement(solid_2.ListBulletIcon, { className: "w-4 h-4 ".concat(props.darkMode ? "text-gray-400" : "text-gray-500") })), defaultValue: false, additionalComp: props.onRowActivity ? (react_2.default.createElement("div", { className: "flex items-center gap-2" },
|
|
2048
|
+
renderMobileTitleAdjacent_1(row, spaceRow),
|
|
2049
|
+
renderActivityButton(row.id))) : (renderMobileTitleAdjacent_1(row, spaceRow)), collapseAdditionalComp: renderMobileTitleSummary_1(row, spaceRow),
|
|
2021
2050
|
// INFO: clicking the summary line expands the row, same as
|
|
2022
2051
|
// the header
|
|
2023
2052
|
collapseAdditionalCompToggle: true, collapseContainerCss: "".concat(isSelected ? selectedRowBg : expandHeaderBg_1, " ").concat(expandHeaderFontColor_1), notCollapseContainerCss: "".concat(isSelected ? selectedRowBg : headerBgColor_1, " ").concat(headerFontColor_1), content: react_2.default.createElement("div", null,
|
|
@@ -2030,13 +2059,13 @@ var NewTable = function (props) {
|
|
|
2030
2059
|
: "") }),
|
|
2031
2060
|
renderFloatingActionBar()));
|
|
2032
2061
|
}
|
|
2033
|
-
return (react_2.default.createElement("div", { className: "w-full ".concat((
|
|
2062
|
+
return (react_2.default.createElement("div", { className: "w-full ".concat((_x = props.className) !== null && _x !== void 0 ? _x : "") },
|
|
2034
2063
|
react_2.default.createElement(modal_1.Modal, { open: filterModal ? true : false, title: "Filter Options", renderContent: function () {
|
|
2035
2064
|
var _a, _b;
|
|
2036
2065
|
return (react_2.default.createElement("div", { className: "pb-44" },
|
|
2037
2066
|
react_2.default.createElement("div", { className: "pb-48" }, (_b = (_a = props.advSettings) === null || _a === void 0 ? void 0 : _a.renderFilterElements) === null || _b === void 0 ? void 0 : _b.call(_a, filterModal))));
|
|
2038
2067
|
}, onClose: function () { return setFilterModal(""); } }),
|
|
2039
|
-
react_2.default.createElement(modal_1.Modal, { open: modalEditVisible, title: (
|
|
2068
|
+
react_2.default.createElement(modal_1.Modal, { open: modalEditVisible, title: (_z = (_y = flatColumns.find(function (eachCol) { return eachCol.key === editDataHeaderKey; })) === null || _y === void 0 ? void 0 : _y.title) !== null && _z !== void 0 ? _z : "Edit", onClose: handleModalEditClose, renderContent: function () {
|
|
2040
2069
|
var _a, _b, _c, _d;
|
|
2041
2070
|
var selectedCol = flatColumns.find(function (eachCol) { return eachCol.key === editDataHeaderKey; });
|
|
2042
2071
|
if (!selectedCol)
|
|
@@ -2076,7 +2105,7 @@ var NewTable = function (props) {
|
|
|
2076
2105
|
react_2.default.createElement(scrollShadow_1.ScrollShadow, { className: "w-full overflow-x-auto ".concat(isFlat
|
|
2077
2106
|
? ""
|
|
2078
2107
|
: "".concat(borderRadius, " border ").concat(borderColor, " ").concat(bgColor, " shadow-sm")), darkMode: props.darkMode },
|
|
2079
|
-
(props.selectAll || ((
|
|
2108
|
+
(props.selectAll || ((_1 = (_0 = props.selectedIds) === null || _0 === void 0 ? void 0 : _0.length) !== null && _1 !== void 0 ? _1 : 0) > 0) &&
|
|
2080
2109
|
(!props.multiActionFloatingBtns ||
|
|
2081
2110
|
(props.multiActionFloatingBtns &&
|
|
2082
2111
|
props.multiActionFloatingBtns.length <= 0)) && (react_2.default.createElement("div", { className: "sticky left-0 flex flex-row items-center px-4 py-3 gap-x-2" },
|
|
@@ -2096,7 +2125,7 @@ var NewTable = function (props) {
|
|
|
2096
2125
|
react_2.default.createElement("div", { className: "h-5 rounded-md animate-pulse ".concat(props.darkMode ? "bg-gray-700" : "bg-gray-200") }))); }))); }),
|
|
2097
2126
|
!props.loading && renderDesktopRows(),
|
|
2098
2127
|
!props.loading && addData && renderAddDataRow())),
|
|
2099
|
-
!props.loading && props.data.length === 0 && (react_2.default.createElement("div", { className: "p-4 text-sm ".concat(cellFontColor, " text-center sticky left-0") }, (
|
|
2128
|
+
!props.loading && props.data.length === 0 && (react_2.default.createElement("div", { className: "p-4 text-sm ".concat(cellFontColor, " text-center sticky left-0") }, (_2 = props.emptyTitle) !== null && _2 !== void 0 ? _2 : "No items")),
|
|
2100
2129
|
renderAddableSection()),
|
|
2101
2130
|
react_2.default.createElement(newPagination_1.NewPagination, { paginationType: props.paginationType, pageIndex: props.pageIndex, limit: props.limit, size: props.size, cursor: props.cursor, resultCount: props.data.length, customPaginationSize: props.customPaginationSize, hidePagination: props.hidePagination, darkMode: props.darkMode, darkModeBg: props.darkModeBg, handleUpdatePageIndex: props.handleUpdatePageIndex, className: "".concat(props.fixedPagination
|
|
2102
2131
|
? "pagination-container w-full ".concat(borderColor, " ").concat(isFixed ? "fixed bottom-0 left-0 z-10" : "sticky top-0 left-0")
|