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