@builttocreate/engine-utils 1.0.2 → 1.0.3
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/dist/tableHelper.js +9 -2
- package/package.json +1 -1
package/dist/tableHelper.js
CHANGED
|
@@ -544,22 +544,27 @@ var generateInputGroupFields = function generateInputGroupFields(field, columns)
|
|
|
544
544
|
var rowOrder = getTableFieldRowOrder(field._id, fieldSettings, tableRows);
|
|
545
545
|
var sortedTableRows = sortRows(tableRows, rowOrder);
|
|
546
546
|
sortedTableRows.forEach(function (row, rowIndex) {
|
|
547
|
+
var lastRowIndex = rowIndex === sortedTableRows.length - 1;
|
|
547
548
|
/**
|
|
548
549
|
* Step 1: Add InputGroup Row Header
|
|
549
550
|
*/
|
|
551
|
+
|
|
550
552
|
tableReferences.push({
|
|
551
553
|
uniqueId: "".concat(field._id, "-").concat(row._id),
|
|
552
554
|
_id: field._id,
|
|
553
555
|
title: field.title,
|
|
554
556
|
type: _Table.inputGroupFieldTypes.inputGroupRowHeader,
|
|
555
557
|
rowIndex: rowIndex,
|
|
556
|
-
rowId: row._id
|
|
558
|
+
rowId: row._id,
|
|
559
|
+
firstIndex: rowIndex === 0,
|
|
560
|
+
lastIndex: false
|
|
557
561
|
});
|
|
558
562
|
/**
|
|
559
563
|
* Step 2: Add Input Group Row Cells
|
|
560
564
|
*/
|
|
561
565
|
|
|
562
566
|
tableColumns.forEach(function (column, columnIndex) {
|
|
567
|
+
var lastColumnIndex = columnIndex === tableColumns.length - 1;
|
|
563
568
|
var value = row && row.cells ? row.cells[column._id] : '';
|
|
564
569
|
var displayValue = column.type === _FieldTableColumnTypes["default"].dropdown ? columnOptionValueLookup[column._id][value] : value;
|
|
565
570
|
tableReferences.push({
|
|
@@ -572,7 +577,9 @@ var generateInputGroupFields = function generateInputGroupFields(field, columns)
|
|
|
572
577
|
columnId: column._id,
|
|
573
578
|
columnIndex: columnIndex,
|
|
574
579
|
value: value,
|
|
575
|
-
displayValue: displayValue
|
|
580
|
+
displayValue: displayValue,
|
|
581
|
+
firstIndex: false,
|
|
582
|
+
lastIndex: lastRowIndex && lastColumnIndex
|
|
576
583
|
});
|
|
577
584
|
});
|
|
578
585
|
});
|