mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: cleanup
This commit is contained in:
@@ -1,17 +1,14 @@
|
||||
/**
|
||||
* Contains the FormattedString and Span classes, which are used to create a formatted (rich text) strings.
|
||||
* @module "ui/text-base/formatted-string"
|
||||
*/ /** */
|
||||
*/
|
||||
|
||||
import { Span } from "./span";
|
||||
import { ObservableArray } from "../../data/observable-array";
|
||||
import { ViewBase } from "../core/view";
|
||||
import { ViewBase } from "../core/view-base";
|
||||
import { Color } from "../../color";
|
||||
import { FontStyle, FontWeight } from "../styling/font";
|
||||
import { TextDecoration } from "../text-base";
|
||||
|
||||
export { Span };
|
||||
|
||||
/**
|
||||
* A class used to create a formatted (rich text) string.
|
||||
*/
|
||||
|
||||
@@ -2,13 +2,12 @@ import { FormattedString as FormattedStringDefinition } from "./formatted-string
|
||||
import { Span } from "./span";
|
||||
import { Observable, PropertyChangeData } from "../../data/observable";
|
||||
import { ObservableArray, ChangedData } from "../../data/observable-array";
|
||||
import { ViewBase, AddArrayFromBuilder, AddChildFromBuilder } from "../core/view";
|
||||
import { AddArrayFromBuilder, AddChildFromBuilder } from "../core/view";
|
||||
import { ViewBase } from "../core/view-base";
|
||||
import { Color } from "../../color";
|
||||
import { FontStyle, FontWeight } from "../styling/font";
|
||||
import { TextDecoration } from "../text-base";
|
||||
|
||||
export { Span };
|
||||
|
||||
export module knownCollections {
|
||||
export const spans = "spans";
|
||||
}
|
||||
@@ -106,7 +105,7 @@ export class FormattedString extends ViewBase implements FormattedStringDefiniti
|
||||
const span = (<ObservableArray<Span>>eventData.object).getItem(eventData.index + i);
|
||||
|
||||
// First add to logical tree so that inherited properties are set.
|
||||
this._addView(span);
|
||||
this._addView(<any>span);
|
||||
|
||||
// Then attach handlers - we skip the first nofitication because
|
||||
// we raise change for the whole instance.
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
/**
|
||||
* @module "ui/text-base"
|
||||
*/ /** */
|
||||
|
||||
import { View, AddChildFromBuilder, Property, CssProperty, InheritedCssProperty, Style, Length } from "../core/view";
|
||||
import { View, AddChildFromBuilder } from "../core/view";
|
||||
import { FormattedString } from "./formatted-string";
|
||||
|
||||
export * from "../core/view";
|
||||
export { FormattedString };
|
||||
import { Style } from "../styling/style";
|
||||
import { Length } from "../styling/style-properties";
|
||||
import { Property, CssProperty, InheritedCssProperty } from "../core/properties";
|
||||
|
||||
export class TextBase extends View implements AddChildFromBuilder {
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
// Types
|
||||
import { TextDecoration, TextAlignment, TextTransform, layout, getClosestPropertyValue } from "./text-base-common";
|
||||
import { TextDecoration, TextAlignment, TextTransform, getClosestPropertyValue } from "./text-base-common";
|
||||
|
||||
// Requires
|
||||
import { Font } from "../styling/font";
|
||||
import { VerticalAlignment } from "../styling/style-properties";
|
||||
import {
|
||||
TextBaseCommon, textProperty, formattedTextProperty, textAlignmentProperty, textDecorationProperty,
|
||||
textTransformProperty, letterSpacingProperty, colorProperty, fontInternalProperty, lineHeightProperty,
|
||||
FormattedString, Span, Color, resetSymbol
|
||||
textTransformProperty, letterSpacingProperty, lineHeightProperty,
|
||||
resetSymbol
|
||||
} from "./text-base-common";
|
||||
import { Color } from "../../color";
|
||||
import { FormattedString } from "./formatted-string";
|
||||
import { Span } from "./span";
|
||||
import { colorProperty, fontInternalProperty } from "../styling/style-properties";
|
||||
import { isString } from "../../utils/types";
|
||||
import { ios } from "../../utils/utils";
|
||||
import { Property } from "../core/properties/properties";
|
||||
import { ios, layout } from "../../utils/utils";
|
||||
import { Property } from "../core/properties";
|
||||
|
||||
export * from "./text-base-common";
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"name": "text-base",
|
||||
"main": "text-base",
|
||||
"types": "text-base.d.ts"
|
||||
}
|
||||
6
nativescript-core/ui/text-base/span.d.ts
vendored
6
nativescript-core/ui/text-base/span.d.ts
vendored
@@ -1,8 +1,4 @@
|
||||
/**
|
||||
* @module "ui/text-base/span"
|
||||
*/ /** */
|
||||
|
||||
import { Color } from "../../color";
|
||||
import { Color } from "../../color";
|
||||
import { ViewBase } from "../core/view-base";
|
||||
import { FontStyle, FontWeight } from "../styling/font";
|
||||
import { TextDecoration } from "../text-base";
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { Color } from "../../color";
|
||||
import { Span as SpanDefinition } from "./span";
|
||||
import { ViewBase } from "../core/view";
|
||||
import { ViewBase } from "../core/view-base";
|
||||
import { FontStyle, FontWeight, } from "../styling/font";
|
||||
import { TextDecoration, EventData } from "../text-base";
|
||||
import { TextDecoration } from "../text-base";
|
||||
import { EventData } from "../../data/observable";
|
||||
|
||||
export class Span extends ViewBase implements SpanDefinition {
|
||||
static linkTapEvent = "linkTap";
|
||||
|
||||
@@ -1,20 +1,33 @@
|
||||
// Types
|
||||
import { TextBase as TextBaseDefinition } from ".";
|
||||
import { TextAlignment, TextDecoration, TextTransform, WhiteSpace } from "./text-base-interfaces";
|
||||
import { Length, ViewBase } from "../core/view";
|
||||
import { FontStyle, FontWeight } from "../styling/font-interfaces";
|
||||
import { PropertyChangeData } from "../../data/observable/observable-interfaces";
|
||||
import { ViewBase } from "../core/view-base";
|
||||
import { FontStyle, FontWeight } from "../styling/font-interfaces";
|
||||
|
||||
// Requires.
|
||||
import { FormattedString, Span } from "./formatted-string";
|
||||
import { FormattedString } from "./formatted-string";
|
||||
import { Span } from "./span";
|
||||
import {
|
||||
View, Property, CssProperty, InheritedCssProperty, Style, isAndroid, isIOS, Observable,
|
||||
makeValidator, makeParser
|
||||
View
|
||||
} from "../core/view";
|
||||
import {
|
||||
Property, CssProperty, InheritedCssProperty,
|
||||
makeValidator, makeParser
|
||||
} from "../core/properties";
|
||||
import {
|
||||
Style
|
||||
} from "../styling/style";
|
||||
import {
|
||||
Length
|
||||
} from "../styling/style-properties";
|
||||
import {
|
||||
isAndroid, isIOS,
|
||||
} from "../../platform";
|
||||
import { Observable } from "../../data/observable";
|
||||
|
||||
import { TextAlignment, TextDecoration, TextTransform, WhiteSpace } from "./text-base-interfaces";
|
||||
import { TextBase as TextBaseDefinition } from ".";
|
||||
|
||||
export { FormattedString, Span };
|
||||
export * from "./text-base-interfaces";
|
||||
export * from "../core/view";
|
||||
|
||||
const CHILD_SPAN = "Span";
|
||||
const CHILD_FORMATTED_TEXT = "formattedText";
|
||||
|
||||
Reference in New Issue
Block a user