diff --git a/npm/ng-packs/packages/theme-shared/extensions/src/lib/components/extensible-table/extensible-table.component.html b/npm/ng-packs/packages/theme-shared/extensions/src/lib/components/extensible-table/extensible-table.component.html index 83314c22f25..ce6d6d4efbe 100644 --- a/npm/ng-packs/packages/theme-shared/extensions/src/lib/components/extensible-table/extensible-table.component.html +++ b/npm/ng-packs/packages/theme-shared/extensions/src/lib/components/extensible-table/extensible-table.component.html @@ -32,6 +32,7 @@ (click)=" prop.action && prop.action({ getInjected: getInjected, record: row, index: i }) " + [ngClass]="entityPropTypeClasses[prop.type]" [class.pointer]="prop.action" > diff --git a/npm/ng-packs/packages/theme-shared/extensions/src/lib/components/extensible-table/extensible-table.component.ts b/npm/ng-packs/packages/theme-shared/extensions/src/lib/components/extensible-table/extensible-table.component.ts index 8e1d2752bed..96821886386 100644 --- a/npm/ng-packs/packages/theme-shared/extensions/src/lib/components/extensible-table/extensible-table.component.ts +++ b/npm/ng-packs/packages/theme-shared/extensions/src/lib/components/extensible-table/extensible-table.component.ts @@ -30,7 +30,12 @@ import { EntityActionList } from '../../models/entity-actions'; import { EntityProp, EntityPropList } from '../../models/entity-props'; import { PropData } from '../../models/props'; import { ExtensionsService } from '../../services/extensions.service'; -import { EXTENSIONS_IDENTIFIER, PROP_DATA_STREAM } from '../../tokens/extensions.token'; +import { + ENTITY_PROP_TYPE_CLASSES, + EntityPropTypeClass, + EXTENSIONS_IDENTIFIER, + PROP_DATA_STREAM, +} from '../../tokens/extensions.token'; const DEFAULT_ACTIONS_COLUMN_WIDTH = 150; @@ -62,6 +67,8 @@ export class ExtensibleTableComponent implements OnChanges { hasAtLeastOnePermittedAction: boolean; + entityPropTypeClasses: EntityPropTypeClass; + readonly columnWidths: number[]; readonly propList: EntityPropList; @@ -75,6 +82,7 @@ export class ExtensibleTableComponent implements OnChanges { private config: ConfigStateService, private injector: Injector, ) { + this.entityPropTypeClasses = injector.get(ENTITY_PROP_TYPE_CLASSES); this.getInjected = injector.get.bind(injector); const extensions = injector.get(ExtensionsService); const name = injector.get(EXTENSIONS_IDENTIFIER); @@ -104,8 +112,8 @@ export class ExtensibleTableComponent implements OnChanges { private getIcon(value: boolean) { return value - ? '
' - : '
'; + ? '
' + : '
'; } private getEnum(rowValue: any, list: Array>) { diff --git a/npm/ng-packs/packages/theme-shared/extensions/src/lib/tokens/extensions.token.ts b/npm/ng-packs/packages/theme-shared/extensions/src/lib/tokens/extensions.token.ts index f0343169c1b..d2cbbe87bd2 100644 --- a/npm/ng-packs/packages/theme-shared/extensions/src/lib/tokens/extensions.token.ts +++ b/npm/ng-packs/packages/theme-shared/extensions/src/lib/tokens/extensions.token.ts @@ -2,6 +2,7 @@ import { InjectionToken } from '@angular/core'; import { ActionCallback, ReadonlyActionData as ActionData } from '../models/actions'; import { ExtensionsService } from '../services/extensions.service'; import { Observable } from 'rxjs'; +import { ePropType } from '../enums/props.enum'; export const EXTENSIONS_IDENTIFIER = new InjectionToken('EXTENSIONS_IDENTIFIER'); export type ActionKeys = Extract<'entityActions' | 'toolbarActions', keyof ExtensionsService>; @@ -13,3 +14,13 @@ export const EXTENSIONS_ACTION_CALLBACK = new InjectionToken>('PROP_DATA_STREAM'); +type EntityPropTypeClassMap = { + [key in ePropType]: string; +}; +export type EntityPropTypeClass = Partial; +export const ENTITY_PROP_TYPE_CLASSES = new InjectionToken( + 'ENTITY_PROP_TYPE_CLASSES', + { + factory: () => ({} as EntityPropTypeClass), + }, +);