uicore-ts 1.0.521 → 1.0.525
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/UIButton.d.ts +2 -2
- package/compiledScripts/UIButton.js +1 -0
- package/compiledScripts/UIButton.js.map +2 -2
- package/compiledScripts/UICore.js +3 -1
- package/compiledScripts/UICore.js.map +2 -2
- package/compiledScripts/UICoreExtensions.d.ts +3 -1
- package/compiledScripts/UICoreExtensions.js +20 -3
- package/compiledScripts/UICoreExtensions.js.map +2 -2
- package/compiledScripts/UIDialogView.d.ts +2 -2
- package/compiledScripts/UIDialogView.js +1 -0
- package/compiledScripts/UIDialogView.js.map +2 -2
- package/compiledScripts/UIImageView.js +4 -1
- package/compiledScripts/UIImageView.js.map +2 -2
- package/compiledScripts/UILinkButton.d.ts +1 -1
- package/compiledScripts/UINativeScrollView.d.ts +1 -0
- package/compiledScripts/UINativeScrollView.js +7 -3
- package/compiledScripts/UINativeScrollView.js.map +2 -2
- package/compiledScripts/UIObject.d.ts +14 -4
- package/compiledScripts/UIObject.js +4 -0
- package/compiledScripts/UIObject.js.map +2 -2
- package/compiledScripts/UIRootViewController.js +8 -9
- package/compiledScripts/UIRootViewController.js.map +2 -2
- package/compiledScripts/UITableView.d.ts +1 -0
- package/compiledScripts/UITableView.js +3 -1
- package/compiledScripts/UITableView.js.map +2 -2
- package/compiledScripts/UITextField.d.ts +1 -1
- package/compiledScripts/UITextField.js.map +2 -2
- package/compiledScripts/UITextView.js +4 -2
- package/compiledScripts/UITextView.js.map +2 -2
- package/compiledScripts/UIView.d.ts +12 -3
- package/compiledScripts/UIView.js +101 -40
- package/compiledScripts/UIView.js.map +2 -2
- package/compiledScripts/UIViewController.js +4 -2
- package/compiledScripts/UIViewController.js.map +2 -2
- package/package.json +1 -1
- package/scripts/UIButton.ts +2 -2
- package/scripts/UICore.ts +37 -36
- package/scripts/UICoreExtensions.ts +28 -4
- package/scripts/UIDialogView.ts +2 -2
- package/scripts/UIImageView.ts +1 -1
- package/scripts/UINativeScrollView.ts +10 -4
- package/scripts/UIObject.ts +24 -6
- package/scripts/UIRootViewController.ts +16 -5
- package/scripts/UITableView.ts +4 -5
- package/scripts/UITextField.ts +1 -1
- package/scripts/UITextView.ts +20 -12
- package/scripts/UIView.ts +165 -65
- package/scripts/UIViewController.ts +7 -3
|
@@ -39,7 +39,8 @@ class UINativeScrollView extends import_UIView.UIView {
|
|
|
39
39
|
""
|
|
40
40
|
) + "translateX(" + this.viewHTMLElement.scrollLeft + "px) translateY(" + this.viewHTMLElement.scrollTop + "px)"
|
|
41
41
|
);
|
|
42
|
-
this.
|
|
42
|
+
this._contentOffset = new import_UIPoint.UIPoint(this.viewHTMLElement.scrollLeft, this.viewHTMLElement.scrollTop);
|
|
43
|
+
this.didScrollToPosition(this._contentOffset);
|
|
43
44
|
this.broadcastEventInSubtree({
|
|
44
45
|
name: import_UIView.UIView.broadcastEventName.PageDidScroll,
|
|
45
46
|
parameters: void 0
|
|
@@ -71,10 +72,13 @@ class UINativeScrollView extends import_UIView.UIView {
|
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
get contentOffset() {
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
if (!this._contentOffset) {
|
|
76
|
+
this._contentOffset = new import_UIPoint.UIPoint(this.viewHTMLElement.scrollLeft, this.viewHTMLElement.scrollTop);
|
|
77
|
+
}
|
|
78
|
+
return this._contentOffset;
|
|
76
79
|
}
|
|
77
80
|
set contentOffset(offsetPoint) {
|
|
81
|
+
this._contentOffset = offsetPoint.copy();
|
|
78
82
|
if (this.animationDuration) {
|
|
79
83
|
this.scrollXTo(this.viewHTMLElement, offsetPoint.x, this.animationDuration);
|
|
80
84
|
this.scrollYTo(this.viewHTMLElement, offsetPoint.y, this.animationDuration);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../scripts/UINativeScrollView.ts"],
|
|
4
|
-
"sourcesContent": ["import { UIPoint } from \"./UIPoint\"\nimport { LooseObject, UIView } from \"./UIView\"\n\n\nexport class UINativeScrollView extends UIView {\n \n animationDuration = 0\n \n constructor(elementID?: string, viewHTMLElement?: (HTMLElement & LooseObject) | null | undefined) {\n \n super(elementID, viewHTMLElement)\n \n this.style.cssText = this.style.cssText + \"-webkit-overflow-scrolling: touch;\"\n this.style.overflow = \"auto\"\n \n this.viewHTMLElement.addEventListener(\"scroll\", () => {\n \n this.resizingHandles.forEach(\n handle => handle.style.transform = (\"\" + handle.style.transform).replace(\n new RegExp(\"translateX\\\\(([^)]+)\\\\)\"),\n \"\"\n ).replace(\n new RegExp(\"translateY\\\\(([^)]+)\\\\)\"),\n \"\"\n ) + \"translateX(\" + this.viewHTMLElement.scrollLeft + \"px)\" + \" translateY(\" + this.viewHTMLElement.scrollTop + \"px)\"\n )\n \n this.
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAwB;AACxB,oBAAoC;AAG7B,MAAM,2BAA2B,qBAAO;AAAA,
|
|
4
|
+
"sourcesContent": ["import { UIPoint } from \"./UIPoint\"\nimport { LooseObject, UIView } from \"./UIView\"\n\n\nexport class UINativeScrollView extends UIView {\n \n animationDuration = 0\n private _contentOffset?: UIPoint\n \n constructor(elementID?: string, viewHTMLElement?: (HTMLElement & LooseObject) | null | undefined) {\n \n super(elementID, viewHTMLElement)\n \n this.style.cssText = this.style.cssText + \"-webkit-overflow-scrolling: touch;\"\n this.style.overflow = \"auto\"\n \n this.viewHTMLElement.addEventListener(\"scroll\", () => {\n \n this.resizingHandles.forEach(\n handle => handle.style.transform = (\"\" + handle.style.transform).replace(\n new RegExp(\"translateX\\\\(([^)]+)\\\\)\"),\n \"\"\n ).replace(\n new RegExp(\"translateY\\\\(([^)]+)\\\\)\"),\n \"\"\n ) + \"translateX(\" + this.viewHTMLElement.scrollLeft + \"px)\" + \" translateY(\" + this.viewHTMLElement.scrollTop + \"px)\"\n )\n \n this._contentOffset = new UIPoint(this.viewHTMLElement.scrollLeft, this.viewHTMLElement.scrollTop)\n \n this.didScrollToPosition(this._contentOffset)\n \n this.broadcastEventInSubtree({\n name: UIView.broadcastEventName.PageDidScroll,\n parameters: undefined\n })\n \n })\n \n }\n \n \n didScrollToPosition(offsetPosition: UIPoint) {\n \n \n }\n \n \n get scrollsX() {\n const result = (this.style.overflowX == \"scroll\")\n return result\n }\n \n set scrollsX(scrolls: boolean) {\n if (scrolls) {\n this.style.overflowX = \"scroll\"\n }\n else {\n this.style.overflowX = \"hidden\"\n }\n }\n \n \n get scrollsY() {\n const result = (this.style.overflowY == \"scroll\")\n return result\n }\n \n set scrollsY(scrolls: boolean) {\n if (scrolls) {\n this.style.overflowY = \"scroll\"\n }\n else {\n this.style.overflowY = \"hidden\"\n }\n }\n \n \n get contentOffset() {\n if (!this._contentOffset) {\n this._contentOffset = new UIPoint(this.viewHTMLElement.scrollLeft, this.viewHTMLElement.scrollTop)\n }\n return this._contentOffset\n }\n \n \n set contentOffset(offsetPoint: UIPoint) {\n \n this._contentOffset = offsetPoint.copy()\n \n if (this.animationDuration) {\n \n this.scrollXTo(this.viewHTMLElement, offsetPoint.x, this.animationDuration)\n this.scrollYTo(this.viewHTMLElement, offsetPoint.y, this.animationDuration)\n \n return\n \n }\n \n this.viewHTMLElement.scrollLeft = offsetPoint.x\n this.viewHTMLElement.scrollTop = offsetPoint.y\n \n }\n \n \n scrollToBottom() {\n \n this.contentOffset = new UIPoint(this.contentOffset.x, this.scrollSize.height - this.frame.height)\n \n }\n \n scrollToTop() {\n \n this.contentOffset = new UIPoint(this.contentOffset.x, 0)\n \n }\n \n get isScrolledToBottom() {\n \n return this.contentOffset.isEqualTo(new UIPoint(this.contentOffset.x, this.scrollSize.height -\n this.frame.height))\n \n }\n \n get isScrolledToTop() {\n \n return this.contentOffset.isEqualTo(new UIPoint(this.contentOffset.x, 0))\n \n }\n \n \n scrollYTo(element: HTMLElement & LooseObject, to: number, duration: number) {\n \n duration = duration * 1000\n \n const start = element.scrollTop\n const change = to - start\n const increment = 10\n \n const animateScroll = (elapsedTime: number) => {\n elapsedTime += increment\n const position = this.easeInOut(elapsedTime, start, change, duration)\n element.scrollTop = position\n if (elapsedTime < duration) {\n setTimeout(function () {\n animateScroll(elapsedTime)\n }, increment)\n }\n }\n \n animateScroll(0)\n }\n \n scrollXTo(element: HTMLElement & LooseObject, to: number, duration: number) {\n \n duration = duration * 1000\n \n const start = element.scrollTop\n const change = to - start\n const increment = 10\n \n const animateScroll = (elapsedTime: number) => {\n elapsedTime += increment\n const position = this.easeInOut(elapsedTime, start, change, duration)\n element.scrollLeft = position\n if (elapsedTime < duration) {\n setTimeout(function () {\n animateScroll(elapsedTime)\n }, increment)\n }\n }\n \n animateScroll(0)\n }\n \n easeInOut(currentTime: number, start: number, change: number, duration: number) {\n currentTime /= duration / 2\n if (currentTime < 1) {\n return change / 2 * currentTime * currentTime + start\n }\n currentTime -= 1\n return -change / 2 * (currentTime * (currentTime - 2) - 1) + start\n }\n \n \n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAwB;AACxB,oBAAoC;AAG7B,MAAM,2BAA2B,qBAAO;AAAA,EAK3C,YAAY,WAAoB,iBAAkE;AAE9F,UAAM,WAAW,eAAe;AALpC,6BAAoB;AAOhB,SAAK,MAAM,UAAU,KAAK,MAAM,UAAU;AAC1C,SAAK,MAAM,WAAW;AAEtB,SAAK,gBAAgB,iBAAiB,UAAU,MAAM;AAElD,WAAK,gBAAgB;AAAA,QACjB,YAAU,OAAO,MAAM,aAAa,KAAK,OAAO,MAAM,WAAW;AAAA,UAC7D,IAAI,OAAO,yBAAyB;A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cAAQ,aAAa;AACrB,UAAI,cAAc,UAAU;AACxB,mBAAW,WAAY;AACnB,wBAAc,WAAW;AAAA,QAC7B,GAAG,SAAS;AAAA,MAChB;AAAA,IACJ;AAEA,kBAAc,CAAC;AAAA,EACnB;AAAA,EAEA,UAAU,aAAqB,OAAe,QAAgB,UAAkB;AAC5E,mBAAe,WAAW;AAC1B,QAAI,cAAc,GAAG;AACjB,aAAO,SAAS,IAAI,cAAc,cAAc;AAAA,IACpD;AACA,mBAAe;AACf,WAAO,CAAC,SAAS,KAAK,eAAe,cAAc,KAAK,KAAK;AAAA,EACjE;AAGJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
export declare var nil: any;
|
|
2
|
-
|
|
2
|
+
declare global {
|
|
3
|
+
interface Window {
|
|
4
|
+
nil: any;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export type RecursiveRequired<T> = Required<{
|
|
8
|
+
[P in keyof T]: T[P] extends object | undefined ? RecursiveRequired<Required<T[P]>> : T[P];
|
|
9
|
+
}>;
|
|
10
|
+
export declare function wrapInNil<T>(object?: T): Required<T>;
|
|
3
11
|
export declare const YES = true;
|
|
4
12
|
export declare const NO = false;
|
|
5
13
|
export declare function IS<T>(object: T | undefined | null | false): object is T;
|
|
@@ -32,9 +40,11 @@ export declare function CALL<T extends (...args: any) => any>(...objects: Parame
|
|
|
32
40
|
export declare class UIFunctionExtender<T extends (...args: any) => any> {
|
|
33
41
|
isAUIFunctionExtenderObject: boolean;
|
|
34
42
|
extendingFunction: T;
|
|
43
|
+
static functionByExtendingFunction<T extends (...args: any) => any>(functionToExtend: T, extendingFunction: T): T & {
|
|
44
|
+
extendedFunction: T;
|
|
45
|
+
};
|
|
35
46
|
constructor(extendingFunction: T);
|
|
36
|
-
extendedFunction(functionToExtend: T): {
|
|
37
|
-
(this: any, ...objects: any[]): void;
|
|
47
|
+
extendedFunction(functionToExtend: T): T & {
|
|
38
48
|
extendedFunction: T;
|
|
39
49
|
};
|
|
40
50
|
}
|
|
@@ -47,7 +57,7 @@ export declare class UILazyPropertyValue<T> {
|
|
|
47
57
|
}
|
|
48
58
|
export declare function LAZY_VALUE<T>(initFunction: () => T): UILazyPropertyValue<T>;
|
|
49
59
|
export type UIInitializerObject<T> = {
|
|
50
|
-
[P in keyof T]?: T[P] extends (...args: any) => any ? UIFunctionCall<T[P]> | UIFunctionExtender<T[P]> | T[P] : T[P] extends object ? UIInitializerObject<T[P]> | UILazyPropertyValue<T[P]> : T[P]
|
|
60
|
+
[P in keyof T]?: T[P] extends (...args: any) => any ? UIFunctionCall<T[P]> | UIFunctionExtender<T[P]> | T[P] : T[P] extends object ? UIInitializerObject<T[P]> | UILazyPropertyValue<T[P]> : Partial<T[P]>;
|
|
51
61
|
};
|
|
52
62
|
export declare class UIObject {
|
|
53
63
|
constructor();
|
|
@@ -74,6 +74,7 @@ var nil = new Proxy(Object.assign(NilFunction, { "class": null, "className": "Ni
|
|
|
74
74
|
return NilFunction();
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
|
+
window.nil = nil;
|
|
77
78
|
function wrapInNil(object) {
|
|
78
79
|
let result = FIRST_OR_NIL(object);
|
|
79
80
|
if (object instanceof Object && !(object instanceof Function)) {
|
|
@@ -208,6 +209,9 @@ class UIFunctionExtender {
|
|
|
208
209
|
this.isAUIFunctionExtenderObject = YES;
|
|
209
210
|
this.extendingFunction = extendingFunction;
|
|
210
211
|
}
|
|
212
|
+
static functionByExtendingFunction(functionToExtend, extendingFunction) {
|
|
213
|
+
return EXTEND(extendingFunction).extendedFunction(functionToExtend);
|
|
214
|
+
}
|
|
211
215
|
extendedFunction(functionToExtend) {
|
|
212
216
|
const extendingFunction = this.extendingFunction;
|
|
213
217
|
function extendedFunction(...objects) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../scripts/UIObject.ts"],
|
|
4
|
-
"sourcesContent": ["import { UICoreExtensionValueObject } from \"./UICoreExtensionValueObject\"\nimport { UITimer } from \"./UITimer\"\nimport { UIComponentView } from \"./UIView\"\n\n\nfunction NilFunction() {\n return nil\n}\n\n\n// The nil object avoids unnecessary crashes by allowing you to call any function or access any variable on it, returning nil\nexport var nil: any = new Proxy(Object.assign(NilFunction, { \"class\": null, \"className\": \"Nil\" }), {\n get(target, name) {\n if (name == Symbol.toPrimitive) {\n return function (hint: string) {\n if (hint == \"number\") {\n return 0\n }\n if (hint == \"string\") {\n return \"\"\n }\n return false\n }\n }\n if (name == \"toString\") {\n return function toString() {\n return \"\"\n }\n }\n return NilFunction()\n },\n set() {\n return NilFunction()\n }\n})\n\n\nexport function wrapInNil<T>(object?: T): T {\n let result = FIRST_OR_NIL(object)\n if (object instanceof Object && !(object instanceof Function)) {\n result = new Proxy(object as Object & T, {\n get(target, name) {\n if (name == \"wrapped_nil_target\") {\n return target\n }\n const value = Reflect.get(target, name)\n if (typeof value === \"object\") {\n return wrapInNil(value)\n }\n if (IS_NOT_LIKE_NULL(value)) {\n return value\n }\n return nil\n },\n set(target: Record<string, any> & T, name: string, value: any) {\n if (IS(target)) {\n // @ts-ignore\n target[name] = value\n }\n return YES\n }\n })\n }\n return result\n}\n\n\nexport const YES = true\nexport const NO = false\n\nexport function IS<T>(object: T | undefined | null | false): object is T {\n if (object && object !== nil) {\n return YES\n }\n return NO\n}\n\nexport function IS_NOT(object: any): object is undefined | null | false {\n return !IS(object)\n}\n\nexport function IS_DEFINED<T>(object: T | undefined): object is T {\n if (object != undefined) {\n return YES\n }\n return NO\n}\n\nexport function IS_UNDEFINED(object: any): object is undefined {\n return !IS_DEFINED(object)\n}\n\nexport function IS_NIL(object: any): object is typeof nil {\n if (object === nil) {\n return YES\n }\n return NO\n}\n\nexport function IS_NOT_NIL<T>(object: T | undefined | null): object is T | undefined | null {\n return !IS_NIL(object)\n}\n\n\nexport function IS_LIKE_NULL(object: any): object is undefined | null {\n return (IS_UNDEFINED(object) || IS_NIL(object) || object == null)\n}\n\nexport function IS_NOT_LIKE_NULL<T>(object: T | null | undefined): object is T {\n return !IS_LIKE_NULL(object)\n}\n\n\nexport function IS_AN_EMAIL_ADDRESS(email: string) {\n const re = /\\S+@\\S+\\.\\S+/\n return re.test(email)\n}\n\n\nexport function FIRST_OR_NIL<T>(...objects: (T | undefined | null)[]): T {\n const result = objects.find(object => IS(object))\n return result || nil\n}\n\nexport function FIRST<T>(...objects: (T | undefined | null)[]): T {\n const result = objects.find(object => IS(object))\n return result || IF(IS_DEFINED(objects.lastElement))(RETURNER(objects.lastElement))()\n}\n\n\nexport function MAKE_ID(randomPartLength = 15) {\n let result = \"\"\n const characters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\"\n for (let i = 0; i < randomPartLength; i++) {\n result = result + characters.charAt(Math.floor(Math.random() * characters.length))\n }\n result = result + Date.now()\n return result\n}\n\n\nexport function RETURNER<T>(value?: T) {\n return (..._objects: any[]) => value\n}\n\n\nexport type UIIFBlockReceiver<T> = (functionToCall: () => any) => UIIFEvaluator<T>;\nexport type UIIFEvaluatorBase<T> = () => T;\n\n\nexport interface UIIFEvaluator<T> extends UIIFEvaluatorBase<T> {\n ELSE_IF: (otherValue: any) => UIIFBlockReceiver<T>;\n ELSE: (functionToCall: () => any) => T;\n}\n\n\nexport function IF<T = any>(value: any): UIIFBlockReceiver<T> {\n \n let thenFunction = nil\n let elseFunction = nil\n \n const result: any = function (functionToCall: () => T) {\n thenFunction = functionToCall\n return result.evaluateConditions\n }\n \n result.evaluateConditions = function () {\n if (IS(value)) {\n return thenFunction()\n }\n return elseFunction()\n }\n \n result.evaluateConditions.ELSE_IF = function (otherValue: any) {\n \n const functionResult = IF(otherValue) as (UIIFBlockReceiver<T> & { evaluateConditions: UIIFEvaluator<T> })\n elseFunction = functionResult.evaluateConditions\n \n const functionResultEvaluateConditionsFunction: any = function () {\n return result.evaluateConditions()\n }\n functionResultEvaluateConditionsFunction.ELSE_IF = functionResult.evaluateConditions.ELSE_IF\n functionResultEvaluateConditionsFunction.ELSE = functionResult.evaluateConditions.ELSE\n \n functionResult.evaluateConditions = functionResultEvaluateConditionsFunction\n \n return functionResult\n \n }\n \n result.evaluateConditions.ELSE = function (functionToCall: () => T) {\n elseFunction = functionToCall\n return result.evaluateConditions()\n }\n \n return result\n}\n\n\nexport class UIFunctionCall<T extends (...args: any) => any> {\n \n isAUIFunctionCallObject = YES\n parameters: Parameters<T>[]\n \n constructor(...parameters: Parameters<T>) {\n this.parameters = parameters\n }\n \n callFunction(functionToCall: T) {\n const parameters = this.parameters\n functionToCall(...parameters)\n }\n \n}\n\n\nexport function CALL<T extends (...args: any) => any>(...objects: Parameters<T>) {\n return new UIFunctionCall<T>(...objects)\n}\n\n\nexport class UIFunctionExtender<T extends (...args: any) => any> {\n \n isAUIFunctionExtenderObject = YES\n extendingFunction: T\n \n constructor(extendingFunction: T) {\n this.extendingFunction = extendingFunction\n }\n \n extendedFunction(functionToExtend: T) {\n const extendingFunction = this.extendingFunction\n \n function extendedFunction(this: any, ...objects: any[]) {\n const boundFunctionToExtend = functionToExtend.bind(this)\n boundFunctionToExtend(...objects)\n const boundExtendingFunction = extendingFunction.bind(this)\n boundExtendingFunction(...objects)\n }\n \n extendedFunction.extendedFunction = functionToExtend\n return extendedFunction\n }\n \n}\n\n\nexport function EXTEND<T extends (...args: any) => any>(extendingFunction: T) {\n return new UIFunctionExtender(extendingFunction)\n}\n\n\nexport class UILazyPropertyValue<T> {\n \n isAUILazyPropertyValueObject = YES\n initFunction: () => T\n \n constructor(initFunction: () => T) {\n this.initFunction = initFunction\n }\n \n setLazyPropertyValue(key: string, target: object) {\n \n let isValueInitialized = NO\n \n // property value\n let _value = nil\n \n const initValue = () => {\n _value = this.initFunction()\n isValueInitialized = YES\n this.initFunction = nil\n }\n \n // @ts-ignore\n if (delete target[key]) {\n \n // Create new property with getter and setter\n Object.defineProperty(target, key, {\n get: function () {\n if (IS_NOT(isValueInitialized)) {\n initValue()\n }\n return _value\n },\n set: function (newValue) {\n _value = newValue\n },\n enumerable: true,\n configurable: true\n })\n \n }\n \n }\n \n}\n\n\nexport function LAZY_VALUE<T>(initFunction: () => T) {\n return new UILazyPropertyValue(initFunction)\n}\n\n\nexport type UIInitializerObject<T> = {\n \n [P in keyof T]?:\n //T[P] extends (infer U)[] ? UIInitializerObject<U>[] :\n T[P] extends (...args: any) => any ? UIFunctionCall<T[P]> | UIFunctionExtender<T[P]> | T[P] :\n T[P] extends object ? UIInitializerObject<T[P]> | UILazyPropertyValue<T[P]> :\n T[P];\n \n}\n\n\nexport class UIObject {\n \n constructor() {\n \n // Do something here if needed\n \n }\n \n public get class(): any {\n return Object.getPrototypeOf(this).constructor\n }\n \n public get superclass(): any {\n return Object.getPrototypeOf(Object.getPrototypeOf(this)).constructor\n }\n \n isKindOfClass(classObject: any) {\n if (this.isMemberOfClass(classObject)) {\n return YES\n }\n for (let superclassObject = this.superclass; IS(superclassObject); superclassObject = superclassObject.superclass) {\n if (superclassObject == classObject) {\n return YES\n }\n }\n return NO\n }\n \n \n isMemberOfClass(classObject: any) {\n return (this.class == classObject)\n }\n \n \n static annotationsMap: WeakMap<any, Function[]> = new WeakMap<ClassDecoratorContext, Function[]>()\n static recordAnnotation(annotation: Function, target: Function) {\n if (!UIObject.annotationsMap.has(target)) {\n UIObject.annotationsMap.set(target, [])\n }\n UIObject.annotationsMap.get(target)!.push(annotation)\n }\n static classHasAnnotation(classObject: Function, annotation: Function) {\n return UIObject.annotationsMap.get(classObject)?.contains(annotation)\n }\n static annotationsOnClass(classObject: Function) {\n return UIObject.annotationsMap.get(classObject) ?? []\n }\n \n public static wrapObject<T>(object: T): UIObject & T {\n if (IS_NOT(object)) {\n return nil\n }\n \n if ((object as any) instanceof UIObject) {\n // @ts-ignore\n return object\n }\n \n return Object.assign(new UIObject(), object)\n }\n \n \n valueForKey(key: string) {\n // @ts-ignore\n return this[key]\n }\n \n valueForKeyPath<T = any>(keyPath: string, defaultValue?: T): T | undefined {\n return UIObject.valueForKeyPath(keyPath, this, defaultValue)\n }\n \n static valueForKeyPath<T = any>(keyPath: string, object: any, defaultValue?: T): T | undefined {\n \n if (IS_NOT(keyPath)) {\n return object\n }\n \n const keys = keyPath.split(\".\")\n let currentObject = object\n \n for (let i = 0; i < keys.length; i++) {\n \n const key = keys[i]\n \n if (key.substring(0, 2) == \"[]\") {\n \n // This next object will be an array and the rest of the keys need to be run for each of the elements\n currentObject = currentObject[key.substring(2)]\n \n // CurrentObject is now an array\n \n const remainingKeyPath = keys.slice(i + 1).join(\".\")\n const currentArray = currentObject as unknown as any[]\n currentObject = currentArray.map(subObject => UIObject.valueForKeyPath(remainingKeyPath, subObject))\n \n break\n \n }\n \n currentObject = currentObject?.[key]\n if (IS_LIKE_NULL(currentObject)) {\n currentObject = defaultValue\n }\n \n }\n \n return currentObject\n \n }\n \n setValueForKeyPath(keyPath: string, value: any, createPath = YES) {\n return UIObject.setValueForKeyPath(keyPath, value, this, createPath)\n }\n \n static setValueForKeyPath(keyPath: string, value: any, currentObject: any, createPath: boolean) {\n \n const keys = keyPath.split(\".\")\n let didSetValue = NO\n \n keys.forEach((key, index, array) => {\n if (index == array.length - 1 && IS_NOT_LIKE_NULL(currentObject)) {\n currentObject[key] = value\n didSetValue = YES\n return\n }\n else if (IS_NOT(currentObject)) {\n return\n }\n \n const currentObjectValue = currentObject[key]\n if (IS_LIKE_NULL(currentObjectValue) && createPath) {\n currentObject[key] = {}\n }\n currentObject = currentObject[key]\n })\n \n return didSetValue\n \n }\n \n \n configureWithObject(object: UIInitializerObject<this>) {\n \n return UIObject.configureWithObject(this, object)\n \n }\n \n configuredWithObject(object: UIInitializerObject<this>): this {\n \n this.configureWithObject(object)\n return this\n \n }\n \n \n static configureWithObject<TargetObjectType extends object, ConfigurationObjectType extends UIInitializerObject<TargetObjectType>>(\n configurationTarget: TargetObjectType,\n object: ConfigurationObjectType\n ): ConfigurationObjectType {\n \n const isAnObject = (item: any) => (item && typeof item === \"object\" && !Array.isArray(item) && !(item instanceof UICoreExtensionValueObject))\n const isAPureObject = (item: any) => isAnObject(item) && Object.getPrototypeOf(item) === Object.getPrototypeOf({})\n \n function isAClass(funcOrClass: object) {\n if (IS_NOT(funcOrClass)) {\n return NO\n }\n const isFunction = (functionToCheck: object) => (functionToCheck && {}.toString.call(functionToCheck) ===\n \"[object Function]\")\n const propertyNames = Object.getOwnPropertyNames(funcOrClass)\n return (isFunction(funcOrClass) && !propertyNames.includes(\"arguments\") &&\n propertyNames.includes(\"prototype\"))\n }\n \n const result = {} as ConfigurationObjectType\n \n let keyPathsAndValues: { value: any, keyPath: string }[] = []\n \n function prepareKeyPathsAndValues(target: Record<string, any>, source: object, keyPath = \"\") {\n \n if ((isAnObject(target) || isAClass(target)) && isAnObject(source)) {\n \n source.forEach((sourceValue, key) => {\n \n const valueKeyPath = keyPath + \".\" + key\n \n function addValueAndKeyPath(sourceValue: any) {\n keyPathsAndValues.push({\n value: sourceValue,\n keyPath: valueKeyPath.replace(\".\", \"\")\n })\n }\n \n \n if (isAPureObject(sourceValue) || isAClass(sourceValue)) {\n if (!(key in target) || target[key] instanceof Function) {\n addValueAndKeyPath(sourceValue)\n }\n else {\n prepareKeyPathsAndValues(target[key], sourceValue, valueKeyPath)\n }\n }\n else if (sourceValue instanceof UICoreExtensionValueObject) {\n addValueAndKeyPath(sourceValue.value)\n }\n else {\n addValueAndKeyPath(sourceValue)\n }\n \n })\n \n }\n \n }\n \n prepareKeyPathsAndValues(configurationTarget, object)\n \n // Sort based on key path lengths\n keyPathsAndValues = keyPathsAndValues.sort((a, b) => {\n \n const firstKeyPath = (a.keyPath as string).split(\".\").length\n const secondKeyPath = (b.keyPath as string).split(\".\").length\n \n if (firstKeyPath < secondKeyPath) {\n return -1\n }\n if (firstKeyPath > secondKeyPath) {\n return 1\n }\n return 0\n \n })\n \n keyPathsAndValues.forEach((valueAndKeyPath) => {\n \n const keyPath: string = valueAndKeyPath.keyPath\n let value = valueAndKeyPath.value\n \n const getTargetFunction = (bindThis = NO) => {\n let result = (UIObject.valueForKeyPath(keyPath, configurationTarget) as Function)\n if (bindThis) {\n const indexOfDot = keyPath.lastIndexOf(\".\")\n const thisObject = UIObject.valueForKeyPath(keyPath.substring(0, indexOfDot), configurationTarget)\n result = result.bind(thisObject)\n }\n return result\n }\n \n if (value instanceof UILazyPropertyValue) {\n const indexOfDot = keyPath.lastIndexOf(\".\")\n const thisObject = UIObject.valueForKeyPath(keyPath.substring(0, indexOfDot), configurationTarget)\n const key = keyPath.substring(indexOfDot + 1)\n value.setLazyPropertyValue(key, thisObject)\n return\n }\n \n if (value instanceof UIFunctionCall) {\n value.callFunction(getTargetFunction(YES))\n return\n }\n \n if (value instanceof UIFunctionExtender) {\n value = value.extendedFunction(getTargetFunction())\n }\n \n UIObject.setValueForKeyPath(keyPath, UIObject.valueForKeyPath(keyPath, configurationTarget), result, YES)\n UIObject.setValueForKeyPath(keyPath, value, configurationTarget, YES)\n \n })\n \n \n return result\n \n }\n \n static configuredWithObject<T extends object>(configurationTarget: T, object: UIInitializerObject<T>) {\n this.configureWithObject(configurationTarget, object)\n return configurationTarget\n }\n \n \n get methods(): MethodsOnly<Omit<this, \"methods\">> {\n const thisObject = this as object\n const result = {} as any\n thisObject.forEach((value, key) => {\n if (value instanceof Function && key != \"methods\") {\n result[key] = value.bind(thisObject)\n }\n })\n return result\n }\n \n \n performFunctionWithSelf<T>(functionToPerform: (self: this) => T): T {\n return functionToPerform(this)\n }\n \n performingFunctionWithSelf(functionToPerform: (self: this) => void): this {\n functionToPerform(this)\n return this\n }\n \n performFunctionWithDelay(delay: number, functionToCall: Function) {\n \n new UITimer(delay, NO, functionToCall)\n \n }\n \n \n}\n\nexport type MethodsOnly<T> =\n Pick<T, { [K in keyof T]: T[K] extends Function ? K : never }[keyof T]>;\n\nexport type ValueOf<T> = T[keyof T];\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wCAA2C;AAC3C,qBAAwB;
|
|
4
|
+
"sourcesContent": ["import { UICoreExtensionValueObject } from \"./UICoreExtensionValueObject\"\nimport { UITimer } from \"./UITimer\"\n\n\nfunction NilFunction() {\n return nil\n}\n\n\n// The nil object avoids unnecessary crashes by allowing you to call any function or access any variable on it, returning nil\nexport var nil: any = new Proxy(Object.assign(NilFunction, { \"class\": null, \"className\": \"Nil\" }), {\n get(target, name) {\n if (name == Symbol.toPrimitive) {\n return function (hint: string) {\n if (hint == \"number\") {\n return 0\n }\n if (hint == \"string\") {\n return \"\"\n }\n return false\n }\n }\n if (name == \"toString\") {\n return function toString() {\n return \"\"\n }\n }\n return NilFunction()\n },\n set() {\n return NilFunction()\n }\n})\nwindow.nil = nil\n\ndeclare global {\n interface Window {\n nil: any;\n }\n}\n\n\nexport type RecursiveRequired<T> = Required<{\n [P in keyof T]: T[P] extends object | undefined ? RecursiveRequired<Required<T[P]>> : T[P];\n}>;\n\nexport function wrapInNil<T>(object?: T): Required<T> {\n let result = FIRST_OR_NIL(object)\n if (object instanceof Object && !(object instanceof Function)) {\n result = new Proxy(object as Object & T, {\n get(target, name) {\n if (name == \"wrapped_nil_target\") {\n return target\n }\n const value = Reflect.get(target, name)\n if (typeof value === \"object\") {\n return wrapInNil(value)\n }\n if (IS_NOT_LIKE_NULL(value)) {\n return value\n }\n return nil\n },\n set(target: Record<string, any> & T, name: string, value: any) {\n if (IS(target)) {\n // @ts-ignore\n target[name] = value\n }\n return YES\n }\n })\n }\n return result as any\n}\n\n\nexport const YES = true\nexport const NO = false\n\nexport function IS<T>(object: T | undefined | null | false): object is T {\n if (object && object !== nil) {\n return YES\n }\n return NO\n}\n\nexport function IS_NOT(object: any): object is undefined | null | false {\n return !IS(object)\n}\n\nexport function IS_DEFINED<T>(object: T | undefined): object is T {\n if (object != undefined) {\n return YES\n }\n return NO\n}\n\nexport function IS_UNDEFINED(object: any): object is undefined {\n return !IS_DEFINED(object)\n}\n\nexport function IS_NIL(object: any): object is typeof nil {\n if (object === nil) {\n return YES\n }\n return NO\n}\n\nexport function IS_NOT_NIL<T>(object: T | undefined | null): object is T | undefined | null {\n return !IS_NIL(object)\n}\n\n\nexport function IS_LIKE_NULL(object: any): object is undefined | null {\n return (IS_UNDEFINED(object) || IS_NIL(object) || object == null)\n}\n\nexport function IS_NOT_LIKE_NULL<T>(object: T | null | undefined): object is T {\n return !IS_LIKE_NULL(object)\n}\n\n\nexport function IS_AN_EMAIL_ADDRESS(email: string) {\n const re = /\\S+@\\S+\\.\\S+/\n return re.test(email)\n}\n\n\nexport function FIRST_OR_NIL<T>(...objects: (T | undefined | null)[]): T {\n const result = objects.find(object => IS(object))\n return result || nil\n}\n\nexport function FIRST<T>(...objects: (T | undefined | null)[]): T {\n const result = objects.find(object => IS(object))\n return result || IF(IS_DEFINED(objects.lastElement))(RETURNER(objects.lastElement))()\n}\n\n\nexport function MAKE_ID(randomPartLength = 15) {\n let result = \"\"\n const characters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\"\n for (let i = 0; i < randomPartLength; i++) {\n result = result + characters.charAt(Math.floor(Math.random() * characters.length))\n }\n result = result + Date.now()\n return result\n}\n\n\nexport function RETURNER<T>(value?: T) {\n return (..._objects: any[]) => value\n}\n\n\nexport type UIIFBlockReceiver<T> = (functionToCall: () => any) => UIIFEvaluator<T>;\nexport type UIIFEvaluatorBase<T> = () => T;\n\n\nexport interface UIIFEvaluator<T> extends UIIFEvaluatorBase<T> {\n ELSE_IF: (otherValue: any) => UIIFBlockReceiver<T>;\n ELSE: (functionToCall: () => any) => T;\n}\n\n\nexport function IF<T = any>(value: any): UIIFBlockReceiver<T> {\n \n let thenFunction = nil\n let elseFunction = nil\n \n const result: any = function (functionToCall: () => T) {\n thenFunction = functionToCall\n return result.evaluateConditions\n }\n \n result.evaluateConditions = function () {\n if (IS(value)) {\n return thenFunction()\n }\n return elseFunction()\n }\n \n result.evaluateConditions.ELSE_IF = function (otherValue: any) {\n \n const functionResult = IF(otherValue) as (UIIFBlockReceiver<T> & { evaluateConditions: UIIFEvaluator<T> })\n elseFunction = functionResult.evaluateConditions\n \n const functionResultEvaluateConditionsFunction: any = function () {\n return result.evaluateConditions()\n }\n functionResultEvaluateConditionsFunction.ELSE_IF = functionResult.evaluateConditions.ELSE_IF\n functionResultEvaluateConditionsFunction.ELSE = functionResult.evaluateConditions.ELSE\n \n functionResult.evaluateConditions = functionResultEvaluateConditionsFunction\n \n return functionResult\n \n }\n \n result.evaluateConditions.ELSE = function (functionToCall: () => T) {\n elseFunction = functionToCall\n return result.evaluateConditions()\n }\n \n return result\n}\n\n\nexport class UIFunctionCall<T extends (...args: any) => any> {\n \n isAUIFunctionCallObject = YES\n parameters: Parameters<T>[]\n \n constructor(...parameters: Parameters<T>) {\n this.parameters = parameters\n }\n \n callFunction(functionToCall: T) {\n const parameters = this.parameters\n functionToCall(...parameters)\n }\n \n}\n\n\nexport function CALL<T extends (...args: any) => any>(...objects: Parameters<T>) {\n return new UIFunctionCall<T>(...objects)\n}\n\n\nexport class UIFunctionExtender<T extends (...args: any) => any> {\n \n isAUIFunctionExtenderObject = YES\n extendingFunction: T\n \n static functionByExtendingFunction<T extends (...args: any) => any>(functionToExtend: T, extendingFunction: T) {\n return EXTEND(extendingFunction).extendedFunction(functionToExtend)\n }\n \n constructor(extendingFunction: T) {\n this.extendingFunction = extendingFunction\n }\n \n extendedFunction(functionToExtend: T): T & { extendedFunction: T } {\n const extendingFunction = this.extendingFunction\n \n function extendedFunction(this: any, ...objects: any[]) {\n const boundFunctionToExtend = functionToExtend.bind(this)\n boundFunctionToExtend(...objects)\n const boundExtendingFunction = extendingFunction.bind(this)\n boundExtendingFunction(...objects)\n }\n \n extendedFunction.extendedFunction = functionToExtend\n return extendedFunction as any\n }\n \n}\n\n\nexport function EXTEND<T extends (...args: any) => any>(extendingFunction: T) {\n return new UIFunctionExtender(extendingFunction)\n}\n\n\nexport class UILazyPropertyValue<T> {\n \n isAUILazyPropertyValueObject = YES\n initFunction: () => T\n \n constructor(initFunction: () => T) {\n this.initFunction = initFunction\n }\n \n setLazyPropertyValue(key: string, target: object) {\n \n let isValueInitialized = NO\n \n // property value\n let _value = nil\n \n const initValue = () => {\n _value = this.initFunction()\n isValueInitialized = YES\n this.initFunction = nil\n }\n \n // @ts-ignore\n if (delete target[key]) {\n \n // Create new property with getter and setter\n Object.defineProperty(target, key, {\n get: function () {\n if (IS_NOT(isValueInitialized)) {\n initValue()\n }\n return _value\n },\n set: function (newValue) {\n _value = newValue\n },\n enumerable: true,\n configurable: true\n })\n \n }\n \n }\n \n}\n\n\nexport function LAZY_VALUE<T>(initFunction: () => T) {\n return new UILazyPropertyValue(initFunction)\n}\n\n\nexport type UIInitializerObject<T> = {\n \n [P in keyof T]?:\n //T[P] extends (infer U)[] ? UIInitializerObject<U>[] :\n T[P] extends (...args: any) => any ? UIFunctionCall<T[P]> | UIFunctionExtender<T[P]> | T[P] :\n T[P] extends object ? UIInitializerObject<T[P]> | UILazyPropertyValue<T[P]> :\n Partial<T[P]>;\n \n}\n\n\nexport class UIObject {\n \n constructor() {\n \n // Do something here if needed\n \n }\n \n public get class(): any {\n return Object.getPrototypeOf(this).constructor\n }\n \n public get superclass(): any {\n return Object.getPrototypeOf(Object.getPrototypeOf(this)).constructor\n }\n \n isKindOfClass(classObject: any) {\n if (this.isMemberOfClass(classObject)) {\n return YES\n }\n for (let superclassObject = this.superclass; IS(superclassObject); superclassObject = superclassObject.superclass) {\n if (superclassObject == classObject) {\n return YES\n }\n }\n return NO\n }\n \n \n isMemberOfClass(classObject: any) {\n return (this.class == classObject)\n }\n \n \n static annotationsMap: WeakMap<any, Function[]> = new WeakMap<ClassDecoratorContext, Function[]>()\n \n static recordAnnotation(annotation: Function, target: Function) {\n if (!UIObject.annotationsMap.has(target)) {\n UIObject.annotationsMap.set(target, [])\n }\n UIObject.annotationsMap.get(target)!.push(annotation)\n }\n \n static classHasAnnotation(classObject: Function, annotation: Function) {\n return UIObject.annotationsMap.get(classObject)?.contains(annotation)\n }\n \n static annotationsOnClass(classObject: Function) {\n return UIObject.annotationsMap.get(classObject) ?? []\n }\n \n public static wrapObject<T>(object: T): UIObject & T {\n if (IS_NOT(object)) {\n return nil\n }\n \n if ((object as any) instanceof UIObject) {\n // @ts-ignore\n return object\n }\n \n return Object.assign(new UIObject(), object)\n }\n \n \n valueForKey(key: string) {\n // @ts-ignore\n return this[key]\n }\n \n valueForKeyPath<T = any>(keyPath: string, defaultValue?: T): T | undefined {\n return UIObject.valueForKeyPath(keyPath, this, defaultValue)\n }\n \n static valueForKeyPath<T = any>(keyPath: string, object: any, defaultValue?: T): T | undefined {\n \n if (IS_NOT(keyPath)) {\n return object\n }\n \n const keys = keyPath.split(\".\")\n let currentObject = object\n \n for (let i = 0; i < keys.length; i++) {\n \n const key = keys[i]\n \n if (key.substring(0, 2) == \"[]\") {\n \n // This next object will be an array and the rest of the keys need to be run for each of the elements\n currentObject = currentObject[key.substring(2)]\n \n // CurrentObject is now an array\n \n const remainingKeyPath = keys.slice(i + 1).join(\".\")\n const currentArray = currentObject as unknown as any[]\n currentObject = currentArray.map(subObject => UIObject.valueForKeyPath(remainingKeyPath, subObject))\n \n break\n \n }\n \n currentObject = currentObject?.[key]\n if (IS_LIKE_NULL(currentObject)) {\n currentObject = defaultValue\n }\n \n }\n \n return currentObject\n \n }\n \n setValueForKeyPath(keyPath: string, value: any, createPath = YES) {\n return UIObject.setValueForKeyPath(keyPath, value, this, createPath)\n }\n \n static setValueForKeyPath(keyPath: string, value: any, currentObject: any, createPath: boolean) {\n \n const keys = keyPath.split(\".\")\n let didSetValue = NO\n \n keys.forEach((key, index, array) => {\n if (index == array.length - 1 && IS_NOT_LIKE_NULL(currentObject)) {\n currentObject[key] = value\n didSetValue = YES\n return\n }\n else if (IS_NOT(currentObject)) {\n return\n }\n \n const currentObjectValue = currentObject[key]\n if (IS_LIKE_NULL(currentObjectValue) && createPath) {\n currentObject[key] = {}\n }\n currentObject = currentObject[key]\n })\n \n return didSetValue\n \n }\n \n \n configureWithObject(object: UIInitializerObject<this>) {\n \n return UIObject.configureWithObject(this, object)\n \n }\n \n configuredWithObject(object: UIInitializerObject<this>): this {\n \n this.configureWithObject(object)\n return this\n \n }\n \n \n static configureWithObject<TargetObjectType extends object, ConfigurationObjectType extends UIInitializerObject<TargetObjectType>>(\n configurationTarget: TargetObjectType,\n object: ConfigurationObjectType\n ): ConfigurationObjectType {\n \n const isAnObject = (item: any) => (item && typeof item === \"object\" && !Array.isArray(item) && !(item instanceof UICoreExtensionValueObject))\n const isAPureObject = (item: any) => isAnObject(item) && Object.getPrototypeOf(item) === Object.getPrototypeOf({})\n \n function isAClass(funcOrClass: object) {\n if (IS_NOT(funcOrClass)) {\n return NO\n }\n const isFunction = (functionToCheck: object) => (functionToCheck && {}.toString.call(functionToCheck) ===\n \"[object Function]\")\n const propertyNames = Object.getOwnPropertyNames(funcOrClass)\n return (isFunction(funcOrClass) && !propertyNames.includes(\"arguments\") &&\n propertyNames.includes(\"prototype\"))\n }\n \n const result = {} as ConfigurationObjectType\n \n let keyPathsAndValues: { value: any, keyPath: string }[] = []\n \n function prepareKeyPathsAndValues(target: Record<string, any>, source: object, keyPath = \"\") {\n \n if ((isAnObject(target) || isAClass(target)) && isAnObject(source)) {\n \n source.forEach((sourceValue, key) => {\n \n const valueKeyPath = keyPath + \".\" + key\n \n function addValueAndKeyPath(sourceValue: any) {\n keyPathsAndValues.push({\n value: sourceValue,\n keyPath: valueKeyPath.replace(\".\", \"\")\n })\n }\n \n \n if (isAPureObject(sourceValue) || isAClass(sourceValue)) {\n if (!(key in target) || target[key] instanceof Function) {\n addValueAndKeyPath(sourceValue)\n }\n else {\n prepareKeyPathsAndValues(target[key], sourceValue, valueKeyPath)\n }\n }\n else if (sourceValue instanceof UICoreExtensionValueObject) {\n addValueAndKeyPath(sourceValue.value)\n }\n else {\n addValueAndKeyPath(sourceValue)\n }\n \n })\n \n }\n \n }\n \n prepareKeyPathsAndValues(configurationTarget, object)\n \n // Sort based on key path lengths\n keyPathsAndValues = keyPathsAndValues.sort((a, b) => {\n \n const firstKeyPath = (a.keyPath as string).split(\".\").length\n const secondKeyPath = (b.keyPath as string).split(\".\").length\n \n if (firstKeyPath < secondKeyPath) {\n return -1\n }\n if (firstKeyPath > secondKeyPath) {\n return 1\n }\n return 0\n \n })\n \n keyPathsAndValues.forEach((valueAndKeyPath) => {\n \n const keyPath: string = valueAndKeyPath.keyPath\n let value = valueAndKeyPath.value\n \n const getTargetFunction = (bindThis = NO) => {\n let result = (UIObject.valueForKeyPath(keyPath, configurationTarget) as Function)\n if (bindThis) {\n const indexOfDot = keyPath.lastIndexOf(\".\")\n const thisObject = UIObject.valueForKeyPath(keyPath.substring(0, indexOfDot), configurationTarget)\n result = result.bind(thisObject)\n }\n return result\n }\n \n if (value instanceof UILazyPropertyValue) {\n const indexOfDot = keyPath.lastIndexOf(\".\")\n const thisObject = UIObject.valueForKeyPath(keyPath.substring(0, indexOfDot), configurationTarget)\n const key = keyPath.substring(indexOfDot + 1)\n value.setLazyPropertyValue(key, thisObject)\n return\n }\n \n if (value instanceof UIFunctionCall) {\n value.callFunction(getTargetFunction(YES))\n return\n }\n \n if (value instanceof UIFunctionExtender) {\n value = value.extendedFunction(getTargetFunction())\n }\n \n UIObject.setValueForKeyPath(keyPath, UIObject.valueForKeyPath(keyPath, configurationTarget), result, YES)\n UIObject.setValueForKeyPath(keyPath, value, configurationTarget, YES)\n \n })\n \n \n return result\n \n }\n \n static configuredWithObject<T extends object>(configurationTarget: T, object: UIInitializerObject<T>) {\n this.configureWithObject(configurationTarget, object)\n return configurationTarget\n }\n \n \n get methods(): MethodsOnly<Omit<this, \"methods\">> {\n const thisObject = this as object\n const result = {} as any\n thisObject.forEach((value, key) => {\n if (value instanceof Function && key != \"methods\") {\n result[key] = value.bind(thisObject)\n }\n })\n return result\n }\n \n \n performFunctionWithSelf<T>(functionToPerform: (self: this) => T): T {\n return functionToPerform(this)\n }\n \n performingFunctionWithSelf(functionToPerform: (self: this) => void): this {\n functionToPerform(this)\n return this\n }\n \n performFunctionWithDelay(delay: number, functionToCall: Function) {\n \n new UITimer(delay, NO, functionToCall)\n \n }\n \n \n}\n\n\nexport type MethodsOnly<T> =\n Pick<T, { [K in keyof T]: T[K] extends Function ? K : never }[keyof T]>;\n\nexport type ValueOf<T> = T[keyof T];\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wCAA2C;AAC3C,qBAAwB;AAGxB,SAAS,cAAc;AACnB,SAAO;AACX;AAIO,IAAI,MAAW,IAAI,MAAM,OAAO,OAAO,aAAa,EAAE,SAAS,MAAM,aAAa,MAAM,CAAC,GAAG;AAAA,EAC/F,IAAI,QAAQ,MAAM;AACd,QAAI,QAAQ,OAAO,aAAa;AAC5B,aAAO,SAAU,MAAc;AAC3B,YAAI,QAAQ,UAAU;AAClB,iBAAO;AAAA,QACX;AACA,YAAI,QAAQ,UAAU;AAClB,iBAAO;AAAA,QACX;AACA,eAAO;AAAA,MACX;AAAA,IACJ;AACA,QAAI,QAAQ,YAAY;AACpB,aAAO,SAAS,WAAW;AACvB,eAAO;AAAA,MACX;AAAA,IACJ;AACA,WAAO,YAAY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AI,QAA2C;",
|
|
6
6
|
"names": ["sourceValue", "result"]
|
|
7
7
|
}
|
|
@@ -180,7 +180,8 @@ class UIRootViewController extends import_UIViewController.UIViewController {
|
|
|
180
180
|
minScale = 0.7,
|
|
181
181
|
maxScale = 1
|
|
182
182
|
} = {}) {
|
|
183
|
-
|
|
183
|
+
var _a;
|
|
184
|
+
const actualPageWidth = (_a = window.innerWidth) != null ? _a : (import_UIView.UIView.pageWidth * import_UIView.UIView.pageScale).integerValue;
|
|
184
185
|
let scale = minScale + (maxScale - minScale) * ((actualPageWidth - minScaleWidth) / (maxScaleWidth - minScaleWidth));
|
|
185
186
|
scale = Math.min(scale, maxScale);
|
|
186
187
|
scale = Math.max(scale, minScale);
|
|
@@ -192,22 +193,21 @@ class UIRootViewController extends import_UIViewController.UIViewController {
|
|
|
192
193
|
topBarHeight = 65,
|
|
193
194
|
bottomBarMinHeight = 100
|
|
194
195
|
} = {}) {
|
|
195
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
196
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
196
197
|
const bounds = this.view.bounds;
|
|
197
198
|
if (this.topBarView) {
|
|
198
199
|
this.topBarView.frame = new import_UIRectangle.UIRectangle(0, 0, topBarHeight, bounds.width);
|
|
199
200
|
}
|
|
200
|
-
this.backgroundView.style.top = "" + ((_a = this.topBarView) == null ? void 0 : _a.frame.height.integerValue);
|
|
201
|
+
this.backgroundView.style.top = "" + ((_b = (_a = this.topBarView) == null ? void 0 : _a.frame.height.integerValue) != null ? _b : 0) + "px";
|
|
201
202
|
this.backgroundView.style.width = "100%";
|
|
202
203
|
this.backgroundView.style.height = "fit-content";
|
|
203
|
-
this.backgroundView.style.minHeight = "" + (bounds.height - ((
|
|
204
|
-
const contentView = (
|
|
204
|
+
this.backgroundView.style.minHeight = "" + (bounds.height - ((_d = (_c = this.topBarView) == null ? void 0 : _c.frame.height) != null ? _d : 0) - ((_f = (_e = this.bottomBarView) == null ? void 0 : _e.frame.height) != null ? _f : 0)).integerValue + "px";
|
|
205
|
+
const contentView = (_h = (_g = this.contentViewController) == null ? void 0 : _g.view) != null ? _h : import_UIObject.nil;
|
|
205
206
|
contentView.style.position = "relative";
|
|
206
207
|
contentView.style.bottom = "0";
|
|
207
208
|
contentView.style.top = "0";
|
|
208
209
|
contentView.style.width = "100%";
|
|
209
210
|
contentView.setPaddings(import_UIObject.nil, import_UIObject.nil, paddingLength, import_UIObject.nil);
|
|
210
|
-
contentView.setNeedsLayout();
|
|
211
211
|
if (contentViewMaxWidth < this.backgroundView.bounds.width) {
|
|
212
212
|
contentView.style.marginBottom = "" + Math.min(
|
|
213
213
|
(this.backgroundView.bounds.width - contentViewMaxWidth) * 0.5,
|
|
@@ -224,7 +224,7 @@ class UIRootViewController extends import_UIViewController.UIViewController {
|
|
|
224
224
|
contentView.style.left = "";
|
|
225
225
|
contentView.style.maxWidth = "";
|
|
226
226
|
}
|
|
227
|
-
(
|
|
227
|
+
(_i = this.contentViewController) == null ? void 0 : _i._triggerLayoutViewSubviews();
|
|
228
228
|
let contentViewControllerViewHeight = contentView.intrinsicContentHeight(
|
|
229
229
|
contentView.bounds.width
|
|
230
230
|
);
|
|
@@ -235,7 +235,6 @@ class UIRootViewController extends import_UIViewController.UIViewController {
|
|
|
235
235
|
contentViewControllerViewHeight = detailsViewControllerViewHeight;
|
|
236
236
|
}
|
|
237
237
|
contentView.style.height = "" + contentViewControllerViewHeight.integerValue + "px";
|
|
238
|
-
contentView.setNeedsLayout();
|
|
239
238
|
if ((0, import_UIObject.IS)(this.detailsViewController)) {
|
|
240
239
|
contentView.style.transform = "translateX(" + 0 + "px)";
|
|
241
240
|
this.detailsViewController.view.frame = this.backgroundView.frame.rectangleWithInset(
|
|
@@ -261,7 +260,7 @@ class UIRootViewController extends import_UIViewController.UIViewController {
|
|
|
261
260
|
Math.max(bottomBarMinHeight, this.bottomBarView.intrinsicContentHeight(this.backgroundView.frame.width))
|
|
262
261
|
);
|
|
263
262
|
}
|
|
264
|
-
(0, import_UIObject.wrapInNil)(this._detailsDialogView).setMaxSizes((
|
|
263
|
+
(0, import_UIObject.wrapInNil)(this._detailsDialogView).setMaxSizes((_k = (_j = this.bottomBarView) == null ? void 0 : _j.frame.max.y) != null ? _k : 0);
|
|
265
264
|
}
|
|
266
265
|
}
|
|
267
266
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../scripts/UIRootViewController.ts"],
|
|
4
|
-
"sourcesContent": ["import { UIColor } from \"./UIColor\"\nimport { UICore } from \"./UICore\"\nimport { UIDialogView } from \"./UIDialogView\"\nimport { EXTEND, FIRST, FIRST_OR_NIL, IS, IS_NOT, LAZY_VALUE, nil, NO, UIObject, wrapInNil, YES } from \"./UIObject\"\nimport { UIRectangle } from \"./UIRectangle\"\nimport { UIRoute } from \"./UIRoute\"\nimport { UIView } from \"./UIView\"\nimport { UIViewController } from \"./UIViewController\"\n\n\nexport interface UIRootViewControllerLazyViewControllerObject<T extends typeof UIViewController> {\n instance: InstanceType<T>;\n class: T;\n shouldShow: () => (Promise<boolean> | boolean);\n isInitialized: boolean\n}\n\n\nexport interface UIRootViewControllerLazyViewControllersObject {\n [x: string]: UIRootViewControllerLazyViewControllerObject<typeof UIViewController>\n}\n\n\nexport interface UIRootViewControllerLazyContentViewControllersObject extends UIRootViewControllerLazyViewControllersObject {\n mainViewController: UIRootViewControllerLazyViewControllerObject<typeof UIViewController>\n}\n\n\nexport class UIRootViewController extends UIViewController {\n \n topBarView?: UIView\n backgroundView: UIView = new UIView(this.view.elementID + \"BackgroundView\").configuredWithObject({\n style: {\n background: \"linear-gradient(\" + UIColor.whiteColor.stringValue + \", \" + UIColor.blueColor.stringValue + \")\",\n backgroundSize: \"cover\",\n backgroundRepeat: \"no-repeat\"\n }\n })\n bottomBarView?: UIView\n \n _contentViewController?: UIViewController\n contentViewControllers: UIRootViewControllerLazyContentViewControllersObject = {\n mainViewController: this.lazyViewControllerObjectWithClass(UIViewController)\n }\n \n _detailsDialogView: UIDialogView = new UIDialogView(this.view.elementID + \"DetailsDialogView\")\n .configuredWithObject({\n dismiss: EXTEND(() => {\n const route = UIRoute.currentRoute\n this.detailsViewControllers.allValues.forEach(\n value => route.routeByRemovingComponentNamed(value.class.routeComponentName)\n )\n route.apply()\n }\n )\n })\n _detailsViewController?: UIViewController\n detailsViewControllers: UIRootViewControllerLazyViewControllersObject = {}\n \n \n constructor(view: UIView) {\n \n super(view)\n \n this.view.addSubview(this.backgroundView)\n \n }\n \n \n lazyViewControllerObjectWithClass<T extends typeof UIViewController>(\n classObject: T,\n shouldShow: () => (Promise<boolean> | boolean) = () => YES\n ): UIRootViewControllerLazyViewControllerObject<T> {\n const result: UIRootViewControllerLazyViewControllerObject<T> = {\n class: classObject,\n instance: nil,\n shouldShow: shouldShow,\n isInitialized: NO\n }\n UIObject.configureWithObject(result, {\n // @ts-ignore\n instance: LAZY_VALUE(\n () => {\n result.isInitialized = YES\n return new classObject(\n new UIView(classObject.name.replace(\"ViewController\", \"View\"))\n )\n }\n )\n })\n return result\n }\n \n \n override async handleRoute(route: UIRoute) {\n \n await super.handleRoute(route)\n \n UICore.languageService.updateCurrentLanguageKey()\n \n // Show content view\n await this.setContentViewControllerForRoute(route)\n \n await this.setDetailsViewControllerForRoute(route)\n \n }\n \n \n async setContentViewControllerForRoute(route: UIRoute) {\n const contentViewControllerObject = FIRST(\n await this.contentViewControllers.allValues.findAsyncSequential(\n async value => IS(route.componentWithViewController(value.class)) && await value.shouldShow()\n ),\n this.contentViewControllers.mainViewController\n )\n this.contentViewController = contentViewControllerObject.instance\n }\n \n async setDetailsViewControllerForRoute(route: UIRoute) {\n const detailsViewControllerObject = FIRST_OR_NIL(\n await this.detailsViewControllers.allValues.findAsyncSequential(\n async value => IS(route.componentWithViewController(value.class)) && await value.shouldShow()\n )\n )\n if (IS(route) && IS(this.detailsViewController) && IS_NOT(detailsViewControllerObject)) {\n this.detailsViewController = undefined\n this._detailsDialogView.dismiss()\n this.view.setNeedsLayout()\n return\n }\n this.detailsViewController = detailsViewControllerObject.instance\n }\n \n get contentViewController(): UIViewController | undefined {\n return this._contentViewController\n }\n \n set contentViewController(controller: UIViewController) {\n \n if (this.contentViewController == controller) {\n return\n }\n \n if (this.contentViewController) {\n this.removeChildViewController(this.contentViewController)\n }\n \n this._contentViewController = controller\n this.addChildViewControllerInContainer(controller, this.backgroundView)\n this._triggerLayoutViewSubviews()\n \n if (this.contentViewController) {\n this.contentViewController.view.style.boxShadow = \"0 3px 6px 0 rgba(0, 0, 0, 0.1)\"\n }\n \n this.view.setNeedsLayout()\n \n }\n \n \n get detailsViewController(): UIViewController | undefined {\n return this._detailsViewController\n }\n \n set detailsViewController(controller: UIViewController | undefined) {\n \n if (this.detailsViewController == controller) {\n return\n }\n \n if (IS(this.detailsViewController)) {\n this.removeChildViewController(this.detailsViewController)\n }\n \n this._detailsViewController = controller\n \n if (!IS(controller)) {\n return\n }\n \n this.addChildViewControllerInDialogView(controller, this._detailsDialogView)\n this._triggerLayoutViewSubviews()\n \n FIRST_OR_NIL(this.detailsViewController).view.style.borderRadius = \"5px\"\n \n this._detailsDialogView.showInView(this.view, YES)\n \n }\n \n updatePageScale(\n {\n minScaleWidth = 700,\n maxScaleWidth = 1500,\n minScale = 0.7,\n maxScale = 1\n } = {}\n ) {\n const actualPageWidth = (UIView.pageWidth * UIView.pageScale).integerValue\n let scale = minScale + (maxScale - minScale) *\n ((actualPageWidth - minScaleWidth) / (maxScaleWidth - minScaleWidth))\n scale = Math.min(scale, maxScale)\n scale = Math.max(scale, minScale)\n UIView.pageScale = scale\n }\n \n \n performDefaultLayout(\n {\n paddingLength = 20,\n contentViewMaxWidth = 1000,\n topBarHeight = 65,\n bottomBarMinHeight = 100\n } = {}\n ) {\n \n // View bounds\n const bounds = this.view.bounds\n \n if (this.topBarView) {\n this.topBarView.frame = new UIRectangle(0, 0, topBarHeight, bounds.width)\n }\n \n this.backgroundView.style.top = \"\" + this.topBarView?.frame.height.integerValue ?? 0 + \"px\"\n this.backgroundView.style.width = \"100%\"\n this.backgroundView.style.height = \"fit-content\"\n this.backgroundView.style.minHeight = \"\" +\n (bounds.height - (this.topBarView?.frame.height ?? 0) - (this.bottomBarView?.frame.height ?? 0)).integerValue + \"px\"\n \n const contentView = this.contentViewController?.view ?? nil\n contentView.style.position = \"relative\"\n contentView.style.bottom = \"0\"\n contentView.style.top = \"0\"\n contentView.style.width = \"100%\"\n contentView.setPaddings(nil, nil, paddingLength, nil)\n contentView.setNeedsLayout()\n \n if (contentViewMaxWidth < this.backgroundView.bounds.width) {\n \n contentView.style.marginBottom = \"\" +\n Math.min(\n (this.backgroundView.bounds.width - contentViewMaxWidth) * 0.5,\n paddingLength\n ).integerValue + \"px\"\n contentView.style.marginTop = \"\" +\n Math.min(\n (this.backgroundView.bounds.width - contentViewMaxWidth) * 0.5,\n paddingLength\n ).integerValue + \"px\"\n contentView.style.maxWidth = contentViewMaxWidth + \"px\"\n \n contentView.style.left = \"\" +\n ((this.backgroundView.bounds.width - contentView.bounds.width) * 0.5).integerValue +\n \"px\"\n \n }\n else {\n \n contentView.style.margin = \"\"\n contentView.style.left = \"\"\n contentView.style.maxWidth = \"\"\n \n }\n \n // Triggering immediate layout to ensure that the intrinsicContentHeight calculations work well\n this.contentViewController?._triggerLayoutViewSubviews()\n \n let contentViewControllerViewHeight = contentView.intrinsicContentHeight(\n contentView.bounds.width\n )\n \n const detailsViewControllerViewHeight = FIRST_OR_NIL(this.detailsViewController).view.intrinsicContentHeight(\n contentView.bounds.width)\n if (detailsViewControllerViewHeight > contentViewControllerViewHeight) {\n contentViewControllerViewHeight = detailsViewControllerViewHeight\n }\n \n \n contentView.style.height = \"\" + contentViewControllerViewHeight.integerValue + \"px\"\n contentView.setNeedsLayout()\n \n if (IS(this.detailsViewController)) {\n \n contentView.style.transform = \"translateX(\" + 0 + \"px)\"\n \n this.detailsViewController.view.frame = this.backgroundView.frame.rectangleWithInset(\n paddingLength\n ).rectangleWithWidth(\n contentView.bounds.width,\n 0.5\n ).rectangleWithHeight(\n Math.max(\n this.detailsViewController.view.intrinsicContentHeight(\n this.detailsViewController.view.bounds.width\n ),\n contentView.bounds.height\n )\n )\n \n }\n else {\n \n contentView.style.transform = \"translateX(\" + 0 + \"px)\"\n \n }\n \n if (this.bottomBarView) {\n this.bottomBarView.frame = this.backgroundView.frame.rectangleWithY(\n this.backgroundView.frame.max.y\n ).rectangleWithHeight(\n Math.max(bottomBarMinHeight, this.bottomBarView.intrinsicContentHeight(this.backgroundView.frame.width))\n )\n }\n \n \n wrapInNil(this._detailsDialogView).setMaxSizes(this.bottomBarView?.frame.max.y ?? 0)\n \n }\n \n \n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAwB;AACxB,oBAAuB;AACvB,0BAA6B;AAC7B,sBAAuG;AACvG,yBAA4B;AAC5B,qBAAwB;AACxB,oBAAuB;AACvB,8BAAiC;AAqB1B,MAAM,6BAA6B,yCAAiB;AAAA,EAgCvD,YAAY,MAAc;AAEtB,UAAM,IAAI;AA/Bd,0BAAyB,IAAI,qBAAO,KAAK,KAAK,YAAY,gBAAgB,EAAE,qBAAqB;AAAA,MAC7F,OAAO;AAAA,QACH,YAAY,qBAAqB,uBAAQ,WAAW,cAAc,OAAO,uBAAQ,UAAU,cAAc;AAAA,QACzG,gBAAgB;AAAA,QAChB,kBAAkB;AAAA,MACtB;AAAA,IACJ,CAAC;AAID,kCAA+E;AAAA,MAC3E,oBAAoB,KAAK,kCAAkC,wCAAgB;AAAA,IAC/E;AAEA,8BAAmC,IAAI,iCAAa,KAAK,KAAK,YAAY,mBAAmB,EACxF,qBAAqB;AAAA,MAClB,aAAS;AAAA,QAAO,MAAM;AACd,gBAAM,QAAQ,uBAAQ;AACtB,e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B;AAAA,IAChB,WAAW;AAAA,IACX,WAAW;AAAA,EACf,IAAI,CAAC,GACP;
|
|
4
|
+
"sourcesContent": ["import { UIColor } from \"./UIColor\"\nimport { UICore } from \"./UICore\"\nimport { UIDialogView } from \"./UIDialogView\"\nimport { EXTEND, FIRST, FIRST_OR_NIL, IS, IS_NOT, LAZY_VALUE, nil, NO, UIObject, wrapInNil, YES } from \"./UIObject\"\nimport { UIRectangle } from \"./UIRectangle\"\nimport { UIRoute } from \"./UIRoute\"\nimport { UIView } from \"./UIView\"\nimport { UIViewController } from \"./UIViewController\"\n\n\nexport interface UIRootViewControllerLazyViewControllerObject<T extends typeof UIViewController> {\n instance: InstanceType<T>;\n class: T;\n shouldShow: () => (Promise<boolean> | boolean);\n isInitialized: boolean\n}\n\n\nexport interface UIRootViewControllerLazyViewControllersObject {\n [x: string]: UIRootViewControllerLazyViewControllerObject<typeof UIViewController>\n}\n\n\nexport interface UIRootViewControllerLazyContentViewControllersObject extends UIRootViewControllerLazyViewControllersObject {\n mainViewController: UIRootViewControllerLazyViewControllerObject<typeof UIViewController>\n}\n\n\nexport class UIRootViewController extends UIViewController {\n \n topBarView?: UIView\n backgroundView: UIView = new UIView(this.view.elementID + \"BackgroundView\").configuredWithObject({\n style: {\n background: \"linear-gradient(\" + UIColor.whiteColor.stringValue + \", \" + UIColor.blueColor.stringValue + \")\",\n backgroundSize: \"cover\",\n backgroundRepeat: \"no-repeat\"\n }\n })\n bottomBarView?: UIView\n \n _contentViewController?: UIViewController\n contentViewControllers: UIRootViewControllerLazyContentViewControllersObject = {\n mainViewController: this.lazyViewControllerObjectWithClass(UIViewController)\n }\n \n _detailsDialogView: UIDialogView = new UIDialogView(this.view.elementID + \"DetailsDialogView\")\n .configuredWithObject({\n dismiss: EXTEND(() => {\n const route = UIRoute.currentRoute\n this.detailsViewControllers.allValues.forEach(\n value => route.routeByRemovingComponentNamed(value.class.routeComponentName)\n )\n route.apply()\n }\n )\n })\n _detailsViewController?: UIViewController\n detailsViewControllers: UIRootViewControllerLazyViewControllersObject = {}\n \n \n constructor(view: UIView) {\n \n super(view)\n \n this.view.addSubview(this.backgroundView)\n \n }\n \n \n lazyViewControllerObjectWithClass<T extends typeof UIViewController>(\n classObject: T,\n shouldShow: () => (Promise<boolean> | boolean) = () => YES\n ): UIRootViewControllerLazyViewControllerObject<T> {\n const result: UIRootViewControllerLazyViewControllerObject<T> = {\n class: classObject,\n instance: nil,\n shouldShow: shouldShow,\n isInitialized: NO\n }\n UIObject.configureWithObject(result, {\n // @ts-ignore\n instance: LAZY_VALUE(\n () => {\n result.isInitialized = YES\n return new classObject(\n new UIView(classObject.name.replace(\"ViewController\", \"View\"))\n )\n }\n )\n })\n return result\n }\n \n \n override async handleRoute(route: UIRoute) {\n \n await super.handleRoute(route)\n \n UICore.languageService.updateCurrentLanguageKey()\n \n // Show content view\n await this.setContentViewControllerForRoute(route)\n \n await this.setDetailsViewControllerForRoute(route)\n \n }\n \n \n async setContentViewControllerForRoute(route: UIRoute) {\n const contentViewControllerObject = FIRST(\n await this.contentViewControllers.allValues.findAsyncSequential(\n async value => IS(route.componentWithViewController(value.class)) && await value.shouldShow()\n ),\n this.contentViewControllers.mainViewController\n )\n this.contentViewController = contentViewControllerObject.instance\n }\n \n async setDetailsViewControllerForRoute(route: UIRoute) {\n const detailsViewControllerObject = FIRST_OR_NIL(\n await this.detailsViewControllers.allValues.findAsyncSequential(\n async value => IS(route.componentWithViewController(value.class)) && await value.shouldShow()\n )\n )\n if (IS(route) && IS(this.detailsViewController) && IS_NOT(detailsViewControllerObject)) {\n this.detailsViewController = undefined\n this._detailsDialogView.dismiss()\n this.view.setNeedsLayout()\n return\n }\n this.detailsViewController = detailsViewControllerObject.instance\n }\n \n get contentViewController(): UIViewController | undefined {\n return this._contentViewController\n }\n \n set contentViewController(controller: UIViewController) {\n \n if (this.contentViewController == controller) {\n return\n }\n \n if (this.contentViewController) {\n this.removeChildViewController(this.contentViewController)\n }\n \n this._contentViewController = controller\n this.addChildViewControllerInContainer(controller, this.backgroundView)\n this._triggerLayoutViewSubviews()\n \n if (this.contentViewController) {\n this.contentViewController.view.style.boxShadow = \"0 3px 6px 0 rgba(0, 0, 0, 0.1)\"\n }\n \n this.view.setNeedsLayout()\n \n }\n \n \n get detailsViewController(): UIViewController | undefined {\n return this._detailsViewController\n }\n \n set detailsViewController(controller: UIViewController | undefined) {\n \n if (this.detailsViewController == controller) {\n return\n }\n \n if (IS(this.detailsViewController)) {\n this.removeChildViewController(this.detailsViewController)\n }\n \n this._detailsViewController = controller\n \n if (!IS(controller)) {\n return\n }\n \n this.addChildViewControllerInDialogView(controller, this._detailsDialogView)\n this._triggerLayoutViewSubviews()\n \n FIRST_OR_NIL(this.detailsViewController).view.style.borderRadius = \"5px\"\n \n this._detailsDialogView.showInView(this.view, YES)\n \n }\n \n updatePageScale(\n {\n minScaleWidth = 700,\n maxScaleWidth = 1500,\n minScale = 0.7,\n maxScale = 1\n } = {}\n ) {\n const actualPageWidth = window.innerWidth ?? (UIView.pageWidth * UIView.pageScale).integerValue\n let scale = minScale + (maxScale - minScale) *\n ((actualPageWidth - minScaleWidth) / (maxScaleWidth - minScaleWidth))\n scale = Math.min(scale, maxScale)\n scale = Math.max(scale, minScale)\n UIView.pageScale = scale\n }\n \n \n performDefaultLayout(\n {\n paddingLength = 20,\n contentViewMaxWidth = 1000,\n topBarHeight = 65,\n bottomBarMinHeight = 100\n } = {}\n ) {\n \n // View bounds\n const bounds = this.view.bounds\n \n if (this.topBarView) {\n this.topBarView.frame = new UIRectangle(0, 0, topBarHeight, bounds.width)\n }\n \n this.backgroundView.style.top = \"\" + (this.topBarView?.frame.height.integerValue ?? 0) + \"px\"\n this.backgroundView.style.width = \"100%\"\n this.backgroundView.style.height = \"fit-content\"\n this.backgroundView.style.minHeight = \"\" +\n (bounds.height - (this.topBarView?.frame.height ?? 0) - (this.bottomBarView?.frame.height ?? 0)).integerValue + \"px\"\n \n const contentView: UIView = this.contentViewController?.view ?? nil\n \n //var contentViewStyleString = contentView.viewHTMLElement.style.cssText\n \n contentView.style.position = \"relative\"\n contentView.style.bottom = \"0\"\n contentView.style.top = \"0\"\n contentView.style.width = \"100%\"\n contentView.setPaddings(nil, nil, paddingLength, nil)\n \n \n if (contentViewMaxWidth < this.backgroundView.bounds.width) {\n \n contentView.style.marginBottom = \"\" +\n Math.min(\n (this.backgroundView.bounds.width - contentViewMaxWidth) * 0.5,\n paddingLength\n ).integerValue + \"px\"\n contentView.style.marginTop = \"\" +\n Math.min(\n (this.backgroundView.bounds.width - contentViewMaxWidth) * 0.5,\n paddingLength\n ).integerValue + \"px\"\n contentView.style.maxWidth = contentViewMaxWidth + \"px\"\n \n contentView.style.left = \"\" +\n ((this.backgroundView.bounds.width - contentView.bounds.width) * 0.5).integerValue +\n \"px\"\n \n }\n else {\n \n contentView.style.margin = \"\"\n contentView.style.left = \"\"\n contentView.style.maxWidth = \"\"\n \n }\n \n // if (contentViewStyleString != contentView.style.cssText) {\n //\n // contentView.setNeedsLayout()\n //\n // }\n \n \n \n // Triggering immediate layout to ensure that the intrinsicContentHeight calculations work well\n this.contentViewController?._triggerLayoutViewSubviews()\n \n let contentViewControllerViewHeight = contentView.intrinsicContentHeight(\n contentView.bounds.width\n )\n \n const detailsViewControllerViewHeight = FIRST_OR_NIL(this.detailsViewController).view.intrinsicContentHeight(\n contentView.bounds.width)\n if (detailsViewControllerViewHeight > contentViewControllerViewHeight) {\n contentViewControllerViewHeight = detailsViewControllerViewHeight\n }\n \n \n contentView.style.height = \"\" + contentViewControllerViewHeight.integerValue + \"px\"\n //contentView.setNeedsLayout()\n \n if (IS(this.detailsViewController)) {\n \n contentView.style.transform = \"translateX(\" + 0 + \"px)\"\n \n this.detailsViewController.view.frame = this.backgroundView.frame.rectangleWithInset(\n paddingLength\n ).rectangleWithWidth(\n contentView.bounds.width,\n 0.5\n ).rectangleWithHeight(\n Math.max(\n this.detailsViewController.view.intrinsicContentHeight(\n this.detailsViewController.view.bounds.width\n ),\n contentView.bounds.height\n )\n )\n \n }\n else {\n \n contentView.style.transform = \"translateX(\" + 0 + \"px)\"\n \n }\n \n if (this.bottomBarView) {\n this.bottomBarView.frame = this.backgroundView.frame.rectangleWithY(\n this.backgroundView.frame.max.y\n ).rectangleWithHeight(\n Math.max(bottomBarMinHeight, this.bottomBarView.intrinsicContentHeight(this.backgroundView.frame.width))\n )\n }\n \n \n wrapInNil(this._detailsDialogView).setMaxSizes(this.bottomBarView?.frame.max.y ?? 0)\n \n }\n \n \n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAwB;AACxB,oBAAuB;AACvB,0BAA6B;AAC7B,sBAAuG;AACvG,yBAA4B;AAC5B,qBAAwB;AACxB,oBAAuB;AACvB,8BAAiC;AAqB1B,MAAM,6BAA6B,yCAAiB;AAAA,EAgCvD,YAAY,MAAc;AAEtB,UAAM,IAAI;AA/Bd,0BAAyB,IAAI,qBAAO,KAAK,KAAK,YAAY,gBAAgB,EAAE,qBAAqB;AAAA,MAC7F,OAAO;AAAA,QACH,YAAY,qBAAqB,uBAAQ,WAAW,cAAc,OAAO,uBAAQ,UAAU,cAAc;AAAA,QACzG,gBAAgB;AAAA,QAChB,kBAAkB;AAAA,MACtB;AAAA,IACJ,CAAC;AAID,kCAA+E;AAAA,MAC3E,oBAAoB,KAAK,kCAAkC,wCAAgB;AAAA,IAC/E;AAEA,8BAAmC,IAAI,iCAAa,KAAK,KAAK,YAAY,mBAAmB,EACxF,qBAAqB;AAAA,MAClB,aAAS;AAAA,QAAO,MAAM;AACd,gBAAM,QAAQ,uBAAQ;AACtB,eAAK,uBAAuB,UAAU;AAAA,YAClC,WAAS,MAAM,8BAA8B,MAAM,MAAM,kBAAkB;AAAA,UAC/E;AACA,gBAAM,MAAM;AAAA,QAChB;AAAA,MACJ;AAAA,IACJ,CAAC;AAEL,kCAAwE,CAAC;AAOrE,SA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B,YAAmC,CAAC;AAAA,EAEvF;AAGJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -25,6 +25,7 @@ export declare class UITableView extends UINativeScrollView {
|
|
|
25
25
|
_rowIDIndex: number;
|
|
26
26
|
reloadsOnLanguageChange: boolean;
|
|
27
27
|
sidePadding: number;
|
|
28
|
+
cellWeights?: number[];
|
|
28
29
|
_persistedData: any[];
|
|
29
30
|
_needsDrawingOfVisibleRowsBeforeLayout: boolean;
|
|
30
31
|
_isDrawVisibleRowsScheduled: boolean;
|
|
@@ -161,12 +161,13 @@ class UITableView extends import_UINativeScrollView.UINativeScrollView {
|
|
|
161
161
|
_removeVisibleRows() {
|
|
162
162
|
const visibleRows = [];
|
|
163
163
|
this._visibleRows.forEach((row) => {
|
|
164
|
+
var _a;
|
|
164
165
|
this._persistedData[row._UITableViewRowIndex] = this.persistenceDataItemForRowWithIndex(
|
|
165
166
|
row._UITableViewRowIndex,
|
|
166
167
|
row
|
|
167
168
|
);
|
|
168
169
|
row.removeFromSuperview();
|
|
169
|
-
this._removedReusableViews[row._UITableViewReusabilityIdentifier].push(row);
|
|
170
|
+
(_a = this._removedReusableViews[row == null ? void 0 : row._UITableViewReusabilityIdentifier]) == null ? void 0 : _a.push(row);
|
|
170
171
|
});
|
|
171
172
|
this._visibleRows = visibleRows;
|
|
172
173
|
}
|
|
@@ -276,6 +277,7 @@ class UITableView extends import_UINativeScrollView.UINativeScrollView {
|
|
|
276
277
|
}
|
|
277
278
|
viewForRowWithIndex(rowIndex) {
|
|
278
279
|
const row = this.reusableViewForIdentifier("Row", rowIndex);
|
|
280
|
+
row._UITableViewRowIndex = rowIndex;
|
|
279
281
|
(0, import_UIObject.FIRST_OR_NIL)(row.titleLabel).text = "Row " + rowIndex;
|
|
280
282
|
return row;
|
|
281
283
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../scripts/UITableView.ts"],
|
|
4
|
-
"sourcesContent": ["import { UIButton } from \"./UIButton\"\nimport { UINativeScrollView } from \"./UINativeScrollView\"\nimport { FIRST_OR_NIL, IS, IS_DEFINED, nil, NO, YES } from \"./UIObject\"\nimport { UIPoint } from \"./UIPoint\"\nimport { UIRectangle } from \"./UIRectangle\"\nimport { UIView, UIViewBroadcastEvent } from \"./UIView\"\n\n\ninterface UITableViewRowView extends UIView {\n \n _UITableViewRowIndex?: number;\n \n}\n\n\nexport interface UITableViewReusableViewsContainerObject {\n \n [key: string]: UIView[];\n \n}\n\n\nexport interface UITableViewReusableViewPositionObject {\n \n bottomY: number;\n topY: number;\n \n isValid: boolean;\n \n}\n\n\nexport class UITableView extends UINativeScrollView {\n \n \n allRowsHaveEqualHeight: boolean = NO\n _visibleRows: UITableViewRowView[] = []\n _firstLayoutVisibleRows: UITableViewRowView[] = []\n \n _rowPositions: UITableViewReusableViewPositionObject[] = []\n \n _highestValidRowPositionIndex: number = 0\n \n _reusableViews: UITableViewReusableViewsContainerObject = {}\n \n _removedReusableViews: UITableViewReusableViewsContainerObject = {}\n \n _fullHeightView: UIView\n \n _rowIDIndex: number = 0\n \n reloadsOnLanguageChange = YES\n \n sidePadding = 0\n \n _persistedData: any[] = []\n _needsDrawingOfVisibleRowsBeforeLayout = NO\n _isDrawVisibleRowsScheduled = NO\n _shouldAnimateNextLayout?: boolean\n \n override animationDuration = 0.25\n \n \n constructor(elementID?: string) {\n \n super(elementID)\n \n this._fullHeightView = new UIView()\n this._fullHeightView.hidden = YES\n this._fullHeightView.userInteractionEnabled = NO\n this.addSubview(this._fullHeightView)\n \n this.scrollsX = NO\n \n }\n \n \n loadData() {\n \n this._persistedData = []\n \n this._calculatePositionsUntilIndex(this.numberOfRows() - 1)\n this._needsDrawingOfVisibleRowsBeforeLayout = YES\n \n this.setNeedsLayout()\n \n }\n \n reloadData() {\n \n this._removeVisibleRows()\n this._removeAllReusableRows()\n \n this._rowPositions = []\n this._highestValidRowPositionIndex = 0\n \n this.loadData()\n \n }\n \n \n highlightChanges(previousData: any[], newData: any[]) {\n \n previousData = previousData.map(dataPoint => JSON.stringify(dataPoint))\n newData = newData.map(dataPoint => JSON.stringify(dataPoint))\n \n const newIndexes: number[] = []\n \n newData.forEach((value, index) => {\n \n if (!previousData.contains(value)) {\n \n newIndexes.push(index)\n \n }\n \n })\n \n newIndexes.forEach(index => {\n \n if (this.isRowWithIndexVisible(index)) {\n this.highlightRowAsNew(this.visibleRowWithIndex(index) as UIView)\n }\n \n })\n \n }\n \n \n highlightRowAsNew(row: UIView) {\n \n \n }\n \n \n invalidateSizeOfRowWithIndex(index: number, animateChange = NO) {\n \n if (this._rowPositions[index]) {\n this._rowPositions[index].isValid = NO\n }\n \n this._highestValidRowPositionIndex = Math.min(this._highestValidRowPositionIndex, index - 1)\n \n // if (index == 0) {\n \n // this._highestValidRowPositionIndex = 0;\n \n // this._rowPositions = [];\n \n // }\n \n this._needsDrawingOfVisibleRowsBeforeLayout = YES\n \n this._shouldAnimateNextLayout = animateChange\n \n }\n \n \n _calculateAllPositions() {\n this._calculatePositionsUntilIndex(this.numberOfRows() - 1)\n }\n \n _calculatePositionsUntilIndex(maxIndex: number) {\n \n var validPositionObject = this._rowPositions[this._highestValidRowPositionIndex]\n if (!IS(validPositionObject)) {\n validPositionObject = {\n bottomY: 0,\n topY: 0,\n isValid: YES\n }\n }\n \n var previousBottomY = validPositionObject.bottomY\n \n if (!this._rowPositions.length) {\n \n this._highestValidRowPositionIndex = -1\n \n }\n \n for (var i = this._highestValidRowPositionIndex + 1; i <= maxIndex; i++) {\n \n var height: number\n \n const rowPositionObject = this._rowPositions[i]\n \n if (IS((rowPositionObject || nil).isValid)) {\n \n height = rowPositionObject.bottomY - rowPositionObject.topY\n \n }\n else {\n \n height = this.heightForRowWithIndex(i)\n \n }\n \n \n const positionObject: UITableViewReusableViewPositionObject = {\n bottomY: previousBottomY + height,\n topY: previousBottomY,\n isValid: YES\n }\n \n if (i < this._rowPositions.length) {\n this._rowPositions[i] = positionObject\n }\n else {\n this._rowPositions.push(positionObject)\n }\n this._highestValidRowPositionIndex = i\n previousBottomY = previousBottomY + height\n \n }\n \n }\n \n \n indexesForVisibleRows(paddingRatio = 0.5): number[] {\n \n const firstVisibleY = this.contentOffset.y - this.bounds.height * paddingRatio\n const lastVisibleY = firstVisibleY + this.bounds.height * (1 + paddingRatio)\n \n const numberOfRows = this.numberOfRows()\n \n if (this.allRowsHaveEqualHeight) {\n \n const rowHeight = this.heightForRowWithIndex(0)\n \n var firstIndex = firstVisibleY / rowHeight\n var lastIndex = lastVisibleY / rowHeight\n \n firstIndex = Math.trunc(firstIndex)\n lastIndex = Math.trunc(lastIndex) + 1\n \n firstIndex = Math.max(firstIndex, 0)\n lastIndex = Math.min(lastIndex, numberOfRows - 1)\n \n var result = []\n for (var i = firstIndex; i < lastIndex + 1; i++) {\n result.push(i)\n }\n return result\n }\n \n var accumulatedHeight = 0\n var result = []\n \n this._calculateAllPositions()\n \n const rowPositions = this._rowPositions\n \n for (var i = 0; i < numberOfRows; i++) {\n \n const height = rowPositions[i].bottomY - rowPositions[i].topY // this.heightForRowWithIndex(i)\n \n accumulatedHeight = accumulatedHeight + height\n if (accumulatedHeight >= firstVisibleY) {\n result.push(i)\n }\n if (accumulatedHeight >= lastVisibleY) {\n break\n }\n \n }\n \n return result\n \n }\n \n \n _removeVisibleRows() {\n \n const visibleRows: UITableViewRowView[] = []\n this._visibleRows.forEach((row: UIView) => {\n \n this._persistedData[row._UITableViewRowIndex as number] = this.persistenceDataItemForRowWithIndex(\n row._UITableViewRowIndex as number,\n row\n )\n row.removeFromSuperview()\n this._removedReusableViews[row._UITableViewReusabilityIdentifier].push(row)\n \n \n })\n this._visibleRows = visibleRows\n \n }\n \n \n _removeAllReusableRows() {\n this._reusableViews.forEach((rows: UIView[]) =>\n rows.forEach((row: UIView) => {\n \n this._persistedData[row._UITableViewRowIndex as number] = this.persistenceDataItemForRowWithIndex(\n row._UITableViewRowIndex as number,\n row\n )\n row.removeFromSuperview()\n \n this._markReusableViewAsUnused(row)\n \n })\n )\n }\n \n \n _markReusableViewAsUnused(row: UIView) {\n if (!this._removedReusableViews[row._UITableViewReusabilityIdentifier].contains(row)) {\n this._removedReusableViews[row._UITableViewReusabilityIdentifier].push(row)\n }\n }\n \n _drawVisibleRows() {\n \n if (!this.isMemberOfViewTree) {\n return\n }\n \n const visibleIndexes = this.indexesForVisibleRows()\n \n const minIndex = visibleIndexes[0]\n const maxIndex = visibleIndexes[visibleIndexes.length - 1]\n \n const removedViews: UITableViewRowView[] = []\n \n const visibleRows: UITableViewRowView[] = []\n this._visibleRows.forEach((row) => {\n if (IS_DEFINED(row._UITableViewRowIndex) && (row._UITableViewRowIndex < minIndex || row._UITableViewRowIndex > maxIndex)) {\n \n //row.removeFromSuperview();\n \n this._persistedData[row._UITableViewRowIndex] = this.persistenceDataItemForRowWithIndex(\n row._UITableViewRowIndex,\n row\n )\n \n this._removedReusableViews[row._UITableViewReusabilityIdentifier].push(row)\n \n removedViews.push(row)\n \n }\n else {\n visibleRows.push(row)\n }\n })\n this._visibleRows = visibleRows\n \n visibleIndexes.forEach((rowIndex: number) => {\n \n if (this.isRowWithIndexVisible(rowIndex)) {\n return\n }\n const view: UITableViewRowView = this.viewForRowWithIndex(rowIndex)\n //view._UITableViewRowIndex = rowIndex;\n this._firstLayoutVisibleRows.push(view)\n this._visibleRows.push(view)\n this.addSubview(view)\n \n })\n \n for (let i = 0; i < removedViews.length; i++) {\n \n const view = removedViews[i]\n if (this._visibleRows.indexOf(view) == -1) {\n \n //this._persistedData[view._UITableViewRowIndex] = this.persistenceDataItemForRowWithIndex(view._UITableViewRowIndex, view);\n view.removeFromSuperview()\n \n //this._removedReusableViews[view._UITableViewReusabilityIdentifier].push(view);\n \n }\n \n }\n \n //this.setNeedsLayout();\n \n }\n \n \n visibleRowWithIndex(rowIndex: number | undefined): UIView {\n for (var i = 0; i < this._visibleRows.length; i++) {\n const row = this._visibleRows[i]\n if (row._UITableViewRowIndex == rowIndex) {\n return row\n }\n }\n return nil\n }\n \n \n isRowWithIndexVisible(rowIndex: number) {\n return IS(this.visibleRowWithIndex(rowIndex))\n }\n \n \n reusableViewForIdentifier(identifier: string, rowIndex: number): UITableViewRowView {\n \n if (!this._removedReusableViews[identifier]) {\n this._removedReusableViews[identifier] = []\n }\n \n if (this._removedReusableViews[identifier] && this._removedReusableViews[identifier].length) {\n \n const view = this._removedReusableViews[identifier].pop() as UITableViewRowView\n view._UITableViewRowIndex = rowIndex\n Object.assign(view, this._persistedData[rowIndex] || this.defaultRowPersistenceDataItem())\n return view\n \n }\n \n if (!this._reusableViews[identifier]) {\n this._reusableViews[identifier] = []\n }\n \n const newView = this.newReusableViewForIdentifier(identifier, this._rowIDIndex) as UITableViewRowView\n this._rowIDIndex = this._rowIDIndex + 1\n \n newView._UITableViewReusabilityIdentifier = identifier\n newView._UITableViewRowIndex = rowIndex\n \n Object.assign(newView, this._persistedData[rowIndex] || this.defaultRowPersistenceDataItem())\n this._reusableViews[identifier].push(newView)\n \n return newView\n \n }\n \n \n // Functions that should be overridden to draw the correct content START\n newReusableViewForIdentifier(identifier: string, rowIDIndex: number): UIView {\n \n const view = new UIButton(this.elementID + \"Row\" + rowIDIndex)\n \n view.stopsPointerEventPropagation = NO\n view.pausesPointerEvents = NO\n \n return view\n \n }\n \n heightForRowWithIndex(index: number): number {\n return 50\n }\n \n numberOfRows() {\n return 10000\n }\n \n defaultRowPersistenceDataItem(): any {\n \n \n }\n \n persistenceDataItemForRowWithIndex(rowIndex: number, row: UIView): any {\n \n \n }\n \n viewForRowWithIndex(rowIndex: number): UITableViewRowView {\n const row = this.reusableViewForIdentifier(\"Row\", rowIndex);\n FIRST_OR_NIL((row as unknown as UIButton).titleLabel).text = \"Row \" + rowIndex\n return row\n }\n \n // Functions that should be overridden to draw the correct content END\n \n \n // Functions that trigger redrawing of the content\n override didScrollToPosition(offsetPosition: UIPoint) {\n \n super.didScrollToPosition(offsetPosition)\n \n this.forEachViewInSubtree(function (view: UIView) {\n \n view._isPointerValid = NO\n \n })\n \n if (!this._isDrawVisibleRowsScheduled) {\n \n this._isDrawVisibleRowsScheduled = YES\n \n UIView.runFunctionBeforeNextFrame(function (this: UITableView) {\n \n this._calculateAllPositions()\n \n this._drawVisibleRows()\n \n this.setNeedsLayout()\n \n this._isDrawVisibleRowsScheduled = NO\n \n }.bind(this))\n \n }\n \n }\n \n override wasAddedToViewTree() {\n this.loadData()\n }\n \n override setFrame(rectangle: UIRectangle, zIndex?: number, performUncheckedLayout?: boolean) {\n \n const frame = this.frame\n super.setFrame(rectangle, zIndex, performUncheckedLayout)\n if (frame.isEqualTo(rectangle) && !performUncheckedLayout) {\n return\n }\n \n this._needsDrawingOfVisibleRowsBeforeLayout = YES\n \n }\n \n \n override didReceiveBroadcastEvent(event: UIViewBroadcastEvent) {\n \n super.didReceiveBroadcastEvent(event)\n \n if (event.name == UIView.broadcastEventName.LanguageChanged && this.reloadsOnLanguageChange) {\n \n this.reloadData()\n \n }\n \n \n }\n \n \n private _layoutAllRows(positions = this._rowPositions) {\n \n const bounds = this.bounds\n \n this._visibleRows.forEach(row => {\n \n const frame = bounds.copy()\n \n const positionObject = positions[row._UITableViewRowIndex!]\n frame.min.y = positionObject.topY\n frame.max.y = positionObject.bottomY\n row.frame = frame\n \n row.style.width = \"\" + (bounds.width - this.sidePadding * 2).integerValue + \"px\"\n row.style.left = \"\" + this.sidePadding.integerValue + \"px\"\n \n \n })\n \n this._fullHeightView.frame = bounds.rectangleWithHeight((positions.lastElement ||\n nil).bottomY).rectangleWithWidth(bounds.width * 0.5)\n \n this._firstLayoutVisibleRows = []\n \n }\n \n private _animateLayoutAllRows() {\n \n UIView.animateViewOrViewsWithDurationDelayAndFunction(\n this._visibleRows,\n this.animationDuration,\n 0,\n undefined,\n function (this: UITableView) {\n \n this._layoutAllRows()\n \n }.bind(this),\n function (this: UITableView) {\n \n // this._calculateAllPositions()\n // this._layoutAllRows()\n \n }.bind(this)\n )\n \n }\n \n \n override layoutSubviews() {\n \n const previousPositions: UITableViewReusableViewPositionObject[] = JSON.parse(JSON.stringify(this._rowPositions))\n \n const previousVisibleRowsLength = this._visibleRows.length\n \n if (this._needsDrawingOfVisibleRowsBeforeLayout) {\n \n //this._calculateAllPositions()\n \n this._drawVisibleRows()\n \n this._needsDrawingOfVisibleRowsBeforeLayout = NO\n \n }\n \n \n super.layoutSubviews()\n \n \n if (!this.numberOfRows() || !this.isMemberOfViewTree) {\n \n return\n \n }\n \n \n if (this._shouldAnimateNextLayout) {\n \n \n // Need to do layout with the previous positions\n \n this._layoutAllRows(previousPositions)\n \n \n if (previousVisibleRowsLength < this._visibleRows.length) {\n \n \n UIView.runFunctionBeforeNextFrame(function (this: UITableView) {\n \n this._animateLayoutAllRows()\n \n }.bind(this))\n \n }\n else {\n \n this._animateLayoutAllRows()\n \n }\n \n \n this._shouldAnimateNextLayout = NO\n \n }\n else {\n \n // if (this._needsDrawingOfVisibleRowsBeforeLayout) {\n \n // this._drawVisibleRows();\n \n // this._needsDrawingOfVisibleRowsBeforeLayout = NO;\n \n // }\n \n this._calculateAllPositions()\n \n this._layoutAllRows()\n \n \n }\n \n \n }\n \n \n override intrinsicContentHeight(constrainingWidth = 0) {\n \n \n var result = 0\n \n this._calculateAllPositions()\n \n if (this._rowPositions.length) {\n \n result = this._rowPositions[this._rowPositions.length - 1].bottomY\n \n }\n \n return result\n \n }\n \n \n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAyB;AACzB,gCAAmC;AACnC,sBAA2D;AAG3D,oBAA6C;AA2BtC,MAAM,oBAAoB,6CAAmB;AAAA,
|
|
4
|
+
"sourcesContent": ["import { UIButton } from \"./UIButton\"\nimport { UINativeScrollView } from \"./UINativeScrollView\"\nimport { FIRST_OR_NIL, IS, IS_DEFINED, nil, NO, YES } from \"./UIObject\"\nimport { UIPoint } from \"./UIPoint\"\nimport { UIRectangle } from \"./UIRectangle\"\nimport { UIView, UIViewBroadcastEvent } from \"./UIView\"\n\n\ninterface UITableViewRowView extends UIView {\n \n _UITableViewRowIndex?: number;\n \n}\n\n\nexport interface UITableViewReusableViewsContainerObject {\n \n [key: string]: UIView[];\n \n}\n\n\nexport interface UITableViewReusableViewPositionObject {\n \n bottomY: number;\n topY: number;\n \n isValid: boolean;\n \n}\n\n\nexport class UITableView extends UINativeScrollView {\n \n \n allRowsHaveEqualHeight: boolean = NO\n _visibleRows: UITableViewRowView[] = []\n _firstLayoutVisibleRows: UITableViewRowView[] = []\n \n _rowPositions: UITableViewReusableViewPositionObject[] = []\n \n _highestValidRowPositionIndex: number = 0\n \n _reusableViews: UITableViewReusableViewsContainerObject = {}\n _removedReusableViews: UITableViewReusableViewsContainerObject = {}\n \n _fullHeightView: UIView\n _rowIDIndex: number = 0\n reloadsOnLanguageChange = YES\n sidePadding = 0\n\n cellWeights?: number[]\n \n _persistedData: any[] = []\n _needsDrawingOfVisibleRowsBeforeLayout = NO\n _isDrawVisibleRowsScheduled = NO\n _shouldAnimateNextLayout?: boolean\n \n override animationDuration = 0.25\n \n \n constructor(elementID?: string) {\n \n super(elementID)\n \n this._fullHeightView = new UIView()\n this._fullHeightView.hidden = YES\n this._fullHeightView.userInteractionEnabled = NO\n this.addSubview(this._fullHeightView)\n \n this.scrollsX = NO\n \n }\n \n \n loadData() {\n \n this._persistedData = []\n \n this._calculatePositionsUntilIndex(this.numberOfRows() - 1)\n this._needsDrawingOfVisibleRowsBeforeLayout = YES\n \n this.setNeedsLayout()\n \n }\n \n reloadData() {\n \n this._removeVisibleRows()\n this._removeAllReusableRows()\n \n this._rowPositions = []\n this._highestValidRowPositionIndex = 0\n \n this.loadData()\n \n }\n \n \n highlightChanges(previousData: any[], newData: any[]) {\n \n previousData = previousData.map(dataPoint => JSON.stringify(dataPoint))\n newData = newData.map(dataPoint => JSON.stringify(dataPoint))\n \n const newIndexes: number[] = []\n \n newData.forEach((value, index) => {\n \n if (!previousData.contains(value)) {\n \n newIndexes.push(index)\n \n }\n \n })\n \n newIndexes.forEach(index => {\n \n if (this.isRowWithIndexVisible(index)) {\n this.highlightRowAsNew(this.visibleRowWithIndex(index) as UIView)\n }\n \n })\n \n }\n \n \n highlightRowAsNew(row: UIView) {\n \n \n }\n \n \n invalidateSizeOfRowWithIndex(index: number, animateChange = NO) {\n \n if (this._rowPositions[index]) {\n this._rowPositions[index].isValid = NO\n }\n \n this._highestValidRowPositionIndex = Math.min(this._highestValidRowPositionIndex, index - 1)\n \n // if (index == 0) {\n \n // this._highestValidRowPositionIndex = 0;\n \n // this._rowPositions = [];\n \n // }\n \n this._needsDrawingOfVisibleRowsBeforeLayout = YES\n \n this._shouldAnimateNextLayout = animateChange\n \n }\n \n \n _calculateAllPositions() {\n this._calculatePositionsUntilIndex(this.numberOfRows() - 1)\n }\n \n _calculatePositionsUntilIndex(maxIndex: number) {\n \n var validPositionObject = this._rowPositions[this._highestValidRowPositionIndex]\n if (!IS(validPositionObject)) {\n validPositionObject = {\n bottomY: 0,\n topY: 0,\n isValid: YES\n }\n }\n \n var previousBottomY = validPositionObject.bottomY\n \n if (!this._rowPositions.length) {\n \n this._highestValidRowPositionIndex = -1\n \n }\n \n for (var i = this._highestValidRowPositionIndex + 1; i <= maxIndex; i++) {\n \n var height: number\n \n const rowPositionObject = this._rowPositions[i]\n \n if (IS((rowPositionObject || nil).isValid)) {\n \n height = rowPositionObject.bottomY - rowPositionObject.topY\n \n }\n else {\n \n height = this.heightForRowWithIndex(i)\n \n }\n \n \n const positionObject: UITableViewReusableViewPositionObject = {\n bottomY: previousBottomY + height,\n topY: previousBottomY,\n isValid: YES\n }\n \n if (i < this._rowPositions.length) {\n this._rowPositions[i] = positionObject\n }\n else {\n this._rowPositions.push(positionObject)\n }\n this._highestValidRowPositionIndex = i\n previousBottomY = previousBottomY + height\n \n }\n \n }\n \n \n indexesForVisibleRows(paddingRatio = 0.5): number[] {\n \n const firstVisibleY = this.contentOffset.y - this.bounds.height * paddingRatio\n const lastVisibleY = firstVisibleY + this.bounds.height * (1 + paddingRatio)\n \n const numberOfRows = this.numberOfRows()\n \n if (this.allRowsHaveEqualHeight) {\n \n const rowHeight = this.heightForRowWithIndex(0)\n \n var firstIndex = firstVisibleY / rowHeight\n var lastIndex = lastVisibleY / rowHeight\n \n firstIndex = Math.trunc(firstIndex)\n lastIndex = Math.trunc(lastIndex) + 1\n \n firstIndex = Math.max(firstIndex, 0)\n lastIndex = Math.min(lastIndex, numberOfRows - 1)\n \n var result = []\n for (var i = firstIndex; i < lastIndex + 1; i++) {\n result.push(i)\n }\n return result\n }\n \n var accumulatedHeight = 0\n var result = []\n \n this._calculateAllPositions()\n \n const rowPositions = this._rowPositions\n \n for (var i = 0; i < numberOfRows; i++) {\n \n const height = rowPositions[i].bottomY - rowPositions[i].topY // this.heightForRowWithIndex(i)\n \n accumulatedHeight = accumulatedHeight + height\n if (accumulatedHeight >= firstVisibleY) {\n result.push(i)\n }\n if (accumulatedHeight >= lastVisibleY) {\n break\n }\n \n }\n \n return result\n \n }\n \n \n _removeVisibleRows() {\n \n const visibleRows: UITableViewRowView[] = []\n this._visibleRows.forEach((row: UIView) => {\n \n this._persistedData[row._UITableViewRowIndex as number] = this.persistenceDataItemForRowWithIndex(\n row._UITableViewRowIndex as number,\n row\n )\n row.removeFromSuperview()\n this._removedReusableViews[row?._UITableViewReusabilityIdentifier]?.push(row)\n \n \n })\n this._visibleRows = visibleRows\n \n }\n \n \n _removeAllReusableRows() {\n this._reusableViews.forEach((rows: UIView[]) =>\n rows.forEach((row: UIView) => {\n \n this._persistedData[row._UITableViewRowIndex as number] = this.persistenceDataItemForRowWithIndex(\n row._UITableViewRowIndex as number,\n row\n )\n row.removeFromSuperview()\n \n this._markReusableViewAsUnused(row)\n \n })\n )\n }\n \n \n _markReusableViewAsUnused(row: UIView) {\n if (!this._removedReusableViews[row._UITableViewReusabilityIdentifier].contains(row)) {\n this._removedReusableViews[row._UITableViewReusabilityIdentifier].push(row)\n }\n }\n \n _drawVisibleRows() {\n \n if (!this.isMemberOfViewTree) {\n return\n }\n \n const visibleIndexes = this.indexesForVisibleRows()\n \n const minIndex = visibleIndexes[0]\n const maxIndex = visibleIndexes[visibleIndexes.length - 1]\n \n const removedViews: UITableViewRowView[] = []\n \n const visibleRows: UITableViewRowView[] = []\n this._visibleRows.forEach((row) => {\n if (IS_DEFINED(row._UITableViewRowIndex) && (row._UITableViewRowIndex < minIndex || row._UITableViewRowIndex > maxIndex)) {\n \n //row.removeFromSuperview();\n \n this._persistedData[row._UITableViewRowIndex] = this.persistenceDataItemForRowWithIndex(\n row._UITableViewRowIndex,\n row\n )\n \n this._removedReusableViews[row._UITableViewReusabilityIdentifier].push(row)\n \n removedViews.push(row)\n \n }\n else {\n visibleRows.push(row)\n }\n })\n this._visibleRows = visibleRows\n \n visibleIndexes.forEach((rowIndex: number) => {\n \n if (this.isRowWithIndexVisible(rowIndex)) {\n return\n }\n const view: UITableViewRowView = this.viewForRowWithIndex(rowIndex)\n //view._UITableViewRowIndex = rowIndex;\n this._firstLayoutVisibleRows.push(view)\n this._visibleRows.push(view)\n this.addSubview(view)\n \n })\n \n for (let i = 0; i < removedViews.length; i++) {\n \n const view = removedViews[i]\n if (this._visibleRows.indexOf(view) == -1) {\n \n //this._persistedData[view._UITableViewRowIndex] = this.persistenceDataItemForRowWithIndex(view._UITableViewRowIndex, view);\n view.removeFromSuperview()\n \n //this._removedReusableViews[view._UITableViewReusabilityIdentifier].push(view);\n \n }\n \n }\n \n //this.setNeedsLayout();\n \n }\n \n \n visibleRowWithIndex(rowIndex: number | undefined): UIView {\n for (var i = 0; i < this._visibleRows.length; i++) {\n const row = this._visibleRows[i]\n if (row._UITableViewRowIndex == rowIndex) {\n return row\n }\n }\n return nil\n }\n \n \n isRowWithIndexVisible(rowIndex: number) {\n return IS(this.visibleRowWithIndex(rowIndex))\n }\n \n \n reusableViewForIdentifier(identifier: string, rowIndex: number): UITableViewRowView {\n \n if (!this._removedReusableViews[identifier]) {\n this._removedReusableViews[identifier] = []\n }\n \n if (this._removedReusableViews[identifier] && this._removedReusableViews[identifier].length) {\n \n const view = this._removedReusableViews[identifier].pop() as UITableViewRowView\n view._UITableViewRowIndex = rowIndex\n Object.assign(view, this._persistedData[rowIndex] || this.defaultRowPersistenceDataItem())\n return view\n \n }\n \n if (!this._reusableViews[identifier]) {\n this._reusableViews[identifier] = []\n }\n \n const newView = this.newReusableViewForIdentifier(identifier, this._rowIDIndex) as UITableViewRowView\n this._rowIDIndex = this._rowIDIndex + 1\n \n newView._UITableViewReusabilityIdentifier = identifier\n newView._UITableViewRowIndex = rowIndex\n \n Object.assign(newView, this._persistedData[rowIndex] || this.defaultRowPersistenceDataItem())\n this._reusableViews[identifier].push(newView)\n \n return newView\n \n }\n \n \n // Functions that should be overridden to draw the correct content START\n newReusableViewForIdentifier(identifier: string, rowIDIndex: number): UIView {\n \n const view = new UIButton(this.elementID + \"Row\" + rowIDIndex)\n \n view.stopsPointerEventPropagation = NO\n view.pausesPointerEvents = NO\n \n return view\n \n }\n \n heightForRowWithIndex(index: number): number {\n return 50\n }\n \n numberOfRows() {\n return 10000\n }\n \n defaultRowPersistenceDataItem(): any {\n \n \n }\n \n persistenceDataItemForRowWithIndex(rowIndex: number, row: UIView): any {\n \n \n }\n \n viewForRowWithIndex(rowIndex: number): UITableViewRowView {\n const row = this.reusableViewForIdentifier(\"Row\", rowIndex);\n row._UITableViewRowIndex = rowIndex\n FIRST_OR_NIL((row as unknown as UIButton).titleLabel).text = \"Row \" + rowIndex\n return row\n }\n \n // Functions that should be overridden to draw the correct content END\n \n \n // Functions that trigger redrawing of the content\n override didScrollToPosition(offsetPosition: UIPoint) {\n \n super.didScrollToPosition(offsetPosition)\n \n this.forEachViewInSubtree(function (view: UIView) {\n \n view._isPointerValid = NO\n \n })\n \n if (!this._isDrawVisibleRowsScheduled) {\n \n this._isDrawVisibleRowsScheduled = YES\n \n UIView.runFunctionBeforeNextFrame(function (this: UITableView) {\n \n this._calculateAllPositions()\n \n this._drawVisibleRows()\n \n this.setNeedsLayout()\n \n this._isDrawVisibleRowsScheduled = NO\n \n }.bind(this))\n \n }\n \n }\n \n override wasAddedToViewTree() {\n this.loadData()\n }\n \n override setFrame(rectangle: UIRectangle, zIndex?: number, performUncheckedLayout?: boolean) {\n \n const frame = this.frame\n super.setFrame(rectangle, zIndex, performUncheckedLayout)\n if (frame.isEqualTo(rectangle) && !performUncheckedLayout) {\n return\n }\n \n this._needsDrawingOfVisibleRowsBeforeLayout = YES\n \n }\n \n \n override didReceiveBroadcastEvent(event: UIViewBroadcastEvent) {\n \n super.didReceiveBroadcastEvent(event)\n \n if (event.name == UIView.broadcastEventName.LanguageChanged && this.reloadsOnLanguageChange) {\n \n this.reloadData()\n \n }\n \n \n }\n \n \n private _layoutAllRows(positions = this._rowPositions) {\n \n const bounds = this.bounds\n \n this._visibleRows.forEach(row => {\n \n const frame = bounds.copy()\n \n const positionObject = positions[row._UITableViewRowIndex!]\n frame.min.y = positionObject.topY\n frame.max.y = positionObject.bottomY\n row.frame = frame\n \n row.style.width = \"\" + (bounds.width - this.sidePadding * 2).integerValue + \"px\"\n row.style.left = \"\" + this.sidePadding.integerValue + \"px\"\n \n \n })\n \n this._fullHeightView.frame = bounds.rectangleWithHeight((positions.lastElement ||\n nil).bottomY).rectangleWithWidth(bounds.width * 0.5)\n \n this._firstLayoutVisibleRows = []\n \n }\n \n private _animateLayoutAllRows() {\n \n UIView.animateViewOrViewsWithDurationDelayAndFunction(\n this._visibleRows,\n this.animationDuration,\n 0,\n undefined,\n function (this: UITableView) {\n \n this._layoutAllRows()\n \n }.bind(this),\n function (this: UITableView) {\n \n // this._calculateAllPositions()\n // this._layoutAllRows()\n \n }.bind(this)\n )\n \n }\n \n \n override layoutSubviews() {\n \n const previousPositions: UITableViewReusableViewPositionObject[] = JSON.parse(JSON.stringify(this._rowPositions))\n \n const previousVisibleRowsLength = this._visibleRows.length\n \n if (this._needsDrawingOfVisibleRowsBeforeLayout) {\n \n //this._calculateAllPositions()\n \n this._drawVisibleRows()\n \n this._needsDrawingOfVisibleRowsBeforeLayout = NO\n \n }\n \n \n super.layoutSubviews()\n \n \n if (!this.numberOfRows() || !this.isMemberOfViewTree) {\n \n return\n \n }\n \n \n if (this._shouldAnimateNextLayout) {\n \n \n // Need to do layout with the previous positions\n \n this._layoutAllRows(previousPositions)\n \n \n if (previousVisibleRowsLength < this._visibleRows.length) {\n \n \n UIView.runFunctionBeforeNextFrame(function (this: UITableView) {\n \n this._animateLayoutAllRows()\n \n }.bind(this))\n \n }\n else {\n \n this._animateLayoutAllRows()\n \n }\n \n \n this._shouldAnimateNextLayout = NO\n \n }\n else {\n \n // if (this._needsDrawingOfVisibleRowsBeforeLayout) {\n \n // this._drawVisibleRows();\n \n // this._needsDrawingOfVisibleRowsBeforeLayout = NO;\n \n // }\n \n this._calculateAllPositions()\n \n this._layoutAllRows()\n \n \n }\n \n \n }\n \n \n override intrinsicContentHeight(constrainingWidth = 0) {\n \n \n var result = 0\n \n this._calculateAllPositions()\n \n if (this._rowPositions.length) {\n \n result = this._rowPositions[this._rowPositions.length - 1].bottomY\n \n }\n \n return result\n \n }\n \n \n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAyB;AACzB,gCAAmC;AACnC,sBAA2D;AAG3D,oBAA6C;AA2BtC,MAAM,oBAAoB,6CAAmB;AAAA,EA6BhD,YAAY,WAAoB;AAE5B,UAAM,SAAS;AA5BnB,kCAAkC;AAClC,wBAAqC,CAAC;AACtC,mCAAgD,CAAC;AAEjD,yBAAyD,CAAC;AAE1D,yCAAwC;AAExC,0BAA0D,CAAC;AAC3D,iCAAiE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