diff --git a/projects/ppwcode/ng-common-components/src/lib/table/abstract-table.component.ts b/projects/ppwcode/ng-common-components/src/lib/table/abstract-table.component.ts index 9f8a0cae..f74152f7 100644 --- a/projects/ppwcode/ng-common-components/src/lib/table/abstract-table.component.ts +++ b/projects/ppwcode/ng-common-components/src/lib/table/abstract-table.component.ts @@ -123,6 +123,18 @@ export abstract class AbstractTableComponent>> = linkedSignal(() => { return new MatTableDataSource(this.localRecords()) }) + public arrowPositions = computed(() => { + const columns = this.columns() + const headerStyles = this.options()?.header?.styles + const textAlignConst = 'text-align' + const alignRightConst = 'right' + + return columns.reduce>((positionsByColumn, column) => { + const textAlign = headerStyles?.[column.name]?.()?.[textAlignConst] + positionsByColumn[column.name] = textAlign === alignRightConst ? 'before' : 'after' + return positionsByColumn + }, {}) + }) public selection = new SelectionModel>( true, diff --git a/projects/ppwcode/ng-common-components/src/lib/table/table.component.html b/projects/ppwcode/ng-common-components/src/lib/table/table.component.html index 197ad438..ff7eacc3 100644 --- a/projects/ppwcode/ng-common-components/src/lib/table/table.component.html +++ b/projects/ppwcode/ng-common-components/src/lib/table/table.component.html @@ -65,6 +65,7 @@ { return { 'text-align': 'right' } }, + age: () => { + return { 'text-align': 'right' } + }, + income: () => { + return { 'text-align': 'right' } + }, + bonus: () => { + return { 'text-align': 'right' } + }, active: () => { return { 'text-align': 'center' } }