From 36763fd3b27c78e2b7b75007cf927d8acd816dda Mon Sep 17 00:00:00 2001 From: Martin Guillon Date: Fri, 22 Jul 2022 10:35:52 +0200 Subject: [PATCH] fix: `maxLines` fix for latest N --- src/label.android.ts | 19 +++++++++---------- src/label.ios.ts | 17 ++++------------- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/src/label.android.ts b/src/label.android.ts index f7543e3..7d2ca9d 100644 --- a/src/label.android.ts +++ b/src/label.android.ts @@ -34,22 +34,17 @@ import { } from '@nativescript/core/ui/styling/style-properties'; import { letterSpacingProperty, + lineHeightProperty, textAlignmentProperty, textDecorationProperty, textTransformProperty, whiteSpaceProperty } from '@nativescript/core/ui/text-base'; -import { lineHeightProperty } from '@nativescript/core/ui/text-base/text-base-common'; -import { layout } from '@nativescript/core/utils/utils'; -import { Label as LabelViewDefinition, LineBreak, TextShadow } from './label'; -import { - autoFontSizeProperty, - lineBreakProperty, - maxLinesProperty, - selectableProperty, - textShadowProperty -} from './label-common'; +import { maxLinesProperty } from '@nativescript/core/ui/text-base/text-base-common'; import lazy from '@nativescript/core/utils/lazy'; +import { layout } from '@nativescript/core/utils/utils'; +import { Label as LabelViewDefinition, LineBreak } from './label'; +import { autoFontSizeProperty, lineBreakProperty, selectableProperty, textShadowProperty } from './label-common'; export { createNativeAttributedString, enableIOSDTCoreText } from '@nativescript-community/text'; export * from './label-common'; @@ -195,6 +190,8 @@ abstract class LabelBase extends View implements LabelViewDefinition { public html: string; @cssProperty selectable: boolean; + _isSingleLine: boolean; + public mIsSingleLine: boolean; public text: string; @@ -217,6 +214,8 @@ abstract class LabelBase extends View implements LabelViewDefinition { @cssProperty lineBreak: LineBreak; @cssProperty textAlignment: CoreTypes.TextAlignmentType; @cssProperty textDecoration: CoreTypes.TextDecorationType; + + //@ts-ignore @cssProperty textTransform: CoreTypes.TextTransformType; @cssProperty whiteSpace: CoreTypes.WhiteSpaceType; diff --git a/src/label.ios.ts b/src/label.ios.ts index 534674e..0121ce7 100644 --- a/src/label.ios.ts +++ b/src/label.ios.ts @@ -1,18 +1,10 @@ -import { - LightFormattedString, - VerticalTextAlignment, - computeBaseLineOffset, - createNativeAttributedString, - usingIOSDTCoreText, - verticalTextAlignmentProperty -} from '@nativescript-community/text'; -import { Color, CoreTypes, Font, FormattedString, Span, View } from '@nativescript/core'; +import { VerticalTextAlignment, createNativeAttributedString, verticalTextAlignmentProperty } from '@nativescript-community/text'; +import { Color, CoreTypes, Font, FormattedString, View } from '@nativescript/core'; import { borderBottomWidthProperty, borderLeftWidthProperty, borderRightWidthProperty, borderTopWidthProperty, - colorProperty, fontInternalProperty, paddingBottomProperty, paddingLeftProperty, @@ -22,10 +14,10 @@ import { import { formattedTextProperty, letterSpacingProperty, - textDecorationProperty, + lineHeightProperty, whiteSpaceProperty } from '@nativescript/core/ui/text-base'; -import { getClosestPropertyValue, lineHeightProperty } from '@nativescript/core/ui/text-base/text-base-common'; +import { maxLinesProperty } from '@nativescript/core/ui/text-base/text-base-common'; import { isNullOrUndefined, isString } from '@nativescript/core/utils/types'; import { iOSNativeHelper, layout } from '@nativescript/core/utils/utils'; import { TextShadow } from './label'; @@ -36,7 +28,6 @@ import { lineBreakProperty, linkColorProperty, linkUnderlineProperty, - maxLinesProperty, needFormattedStringComputation, selectableProperty, textShadowProperty