forked from evt-project/evt-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request evt-project#100 from evt-project/feature/multiple-…
…lines-words Feature/multiple lines words
- Loading branch information
Showing
9 changed files
with
92 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<span class="word {{data.class}}" [evtHtmlAttributes]="data.attributes"> | ||
<evt-content-viewer *ngFor="let el of word" [content]="el" [editionLevel]="editionLevel" | ||
[itemsToHighlight]="itemsToHighlight" [evtHighlight]="highlightData"> | ||
</evt-content-viewer> | ||
</span> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { WordComponent } from './word.component'; | ||
|
||
describe('WordComponent', () => { | ||
let component: WordComponent; | ||
let fixture: ComponentFixture<WordComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ WordComponent ], | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(WordComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Component, Input } from '@angular/core'; | ||
|
||
import { GenericElement, Lb, Word } from '../../models/evt-models'; | ||
import { register } from '../../services/component-register.service'; | ||
import { EditionlevelSusceptible, Highlightable } from '../components-mixins'; | ||
|
||
export interface WordComponent extends EditionlevelSusceptible, Highlightable { } | ||
|
||
@Component({ | ||
selector: 'evt-word', | ||
templateUrl: './word.component.html', | ||
styleUrls: ['./word.component.scss'], | ||
}) | ||
@register(Word) | ||
export class WordComponent { | ||
@Input() data: Word; | ||
|
||
get word() { | ||
if (this.editionLevel === 'diplomatic') { | ||
return this.data.content; | ||
} | ||
|
||
const lbIndex = this.data.content.findIndex((el: GenericElement) => el.type === Lb); | ||
if (lbIndex >= 0) { | ||
const wordContent = [...this.data.content]; | ||
wordContent.splice(lbIndex, 1); | ||
wordContent.push(this.data.content[lbIndex]); | ||
|
||
return wordContent; | ||
} | ||
|
||
return this.data.content; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters