@cellaware/utils 8.1.3 → 8.1.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/chatwms/datagrid.js +10 -10
- package/package.json +1 -1
package/dist/chatwms/datagrid.js
CHANGED
|
@@ -816,15 +816,15 @@ export function datagridToHtml(datagridState) {
|
|
|
816
816
|
return buf;
|
|
817
817
|
}
|
|
818
818
|
// Header:
|
|
819
|
-
buf += '<table
|
|
819
|
+
buf += '<table>\n\t<thead>\n\t\t<tr>';
|
|
820
820
|
let columns = [];
|
|
821
821
|
for (const key in datagridState.adjRowData[0]) {
|
|
822
822
|
columns.push(key);
|
|
823
|
-
buf +=
|
|
823
|
+
buf += `\n\t\t\t<th>${key}</th>`;
|
|
824
824
|
}
|
|
825
|
-
buf += '</tr
|
|
825
|
+
buf += '\n\t\t</tr>\n\t</thead>';
|
|
826
826
|
// Rows:
|
|
827
|
-
buf += '<tbody>';
|
|
827
|
+
buf += '\n\t<tbody>';
|
|
828
828
|
let rowIdx = 0;
|
|
829
829
|
for (const row of datagridState.adjRowData) {
|
|
830
830
|
let colIdx = 0;
|
|
@@ -864,25 +864,25 @@ export function datagridToHtml(datagridState) {
|
|
|
864
864
|
}
|
|
865
865
|
// Apply row styles.
|
|
866
866
|
if (rowStyles.length > 0) {
|
|
867
|
-
buf +=
|
|
867
|
+
buf += `\n\t\t<tr class="${rowStyles.join(', ')}">`;
|
|
868
868
|
}
|
|
869
869
|
else {
|
|
870
|
-
buf += '<tr>';
|
|
870
|
+
buf += '\n\t\t<tr>';
|
|
871
871
|
}
|
|
872
872
|
// Write cell values with styles.
|
|
873
873
|
colIdx = 0;
|
|
874
874
|
for (const rowValue of cellValues) {
|
|
875
875
|
if (colStyles[colIdx].styles.length > 0) {
|
|
876
|
-
buf +=
|
|
876
|
+
buf += `\n\t\t\t<td class="${colStyles[colIdx].styles.join(', ')}">${rowValue}</td>`;
|
|
877
877
|
}
|
|
878
878
|
else {
|
|
879
|
-
buf +=
|
|
879
|
+
buf += `\n\t\t\t<td>${rowValue}</td>`;
|
|
880
880
|
}
|
|
881
881
|
colIdx++;
|
|
882
882
|
}
|
|
883
|
-
buf += '</tr>';
|
|
883
|
+
buf += '\n\t\t</tr>';
|
|
884
884
|
rowIdx++;
|
|
885
885
|
}
|
|
886
|
-
buf += '</tbody
|
|
886
|
+
buf += '\n\t</tbody>\n</table>';
|
|
887
887
|
return buf;
|
|
888
888
|
}
|