mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat(core): maxLines support for all text components (#9884)
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user