feat(core): maxLines support for all text components (#9884)

This commit is contained in:
farfromrefuge
2022-04-30 19:50:05 +02:00
committed by GitHub
parent 17a87a4a86
commit df10ceb491
12 changed files with 57 additions and 40 deletions

View File

@@ -90,6 +90,13 @@ export abstract class TextBaseCommon extends View implements TextBaseDefinition
this.style.lineHeight = value;
}
get maxLines(): CoreTypes.MaxLinesType {
return this.style.maxLines;
}
set maxLines(value: CoreTypes.MaxLinesType) {
this.style.maxLines = value;
}
get textAlignment(): CoreTypes.TextAlignmentType {
return this.style.textAlignment;
}
@@ -310,4 +317,11 @@ export const lineHeightProperty = new InheritedCssProperty<Style, number>({
});
lineHeightProperty.register(Style);
export const maxLinesProperty = new CssProperty<Style, CoreTypes.MaxLinesType>({
name: 'maxLines',
cssName: 'max-lines',
valueConverter: (v) => (v === 'none' ? 0 : parseInt(v, 10)),
});
maxLinesProperty.register(Style);
export const resetSymbol = Symbol('textPropertyDefault');