uicore-ts 1.1.88 → 1.1.102
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/compiledScripts/UICore.js +3 -0
- package/compiledScripts/UICore.js.map +2 -2
- package/compiledScripts/UIRectangle.d.ts +4 -0
- package/compiledScripts/UIRectangle.js +19 -4
- package/compiledScripts/UIRectangle.js.map +2 -2
- package/compiledScripts/UITableView.d.ts +34 -0
- package/compiledScripts/UITableView.js +214 -25
- package/compiledScripts/UITableView.js.map +3 -3
- package/compiledScripts/UITextView.d.ts +49 -39
- package/compiledScripts/UITextView.js +137 -126
- package/compiledScripts/UITextView.js.map +2 -2
- package/compiledScripts/UIView.d.ts +40 -2
- package/compiledScripts/UIView.js +242 -89
- package/compiledScripts/UIView.js.map +2 -2
- package/package.json +1 -1
- package/scripts/UICore.ts +5 -0
- package/scripts/UIRectangle.ts +35 -5
- package/scripts/UITableView.ts +330 -93
- package/scripts/UITextView.ts +273 -358
- package/scripts/UIView.ts +361 -90
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uicore-ts",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.102",
|
|
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",
|
package/scripts/UICore.ts
CHANGED
|
@@ -76,6 +76,11 @@ export class UICore extends UIObject {
|
|
|
76
76
|
|
|
77
77
|
const windowDidResize = () => {
|
|
78
78
|
|
|
79
|
+
this.rootViewController.view.forEachViewInSubtree((view) => {
|
|
80
|
+
|
|
81
|
+
view._frameCache = undefined
|
|
82
|
+
|
|
83
|
+
})
|
|
79
84
|
// Doing layout two times to prevent page scrollbars from confusing the layout
|
|
80
85
|
this.rootViewController.view.setNeedsLayout()
|
|
81
86
|
this.rootViewController._triggerLayoutViewSubviews()
|
package/scripts/UIRectangle.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FIRST_OR_NIL, IS, IS_DEFINED, IS_NIL, IS_NOT_NIL, nil, NO, UIObject, YES } from "./UIObject"
|
|
1
|
+
import { FIRST_OR_NIL, IS, IS_DEFINED, IS_NIL, IS_NOT_LIKE_NULL, IS_NOT_NIL, nil, NO, UIObject, YES } from "./UIObject"
|
|
2
2
|
import { UIPoint } from "./UIPoint"
|
|
3
3
|
import { UIView } from "./UIView"
|
|
4
4
|
|
|
@@ -380,6 +380,22 @@ export class UIRectangle extends UIObject {
|
|
|
380
380
|
|
|
381
381
|
}
|
|
382
382
|
|
|
383
|
+
rectangleByAddingWidth(widthToAdd: number, centeredOnPosition = 0) {
|
|
384
|
+
|
|
385
|
+
const result = this.rectangleWithWidth(this.width + widthToAdd, centeredOnPosition)
|
|
386
|
+
|
|
387
|
+
return result
|
|
388
|
+
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
rectangleByAddingHeight(heightToAdd: number, centeredOnPosition = 0) {
|
|
392
|
+
|
|
393
|
+
const result = this.rectangleWithHeight(this.height + heightToAdd, centeredOnPosition)
|
|
394
|
+
|
|
395
|
+
return result
|
|
396
|
+
|
|
397
|
+
}
|
|
398
|
+
|
|
383
399
|
|
|
384
400
|
rectangleWithRelativeValues(
|
|
385
401
|
relativeXPosition: number,
|
|
@@ -891,15 +907,15 @@ export class UIRectangle extends UIObject {
|
|
|
891
907
|
rectangleByEnforcingMinAndMaxSizes(centeredOnXPosition = 0, centeredOnYPosition = 0) {
|
|
892
908
|
return this.rectangleWithHeight(
|
|
893
909
|
[
|
|
894
|
-
[this.height, this.maxHeight].min(),
|
|
910
|
+
[this.height, this.maxHeight].filter(value => IS_NOT_LIKE_NULL(value)).min(),
|
|
895
911
|
this.minHeight
|
|
896
|
-
].max(),
|
|
912
|
+
].filter(value => IS_NOT_LIKE_NULL(value)).max(),
|
|
897
913
|
centeredOnYPosition
|
|
898
914
|
).rectangleWithWidth(
|
|
899
915
|
[
|
|
900
|
-
[this.width, this.maxWidth].min(),
|
|
916
|
+
[this.width, this.maxWidth].filter(value => IS_NOT_LIKE_NULL(value)).min(),
|
|
901
917
|
this.minWidth
|
|
902
|
-
].max(),
|
|
918
|
+
].filter(value => IS_NOT_LIKE_NULL(value)).max(),
|
|
903
919
|
centeredOnXPosition
|
|
904
920
|
)
|
|
905
921
|
}
|
|
@@ -911,6 +927,20 @@ export class UIRectangle extends UIObject {
|
|
|
911
927
|
}
|
|
912
928
|
|
|
913
929
|
|
|
930
|
+
override toString() {
|
|
931
|
+
|
|
932
|
+
const result = "[" + this.class.name + "] { x: " + this.x + ", y: " + this.y + ", " +
|
|
933
|
+
"height: " + this.height.toFixed(2) + ", width: " + this.height.toFixed(2) + " }"
|
|
934
|
+
|
|
935
|
+
return result
|
|
936
|
+
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
get [Symbol.toStringTag]() {
|
|
940
|
+
return this.toString()
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
|
|
914
944
|
// Bounding box
|
|
915
945
|
static boundingBoxForPoints(points: string | any[]) {
|
|
916
946
|
const result = new UIRectangle()
|