lemmatized-entity-detail.component.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import { Component, Input } from '@angular/core';
  2. import { LemmatizedEntityInfo } from '../../../models/evt-models';
  3. import { register } from '../../../services/component-register.service';
  4. import { normalizeUrl } from '../../../utils/js-utils';
  5. @Component({
  6. selector: 'evt-lemmatized-entity-detail',
  7. templateUrl: './lemmatized-entity-detail.component.html',
  8. styleUrls: ['./lemmatized-entity-detail.component.scss'],
  9. })
  10. @register(LemmatizedEntityInfo)
  11. export class LemmatizedEntityDetailComponent {
  12. @Input() data: LemmatizedEntityInfo;
  13. iconData = {
  14. actors: { icon: 'users' },
  15. birth: { icon: 'birthday-cake' },
  16. bloc: { icon: 'map-marker' },
  17. country: { icon: 'map-marker' },
  18. death: { icon: 'times', rotate: 45 },
  19. district: { icon: 'map-marker' },
  20. geogFeat: { icon: 'map-marker' },
  21. geoname: { icon: 'map-marker' },
  22. idno: { icon: 'barcode' },
  23. note: { icon: 'sticky-note' },
  24. occupation: { icon: 'briefcase' },
  25. orgname: { icon: 'users' },
  26. persname: { icon: 'user' },
  27. placename: { icon: 'map-marker' },
  28. region: { icon: 'map-marker' },
  29. relations: { icon: 'share-alt' },
  30. residence: { icon: 'home' },
  31. settlement: { icon: 'location-arrow' },
  32. sex: { icon: 'venus-mars' },
  33. link: { icon: 'external-link-alt', iconSet: 'fas'}
  34. };
  35. defaultIcon = { icon: 'info-circle' };
  36. get linkLem() {
  37. var link = this.data.attributes.lemmaRef
  38. return normalizeUrl(link);
  39. }
  40. openlinkLem() {
  41. if (this.linkLem) {
  42. window.open(this.linkLem, '_blank');
  43. }
  44. }
  45. }