@nativescript-community/ui-label 1.2.6 → 1.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/label.ios.js +7 -7
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,14 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [1.2.7](https://github.com/nativescript-community/ui-label/compare/v1.2.6...v1.2.7) (2022-04-05)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @nativescript-community/ui-label
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
6
14
|
## [1.2.6](https://github.com/nativescript-community/ui-label/compare/v1.2.5...v1.2.6) (2022-02-09)
|
7
15
|
|
8
16
|
**Note:** Version bump only for package @nativescript-community/ui-label
|
package/label.ios.js
CHANGED
@@ -85,13 +85,13 @@ var LabelUITextViewDelegateImpl = /** @class */ (function (_super) {
|
|
85
85
|
LabelUITextViewDelegateImpl.ObjCProtocols = [UITextViewDelegate];
|
86
86
|
return LabelUITextViewDelegateImpl;
|
87
87
|
}(NSObject));
|
88
|
-
var
|
89
|
-
__extends(
|
90
|
-
function
|
88
|
+
var LabelObserverClass = /** @class */ (function (_super) {
|
89
|
+
__extends(LabelObserverClass, _super);
|
90
|
+
function LabelObserverClass() {
|
91
91
|
return _super !== null && _super.apply(this, arguments) || this;
|
92
92
|
}
|
93
93
|
// NOTE: Refactor this - use Typescript property instead of strings....
|
94
|
-
|
94
|
+
LabelObserverClass.prototype.observeValueForKeyPathOfObjectChangeContext = function (path, tv) {
|
95
95
|
if (path === 'contentSize') {
|
96
96
|
var owner = this._owner && this._owner.get();
|
97
97
|
if (owner) {
|
@@ -99,7 +99,7 @@ var ObserverClass = /** @class */ (function (_super) {
|
|
99
99
|
}
|
100
100
|
}
|
101
101
|
};
|
102
|
-
return
|
102
|
+
return LabelObserverClass;
|
103
103
|
}(NSObject));
|
104
104
|
export class Label extends LabelBase {
|
105
105
|
constructor() {
|
@@ -135,7 +135,7 @@ export class Label extends LabelBase {
|
|
135
135
|
initNativeView() {
|
136
136
|
super.initNativeView();
|
137
137
|
this._delegate = LabelUITextViewDelegateImpl.initWithOwner(new WeakRef(this));
|
138
|
-
this._observer =
|
138
|
+
this._observer = LabelObserverClass.alloc().init();
|
139
139
|
this._observer['_owner'] = new WeakRef(this);
|
140
140
|
this.nativeViewProtected.addObserverForKeyPathOptionsContext(this._observer, 'contentSize', 1 /* New */, null);
|
141
141
|
this.nativeViewProtected.attributedText = this.attributedString;
|
@@ -266,7 +266,7 @@ export class Label extends LabelBase {
|
|
266
266
|
}
|
267
267
|
}
|
268
268
|
const desiredSize = layout.measureNativeView(nativeView, width, widthMode, height, heightMode);
|
269
|
-
if (resetFont) {
|
269
|
+
if (!this.formattedText && !this.html && resetFont) {
|
270
270
|
nativeView.font = resetFont;
|
271
271
|
}
|
272
272
|
const labelWidth = widthMode === layout.AT_MOST ? Math.min(desiredSize.width, width) : desiredSize.width;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nativescript-community/ui-label",
|
3
|
-
"version": "1.2.
|
3
|
+
"version": "1.2.7",
|
4
4
|
"description": "Alternative to the built-in NativeScript Label but with better performance and additional features such as HTML rendering and more.",
|
5
5
|
"main": "./label",
|
6
6
|
"sideEffects": false,
|
@@ -34,5 +34,5 @@
|
|
34
34
|
"dependencies": {
|
35
35
|
"@nativescript-community/text": "^1.4.36"
|
36
36
|
},
|
37
|
-
"gitHead": "
|
37
|
+
"gitHead": "092a8246b892db73f17613a3d10b8f52444ef2ce"
|
38
38
|
}
|