uicore-ts 1.1.18 → 1.1.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uicore-ts",
3
- "version": "1.1.18",
3
+ "version": "1.1.22",
4
4
  "description": "UICore is a library to build native-like user interfaces using pure Typescript. No HTML is needed at all. Components are described as TS classes and all user interactions are handled explicitly. This library is strongly inspired by the UIKit framework that is used in IOS. In addition, UICore has tools to handle URL based routing, array sorting and filtering and adds a number of other utilities for convenience.",
5
5
  "main": "compiledScripts/index.js",
6
6
  "types": "compiledScripts/index.d.ts",
@@ -258,7 +258,7 @@ export class UIImageView extends UIView {
258
258
  }
259
259
 
260
260
 
261
- override intrinsicContentSize() {
261
+ override intrinsicContentSize = () => {
262
262
 
263
263
 
264
264
  return new UIRectangle(0, 0, this.viewHTMLElement.naturalHeight, this.viewHTMLElement.naturalWidth)
@@ -266,7 +266,7 @@ export class UIImageView extends UIView {
266
266
 
267
267
  }
268
268
 
269
- override intrinsicContentSizeWithConstraints(constrainingHeight = 0, constrainingWidth = 0) {
269
+ override intrinsicContentSizeWithConstraints = (constrainingHeight = 0, constrainingWidth = 0) => {
270
270
 
271
271
  const heightRatio = constrainingHeight / this.viewHTMLElement.naturalHeight
272
272
 
@@ -166,7 +166,7 @@ export class UIKeyValueSorter extends UIObject {
166
166
  "string": "string",
167
167
  "number": "number"
168
168
 
169
- }
169
+ } as const
170
170
 
171
171
 
172
172
  static direction = {
@@ -174,7 +174,7 @@ export class UIKeyValueSorter extends UIObject {
174
174
  "descending": "descending",
175
175
  "ascending": "ascending"
176
176
 
177
- }
177
+ } as const
178
178
 
179
179
 
180
180
  sortData<T>(
@@ -656,7 +656,7 @@ export class UITableView extends UINativeScrollView {
656
656
  }
657
657
 
658
658
 
659
- override intrinsicContentHeight(constrainingWidth = 0) {
659
+ override intrinsicContentHeight = (constrainingWidth = 0) => {
660
660
 
661
661
 
662
662
  var result = 0
@@ -379,7 +379,7 @@ export class UITextView extends UIView {
379
379
  }
380
380
 
381
381
 
382
- override intrinsicContentHeight(constrainingWidth = 0) {
382
+ override intrinsicContentHeight = (constrainingWidth = 0) => {
383
383
 
384
384
  const keyPath = (this.viewHTMLElement.innerHTML + "_csf_" + this.computedStyle.font).replace(new RegExp(
385
385
  "\\.",
@@ -403,7 +403,7 @@ export class UITextView extends UIView {
403
403
 
404
404
  if (IS_LIKE_NULL(result)) {
405
405
 
406
- result = super.intrinsicContentHeight(constrainingWidth)
406
+ result = UIView.prototype.intrinsicContentHeight.call(this, constrainingWidth)
407
407
 
408
408
  cacheObject.setValueForKeyPath(keyPath, result)
409
409
 
@@ -415,7 +415,7 @@ export class UITextView extends UIView {
415
415
 
416
416
  }
417
417
 
418
- override intrinsicContentWidth(constrainingHeight = 0) {
418
+ override intrinsicContentWidth = (constrainingHeight = 0) => {
419
419
 
420
420
  const keyPath = (this.viewHTMLElement.innerHTML + "_csf_" + this.computedStyle.font).replace(new RegExp(
421
421
  "\\.",
@@ -439,7 +439,7 @@ export class UITextView extends UIView {
439
439
 
440
440
  if (IS_LIKE_NULL(result)) {
441
441
 
442
- result = super.intrinsicContentWidth(constrainingHeight)
442
+ result = UIView.prototype.intrinsicContentWidth.call(this, constrainingHeight)
443
443
 
444
444
  cacheObject.setValueForKeyPath(keyPath, result)
445
445
 
@@ -452,7 +452,7 @@ export class UITextView extends UIView {
452
452
  }
453
453
 
454
454
 
455
- override intrinsicContentSize() {
455
+ override intrinsicContentSize = () => {
456
456
 
457
457
  // This works but is slow
458
458
  const result = this.intrinsicContentSizeWithConstraints(nil, nil)
package/scripts/UIView.ts CHANGED
@@ -3366,7 +3366,7 @@ export class UIView extends UIObject {
3366
3366
  }
3367
3367
 
3368
3368
 
3369
- intrinsicContentSizeWithConstraints(constrainingHeight: number = 0, constrainingWidth: number = 0) {
3369
+ intrinsicContentSizeWithConstraints = (constrainingHeight: number = 0, constrainingWidth: number = 0) => {
3370
3370
 
3371
3371
  const cacheKey = "h_" + constrainingHeight + "__w_" + constrainingWidth
3372
3372
  const cachedResult = this._intrinsicSizesCache[cacheKey]
@@ -3448,13 +3448,13 @@ export class UIView extends UIObject {
3448
3448
 
3449
3449
  }
3450
3450
 
3451
- intrinsicContentWidth(constrainingHeight: number = 0): number {
3451
+ intrinsicContentWidth = (constrainingHeight: number = 0): number => {
3452
3452
 
3453
3453
  return this.intrinsicContentSizeWithConstraints(constrainingHeight).width
3454
3454
 
3455
3455
  }
3456
3456
 
3457
- intrinsicContentHeight(constrainingWidth: number = 0): number {
3457
+ intrinsicContentHeight = (constrainingWidth: number = 0): number => {
3458
3458
 
3459
3459
  return this.intrinsicContentSizeWithConstraints(undefined, constrainingWidth).height
3460
3460
 
@@ -3462,7 +3462,7 @@ export class UIView extends UIObject {
3462
3462
  }
3463
3463
 
3464
3464
 
3465
- intrinsicContentSize(): UIRectangle {
3465
+ intrinsicContentSize = (): UIRectangle => {
3466
3466
 
3467
3467
  return nil
3468
3468