@nativescript-community/ui-material-textview
Advanced tools
Comparing version 5.0.4 to 5.0.5
@@ -6,2 +6,10 @@ # Change Log | ||
## [5.0.5](https://github.com/nativescript-community/ui-material-components/compare/v5.0.4...v5.0.5) (2020-09-22) | ||
**Note:** Version bump only for package @nativescript-community/ui-material-textview | ||
## [5.0.4](https://github.com/nativescript-community/ui-material-components/compare/v5.0.3...v5.0.4) (2020-09-21) | ||
@@ -8,0 +16,0 @@ |
{ | ||
"name": "@nativescript-community/ui-material-textview", | ||
"version": "5.0.4", | ||
"version": "5.0.5", | ||
"description": "Material textview component", | ||
@@ -39,5 +39,5 @@ "main": "./textview", | ||
"dependencies": { | ||
"@nativescript-community/ui-material-core": "^5.0.4" | ||
"@nativescript-community/ui-material-core": "^5.0.5" | ||
}, | ||
"gitHead": "451742908c847a90fface2d8f263b80ebbcd5b0b" | ||
"gitHead": "aaa92f8eb84e095a1a2aaa3cd82c6ed73b131d46" | ||
} |
import { Style } from '@nativescript/core'; | ||
import { TextViewBase } from './textview.common'; | ||
declare module '@nativescript/core/ui/text-view' { | ||
interface TextView { | ||
setFormattedTextDecorationAndTransform(): any; | ||
setTextDecorationAndTransform(): any; | ||
} | ||
} | ||
declare module '@nativescript/core/ui/text-field' { | ||
@@ -21,2 +27,3 @@ interface TextField { | ||
createNativeView(): MDCMultilineTextField; | ||
layoutDelegate: MDCMultilineTextInputLayoutDelegate; | ||
initNativeView(): void; | ||
@@ -26,2 +33,4 @@ disposeNativeView(): void; | ||
setSelection(start: number, stop?: number): void; | ||
setFormattedTextDecorationAndTransform(): void; | ||
setTextDecorationAndTransform(): void; | ||
} |
import { themer } from '@nativescript-community/ui-material-core'; | ||
import { buttonColorProperty, errorColorProperty, errorProperty, floatingColorProperty, floatingInactiveColorProperty, floatingProperty, helperProperty, maxLengthProperty, strokeColorProperty, strokeInactiveColorProperty, } from '@nativescript-community/ui-material-core/textbase/cssproperties'; | ||
import { Color, Property, Screen, backgroundInternalProperty, editableProperty, hintProperty, isAndroid, placeholderColorProperty } from '@nativescript/core'; | ||
import { Color, Screen, backgroundInternalProperty, editableProperty, hintProperty, placeholderColorProperty } from '@nativescript/core'; | ||
import { TextViewBase } from './textview.common'; | ||
const textProperty = new Property({ | ||
name: 'text', | ||
defaultValue: '', | ||
affectsLayout: isAndroid, | ||
}); | ||
let colorScheme; | ||
function getColorScheme() { | ||
if (!colorScheme) { | ||
colorScheme = MDCSemanticColorScheme.new(); | ||
} | ||
return colorScheme; | ||
} | ||
var MDCMultilineTextInputLayoutDelegateImpl = /** @class */ (function (_super) { | ||
@@ -29,3 +17,3 @@ __extends(MDCMultilineTextInputLayoutDelegateImpl, _super); | ||
// called when clicked on background | ||
var owner = this._owner.get(); | ||
var owner = this._owner ? this._owner.get() : null; | ||
if (owner) { | ||
@@ -176,3 +164,2 @@ owner._onTextFieldDidChangeContentSize && owner._onTextFieldDidChangeContentSize(size); | ||
} | ||
view.textInsetsMode = 1; | ||
return view; | ||
@@ -184,2 +171,3 @@ } | ||
view.layoutDelegate = MDCMultilineTextInputLayoutDelegateImpl.initWithOwner(this); | ||
this.layoutDelegate = view.layoutDelegate; | ||
} | ||
@@ -189,2 +177,3 @@ disposeNativeView() { | ||
view.layoutDelegate = null; | ||
this.layoutDelegate = null; | ||
super.disposeNativeView(); | ||
@@ -278,4 +267,20 @@ } | ||
} | ||
setFormattedTextDecorationAndTransform() { | ||
super.setFormattedTextDecorationAndTransform(); | ||
const attributedText = this.nativeTextViewProtected.attributedText; | ||
this.nativeTextViewProtected.text = null; | ||
this.nativeViewProtected.attributedText = attributedText; | ||
} | ||
setTextDecorationAndTransform() { | ||
super.setTextDecorationAndTransform(); | ||
if (this.nativeTextViewProtected.attributedText) { | ||
const attributedText = this.nativeTextViewProtected.attributedText; | ||
this.nativeViewProtected.attributedText = attributedText; | ||
} | ||
else { | ||
const text = this.nativeTextViewProtected.text; | ||
this.nativeViewProtected.text = text; | ||
} | ||
} | ||
} | ||
textProperty.register(TextView); | ||
//# sourceMappingURL=textview.ios.js.map |
Sorry, the diff of this file is not supported yet
198983
1234