mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(core): type collisions with namespace (#8809)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// Types
|
||||
import { TextDecoration, TextAlignment, TextTransform, getClosestPropertyValue } from './text-base-common';
|
||||
import { getClosestPropertyValue } from './text-base-common';
|
||||
import { CSSShadow } from '../styling/css-shadow';
|
||||
|
||||
// Requires
|
||||
@@ -8,10 +8,11 @@ import { TextBaseCommon, textProperty, formattedTextProperty, textAlignmentPrope
|
||||
import { Color } from '../../color';
|
||||
import { FormattedString } from './formatted-string';
|
||||
import { Span } from './span';
|
||||
import { colorProperty, fontInternalProperty, Length, VerticalAlignment } from '../styling/style-properties';
|
||||
import { colorProperty, fontInternalProperty, Length } from '../styling/style-properties';
|
||||
import { isString, isNullOrUndefined } from '../../utils/types';
|
||||
import { iOSNativeHelper } from '../../utils';
|
||||
import { Trace } from '../../trace';
|
||||
import { Enums } from '../enums';
|
||||
|
||||
export * from './text-base-common';
|
||||
|
||||
@@ -157,7 +158,7 @@ export class TextBase extends TextBaseCommon {
|
||||
}
|
||||
}
|
||||
|
||||
[textAlignmentProperty.setNative](value: TextAlignment) {
|
||||
[textAlignmentProperty.setNative](value: Enums.TextAlignmentType) {
|
||||
const nativeView = <UITextField | UITextView | UILabel>this.nativeTextViewProtected;
|
||||
switch (value) {
|
||||
case 'initial':
|
||||
@@ -173,11 +174,11 @@ export class TextBase extends TextBaseCommon {
|
||||
}
|
||||
}
|
||||
|
||||
[textDecorationProperty.setNative](value: TextDecoration) {
|
||||
[textDecorationProperty.setNative](value: Enums.TextDecorationType) {
|
||||
this._setNativeText();
|
||||
}
|
||||
|
||||
[textTransformProperty.setNative](value: TextTransform) {
|
||||
[textTransformProperty.setNative](value: Enums.TextTransformType) {
|
||||
this._setNativeText();
|
||||
}
|
||||
|
||||
@@ -374,7 +375,6 @@ export class TextBase extends TextBaseCommon {
|
||||
}
|
||||
|
||||
layer.shadowOffset = CGSizeMake(Length.toDevicePixels(value.offsetX), Length.toDevicePixels(value.offsetY));
|
||||
// layer.shadowOffset = CGSizeMake(Length.toDevicePixels(value.offsetX), Length.toDevicePixels(value.offsetY));
|
||||
layer.masksToBounds = false;
|
||||
|
||||
// NOTE: generally should not need shouldRasterize
|
||||
@@ -410,7 +410,7 @@ export class TextBase extends TextBaseCommon {
|
||||
return mas;
|
||||
}
|
||||
|
||||
getBaselineOffset(font: UIFont, align?: VerticalAlignment): number {
|
||||
getBaselineOffset(font: UIFont, align?: Enums.VerticalAlignmentTextType): number {
|
||||
if (!align || ['stretch', 'baseline'].includes(align)) {
|
||||
return 0;
|
||||
}
|
||||
@@ -435,7 +435,7 @@ export class TextBase extends TextBaseCommon {
|
||||
return (font.descender - font.ascender) / 2 - font.descender;
|
||||
}
|
||||
|
||||
if (align === 'super') {
|
||||
if (align === 'sup') {
|
||||
return -this.fontSize * 0.4;
|
||||
}
|
||||
|
||||
@@ -465,7 +465,7 @@ export class TextBase extends TextBaseCommon {
|
||||
attrDict[NSBackgroundColorAttributeName] = backgroundColor.ios;
|
||||
}
|
||||
|
||||
const textDecoration: TextDecoration = getClosestPropertyValue(textDecorationProperty, span);
|
||||
const textDecoration: Enums.TextDecorationType = getClosestPropertyValue(textDecorationProperty, span);
|
||||
|
||||
if (textDecoration) {
|
||||
const underline = textDecoration.indexOf('underline') !== -1;
|
||||
@@ -487,7 +487,7 @@ export class TextBase extends TextBaseCommon {
|
||||
}
|
||||
}
|
||||
|
||||
export function getTransformedText(text: string, textTransform: TextTransform): string {
|
||||
export function getTransformedText(text: string, textTransform: Enums.TextTransformType): string {
|
||||
if (!text || !isString(text)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user