Explorar o código

Table: footer follows body cell align (#14730)

hetech %!s(int64=6) %!d(string=hai) anos
pai
achega
9f19298d1a
Modificáronse 1 ficheiros con 15 adicións e 1 borrados
  1. 15 1
      packages/table/src/table-footer.js

+ 15 - 1
packages/table/src/table-footer.js

@@ -62,7 +62,7 @@ export default {
                 <td
                   colspan={ column.colSpan }
                   rowspan={ column.rowSpan }
-                  class={ [column.id, column.headerAlign, column.className || '', this.isCellHidden(cellIndex, this.columns, column) ? 'is-hidden' : '', !column.children ? 'is-leaf' : '', column.labelClassName] }>
+                  class={ this.getRowClasses(column, cellIndex) }>
                   <div class={ ['cell', column.labelClassName] }>
                     {
                       sums[cellIndex]
@@ -152,6 +152,20 @@ export default {
       } else {
         return (index < this.leftFixedCount) || (index >= this.columnsCount - this.rightFixedCount);
       }
+    },
+
+    getRowClasses(column, cellIndex) {
+      const classes = [column.id, column.align, column.labelClassName];
+      if (column.className) {
+        classes.push(column.className);
+      }
+      if (this.isCellHidden(cellIndex, this.columns, column)) {
+        classes.push('is-hidden');
+      }
+      if (!column.children) {
+        classes.push('is-leaf');
+      }
+      return classes;
     }
   }
 };