uicore-ts 1.0.145 → 1.0.152

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.
@@ -61,9 +61,9 @@ export declare class UIObject {
61
61
  static valueForKeyPath(keyPath: string, object: any): any;
62
62
  setValueForKeyPath(keyPath: string, value: any, createPath?: boolean): boolean;
63
63
  static setValueForKeyPath(keyPath: string, value: any, currentObject: any, createPath: boolean): boolean;
64
- configureWithObject(object: UIInitializerObject<this>): {};
64
+ configureWithObject(object: UIInitializerObject<this>): UIInitializerObject<this>;
65
65
  configuredWithObject(object: UIInitializerObject<this>): this;
66
- static configureWithObject<T extends object>(configurationTarget: T, object: UIInitializerObject<T>): {};
66
+ static configureWithObject<TargetObjectType extends object, ConfigurationObjectType extends UIInitializerObject<TargetObjectType>>(configurationTarget: TargetObjectType, object: ConfigurationObjectType): ConfigurationObjectType;
67
67
  static configuredWithObject<T extends object>(configurationTarget: T, object: UIInitializerObject<T>): T;
68
68
  performFunctionWithSelf<T>(functionToPerform: (self: this) => T): T;
69
69
  performingFunctionWithSelf(functionToPerform: (self: this) => void): this;
@@ -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\"\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 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(keyPath: string): any {\n return UIObject.valueForKeyPath(keyPath, this)\n }\n \n static valueForKeyPath(keyPath: string, object: any): any {\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 = nil\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<T extends object>(configurationTarget: T, object: UIInitializerObject<T>) {\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 = {}\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, value), 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 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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S,mBAAmB;AACnE,YAAI,UAAU;AACV,gBAAM,aAAa,QAAQ,YAAY,GAAG;AAC1C,gBAAM,aAAa,SAAS,gBAAgB,QAAQ,UAAU,GAAG,UAAU,GAAG,mBAAmB;AACjG,UAAAA,UAASA,QAAO,KAAK,UAAU;AAAA,QACnC;AACA,eAAOA;AAAA,MACX;AAEA,UAAI,iBAAiB,qBAAqB;AACtC,cAAM,aAAa,QAAQ,YAAY,GAAG;AAC1C,cAAM,aAAa,SAAS,gBAAgB,QAAQ,UAAU,GAAG,UAAU,GAAG,mBAAmB;AACjG,cAAM,MAAM,QAAQ,UAAU,aAAa,CAAC;AAC5C,cAAM,qBAAqB,KAAK,UAAU;AAC1C;AAAA,MACJ;AAEA,UAAI,iBAAiB,gBAAgB;AACjC,cAAM,aAAa,kBAAkB,GAAG,CAAC;AACzC;AAAA,MACJ;AAEA,UAAI,iBAAiB,oBAAoB;AACrC,gBAAQ,MAAM,iBAAiB,kBAAkB,CAAC;AAAA,MACtD;AAEA,eAAS,mBAAmB,SAAS,SAAS,gBAAgB,SAAS,KAAK,GAAG,QAAQ,GAAG;AAC1F,eAAS,mBAAmB,SAAS,OAAO,qBAAqB,GAAG;AAAA,IAExE,CAAC;AAGD,WAAO;AAAA,EAEX;AAAA,EAEA,OAAO,qBAAuC,qBAAwB,QAAgC;AAClG,SAAK,oBAAoB,qBAAqB,MAAM;AACpD,WAAO;AAAA,EACX;AAAA,EAGA,wBAA2B,mBAAyC;AAChE,WAAO,kBAAkB,IAAI;AAAA,EACjC;AAAA,EAEA,2BAA2B,mBAA+C;AACtE,sBAAkB,IAAI;AACtB,WAAO;AAAA,EACX;AAAA,EAEA,yBAAyB,OAAe,gBAA0B;AAE9D,QAAI,uBAAQ,OAAO,IAAI,cAAc;AAAA,EAEzC;AAGJ;",
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})\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 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(keyPath: string): any {\n return UIObject.valueForKeyPath(keyPath, this)\n }\n \n static valueForKeyPath(keyPath: string, object: any): any {\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 = nil\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, value), 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 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\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;AAAA,EACvB;AAAA,EACA,MAAM;AACF,WAAO,YAAY;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BAAwB,QAAgC;AAClG,SAAK,oBAAoB,qBAAqB,MAAM;AACpD,WAAO;AAAA,EACX;AAAA,EAGA,wBAA2B,mBAAyC;AAChE,WAAO,kBAAkB,IAAI;AAAA,EACjC;AAAA,EAEA,2BAA2B,mBAA+C;AACtE,sBAAkB,IAAI;AACtB,WAAO;AAAA,EACX;AAAA,EAEA,yBAAyB,OAAe,gBAA0B;AAE9D,QAAI,uBAAQ,OAAO,IAAI,cAAc;AAAA,EAEzC;AAGJ;",
6
6
  "names": ["sourceValue", "result"]
7
7
  }
@@ -267,7 +267,7 @@ export declare class UIView extends UIObject {
267
267
  wasAddedToViewTree(): void;
268
268
  wasRemovedFromViewTree(): void;
269
269
  get isMemberOfViewTree(): boolean;
270
- get allSuperviews(): UIView[];
270
+ get withAllSuperviews(): UIView[];
271
271
  setNeedsLayoutOnAllSuperviews(): void;
272
272
  setNeedsLayoutUpToRootView(): void;
273
273
  focus(): void;
@@ -258,7 +258,7 @@ const _UIView = class extends import_UIObject.UIObject {
258
258
  }
259
259
  get propertyDescriptors() {
260
260
  let result = [];
261
- this.allSuperviews.forEach((view) => {
261
+ this.withAllSuperviews.forEach((view) => {
262
262
  (0, import_UIObject.FIRST_OR_NIL)(view.viewController).forEach((value, key, stopLooping) => {
263
263
  if (this == value) {
264
264
  result.push({ object: view.viewController, name: key });
@@ -1007,7 +1007,7 @@ const _UIView = class extends import_UIObject.UIObject {
1007
1007
  }
1008
1008
  return import_UIObject.NO;
1009
1009
  }
1010
- get allSuperviews() {
1010
+ get withAllSuperviews() {
1011
1011
  const result = [];
1012
1012
  let view = this;
1013
1013
  for (let i = 0; (0, import_UIObject.IS)(view); i = i) {
@@ -1017,7 +1017,7 @@ const _UIView = class extends import_UIObject.UIObject {
1017
1017
  return result;
1018
1018
  }
1019
1019
  setNeedsLayoutOnAllSuperviews() {
1020
- this.allSuperviews.reverse().everyElement.setNeedsLayout();
1020
+ this.withAllSuperviews.reverse().everyElement.setNeedsLayout();
1021
1021
  }
1022
1022
  setNeedsLayoutUpToRootView() {
1023
1023
  this.setNeedsLayoutOnAllSuperviews();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../scripts/UIView.ts"],
4
- "sourcesContent": ["import { IS_FIREFOX, IS_SAFARI } from \"./ClientCheckers\"\nimport { UIColor } from \"./UIColor\"\nimport { UICore } from \"./UICore\"\nimport \"./UICoreExtensions\"\nimport type { UIDialogView } from \"./UIDialogView\"\nimport { UILocalizedTextObject } from \"./UIInterfaces\"\nimport { FIRST, FIRST_OR_NIL, IS, IS_DEFINED, IS_NIL, IS_NOT, nil, NO, UIObject, YES } from \"./UIObject\"\nimport { UIPoint } from \"./UIPoint\"\nimport { UIRectangle } from \"./UIRectangle\"\nimport { UIViewController } from \"./UIViewController\"\n\n\ndeclare module AutoLayout {\n \n \n class Constraint {\n \n [key: string]: any\n \n }\n \n \n class View {\n \n [key: string]: any\n \n }\n \n \n class VisualFormat {\n \n static parse(arg0: any, arg1: any): any;\n \n [key: string]: any\n \n }\n \n \n enum Attribute {\n \n LEFT, RIGHT, BOTTOM, TOP, CENTERX, CENTERY, WIDTH, HEIGHT, ZINDEX, VARIABLE, NOTANATTRIBUTE\n \n }\n \n \n enum Relation {\n \n EQU, LEQ, GEQ\n \n }\n \n \n}\n\n// @ts-ignore\nif (!window.AutoLayout) {\n \n // @ts-ignore\n window.AutoLayout = nil\n \n}\n\n\nexport interface LooseObject {\n [key: string]: any\n}\n\n\nexport interface ControlEventTargetsObject {\n \n [key: string]: Function[];\n \n}\n\n\nexport interface UIViewBroadcastEvent {\n \n name: string;\n parameters: {\n [key: string]: string | string[];\n }\n \n}\n\n\nexport type UIViewAddControlEventTargetObject<T extends { controlEvent: Record<string, any> }> = {\n \n [K in keyof T[\"controlEvent\"]]: ((\n sender: UIView,\n event: Event\n) => void) & Partial<UIViewAddControlEventTargetObject<T>>\n\n}\n\n\ninterface Constraint {\n constant: number;\n multiplier: number;\n view1: any;\n attr2: any;\n priority: number;\n attr1: any;\n view2: any;\n relation: any\n}\n\n\nexport class UIView extends UIObject {\n \n _nativeSelectionEnabled: boolean = YES\n _shouldLayout?: boolean\n _UITableViewRowIndex?: number\n _UITableViewReusabilityIdentifier: any\n _UIViewIntrinsicTemporaryWidth?: string\n _UIViewIntrinsicTemporaryHeight?: string\n _enabled: boolean = YES\n _frame?: UIRectangle & { zIndex?: number }\n _backgroundColor: UIColor = UIColor.transparentColor\n \n _viewHTMLElement!: HTMLElement & LooseObject\n \n // Dynamic innerHTML\n _innerHTMLKey?: string\n _defaultInnerHTML?: string\n _parameters?: { [x: string]: (string | UILocalizedTextObject) }\n \n _localizedTextObject?: UILocalizedTextObject = nil\n \n _controlEventTargets: ControlEventTargetsObject = {} //{ \"PointerDown\": Function[]; \"PointerMove\": Function[]; \"PointerLeave\": Function[]; \"PointerEnter\": Function[]; \"PointerUpInside\": Function[]; \"PointerUp\": Function[]; \"PointerHover\": Function[]; };\n _frameTransform: string\n viewController: UIViewController = nil\n _updateLayoutFunction: any = nil\n // @ts-ignore\n _constraints: any[] //AutoLayout.Constraint[];\n superview: UIView\n subviews: UIView[]\n _styleClasses: any[]\n _isHidden: boolean = NO\n \n pausesPointerEvents: boolean = NO\n stopsPointerEventPropagation: boolean = YES\n pointerDraggingPoint: UIPoint = new UIPoint(0, 0)\n _previousClientPoint: UIPoint = new UIPoint(0, 0)\n _isPointerInside?: boolean\n _isPointerValid?: boolean\n _isPointerDown = NO\n _initialPointerPosition?: UIPoint\n _hasPointerDragged?: boolean\n _pointerDragThreshold = 2\n \n ignoresTouches: boolean = NO\n ignoresMouse: boolean = NO\n \n core: UICore = UICore.main\n \n static _UIViewIndex: number = -1\n _UIViewIndex: number\n \n static _viewsToLayout: UIView[] = []\n \n forceIntrinsicSizeZero: boolean = NO\n _touchEventTime?: number\n \n static _pageScale = 1\n _scale: number = 1\n isInternalScaling: boolean = YES\n private _resizeObserver!: ResizeObserver\n \n constructor(\n elementID: string = (\"UIView\" + UIView.nextIndex),\n viewHTMLElement: HTMLElement & LooseObject | null = null,\n elementType: string | null = null,\n initViewData?: any\n ) {\n \n super()\n \n // Instance variables\n \n UIView._UIViewIndex = UIView.nextIndex\n this._UIViewIndex = UIView._UIViewIndex\n \n this._styleClasses = []\n \n this._initViewHTMLElement(elementID, viewHTMLElement, elementType)\n \n this.subviews = []\n this.superview = nil\n \n this._constraints = []\n this._updateLayoutFunction = nil\n \n \n this._frameTransform = \"\"\n \n this._initViewCSSSelectorsIfNeeded()\n \n this._loadUIEvents()\n this.setNeedsLayout()\n \n }\n \n \n static get nextIndex() {\n return UIView._UIViewIndex + 1\n }\n \n static get pageHeight() {\n const body = document.body\n const html = document.documentElement\n return Math.max(\n body.scrollHeight,\n body.offsetHeight,\n html.clientHeight,\n html.scrollHeight,\n html.offsetHeight\n )\n }\n \n static get pageWidth() {\n const body = document.body\n const html = document.documentElement\n return Math.max(body.scrollWidth, body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth)\n }\n \n \n centerInContainer() {\n this.style.left = \"50%\"\n this.style.top = \"50%\"\n this.style.transform = \"translateX(-50%) translateY(-50%)\"\n }\n \n centerXInContainer() {\n this.style.left = \"50%\"\n this.style.transform = \"translateX(-50%)\"\n }\n \n centerYInContainer() {\n this.style.top = \"50%\"\n this.style.transform = \"translateY(-50%)\"\n }\n \n \n _initViewHTMLElement(\n elementID: string,\n viewHTMLElement: (HTMLElement & LooseObject) | null,\n elementType?: string | null\n ) {\n \n if (!IS(elementType)) {\n elementType = \"div\"\n }\n \n if (!IS(viewHTMLElement)) {\n \n this._viewHTMLElement = this.createElement(elementID, elementType)\n \n this.style.position = \"absolute\"\n this.style.margin = \"0\"\n \n }\n else {\n \n this._viewHTMLElement = viewHTMLElement\n \n }\n \n if (IS(elementID)) {\n this.viewHTMLElement.id = elementID\n }\n \n this.viewHTMLElement.obeyAutolayout = YES\n this.viewHTMLElement.UIView = this\n this.addStyleClass(this.styleClassName)\n \n this._resizeObserver = new ResizeObserver(() => this.setNeedsLayout())\n this._resizeObserver.observe(this.viewHTMLElement)\n \n }\n \n \n set nativeSelectionEnabled(selectable: boolean) {\n this._nativeSelectionEnabled = selectable\n if (!selectable) {\n this.style.cssText = this.style.cssText +\n \" -webkit-touch-callout: none; -webkit-user-select: none; \" +\n \"-khtml-user-select: none; -moz-user-select: none; \" +\n \"-ms-user-select: none; user-select: none;\"\n }\n else {\n this.style.cssText = this.style.cssText +\n \" -webkit-touch-callout: text; -webkit-user-select: text; \" +\n \"-khtml-user-select: text; -moz-user-select: text; \" +\n \"-ms-user-select: text; user-select: text;\"\n }\n }\n \n \n get nativeSelectionEnabled() {\n return this._nativeSelectionEnabled\n }\n \n \n get styleClassName() {\n return \"UICore_UIView_\" + this.class.name\n }\n \n protected _initViewCSSSelectorsIfNeeded() {\n if (!this.class._areViewCSSSelectorsInitialized) {\n this.initViewStyleSelectors()\n this.class._areViewCSSSelectorsInitialized = YES\n }\n }\n \n initViewStyleSelectors() {\n \n // Override this in a subclass\n \n }\n \n initStyleSelector(selector: string, style: string) {\n const styleRules = UIView.getStyleRules(selector)\n if (!styleRules) {\n UIView.createStyleSelector(selector, style)\n }\n }\n \n \n createElement(elementID: string, elementType: string) {\n let result = document.getElementById(elementID)\n if (!result) {\n result = document.createElement(elementType)\n }\n return result\n }\n \n public get viewHTMLElement() {\n return this._viewHTMLElement\n }\n \n public get elementID() {\n return this.viewHTMLElement.id\n }\n \n \n setInnerHTML(key: string, defaultString: string, parameters?: { [x: string]: string | UILocalizedTextObject }) {\n \n this._innerHTMLKey = key\n this._defaultInnerHTML = defaultString\n this._parameters = parameters\n \n const languageName = UICore.languageService.currentLanguageKey\n const result = UICore.languageService.stringForKey(key, languageName, defaultString, parameters)\n \n this.innerHTML = result ?? \"\"\n \n }\n \n \n protected _setInnerHTMLFromKeyIfPossible() {\n if (this._innerHTMLKey && this._defaultInnerHTML) {\n this.setInnerHTML(this._innerHTMLKey, this._defaultInnerHTML, this._parameters)\n }\n }\n \n protected _setInnerHTMLFromLocalizedTextObjectIfPossible() {\n if (IS(this._localizedTextObject)) {\n this.innerHTML = UICore.languageService.stringForCurrentLanguage(this._localizedTextObject)\n }\n }\n \n \n get localizedTextObject() {\n return this._localizedTextObject\n }\n \n set localizedTextObject(localizedTextObject: UILocalizedTextObject | undefined) {\n this._localizedTextObject = localizedTextObject\n this._setInnerHTMLFromLocalizedTextObjectIfPossible()\n }\n \n \n get innerHTML() {\n return this.viewHTMLElement.innerHTML\n }\n \n \n set innerHTML(innerHTML) {\n if (this.innerHTML != innerHTML) {\n this.viewHTMLElement.innerHTML = FIRST(innerHTML, \"\")\n }\n }\n \n \n set hoverText(hoverText: string) {\n this.viewHTMLElement.setAttribute(\"title\", hoverText)\n }\n \n get hoverText() {\n return this.viewHTMLElement.getAttribute(\"title\") ?? \"\"\n }\n \n \n get scrollSize() {\n return new UIRectangle(0, 0, this.viewHTMLElement.scrollHeight, this.viewHTMLElement.scrollWidth)\n }\n \n \n get dialogView(): UIDialogView {\n if (!IS(this.superview)) {\n return nil\n }\n if (!((this as any)[\"_isAUIDialogView\"])) {\n return this.superview.dialogView\n }\n return this as any as UIDialogView\n }\n \n \n get rootView(): UIView {\n if (IS(this.superview)) {\n return this.superview.rootView\n }\n return this\n }\n \n \n public set enabled(enabled: boolean) {\n this._enabled = enabled\n this.updateContentForCurrentEnabledState()\n }\n \n public get enabled(): boolean {\n return this._enabled\n }\n \n updateContentForCurrentEnabledState() {\n this.hidden = !this.enabled\n this.userInteractionEnabled = this.enabled\n }\n \n \n public get tabIndex(): number {\n return Number(this.viewHTMLElement.getAttribute(\"tabindex\"))\n }\n \n public set tabIndex(index: number) {\n this.viewHTMLElement.setAttribute(\"tabindex\", \"\" + index)\n }\n \n \n get propertyDescriptors(): { object: UIObject; name: string }[] {\n let result: any[] = []\n this.allSuperviews.forEach(view => {\n FIRST_OR_NIL(view.viewController).forEach((value, key, stopLooping) => {\n if (this == value) {\n result.push({ object: view.viewController, name: key })\n }\n })\n view.forEach((value, key, stopLooping) => {\n if (this == value) {\n result.push({ object: view, name: key })\n }\n })\n })\n return result\n }\n \n \n get styleClasses() {\n return this._styleClasses\n }\n \n set styleClasses(styleClasses) {\n this._styleClasses = styleClasses\n }\n \n hasStyleClass(styleClass: string) {\n \n // This is for performance reasons\n if (!IS(styleClass)) {\n return NO\n }\n \n const index = this.styleClasses.indexOf(styleClass)\n if (index > -1) {\n return YES\n }\n return NO\n \n }\n \n addStyleClass(styleClass: string) {\n \n if (!IS(styleClass)) {\n return\n }\n \n if (!this.hasStyleClass(styleClass)) {\n this._styleClasses.push(styleClass)\n }\n \n }\n \n removeStyleClass(styleClass: string) {\n \n // This is for performance reasons\n if (!IS(styleClass)) {\n return\n }\n \n const index = this.styleClasses.indexOf(styleClass)\n if (index > -1) {\n this.styleClasses.splice(index, 1)\n }\n \n }\n \n \n static findViewWithElementID(elementID: string): UIView {\n const viewHTMLElement = document.getElementById(elementID)\n if (IS_NOT(viewHTMLElement)) {\n return nil\n }\n // @ts-ignore\n return viewHTMLElement.UIView\n }\n \n \n static createStyleSelector(selector: string, style: string) {\n \n return\n \n // // @ts-ignore\n // if (!document.styleSheets) {\n // return\n // }\n // if (document.getElementsByTagName(\"head\").length == 0) {\n // return\n // }\n //\n // let styleSheet\n // let mediaType\n //\n // if (document.styleSheets.length > 0) {\n // for (var i = 0, l: any = document.styleSheets.length; i < l; i++) {\n // if (document.styleSheets[i].disabled) {\n // continue\n // }\n // const media = document.styleSheets[i].media\n // mediaType = typeof media\n //\n // if (mediaType === \"string\") {\n // if (media as any === \"\" || ((media as any).indexOf(\"screen\") !== -1)) {\n // styleSheet = document.styleSheets[i]\n // }\n // }\n // else if (mediaType == \"object\") {\n // if (media.mediaText === \"\" || (media.mediaText.indexOf(\"screen\") !== -1)) {\n // styleSheet = document.styleSheets[i]\n // }\n // }\n //\n // if (typeof styleSheet !== \"undefined\") {\n // break\n // }\n // }\n // }\n //\n // if (typeof styleSheet === \"undefined\") {\n // const styleSheetElement = document.createElement(\"style\")\n // styleSheetElement.type = \"text/css\"\n // document.getElementsByTagName(\"head\")[0].appendChild(styleSheetElement)\n //\n // for (i = 0; i < document.styleSheets.length; i++) {\n // if (document.styleSheets[i].disabled) {\n // continue\n // }\n // styleSheet = document.styleSheets[i]\n // }\n //\n // mediaType = typeof styleSheet.media\n // }\n //\n // if (mediaType === \"string\") {\n // for (var i = 0, l = styleSheet.rules.length; i < l; i++) {\n // if (styleSheet.rules[i].selectorText && styleSheet.rules[i].selectorText.toLowerCase() ==\n // selector.toLowerCase()) {\n // styleSheet.rules[i].style.cssText = style\n // return\n // }\n // }\n // styleSheet.addRule(selector, style)\n // }\n // else if (mediaType === \"object\") {\n //\n // var styleSheetLength = 0\n //\n // try {\n //\n // styleSheetLength = (styleSheet.cssRules) ? styleSheet.cssRules.length : 0\n //\n // } catch (error) {\n //\n // }\n //\n //\n // for (var i = 0; i < styleSheetLength; i++) {\n // if (styleSheet.cssRules[i].selectorText && styleSheet.cssRules[i].selectorText.toLowerCase() ==\n // selector.toLowerCase()) {\n // styleSheet.cssRules[i].style.cssText = style\n // return\n // }\n // }\n // styleSheet.insertRule(selector + \"{\" + style + \"}\", styleSheetLength)\n // }\n }\n \n \n static getStyleRules(selector: string) {\n \n // https://stackoverflow.com/questions/324486/how-do-you-read-css-rule-values-with-javascript\n //Inside closure so that the inner functions don't need regeneration on every call.\n const getCssClasses = (function () {\n function normalize(str: string) {\n if (!str) {\n return \"\"\n }\n str = String(str).replace(/\\s*([>~+])\\s*/g, \" $1 \") //Normalize symbol spacing.\n return str.replace(/(\\s+)/g, \" \").trim() //Normalize whitespace\n }\n \n function split(str: string, on: string) { //Split, Trim, and remove empty elements\n return str.split(on).map(x => x.trim()).filter(x => x)\n }\n \n function containsAny(selText: string | any[], ors: any[]) {\n return selText ? ors.some(x => selText.indexOf(x) >= 0) : false\n }\n \n return function (selector: string) {\n const logicalORs = split(normalize(selector), \",\")\n const sheets = Array.from(window.document.styleSheets)\n const ruleArrays = sheets.map((x) => Array.from(x.rules || x.cssRules || []))\n const allRules = ruleArrays.reduce((all, x) => all.concat(x), [])\n // @ts-ignore\n return allRules.filter((x) => containsAny(normalize(x.selectorText), logicalORs))\n }\n })()\n \n return getCssClasses(selector)\n \n // selector = selector.toLowerCase()\n // let styleRules\n // for (let i = 0; i < document.styleSheets.length; i++) {\n // const styleSheet = document.styleSheets[i] as any\n //\n // try {\n //\n // styleRules = styleSheet.cssRules ? styleSheet.cssRules : styleSheet.rules\n //\n // } catch (error) {\n //\n // console.log(error)\n //\n // }\n //\n // }\n //\n // return styleRules\n \n }\n \n \n get style() {\n return this.viewHTMLElement.style\n }\n \n get computedStyle() {\n return getComputedStyle(this.viewHTMLElement)\n }\n \n public get hidden(): boolean {\n return this._isHidden\n }\n \n \n public set hidden(v: boolean) {\n \n this._isHidden = v\n \n if (this._isHidden) {\n this.style.visibility = \"hidden\"\n }\n else {\n this.style.visibility = \"visible\"\n }\n \n \n }\n \n static set pageScale(scale: number) {\n \n UIView._pageScale = scale\n \n const zoom = scale\n const width = 100 / zoom\n const viewHTMLElement = UICore.main.rootViewController.view.viewHTMLElement\n viewHTMLElement.style.transformOrigin = \"left top\"\n viewHTMLElement.style.transform = \"scale(\" + zoom + \")\"\n viewHTMLElement.style.width = width + \"%\"\n \n }\n \n static get pageScale() {\n return UIView._pageScale\n }\n \n \n set scale(scale: number) {\n \n this._scale = scale\n \n const zoom = scale\n // const width = 100 / zoom\n // const height = 100 / zoom\n const viewHTMLElement = this.viewHTMLElement\n viewHTMLElement.style.transformOrigin = \"left top\"\n viewHTMLElement.style.transform = viewHTMLElement.style.transform.replace(\n (viewHTMLElement.style.transform.match(\n new RegExp(\"scale\\\\(.*\\\\)\", \"g\")\n )?.firstElement ?? \"\"),\n \"\"\n ) + \"scale(\" + zoom + \")\"\n // viewHTMLElement.style.width = width + \"%\"\n // viewHTMLElement.style.height = height + \"%\"\n \n if (this.isInternalScaling) {\n \n this.setFrame(this.frame, this.frame.zIndex, YES)\n \n }\n \n }\n \n get scale() {\n \n return this._scale\n \n }\n \n \n // Use this method to calculate the frame for the view itself\n // This can be used when adding subviews to existing views like buttons\n calculateAndSetViewFrame() {\n \n }\n \n \n public get frame() {\n let result: UIRectangle & { zIndex?: number } = this._frame?.copy() as any\n if (!result) {\n result = new UIRectangle(\n this.viewHTMLElement.offsetLeft,\n this.viewHTMLElement.offsetTop,\n this.viewHTMLElement.offsetHeight,\n this.viewHTMLElement.offsetWidth\n ) as any\n result.zIndex = 0\n }\n return result\n }\n \n public set frame(rectangle: UIRectangle & { zIndex?: number }) {\n if (IS(rectangle)) {\n this.setFrame(rectangle, rectangle.zIndex)\n }\n }\n \n setFrame(rectangle: UIRectangle & { zIndex?: number }, zIndex = 0, performUncheckedLayout = NO) {\n \n const frame: (UIRectangle & { zIndex?: number }) = this._frame || new UIRectangle(nil, nil, nil, nil) as any\n \n if (zIndex != undefined) {\n rectangle.zIndex = zIndex\n }\n this._frame = rectangle\n \n if (frame && frame.isEqualTo(rectangle) && frame.zIndex == rectangle.zIndex && !performUncheckedLayout) {\n return\n }\n \n if (this.isInternalScaling) {\n rectangle.scale(1 / this.scale)\n }\n \n UIView._setAbsoluteSizeAndPosition(\n this.viewHTMLElement,\n rectangle.topLeft.x,\n rectangle.topLeft.y,\n rectangle.width,\n rectangle.height,\n rectangle.zIndex\n )\n \n if (frame.height != rectangle.height || frame.width != rectangle.width || performUncheckedLayout) {\n this.setNeedsLayout()\n this.boundsDidChange()\n }\n \n }\n \n \n get bounds() {\n let result: UIRectangle\n if (IS_NOT(this._frame)) {\n result = new UIRectangle(0, 0, this.viewHTMLElement.offsetHeight, this.viewHTMLElement.offsetWidth)\n }\n else {\n result = this.frame.copy()\n result.x = 0\n result.y = 0\n }\n return result\n }\n \n set bounds(rectangle) {\n const frame = this.frame\n const newFrame = new UIRectangle(frame.topLeft.x, frame.topLeft.y, rectangle.height, rectangle.width)\n // @ts-ignore\n newFrame.zIndex = frame.zIndex\n this.frame = newFrame\n }\n \n \n boundsDidChange() {\n \n \n }\n \n \n setPosition(\n left: number | string = nil,\n right: number | string = nil,\n bottom: number | string = nil,\n top: number | string = nil,\n height: number | string = nil,\n width: number | string = nil\n ) {\n \n const previousBounds = this.bounds\n \n this.setStyleProperty(\"left\", left)\n this.setStyleProperty(\"right\", right)\n this.setStyleProperty(\"bottom\", bottom)\n this.setStyleProperty(\"top\", top)\n this.setStyleProperty(\"height\", height)\n this.setStyleProperty(\"width\", width)\n \n const bounds = this.bounds\n if (bounds.height != previousBounds.height || bounds.width != previousBounds.width) {\n this.setNeedsLayout()\n this.boundsDidChange()\n }\n \n }\n \n setSizes(height?: number | string, width?: number | string) {\n \n const previousBounds = this.bounds\n \n this.setStyleProperty(\"height\", height)\n this.setStyleProperty(\"width\", width)\n \n const bounds = this.bounds\n if (bounds.height != previousBounds.height || bounds.width != previousBounds.width) {\n this.setNeedsLayout()\n this.boundsDidChange()\n }\n \n }\n \n setMinSizes(height?: number | string, width?: number | string) {\n \n const previousBounds = this.bounds\n \n this.setStyleProperty(\"minHeight\", height)\n this.setStyleProperty(\"minWidth\", width)\n \n const bounds = this.bounds\n if (bounds.height != previousBounds.height || bounds.width != previousBounds.width) {\n this.setNeedsLayout()\n this.boundsDidChange()\n }\n \n }\n \n setMaxSizes(height?: number | string, width?: number | string) {\n \n const previousBounds = this.bounds\n \n this.setStyleProperty(\"maxHeight\", height)\n this.setStyleProperty(\"maxWidth\", width)\n \n const bounds = this.bounds\n if (bounds.height != previousBounds.height || bounds.width != previousBounds.width) {\n this.setNeedsLayout()\n this.boundsDidChange()\n }\n \n }\n \n setMargin(margin?: number | string) {\n \n const previousBounds = this.bounds\n \n this.setStyleProperty(\"margin\", margin)\n \n const bounds = this.bounds\n if (bounds.height != previousBounds.height || bounds.width != previousBounds.width) {\n this.setNeedsLayout()\n this.boundsDidChange()\n }\n \n }\n \n setMargins(left?: number | string, right?: number | string, bottom?: number | string, top?: number | string) {\n \n const previousBounds = this.bounds\n \n this.setStyleProperty(\"marginLeft\", left)\n this.setStyleProperty(\"marginRight\", right)\n this.setStyleProperty(\"marginBottom\", bottom)\n this.setStyleProperty(\"marginTop\", top)\n \n const bounds = this.bounds\n if (bounds.height != previousBounds.height || bounds.width != previousBounds.width) {\n this.setNeedsLayout()\n this.boundsDidChange()\n }\n \n }\n \n setPadding(padding?: number | string) {\n \n const previousBounds = this.bounds\n \n this.setStyleProperty(\"padding\", padding)\n \n const bounds = this.bounds\n if (bounds.height != previousBounds.height || bounds.width != previousBounds.width) {\n this.setNeedsLayout()\n this.boundsDidChange()\n }\n \n }\n \n setPaddings(left?: number | string, right?: number | string, bottom?: number | string, top?: number | string) {\n \n const previousBounds = this.bounds\n \n this.setStyleProperty(\"paddingLeft\", left)\n this.setStyleProperty(\"paddingRight\", right)\n this.setStyleProperty(\"paddingBottom\", bottom)\n this.setStyleProperty(\"paddingTop\", top)\n \n const bounds = this.bounds\n if (bounds.height != previousBounds.height || bounds.width != previousBounds.width) {\n this.setNeedsLayout()\n this.boundsDidChange()\n }\n \n }\n \n \n setBorder(\n radius: number | string = nil,\n width: number | string = 1,\n color: UIColor = UIColor.blackColor,\n style: string = \"solid\"\n ) {\n \n this.setStyleProperty(\"borderStyle\", style)\n \n this.setStyleProperty(\"borderRadius\", radius)\n \n this.setStyleProperty(\"borderColor\", color.stringValue)\n \n this.setStyleProperty(\"borderWidth\", width)\n \n }\n \n \n setStyleProperty(propertyName: string, value?: number | string) {\n \n try {\n \n if (IS_NIL(value)) {\n return\n }\n if (IS_DEFINED(value) && (value as Number).isANumber) {\n value = \"\" + (value as number).integerValue + \"px\"\n }\n \n // @ts-ignore\n this.style[propertyName] = value\n \n } catch (exception) {\n \n console.log(exception)\n \n }\n \n }\n \n \n get userInteractionEnabled() {\n return (this.style.pointerEvents != \"none\")\n }\n \n set userInteractionEnabled(userInteractionEnabled) {\n if (userInteractionEnabled) {\n this.style.pointerEvents = \"\"\n }\n else {\n this.style.pointerEvents = \"none\"\n }\n }\n \n \n get backgroundColor() {\n return this._backgroundColor\n }\n \n set backgroundColor(backgroundColor: UIColor) {\n this._backgroundColor = backgroundColor\n this.style.backgroundColor = backgroundColor.stringValue\n }\n \n \n get alpha() {\n return 1 * (this.style.opacity as any)\n }\n \n set alpha(alpha) {\n this.style.opacity = \"\" + alpha\n }\n \n \n static animateViewOrViewsWithDurationDelayAndFunction(\n viewOrViews: UIView | HTMLElement | UIView[] | HTMLElement[],\n duration: number,\n delay: number,\n timingStyle = \"cubic-bezier(0.25,0.1,0.25,1)\",\n transformFunction: Function,\n transitioncompletionFunction: Function\n ) {\n \n function callTransitioncompletionFunction() {\n (transitioncompletionFunction || nil)();\n (viewOrViews as UIView[] | HTMLElement[]).forEach(view => {\n if (view instanceof UIView) {\n view.animationDidFinish()\n }\n })\n }\n \n if (IS_FIREFOX) {\n \n // Firefox does not fire the transition completion event properly\n new UIObject().performFunctionWithDelay(delay + duration, callTransitioncompletionFunction)\n \n }\n \n \n if (!(viewOrViews instanceof Array)) {\n viewOrViews = [viewOrViews] as any\n }\n \n const transitionStyles: any[] = []\n const transitionDurations: any[] = []\n const transitionDelays: any[] = []\n const transitionTimings: any[] = []\n \n function isUIView(view: any): view is UIView {\n return IS(view.viewHTMLElement)\n }\n \n for (var i = 0; i < (viewOrViews as any).length; i++) {\n \n let view = (viewOrViews as UIView[] | HTMLElement[])[i]\n \n if (isUIView(view)) {\n view = view.viewHTMLElement\n }\n \n // @ts-ignore\n view.addEventListener(\"transitionend\", transitionDidFinish, true)\n \n transitionStyles.push(view.style.transition)\n transitionDurations.push(view.style.transitionDuration)\n transitionDelays.push(view.style.transitionDelay)\n transitionTimings.push(view.style.transitionTimingFunction)\n \n view.style.transition = \"all\"\n view.style.transitionDuration = \"\" + duration + \"s\"\n view.style.transitionDelay = \"\" + delay + \"s\"\n view.style.transitionTimingFunction = timingStyle\n \n }\n \n transformFunction()\n \n const transitionObject = {\n \"finishImmediately\": finishTransitionImmediately,\n \"didFinish\": transitionDidFinishManually,\n \"views\": viewOrViews,\n \"registrationTime\": Date.now()\n }\n \n function finishTransitionImmediately() {\n for (var i = 0; i < (viewOrViews as any).length; i++) {\n let view = (viewOrViews as UIView[] | HTMLElement[])[i]\n if (isUIView(view)) {\n view = view.viewHTMLElement\n }\n view.style.transition = \"all\"\n view.style.transitionDuration = \"\" + duration + \"s\"\n view.style.transitionDelay = \"\" + delay + \"s\"\n view.style.transition = transitionStyles[i]\n view.style.transitionDuration = transitionDurations[i]\n view.style.transitionDelay = transitionDelays[i]\n view.style.transitionTimingFunction = transitionTimings[i]\n }\n }\n \n function transitionDidFinish(this: HTMLElement, event: { srcElement: HTMLElement | UIView }) {\n let view = event.srcElement\n if (!view) {\n return\n }\n if (isUIView(view)) {\n view = view.viewHTMLElement\n }\n view.style.transition = transitionStyles[i]\n view.style.transitionDuration = transitionDurations[i]\n view.style.transitionDelay = transitionDelays[i]\n view.style.transitionTimingFunction = transitionTimings[i]\n \n callTransitioncompletionFunction()\n \n // @ts-ignore\n view.removeEventListener(\"transitionend\", transitionDidFinish, true)\n \n }\n \n function transitionDidFinishManually() {\n for (let i = 0; i < (viewOrViews as any).length; i++) {\n \n let view = (viewOrViews as UIView[] | HTMLElement[])[i]\n \n if (isUIView(view)) {\n view = view.viewHTMLElement\n }\n \n view.style.transition = transitionStyles[i]\n view.style.transitionDuration = transitionDurations[i]\n view.style.transitionDelay = transitionDelays[i]\n view.style.transitionTimingFunction = transitionTimings[i]\n \n // @ts-ignore\n view.removeEventListener(\"transitionend\", transitionDidFinish, true)\n \n }\n \n \n }\n \n return transitionObject\n \n }\n \n \n animationDidFinish() {\n \n \n }\n \n \n static _transformAttribute = ((\"transform\" in document.documentElement.style) ? \"transform\" : undefined) ||\n ((\"-webkit-transform\" in document.documentElement.style) ? \"-webkit-transform\" : \"undefined\") ||\n ((\"-moz-transform\" in document.documentElement.style) ? \"-moz-transform\" : \"undefined\") ||\n ((\"-ms-transform\" in document.documentElement.style) ? \"-ms-transform\" : \"undefined\") ||\n ((\"-o-transform\" in document.documentElement.style) ? \"-o-transform\" : \"undefined\")\n \n static _setAbsoluteSizeAndPosition(\n element: HTMLElement & LooseObject,\n left: number,\n top: number,\n width: string | number,\n height: string | number,\n zIndex = 0\n ) {\n \n if (!IS(element) || !element.obeyAutolayout && !element.getAttribute(\"obeyAutolayout\")) {\n return\n }\n \n if (IS(height)) {\n height = height.integerValue + \"px\"\n }\n \n if (IS(width)) {\n width = width.integerValue + \"px\"\n }\n \n let str = element.style.cssText\n \n const frameTransform = UIView._transformAttribute + \": translate3d(\" + (left).integerValue + \"px, \" +\n (top).integerValue + \"px, 0px)\"\n \n if (element.UIView) {\n \n str = str + frameTransform +\n (element.style.transform.match(\n new RegExp(\"scale\\\\(.*\\\\)\", \"g\")\n )?.firstElement ?? \"\") + \";\"\n \n }\n \n if (IS_NIL(height)) {\n str = str + \" height: unset;\"\n }\n else {\n str = str + \" height:\" + height + \";\"\n }\n \n if (IS_NIL(width)) {\n str = str + \" width: unset;\"\n }\n else {\n str = str + \" width:\" + width + \";\"\n }\n \n if (IS_NIL(zIndex)) {\n str = str + \" z-index: unset;\"\n }\n else {\n str = str + \" z-index:\" + zIndex + \";\"\n }\n \n element.style.cssText = element.style.cssText + str\n \n }\n \n \n static performAutoLayout(\n parentElement: HTMLElement & LooseObject,\n visualFormatArray: string | any[] | null,\n constraintsArray: string | any[]\n ) {\n \n const view = new AutoLayout.View()\n \n if (IS(visualFormatArray) && IS(visualFormatArray.length)) {\n view.addConstraints(AutoLayout.VisualFormat.parse(visualFormatArray, { extended: true }))\n }\n \n if (IS(constraintsArray) && IS(constraintsArray.length)) {\n view.addConstraints(constraintsArray)\n }\n \n const elements: Record<string, HTMLElement> = {}\n for (var key in view.subViews) {\n \n if (!view.subViews.hasOwnProperty(key)) {\n continue\n }\n \n var element = nil\n \n try {\n \n element = parentElement.querySelector(\"#\" + key)\n \n } catch (error) {\n \n //console.log(\"Error occurred \" + error);\n \n }\n \n if (!(element && !element.obeyAutolayout && !element.getAttribute(\"obeyAutolayout\")) && element) {\n element.className += element.className ? \" abs\" : \"abs\"\n elements[key] = element\n }\n \n }\n \n let parentUIView = nil\n \n if (parentElement.UIView) {\n parentUIView = parentElement.UIView\n }\n \n const updateLayout = function () {\n view.setSize(\n parentElement ? parentElement.clientWidth : window.innerWidth,\n parentElement ? parentElement.clientHeight : window.innerHeight\n )\n for (key in view.subViews) {\n \n if (!view.subViews.hasOwnProperty(key)) {\n continue\n }\n \n const subView = view.subViews[key]\n \n if (elements[key]) {\n UIView._setAbsoluteSizeAndPosition(\n elements[key],\n subView.left,\n subView.top,\n subView.width,\n subView.height\n )\n }\n }\n \n parentUIView.didLayoutSubviews()\n \n }\n \n updateLayout()\n return updateLayout\n \n }\n \n \n static runFunctionBeforeNextFrame(step: () => void) {\n \n if (IS_SAFARI) {\n \n // This creates a microtask\n Promise.resolve().then(step)\n \n }\n else {\n \n window.requestAnimationFrame(step)\n \n }\n \n }\n \n \n static scheduleLayoutViewsIfNeeded() {\n \n UIView.runFunctionBeforeNextFrame(UIView.layoutViewsIfNeeded)\n \n }\n \n \n static layoutViewsIfNeeded() {\n for (var i = 0; i < UIView._viewsToLayout.length; i++) {\n const view = UIView._viewsToLayout[i]\n view.layoutIfNeeded()\n }\n UIView._viewsToLayout = []\n }\n \n \n setNeedsLayout() {\n \n if (this._shouldLayout) {\n return\n }\n \n this._shouldLayout = YES\n \n // Register view for layout before next frame\n UIView._viewsToLayout.push(this)\n \n if (UIView._viewsToLayout.length == 1) {\n UIView.scheduleLayoutViewsIfNeeded()\n }\n \n }\n \n \n get needsLayout() {\n \n return this._shouldLayout\n \n }\n \n \n layoutIfNeeded() {\n \n if (!this._shouldLayout) {\n return\n }\n \n this._shouldLayout = NO\n \n try {\n \n this.layoutSubviews()\n \n } catch (exception) {\n \n console.log(exception)\n \n }\n \n }\n \n \n layoutSubviews() {\n \n this.willLayoutSubviews()\n \n this._shouldLayout = NO\n \n // Autolayout\n if (this.constraints.length) {\n this._updateLayoutFunction = UIView.performAutoLayout(this.viewHTMLElement, null, this.constraints)\n }\n this._updateLayoutFunction()\n \n this.viewController.layoutViewSubviews()\n \n this.applyClassesAndStyles()\n \n for (let i = 0; i < this.subviews.length; i++) {\n \n const subview = this.subviews[i]\n subview.calculateAndSetViewFrame()\n \n }\n \n this.didLayoutSubviews()\n \n }\n \n \n applyClassesAndStyles() {\n for (let i = 0; i < this.styleClasses.length; i++) {\n const styleClass = this.styleClasses[i]\n if (styleClass) {\n this.viewHTMLElement.classList.add(styleClass)\n }\n }\n }\n \n willLayoutSubviews() {\n \n this.viewController.viewWillLayoutSubviews()\n \n }\n \n didLayoutSubviews() {\n \n this.viewController.viewDidLayoutSubviews()\n \n }\n \n get constraints() {\n return this._constraints\n }\n \n set constraints(constraints) {\n this._constraints = constraints\n }\n \n addConstraint(constraint: any) {\n this.constraints.push(constraint)\n }\n \n \n addConstraintsWithVisualFormat(visualFormatArray: string[]) {\n this.constraints = this.constraints.concat(AutoLayout.VisualFormat.parse(\n visualFormatArray,\n { extended: true }\n ))\n }\n \n static constraintWithView(\n view: { isKindOfClass: (arg0: typeof UIView) => any; viewHTMLElement: any; id: any },\n attribute: any,\n relation: any,\n toView: { isKindOfClass: any; viewHTMLElement: any; id: any },\n toAttribute: any,\n multiplier: number,\n constant: number,\n priority: number\n ): Constraint {\n \n let UIViewObject = nil\n let viewID = null\n if (view) {\n if (view.isKindOfClass && view.isKindOfClass(UIView)) {\n UIViewObject = view\n view = view.viewHTMLElement\n }\n viewID = view.id\n }\n \n let toUIViewObject = nil\n let toViewID = null\n if (toView) {\n if (toView.isKindOfClass && view.isKindOfClass(UIView)) {\n toUIViewObject = toView\n toView = toView.viewHTMLElement\n }\n toViewID = toView.id\n }\n \n const constraint = {\n \n view1: viewID,\n attr1: attribute,\n relation: relation,\n view2: toViewID,\n attr2: toAttribute,\n multiplier: multiplier,\n constant: constant,\n priority: priority\n \n }\n \n return constraint\n \n }\n \n static constraintAttribute = {\n \n \"left\": AutoLayout.Attribute.LEFT,\n \"right\": AutoLayout.Attribute.RIGHT,\n \"bottom\": AutoLayout.Attribute.BOTTOM,\n \"top\": AutoLayout.Attribute.TOP,\n \"centerX\": AutoLayout.Attribute.CENTERX,\n \"centerY\": AutoLayout.Attribute.CENTERY,\n \"height\": AutoLayout.Attribute.HEIGHT,\n \"width\": AutoLayout.Attribute.WIDTH,\n \"zIndex\": AutoLayout.Attribute.ZINDEX,\n // Not sure what these are for\n \"constant\": AutoLayout.Attribute.NOTANATTRIBUTE,\n \"variable\": AutoLayout.Attribute.VARIABLE\n \n }\n \n static constraintRelation = {\n \n \"equal\": AutoLayout.Relation.EQU,\n \"lessThanOrEqual\": AutoLayout.Relation.LEQ,\n \"greaterThanOrEqual\": AutoLayout.Relation.GEQ\n \n }\n \n \n subviewWithID(viewID: string): UIView {\n let resultHTMLElement = nil\n \n try {\n resultHTMLElement = this.viewHTMLElement.querySelector(\"#\" + viewID)\n } catch (error) {\n console.log(error)\n }\n \n if (resultHTMLElement && resultHTMLElement.UIView) {\n return resultHTMLElement.UIView\n }\n return nil\n }\n \n \n rectangleContainingSubviews() {\n const center = this.bounds.center\n let result = new UIRectangle(center.x, center.y, 0, 0)\n for (let i = 0; i < this.subviews.length; i++) {\n const subview = this.subviews[i]\n let frame = subview.frame\n const rectangleContainingSubviews = subview.rectangleContainingSubviews()\n frame = frame.concatenateWithRectangle(rectangleContainingSubviews)\n result = result.concatenateWithRectangle(frame)\n }\n return result\n }\n \n \n hasSubview(view: UIView) {\n \n // This is for performance reasons\n if (!IS(view)) {\n return NO\n }\n \n for (let i = 0; i < this.subviews.length; i++) {\n const subview = this.subviews[i]\n if (subview == view) {\n return YES\n }\n }\n return NO\n }\n \n get viewBelowThisView() {\n const result: UIView = (this.viewHTMLElement.previousElementSibling as any || {}).UIView\n return result\n }\n \n get viewAboveThisView() {\n const result: UIView = (this.viewHTMLElement.nextElementSibling as any || {}).UIView\n return result\n }\n \n addSubview(view: UIView, aboveView?: UIView) {\n \n if (!this.hasSubview(view) && IS(view)) {\n \n view.willMoveToSuperview(this)\n \n if (IS(aboveView)) {\n this.viewHTMLElement.insertBefore(view.viewHTMLElement, aboveView.viewHTMLElement.nextSibling)\n this.subviews.insertElementAtIndex(this.subviews.indexOf(aboveView), view)\n }\n else {\n this.viewHTMLElement.appendChild(view.viewHTMLElement)\n this.subviews.push(view)\n }\n \n view.core = this.core\n view.didMoveToSuperview(this)\n \n if (this.superview && this.isMemberOfViewTree) {\n \n view.broadcastEventInSubtree({\n name: UIView.broadcastEventName.AddedToViewTree,\n parameters: nil\n })\n \n }\n \n this.setNeedsLayout()\n \n }\n \n }\n \n addSubviews(views: UIView[]) {\n views.forEach(view => this.addSubview(view))\n }\n \n \n addedAsSubviewToView(view: UIView, aboveView?: UIView) {\n view.addSubview(this, aboveView)\n return this\n }\n \n \n moveToBottomOfSuperview() {\n \n if (IS(this.superview)) {\n \n const bottomView = this.superview.subviews.firstElement\n \n if (bottomView == this) {\n return\n }\n \n this.superview.subviews.removeElement(this)\n this.superview.subviews.insertElementAtIndex(0, this)\n this.superview.viewHTMLElement.insertBefore(this.viewHTMLElement, bottomView.viewHTMLElement)\n \n }\n \n }\n \n moveToTopOfSuperview() {\n \n if (IS(this.superview)) {\n \n const topView = this.superview.subviews.lastElement\n \n if (topView == this) {\n return\n }\n \n this.superview.subviews.removeElement(this)\n this.superview.subviews.push(this)\n this.superview.viewHTMLElement.appendChild(this.viewHTMLElement)\n \n }\n \n }\n \n \n removeFromSuperview() {\n if (IS(this.superview)) {\n this.forEachViewInSubtree(view => view.blur())\n const index = this.superview.subviews.indexOf(this)\n if (index > -1) {\n this.superview.subviews.splice(index, 1)\n this.superview.viewHTMLElement.removeChild(this.viewHTMLElement)\n this.superview = nil\n this.broadcastEventInSubtree({\n name: UIView.broadcastEventName.RemovedFromViewTree,\n parameters: nil\n })\n \n }\n }\n }\n \n \n willAppear() {\n \n \n }\n \n \n willMoveToSuperview(superview: UIView) {\n this._setInnerHTMLFromKeyIfPossible()\n this._setInnerHTMLFromLocalizedTextObjectIfPossible()\n }\n \n didMoveToSuperview(superview: UIView) {\n this.superview = superview\n }\n \n wasAddedToViewTree() {\n \n }\n \n wasRemovedFromViewTree() {\n \n }\n \n get isMemberOfViewTree() {\n let element: HTMLElement & LooseObject | null = this.viewHTMLElement\n for (let i = 0; element; i = i) {\n if (element.parentElement && element.parentElement == document.body) {\n return YES\n }\n element = element.parentElement\n }\n return NO\n }\n \n \n get allSuperviews() {\n const result = []\n let view: UIView = this\n for (let i = 0; IS(view); i = i) {\n result.push(view)\n view = view.superview\n }\n return result\n }\n \n \n setNeedsLayoutOnAllSuperviews() {\n this.allSuperviews.reverse().everyElement.setNeedsLayout()\n }\n \n \n setNeedsLayoutUpToRootView() {\n this.setNeedsLayoutOnAllSuperviews()\n this.setNeedsLayout()\n }\n \n \n focus() {\n this.viewHTMLElement.focus()\n }\n \n \n blur() {\n this.viewHTMLElement.blur()\n }\n \n \n static async shouldCallPointerUpInsideOnView(view: UIView) {\n \n return YES\n \n }\n \n static async shouldCallPointerHoverOnView(view: UIView) {\n \n return YES\n \n }\n \n static async shouldCallPointerLeaveOnView(view: UIView) {\n \n return YES\n \n }\n \n static async shouldCallPointerCancelOnView(view: UIView) {\n \n return YES\n \n }\n \n \n shouldCallPointerUpInside() {\n return UIView.shouldCallPointerUpInsideOnView(this)\n }\n \n shouldCallPointerCancel() {\n return UIView.shouldCallPointerCancelOnView(this)\n }\n \n shouldCallPointerHover() {\n return UIView.shouldCallPointerHoverOnView(this)\n }\n \n shouldCallPointerLeave() {\n return UIView.shouldCallPointerLeaveOnView(this)\n }\n \n \n protected _loadUIEvents() {\n \n \n const isTouchEventClassDefined: boolean = NO || (window as any).TouchEvent\n \n const pauseEvent = (event: Event, forced = NO) => {\n \n if (this.pausesPointerEvents || forced) {\n \n if (event.stopPropagation) {\n event.stopPropagation()\n }\n if (event.preventDefault) {\n event.preventDefault()\n }\n event.cancelBubble = true\n event.returnValue = false\n return false\n \n }\n \n if (event.stopPropagation && this.stopsPointerEventPropagation) {\n event.stopPropagation()\n }\n \n }\n \n const onMouseDown = (event: MouseEvent) => {\n \n if ((this.ignoresTouches && isTouchEventClassDefined && event instanceof TouchEvent) ||\n ((this.ignoresMouse || (IS(this._touchEventTime) && (Date.now() - this._touchEventTime) > 500)) &&\n event instanceof MouseEvent)) {\n return\n }\n \n this.sendControlEventForKey(UIView.controlEvent.PointerDown, event)\n \n this._isPointerInside = YES\n this._isPointerValid = YES\n this._isPointerDown = YES\n this._initialPointerPosition = new UIPoint(event.clientX, event.clientY)\n if (isTouchEventClassDefined && event instanceof TouchEvent) {\n this._touchEventTime = Date.now()\n this._initialPointerPosition = new UIPoint(event.touches[0].clientX, event.touches[0].clientY)\n if (event.touches.length > 1) {\n onTouchCancel(event)\n return\n }\n }\n else {\n this._touchEventTime = nil\n pauseEvent(event)\n }\n \n this._hasPointerDragged = NO\n \n const windowMouseMoveFunction = (event: MouseEvent) => {\n onMouseMove(event)\n //pauseEvent(event, YES)\n }\n const windowMouseUpOrLeaveFunction = (event: MouseEvent) => {\n \n window.removeEventListener(\"mousemove\", windowMouseMoveFunction, true)\n window.removeEventListener(\"mouseup\", windowMouseUpOrLeaveFunction, true)\n document.body.removeEventListener(\"mouseleave\", windowMouseUpOrLeaveFunction)\n onmouseup(event)\n \n }\n window.addEventListener(\"mousemove\", windowMouseMoveFunction, true)\n window.addEventListener(\"mouseup\", windowMouseUpOrLeaveFunction, true)\n document.body.addEventListener(\"mouseleave\", windowMouseUpOrLeaveFunction)\n \n const windowTouchFunction = () => {\n window.removeEventListener(\"touchmove\", onTouchMove, true)\n window.removeEventListener(\"mouseup\", windowTouchFunction, true)\n }\n window.addEventListener(\"touchmove\", onTouchMove, true)\n window.addEventListener(\"mouseup\", windowTouchFunction, true)\n \n }\n \n const onTouchStart = onMouseDown as any\n \n const onmouseup = async (event: MouseEvent) => {\n \n this._isPointerDown = NO\n \n if (!this._isPointerValid) {\n return\n }\n \n if ((this.ignoresTouches && isTouchEventClassDefined && event instanceof TouchEvent) ||\n (this.ignoresMouse && event instanceof MouseEvent)) {\n return\n }\n \n if (this._isPointerInside && await this.shouldCallPointerUpInside()) {\n onPointerUpInside(event)\n if (!this._hasPointerDragged) {\n this.sendControlEventForKey(UIView.controlEvent.PointerTap, event)\n }\n }\n \n // This has to be sent after the more specific event so that UIButton can ignore it when not highlighted\n this.sendControlEventForKey(UIView.controlEvent.PointerUp, event)\n \n pauseEvent(event)\n \n }\n \n const onTouchEnd = onmouseup\n \n const onmouseout = async (event: MouseEvent) => {\n \n if ((this.ignoresTouches && isTouchEventClassDefined && event instanceof TouchEvent) ||\n (this.ignoresMouse && event instanceof MouseEvent)) {\n return\n }\n \n if (await this.shouldCallPointerLeave()) {\n this.sendControlEventForKey(UIView.controlEvent.PointerLeave, event)\n }\n \n this._isPointerInside = NO\n \n pauseEvent(event)\n \n }\n \n const onTouchLeave = onmouseout\n \n const onmouseover = async (event: MouseEvent) => {\n \n if ((this.ignoresTouches && isTouchEventClassDefined && event instanceof TouchEvent) ||\n (this.ignoresMouse && event instanceof MouseEvent)) {\n return\n }\n \n if (await this.shouldCallPointerHover()) {\n this.sendControlEventForKey(UIView.controlEvent.PointerHover, event)\n }\n \n this._isPointerInside = YES\n this._isPointerValid = YES\n \n pauseEvent(event)\n \n }\n \n const onMouseMove = (event: MouseEvent) => {\n \n // if (this._isPointerDown) {\n //\n // console.log(\"Mouse move\")\n //\n // }\n \n if (!this._isPointerValid) {\n return\n }\n \n if ((this.ignoresTouches && isTouchEventClassDefined && event instanceof TouchEvent) ||\n (this.ignoresMouse && event instanceof MouseEvent)) {\n return\n }\n \n const clientPoint = new UIPoint(\n event.clientX,\n event.clientY\n )\n if (IS_NOT(this._initialPointerPosition)) {\n this._initialPointerPosition = clientPoint\n }\n \n const distanceToInitialPoint = clientPoint.to(this._initialPointerPosition).length\n if (distanceToInitialPoint > this._pointerDragThreshold) {\n this._hasPointerDragged = YES\n }\n \n this.sendControlEventForKey(UIView.controlEvent.PointerMove, event)\n \n if (this._hasPointerDragged && this._isPointerDown) {\n const movementPoint = this._previousClientPoint.to(clientPoint)\n this.pointerDraggingPoint = new UIPoint(movementPoint.x, movementPoint.y).scale(1 / UIView.pageScale)\n .add(this.pointerDraggingPoint)\n this.sendControlEventForKey(UIView.controlEvent.PointerDrag, event)\n }\n \n this._previousClientPoint = clientPoint\n \n pauseEvent(event)\n \n }\n \n const onTouchMove = async (event: TouchEvent) => {\n \n if (!this._isPointerValid) {\n return\n }\n \n if ((this.ignoresTouches && isTouchEventClassDefined && event instanceof TouchEvent) ||\n (this.ignoresMouse && event instanceof MouseEvent)) {\n return\n }\n \n if (event.touches.length > 1) {\n onTouchZoom(event)\n return\n }\n \n const touch = event.touches[0]\n \n const clientPoint = new UIPoint(\n touch.clientX,\n touch.clientY\n )\n const distanceToInitialPoint = clientPoint.to(this._initialPointerPosition!).length\n if (distanceToInitialPoint > this._pointerDragThreshold) {\n this._hasPointerDragged = YES\n }\n \n if (this._isPointerInside && this.viewHTMLElement !=\n document.elementFromPoint(touch.clientX, touch.clientY)) {\n this._isPointerInside = NO\n if (await this.shouldCallPointerLeave()) {\n this.sendControlEventForKey(UIView.controlEvent.PointerLeave, event)\n }\n }\n \n this.sendControlEventForKey(UIView.controlEvent.PointerMove, event)\n \n \n if (this._hasPointerDragged) {\n const movementPoint = this._previousClientPoint.to(clientPoint)\n this.pointerDraggingPoint = new UIPoint(movementPoint.x, movementPoint.y).scale(1 / UIView.pageScale)\n .add(this.pointerDraggingPoint)\n this.sendControlEventForKey(UIView.controlEvent.PointerDrag, event)\n }\n \n this._previousClientPoint = clientPoint\n \n }\n \n const onTouchZoom = (event: TouchEvent) => {\n this.sendControlEventForKey(UIView.controlEvent.MultipleTouches, event)\n }\n const onPointerUpInside = (event: Event) => {\n \n pauseEvent(event)\n this._isPointerDown = NO\n this.sendControlEventForKey(UIView.controlEvent.PointerUpInside, event)\n \n \n }\n \n const onTouchCancel = async (event: Event) => {\n \n if (!this._isPointerValid) {\n return\n }\n \n if ((this.ignoresTouches && isTouchEventClassDefined && event instanceof TouchEvent) ||\n (this.ignoresMouse && event instanceof MouseEvent)) {\n return\n }\n \n this._isPointerValid = NO\n this._isPointerDown = NO\n \n if (await this.shouldCallPointerCancel()) {\n this.sendControlEventForKey(UIView.controlEvent.PointerCancel, event)\n }\n \n }\n \n function eventKeyIsEnter(event: { keyCode: number }) {\n if (event.keyCode !== 13) {\n return NO\n }\n return YES\n }\n \n function eventKeyIsTab(event: { keyCode: number }) {\n if (event.keyCode !== 9) {\n return NO\n }\n return YES\n }\n \n function eventKeyIsEsc(event: { key: string; keyCode: number }) {\n let result: boolean\n if (\"key\" in event) {\n result = (event.key == \"Escape\" || event.key == \"Esc\")\n }\n else {\n // @ts-ignore\n result = (event.keyCode == 27)\n }\n return result\n }\n \n function eventKeyIsLeft(event: KeyboardEvent) {\n if (event.keyCode != 37) {\n return NO\n }\n return YES\n }\n \n function eventKeyIsRight(event: KeyboardEvent) {\n if (event.keyCode != 39) {\n return NO\n }\n return YES\n }\n \n function eventKeyIsDown(event: KeyboardEvent) {\n if (event.keyCode != 40) {\n return NO\n }\n return YES\n }\n \n function eventKeyIsUp(event: KeyboardEvent) {\n if (event.keyCode != 38) {\n return NO\n }\n return YES\n }\n \n const onKeyDown = (event: KeyboardEvent) => {\n \n if (eventKeyIsEnter(event)) {\n this.sendControlEventForKey(UIView.controlEvent.EnterDown, event)\n }\n \n if (eventKeyIsEsc(event)) {\n this.sendControlEventForKey(UIView.controlEvent.EscDown, event)\n }\n \n if (eventKeyIsTab(event) && this._controlEventTargets.TabDown && this._controlEventTargets.TabDown.length) {\n this.sendControlEventForKey(UIView.controlEvent.TabDown, event)\n pauseEvent(event, YES)\n }\n \n if (eventKeyIsLeft(event)) {\n this.sendControlEventForKey(UIView.controlEvent.LeftArrowDown, event)\n }\n \n if (eventKeyIsRight(event)) {\n this.sendControlEventForKey(UIView.controlEvent.RightArrowDown, event)\n }\n \n if (eventKeyIsDown(event)) {\n this.sendControlEventForKey(UIView.controlEvent.DownArrowDown, event)\n }\n \n if (eventKeyIsUp(event)) {\n this.sendControlEventForKey(UIView.controlEvent.UpArrowDown, event)\n }\n \n }\n \n const onKeyUp = (event: KeyboardEvent) => {\n \n if (eventKeyIsEnter(event)) {\n this.sendControlEventForKey(UIView.controlEvent.EnterUp, event)\n }\n \n }\n \n \n const onfocus = (event: Event) => {\n this.sendControlEventForKey(UIView.controlEvent.Focus, event)\n }\n \n const onblur = (event: Event) => {\n this.sendControlEventForKey(UIView.controlEvent.Blur, event)\n }\n \n \n // Mouse and touch start events\n // this._viewHTMLElement.onmousedown = onMouseDown\n // this._viewHTMLElement.ontouchstart = onTouchStart\n this.viewHTMLElement.addEventListener(\"mousedown\", onMouseDown, false)\n this.viewHTMLElement.addEventListener(\"touchstart\", onTouchStart, false)\n // //this.viewHTMLElement.addEventListener(\"mouseenter\", onMouseEnter.bind(this), false);\n \n // Mouse and touch move events\n // this._viewHTMLElement.onmousemove = onMouseMove\n // this._viewHTMLElement.ontouchmove = onTouchMove\n //this.viewHTMLElement.addEventListener(\"mousemove\", onMouseMove, false)\n this.viewHTMLElement.addEventListener(\"touchmove\", onTouchMove, false)\n \n //this.viewHTMLElement.addEventListener(\"mousewheel\", onmousewheel.bind(this), false)\n \n this._viewHTMLElement.onmouseover = onmouseover\n // this.viewHTMLElement.addEventListener(\"mouseover\", onmouseover.bind(this), false)\n \n // Mouse and touch end events\n // this._viewHTMLElement.onmouseup = onmouseup\n // // @ts-ignore\n // this._viewHTMLElement.ontouchend = onTouchEnd\n // this._viewHTMLElement.ontouchcancel = onTouchCancel\n this.viewHTMLElement.addEventListener(\"mouseup\", onmouseup, false)\n // @ts-ignore\n this.viewHTMLElement.addEventListener(\"touchend\", onTouchEnd, false)\n this.viewHTMLElement.addEventListener(\"touchcancel\", onTouchCancel, false)\n \n //this._viewHTMLElement.onmouseout = onmouseout\n this.viewHTMLElement.addEventListener(\"mouseout\", onmouseout, false)\n // @ts-ignore\n this._viewHTMLElement.addEventListener(\"touchleave\", onTouchLeave, true)\n \n // this.viewHTMLElement.onkeydown = onkeydown\n // this.viewHTMLElement.onkeyup = onkeyup\n this._viewHTMLElement.addEventListener(\"keydown\", onKeyDown, false)\n this._viewHTMLElement.addEventListener(\"keyup\", onKeyUp, false)\n \n // Focus events\n this._viewHTMLElement.onfocus = onfocus\n this._viewHTMLElement.onblur = onblur\n // this.viewHTMLElement.addEventListener(\"focus\", onfocus, true)\n // this.viewHTMLElement.addEventListener(\"blur\", onblur, true)\n \n \n }\n \n public static controlEvent = {\n \n \"PointerDown\": \"PointerDown\",\n \"PointerMove\": \"PointerMove\",\n \"PointerDrag\": \"PointerDrag\",\n \"PointerLeave\": \"PointerLeave\",\n \"PointerEnter\": \"PointerEnter\",\n \"PointerUpInside\": \"PointerUpInside\",\n \"PointerTap\": \"PointerTap\",\n \"PointerUp\": \"PointerUp\",\n \"MultipleTouches\": \"PointerZoom\",\n \"PointerCancel\": \"PointerCancel\",\n \"PointerHover\": \"PointerHover\",\n \"EnterDown\": \"EnterDown\",\n \"EnterUp\": \"EnterUp\",\n \"EscDown\": \"EscDown\",\n \"TabDown\": \"TabDown\",\n \"LeftArrowDown\": \"LeftArrowDown\",\n \"RightArrowDown\": \"RightArrowDown\",\n \"DownArrowDown\": \"DownArrowDown\",\n \"UpArrowDown\": \"UpArrowDown\",\n \"Focus\": \"Focus\",\n \"Blur\": \"Blur\"\n \n }\n \n controlEvent = UIView.controlEvent\n \n \n public get controlEventTargetAccumulator(): UIViewAddControlEventTargetObject<UIView> {\n \n const eventKeys: string[] = []\n \n const result: any = new Proxy(\n (this.constructor as any).controlEvent,\n {\n \n get: (target, key: string, _receiver) => {\n \n eventKeys.push(key)\n \n return result\n \n },\n set: (target, key: string, value, _receiver) => {\n \n eventKeys.push(key)\n this.addTargetForControlEvents(eventKeys, value)\n \n return true\n \n }\n \n }\n )\n \n return result\n \n }\n \n \n addTargetForControlEvents(eventKeys: string[], targetFunction: (sender: UIView, event: Event) => void) {\n eventKeys.forEach(key => this.addTargetForControlEvent(key, targetFunction))\n }\n \n \n addTargetForControlEvent(eventKey: string, targetFunction: (sender: UIView, event: Event) => void) {\n \n let targets = this._controlEventTargets[eventKey]\n \n if (!targets) {\n // @ts-ignore\n targets = []\n this._controlEventTargets[eventKey] = targets\n }\n \n if (targets.indexOf(targetFunction) == -1) {\n targets.push(targetFunction)\n }\n \n }\n \n removeTargetForControlEvent(eventKey: string, targetFunction: (sender: UIView, event: Event) => void) {\n const targets = this._controlEventTargets[eventKey]\n if (!targets) {\n return\n }\n const index = targets.indexOf(targetFunction)\n if (index != -1) {\n targets.splice(index, 1)\n }\n }\n \n removeTargetForControlEvents(eventKeys: string[], targetFunction: (sender: UIView, event: Event) => void) {\n eventKeys.forEach(key => this.removeTargetForControlEvent(key, targetFunction))\n }\n \n sendControlEventForKey(eventKey: string, nativeEvent: Event) {\n let targets = this._controlEventTargets[eventKey]\n if (!targets) {\n return\n }\n targets = targets.copy()\n for (let i = 0; i < targets.length; i++) {\n const target = targets[i]\n target(this, nativeEvent)\n }\n }\n \n \n static broadcastEventName = {\n \n \"LanguageChanged\": \"LanguageChanged\",\n \"RemovedFromViewTree\": \"RemovedFromViewTree\",\n \"AddedToViewTree\": \"AddedToViewTree\",\n \"PageDidScroll\": \"PageDidScroll\"\n \n }\n \n \n broadcastEventInSubtree(event: UIViewBroadcastEvent) {\n this.forEachViewInSubtree(view => {\n view.didReceiveBroadcastEvent(event)\n if (IS(view.viewController)) {\n view.viewController.viewDidReceiveBroadcastEvent(event)\n }\n })\n }\n \n didReceiveBroadcastEvent(event: UIViewBroadcastEvent) {\n \n if (event.name == UIView.broadcastEventName.PageDidScroll) {\n this._isPointerValid = NO\n }\n \n if (event.name == UIView.broadcastEventName.AddedToViewTree) {\n this.wasAddedToViewTree()\n }\n \n if (event.name == UIView.broadcastEventName.RemovedFromViewTree) {\n this.wasRemovedFromViewTree()\n }\n \n if (event.name == UIView.broadcastEventName.LanguageChanged || event.name ==\n UIView.broadcastEventName.AddedToViewTree) {\n this._setInnerHTMLFromKeyIfPossible()\n this._setInnerHTMLFromLocalizedTextObjectIfPossible()\n }\n \n }\n \n \n forEachViewInSubtree(functionToCall: (view: UIView) => void) {\n functionToCall(this)\n this.subviews.everyElement.forEachViewInSubtree(functionToCall)\n }\n \n \n rectangleInView(rectangle: UIRectangle, view: UIView) {\n if (!view.isMemberOfViewTree || !this.isMemberOfViewTree) {\n return nil\n }\n \n const viewClientRectangle = view.viewHTMLElement.getBoundingClientRect()\n const viewLocation = new UIPoint(viewClientRectangle.left, viewClientRectangle.top)\n \n const selfClientRectangle = this.viewHTMLElement.getBoundingClientRect()\n const selfLocation = new UIPoint(selfClientRectangle.left, selfClientRectangle.top)\n \n const offsetPoint = selfLocation.subtract(viewLocation)\n \n return rectangle.copy().offsetByPoint(offsetPoint)\n }\n \n rectangleFromView(rectangle: UIRectangle, view: UIView) {\n return view.rectangleInView(rectangle, this)\n }\n \n \n intrinsicContentSizeWithConstraints(constrainingHeight: number = 0, constrainingWidth: number = 0) {\n \n // This works but is slow\n \n const result = new UIRectangle(0, 0, 0, 0)\n if (this.rootView.forceIntrinsicSizeZero) {\n return result\n }\n \n let temporarilyInViewTree = NO\n let nodeAboveThisView: Node | null = null\n if (!this.isMemberOfViewTree) {\n document.body.appendChild(this.viewHTMLElement)\n temporarilyInViewTree = YES\n nodeAboveThisView = this.viewHTMLElement.nextSibling\n }\n \n const height = this.style.height\n const width = this.style.width\n \n this.style.height = \"\" + constrainingHeight\n this.style.width = \"\" + constrainingWidth\n \n \n const left = this.style.left\n const right = this.style.right\n const bottom = this.style.bottom\n const top = this.style.top\n \n this.style.left = \"\"\n this.style.right = \"\"\n this.style.bottom = \"\"\n this.style.top = \"\"\n \n \n const resultHeight = this.viewHTMLElement.scrollHeight\n \n \n const whiteSpace = this.style.whiteSpace\n this.style.whiteSpace = \"nowrap\"\n \n const resultWidth = this.viewHTMLElement.scrollWidth\n \n this.style.whiteSpace = whiteSpace\n \n \n this.style.height = height\n this.style.width = width\n \n this.style.left = left\n this.style.right = right\n this.style.bottom = bottom\n this.style.top = top\n \n if (temporarilyInViewTree) {\n document.body.removeChild(this.viewHTMLElement)\n if (this.superview) {\n if (nodeAboveThisView) {\n this.superview.viewHTMLElement.insertBefore(this.viewHTMLElement, nodeAboveThisView)\n }\n else {\n this.superview.viewHTMLElement.appendChild(this.viewHTMLElement)\n }\n }\n }\n \n result.height = resultHeight\n result.width = resultWidth\n \n \n return result\n \n }\n \n \n intrinsicContentWidth(constrainingHeight: number = 0): number {\n \n return this.intrinsicContentSizeWithConstraints(constrainingHeight).width\n \n }\n \n intrinsicContentHeight(constrainingWidth: number = 0): number {\n \n return this.intrinsicContentSizeWithConstraints(undefined, constrainingWidth).height\n \n \n }\n \n intrinsicContentSize(): UIRectangle {\n \n return nil\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,4BAAsC;AACtC,qBAAwB;AACxB,oBAAuB;AACvB,8BAAO;AAGP,sBAA4F;AAC5F,qBAAwB;AACxB,yBAA4B;AA+C5B,IAAI,CAAC,OAAO,YAAY;AAGpB,SAAO,aAAa;AAExB;AA+CO,MAAM,UAAN,cAAqB,yBAAS;AAAA,EA6DjC,YACI,YAAqB,WAAW,QAAO,WACvC,kBAAoD,MACpD,cAA6B,MAC7B,cACF;AAEE,UAAM;AAlEV,mCAAmC;AAMnC,oBAAoB;AAEpB,4BAA4B,uBAAQ;AASpC,gCAA+C;AAE/C,gCAAkD,CAAC;AAEnD,0BAAmC;AACnC,iCAA6B;AAM7B,qBAAqB;AAErB,+BAA+B;AAC/B,wCAAwC;AACxC,gCAAgC,IAAI,uBAAQ,GAAG,CAAC;AAChD,gCAA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,WAAW,UAAU;AAAA,EAE/B,YAAY,WAAW,UAAU;AAAA,EACjC,YAAY,WAAW,UAAU;AAErC;AAl6CS,OAo6CF,qBAAqB;AAAA,EAExB,SAAS,WAAW,SAAS;AAAA,EAC7B,mBAAmB,WAAW,SAAS;AAAA,EACvC,sBAAsB,WAAW,SAAS;AAE9C;AA16CS,OAgmEK,eAAe;AAAA,EAEzB,eAAe;AAAA,EACf,eAAe;AAAA,EACf,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,cAAc;AAAA,EACd,aAAa;AAAA,EACb,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,SAAS;AAAA,EACT,QAAQ;AAEZ;AAxnES,OA8sEF,qBAAqB;AAAA,EAExB,mBAAmB;AAAA,EACnB,uBAAuB;AAAA,EACvB,mBAAmB;AAAA,EACnB,iBAAiB;AAErB;",
4
+ "sourcesContent": ["import { IS_FIREFOX, IS_SAFARI } from \"./ClientCheckers\"\nimport { UIColor } from \"./UIColor\"\nimport { UICore } from \"./UICore\"\nimport \"./UICoreExtensions\"\nimport type { UIDialogView } from \"./UIDialogView\"\nimport { UILocalizedTextObject } from \"./UIInterfaces\"\nimport { FIRST, FIRST_OR_NIL, IS, IS_DEFINED, IS_NIL, IS_NOT, nil, NO, UIObject, YES } from \"./UIObject\"\nimport { UIPoint } from \"./UIPoint\"\nimport { UIRectangle } from \"./UIRectangle\"\nimport { UIViewController } from \"./UIViewController\"\n\n\ndeclare module AutoLayout {\n \n \n class Constraint {\n \n [key: string]: any\n \n }\n \n \n class View {\n \n [key: string]: any\n \n }\n \n \n class VisualFormat {\n \n static parse(arg0: any, arg1: any): any;\n \n [key: string]: any\n \n }\n \n \n enum Attribute {\n \n LEFT, RIGHT, BOTTOM, TOP, CENTERX, CENTERY, WIDTH, HEIGHT, ZINDEX, VARIABLE, NOTANATTRIBUTE\n \n }\n \n \n enum Relation {\n \n EQU, LEQ, GEQ\n \n }\n \n \n}\n\n// @ts-ignore\nif (!window.AutoLayout) {\n \n // @ts-ignore\n window.AutoLayout = nil\n \n}\n\n\nexport interface LooseObject {\n [key: string]: any\n}\n\n\nexport interface ControlEventTargetsObject {\n \n [key: string]: Function[];\n \n}\n\n\nexport interface UIViewBroadcastEvent {\n \n name: string;\n parameters: {\n [key: string]: string | string[];\n }\n \n}\n\n\nexport type UIViewAddControlEventTargetObject<T extends { controlEvent: Record<string, any> }> = {\n \n [K in keyof T[\"controlEvent\"]]: ((\n sender: UIView,\n event: Event\n) => void) & Partial<UIViewAddControlEventTargetObject<T>>\n\n}\n\n\ninterface Constraint {\n constant: number;\n multiplier: number;\n view1: any;\n attr2: any;\n priority: number;\n attr1: any;\n view2: any;\n relation: any\n}\n\n\nexport class UIView extends UIObject {\n \n _nativeSelectionEnabled: boolean = YES\n _shouldLayout?: boolean\n _UITableViewRowIndex?: number\n _UITableViewReusabilityIdentifier: any\n _UIViewIntrinsicTemporaryWidth?: string\n _UIViewIntrinsicTemporaryHeight?: string\n _enabled: boolean = YES\n _frame?: UIRectangle & { zIndex?: number }\n _backgroundColor: UIColor = UIColor.transparentColor\n \n _viewHTMLElement!: HTMLElement & LooseObject\n \n // Dynamic innerHTML\n _innerHTMLKey?: string\n _defaultInnerHTML?: string\n _parameters?: { [x: string]: (string | UILocalizedTextObject) }\n \n _localizedTextObject?: UILocalizedTextObject = nil\n \n _controlEventTargets: ControlEventTargetsObject = {} //{ \"PointerDown\": Function[]; \"PointerMove\": Function[]; \"PointerLeave\": Function[]; \"PointerEnter\": Function[]; \"PointerUpInside\": Function[]; \"PointerUp\": Function[]; \"PointerHover\": Function[]; };\n _frameTransform: string\n viewController: UIViewController = nil\n _updateLayoutFunction: any = nil\n // @ts-ignore\n _constraints: any[] //AutoLayout.Constraint[];\n superview: UIView\n subviews: UIView[]\n _styleClasses: any[]\n _isHidden: boolean = NO\n \n pausesPointerEvents: boolean = NO\n stopsPointerEventPropagation: boolean = YES\n pointerDraggingPoint: UIPoint = new UIPoint(0, 0)\n _previousClientPoint: UIPoint = new UIPoint(0, 0)\n _isPointerInside?: boolean\n _isPointerValid?: boolean\n _isPointerDown = NO\n _initialPointerPosition?: UIPoint\n _hasPointerDragged?: boolean\n _pointerDragThreshold = 2\n \n ignoresTouches: boolean = NO\n ignoresMouse: boolean = NO\n \n core: UICore = UICore.main\n \n static _UIViewIndex: number = -1\n _UIViewIndex: number\n \n static _viewsToLayout: UIView[] = []\n \n forceIntrinsicSizeZero: boolean = NO\n _touchEventTime?: number\n \n static _pageScale = 1\n _scale: number = 1\n isInternalScaling: boolean = YES\n private _resizeObserver!: ResizeObserver\n \n constructor(\n elementID: string = (\"UIView\" + UIView.nextIndex),\n viewHTMLElement: HTMLElement & LooseObject | null = null,\n elementType: string | null = null,\n initViewData?: any\n ) {\n \n super()\n \n // Instance variables\n \n UIView._UIViewIndex = UIView.nextIndex\n this._UIViewIndex = UIView._UIViewIndex\n \n this._styleClasses = []\n \n this._initViewHTMLElement(elementID, viewHTMLElement, elementType)\n \n this.subviews = []\n this.superview = nil\n \n this._constraints = []\n this._updateLayoutFunction = nil\n \n \n this._frameTransform = \"\"\n \n this._initViewCSSSelectorsIfNeeded()\n \n this._loadUIEvents()\n this.setNeedsLayout()\n \n }\n \n \n static get nextIndex() {\n return UIView._UIViewIndex + 1\n }\n \n static get pageHeight() {\n const body = document.body\n const html = document.documentElement\n return Math.max(\n body.scrollHeight,\n body.offsetHeight,\n html.clientHeight,\n html.scrollHeight,\n html.offsetHeight\n )\n }\n \n static get pageWidth() {\n const body = document.body\n const html = document.documentElement\n return Math.max(body.scrollWidth, body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth)\n }\n \n \n centerInContainer() {\n this.style.left = \"50%\"\n this.style.top = \"50%\"\n this.style.transform = \"translateX(-50%) translateY(-50%)\"\n }\n \n centerXInContainer() {\n this.style.left = \"50%\"\n this.style.transform = \"translateX(-50%)\"\n }\n \n centerYInContainer() {\n this.style.top = \"50%\"\n this.style.transform = \"translateY(-50%)\"\n }\n \n \n _initViewHTMLElement(\n elementID: string,\n viewHTMLElement: (HTMLElement & LooseObject) | null,\n elementType?: string | null\n ) {\n \n if (!IS(elementType)) {\n elementType = \"div\"\n }\n \n if (!IS(viewHTMLElement)) {\n \n this._viewHTMLElement = this.createElement(elementID, elementType)\n \n this.style.position = \"absolute\"\n this.style.margin = \"0\"\n \n }\n else {\n \n this._viewHTMLElement = viewHTMLElement\n \n }\n \n if (IS(elementID)) {\n this.viewHTMLElement.id = elementID\n }\n \n this.viewHTMLElement.obeyAutolayout = YES\n this.viewHTMLElement.UIView = this\n this.addStyleClass(this.styleClassName)\n \n this._resizeObserver = new ResizeObserver(() => this.setNeedsLayout())\n this._resizeObserver.observe(this.viewHTMLElement)\n \n }\n \n \n set nativeSelectionEnabled(selectable: boolean) {\n this._nativeSelectionEnabled = selectable\n if (!selectable) {\n this.style.cssText = this.style.cssText +\n \" -webkit-touch-callout: none; -webkit-user-select: none; \" +\n \"-khtml-user-select: none; -moz-user-select: none; \" +\n \"-ms-user-select: none; user-select: none;\"\n }\n else {\n this.style.cssText = this.style.cssText +\n \" -webkit-touch-callout: text; -webkit-user-select: text; \" +\n \"-khtml-user-select: text; -moz-user-select: text; \" +\n \"-ms-user-select: text; user-select: text;\"\n }\n }\n \n \n get nativeSelectionEnabled() {\n return this._nativeSelectionEnabled\n }\n \n \n get styleClassName() {\n return \"UICore_UIView_\" + this.class.name\n }\n \n protected _initViewCSSSelectorsIfNeeded() {\n if (!this.class._areViewCSSSelectorsInitialized) {\n this.initViewStyleSelectors()\n this.class._areViewCSSSelectorsInitialized = YES\n }\n }\n \n initViewStyleSelectors() {\n \n // Override this in a subclass\n \n }\n \n initStyleSelector(selector: string, style: string) {\n const styleRules = UIView.getStyleRules(selector)\n if (!styleRules) {\n UIView.createStyleSelector(selector, style)\n }\n }\n \n \n createElement(elementID: string, elementType: string) {\n let result = document.getElementById(elementID)\n if (!result) {\n result = document.createElement(elementType)\n }\n return result\n }\n \n public get viewHTMLElement() {\n return this._viewHTMLElement\n }\n \n public get elementID() {\n return this.viewHTMLElement.id\n }\n \n \n setInnerHTML(key: string, defaultString: string, parameters?: { [x: string]: string | UILocalizedTextObject }) {\n \n this._innerHTMLKey = key\n this._defaultInnerHTML = defaultString\n this._parameters = parameters\n \n const languageName = UICore.languageService.currentLanguageKey\n const result = UICore.languageService.stringForKey(key, languageName, defaultString, parameters)\n \n this.innerHTML = result ?? \"\"\n \n }\n \n \n protected _setInnerHTMLFromKeyIfPossible() {\n if (this._innerHTMLKey && this._defaultInnerHTML) {\n this.setInnerHTML(this._innerHTMLKey, this._defaultInnerHTML, this._parameters)\n }\n }\n \n protected _setInnerHTMLFromLocalizedTextObjectIfPossible() {\n if (IS(this._localizedTextObject)) {\n this.innerHTML = UICore.languageService.stringForCurrentLanguage(this._localizedTextObject)\n }\n }\n \n \n get localizedTextObject() {\n return this._localizedTextObject\n }\n \n set localizedTextObject(localizedTextObject: UILocalizedTextObject | undefined) {\n this._localizedTextObject = localizedTextObject\n this._setInnerHTMLFromLocalizedTextObjectIfPossible()\n }\n \n \n get innerHTML() {\n return this.viewHTMLElement.innerHTML\n }\n \n \n set innerHTML(innerHTML) {\n if (this.innerHTML != innerHTML) {\n this.viewHTMLElement.innerHTML = FIRST(innerHTML, \"\")\n }\n }\n \n \n set hoverText(hoverText: string) {\n this.viewHTMLElement.setAttribute(\"title\", hoverText)\n }\n \n get hoverText() {\n return this.viewHTMLElement.getAttribute(\"title\") ?? \"\"\n }\n \n \n get scrollSize() {\n return new UIRectangle(0, 0, this.viewHTMLElement.scrollHeight, this.viewHTMLElement.scrollWidth)\n }\n \n \n get dialogView(): UIDialogView {\n if (!IS(this.superview)) {\n return nil\n }\n if (!((this as any)[\"_isAUIDialogView\"])) {\n return this.superview.dialogView\n }\n return this as any as UIDialogView\n }\n \n \n get rootView(): UIView {\n if (IS(this.superview)) {\n return this.superview.rootView\n }\n return this\n }\n \n \n public set enabled(enabled: boolean) {\n this._enabled = enabled\n this.updateContentForCurrentEnabledState()\n }\n \n public get enabled(): boolean {\n return this._enabled\n }\n \n updateContentForCurrentEnabledState() {\n this.hidden = !this.enabled\n this.userInteractionEnabled = this.enabled\n }\n \n \n public get tabIndex(): number {\n return Number(this.viewHTMLElement.getAttribute(\"tabindex\"))\n }\n \n public set tabIndex(index: number) {\n this.viewHTMLElement.setAttribute(\"tabindex\", \"\" + index)\n }\n \n \n get propertyDescriptors(): { object: UIObject; name: string }[] {\n let result: any[] = []\n this.withAllSuperviews.forEach(view => {\n FIRST_OR_NIL(view.viewController).forEach((value, key, stopLooping) => {\n if (this == value) {\n result.push({ object: view.viewController, name: key })\n }\n })\n view.forEach((value, key, stopLooping) => {\n if (this == value) {\n result.push({ object: view, name: key })\n }\n })\n })\n return result\n }\n \n \n get styleClasses() {\n return this._styleClasses\n }\n \n set styleClasses(styleClasses) {\n this._styleClasses = styleClasses\n }\n \n hasStyleClass(styleClass: string) {\n \n // This is for performance reasons\n if (!IS(styleClass)) {\n return NO\n }\n \n const index = this.styleClasses.indexOf(styleClass)\n if (index > -1) {\n return YES\n }\n return NO\n \n }\n \n addStyleClass(styleClass: string) {\n \n if (!IS(styleClass)) {\n return\n }\n \n if (!this.hasStyleClass(styleClass)) {\n this._styleClasses.push(styleClass)\n }\n \n }\n \n removeStyleClass(styleClass: string) {\n \n // This is for performance reasons\n if (!IS(styleClass)) {\n return\n }\n \n const index = this.styleClasses.indexOf(styleClass)\n if (index > -1) {\n this.styleClasses.splice(index, 1)\n }\n \n }\n \n \n static findViewWithElementID(elementID: string): UIView {\n const viewHTMLElement = document.getElementById(elementID)\n if (IS_NOT(viewHTMLElement)) {\n return nil\n }\n // @ts-ignore\n return viewHTMLElement.UIView\n }\n \n \n static createStyleSelector(selector: string, style: string) {\n \n return\n \n // // @ts-ignore\n // if (!document.styleSheets) {\n // return\n // }\n // if (document.getElementsByTagName(\"head\").length == 0) {\n // return\n // }\n //\n // let styleSheet\n // let mediaType\n //\n // if (document.styleSheets.length > 0) {\n // for (var i = 0, l: any = document.styleSheets.length; i < l; i++) {\n // if (document.styleSheets[i].disabled) {\n // continue\n // }\n // const media = document.styleSheets[i].media\n // mediaType = typeof media\n //\n // if (mediaType === \"string\") {\n // if (media as any === \"\" || ((media as any).indexOf(\"screen\") !== -1)) {\n // styleSheet = document.styleSheets[i]\n // }\n // }\n // else if (mediaType == \"object\") {\n // if (media.mediaText === \"\" || (media.mediaText.indexOf(\"screen\") !== -1)) {\n // styleSheet = document.styleSheets[i]\n // }\n // }\n //\n // if (typeof styleSheet !== \"undefined\") {\n // break\n // }\n // }\n // }\n //\n // if (typeof styleSheet === \"undefined\") {\n // const styleSheetElement = document.createElement(\"style\")\n // styleSheetElement.type = \"text/css\"\n // document.getElementsByTagName(\"head\")[0].appendChild(styleSheetElement)\n //\n // for (i = 0; i < document.styleSheets.length; i++) {\n // if (document.styleSheets[i].disabled) {\n // continue\n // }\n // styleSheet = document.styleSheets[i]\n // }\n //\n // mediaType = typeof styleSheet.media\n // }\n //\n // if (mediaType === \"string\") {\n // for (var i = 0, l = styleSheet.rules.length; i < l; i++) {\n // if (styleSheet.rules[i].selectorText && styleSheet.rules[i].selectorText.toLowerCase() ==\n // selector.toLowerCase()) {\n // styleSheet.rules[i].style.cssText = style\n // return\n // }\n // }\n // styleSheet.addRule(selector, style)\n // }\n // else if (mediaType === \"object\") {\n //\n // var styleSheetLength = 0\n //\n // try {\n //\n // styleSheetLength = (styleSheet.cssRules) ? styleSheet.cssRules.length : 0\n //\n // } catch (error) {\n //\n // }\n //\n //\n // for (var i = 0; i < styleSheetLength; i++) {\n // if (styleSheet.cssRules[i].selectorText && styleSheet.cssRules[i].selectorText.toLowerCase() ==\n // selector.toLowerCase()) {\n // styleSheet.cssRules[i].style.cssText = style\n // return\n // }\n // }\n // styleSheet.insertRule(selector + \"{\" + style + \"}\", styleSheetLength)\n // }\n }\n \n \n static getStyleRules(selector: string) {\n \n // https://stackoverflow.com/questions/324486/how-do-you-read-css-rule-values-with-javascript\n //Inside closure so that the inner functions don't need regeneration on every call.\n const getCssClasses = (function () {\n function normalize(str: string) {\n if (!str) {\n return \"\"\n }\n str = String(str).replace(/\\s*([>~+])\\s*/g, \" $1 \") //Normalize symbol spacing.\n return str.replace(/(\\s+)/g, \" \").trim() //Normalize whitespace\n }\n \n function split(str: string, on: string) { //Split, Trim, and remove empty elements\n return str.split(on).map(x => x.trim()).filter(x => x)\n }\n \n function containsAny(selText: string | any[], ors: any[]) {\n return selText ? ors.some(x => selText.indexOf(x) >= 0) : false\n }\n \n return function (selector: string) {\n const logicalORs = split(normalize(selector), \",\")\n const sheets = Array.from(window.document.styleSheets)\n const ruleArrays = sheets.map((x) => Array.from(x.rules || x.cssRules || []))\n const allRules = ruleArrays.reduce((all, x) => all.concat(x), [])\n // @ts-ignore\n return allRules.filter((x) => containsAny(normalize(x.selectorText), logicalORs))\n }\n })()\n \n return getCssClasses(selector)\n \n // selector = selector.toLowerCase()\n // let styleRules\n // for (let i = 0; i < document.styleSheets.length; i++) {\n // const styleSheet = document.styleSheets[i] as any\n //\n // try {\n //\n // styleRules = styleSheet.cssRules ? styleSheet.cssRules : styleSheet.rules\n //\n // } catch (error) {\n //\n // console.log(error)\n //\n // }\n //\n // }\n //\n // return styleRules\n \n }\n \n \n get style() {\n return this.viewHTMLElement.style\n }\n \n get computedStyle() {\n return getComputedStyle(this.viewHTMLElement)\n }\n \n public get hidden(): boolean {\n return this._isHidden\n }\n \n \n public set hidden(v: boolean) {\n \n this._isHidden = v\n \n if (this._isHidden) {\n this.style.visibility = \"hidden\"\n }\n else {\n this.style.visibility = \"visible\"\n }\n \n \n }\n \n static set pageScale(scale: number) {\n \n UIView._pageScale = scale\n \n const zoom = scale\n const width = 100 / zoom\n const viewHTMLElement = UICore.main.rootViewController.view.viewHTMLElement\n viewHTMLElement.style.transformOrigin = \"left top\"\n viewHTMLElement.style.transform = \"scale(\" + zoom + \")\"\n viewHTMLElement.style.width = width + \"%\"\n \n }\n \n static get pageScale() {\n return UIView._pageScale\n }\n \n \n set scale(scale: number) {\n \n this._scale = scale\n \n const zoom = scale\n // const width = 100 / zoom\n // const height = 100 / zoom\n const viewHTMLElement = this.viewHTMLElement\n viewHTMLElement.style.transformOrigin = \"left top\"\n viewHTMLElement.style.transform = viewHTMLElement.style.transform.replace(\n (viewHTMLElement.style.transform.match(\n new RegExp(\"scale\\\\(.*\\\\)\", \"g\")\n )?.firstElement ?? \"\"),\n \"\"\n ) + \"scale(\" + zoom + \")\"\n // viewHTMLElement.style.width = width + \"%\"\n // viewHTMLElement.style.height = height + \"%\"\n \n if (this.isInternalScaling) {\n \n this.setFrame(this.frame, this.frame.zIndex, YES)\n \n }\n \n }\n \n get scale() {\n \n return this._scale\n \n }\n \n \n // Use this method to calculate the frame for the view itself\n // This can be used when adding subviews to existing views like buttons\n calculateAndSetViewFrame() {\n \n }\n \n \n public get frame() {\n let result: UIRectangle & { zIndex?: number } = this._frame?.copy() as any\n if (!result) {\n result = new UIRectangle(\n this.viewHTMLElement.offsetLeft,\n this.viewHTMLElement.offsetTop,\n this.viewHTMLElement.offsetHeight,\n this.viewHTMLElement.offsetWidth\n ) as any\n result.zIndex = 0\n }\n return result\n }\n \n public set frame(rectangle: UIRectangle & { zIndex?: number }) {\n if (IS(rectangle)) {\n this.setFrame(rectangle, rectangle.zIndex)\n }\n }\n \n setFrame(rectangle: UIRectangle & { zIndex?: number }, zIndex = 0, performUncheckedLayout = NO) {\n \n const frame: (UIRectangle & { zIndex?: number }) = this._frame || new UIRectangle(nil, nil, nil, nil) as any\n \n if (zIndex != undefined) {\n rectangle.zIndex = zIndex\n }\n this._frame = rectangle\n \n if (frame && frame.isEqualTo(rectangle) && frame.zIndex == rectangle.zIndex && !performUncheckedLayout) {\n return\n }\n \n if (this.isInternalScaling) {\n rectangle.scale(1 / this.scale)\n }\n \n UIView._setAbsoluteSizeAndPosition(\n this.viewHTMLElement,\n rectangle.topLeft.x,\n rectangle.topLeft.y,\n rectangle.width,\n rectangle.height,\n rectangle.zIndex\n )\n \n if (frame.height != rectangle.height || frame.width != rectangle.width || performUncheckedLayout) {\n this.setNeedsLayout()\n this.boundsDidChange()\n }\n \n }\n \n \n get bounds() {\n let result: UIRectangle\n if (IS_NOT(this._frame)) {\n result = new UIRectangle(0, 0, this.viewHTMLElement.offsetHeight, this.viewHTMLElement.offsetWidth)\n }\n else {\n result = this.frame.copy()\n result.x = 0\n result.y = 0\n }\n return result\n }\n \n set bounds(rectangle) {\n const frame = this.frame\n const newFrame = new UIRectangle(frame.topLeft.x, frame.topLeft.y, rectangle.height, rectangle.width)\n // @ts-ignore\n newFrame.zIndex = frame.zIndex\n this.frame = newFrame\n }\n \n \n boundsDidChange() {\n \n \n }\n \n \n setPosition(\n left: number | string = nil,\n right: number | string = nil,\n bottom: number | string = nil,\n top: number | string = nil,\n height: number | string = nil,\n width: number | string = nil\n ) {\n \n const previousBounds = this.bounds\n \n this.setStyleProperty(\"left\", left)\n this.setStyleProperty(\"right\", right)\n this.setStyleProperty(\"bottom\", bottom)\n this.setStyleProperty(\"top\", top)\n this.setStyleProperty(\"height\", height)\n this.setStyleProperty(\"width\", width)\n \n const bounds = this.bounds\n if (bounds.height != previousBounds.height || bounds.width != previousBounds.width) {\n this.setNeedsLayout()\n this.boundsDidChange()\n }\n \n }\n \n setSizes(height?: number | string, width?: number | string) {\n \n const previousBounds = this.bounds\n \n this.setStyleProperty(\"height\", height)\n this.setStyleProperty(\"width\", width)\n \n const bounds = this.bounds\n if (bounds.height != previousBounds.height || bounds.width != previousBounds.width) {\n this.setNeedsLayout()\n this.boundsDidChange()\n }\n \n }\n \n setMinSizes(height?: number | string, width?: number | string) {\n \n const previousBounds = this.bounds\n \n this.setStyleProperty(\"minHeight\", height)\n this.setStyleProperty(\"minWidth\", width)\n \n const bounds = this.bounds\n if (bounds.height != previousBounds.height || bounds.width != previousBounds.width) {\n this.setNeedsLayout()\n this.boundsDidChange()\n }\n \n }\n \n setMaxSizes(height?: number | string, width?: number | string) {\n \n const previousBounds = this.bounds\n \n this.setStyleProperty(\"maxHeight\", height)\n this.setStyleProperty(\"maxWidth\", width)\n \n const bounds = this.bounds\n if (bounds.height != previousBounds.height || bounds.width != previousBounds.width) {\n this.setNeedsLayout()\n this.boundsDidChange()\n }\n \n }\n \n setMargin(margin?: number | string) {\n \n const previousBounds = this.bounds\n \n this.setStyleProperty(\"margin\", margin)\n \n const bounds = this.bounds\n if (bounds.height != previousBounds.height || bounds.width != previousBounds.width) {\n this.setNeedsLayout()\n this.boundsDidChange()\n }\n \n }\n \n setMargins(left?: number | string, right?: number | string, bottom?: number | string, top?: number | string) {\n \n const previousBounds = this.bounds\n \n this.setStyleProperty(\"marginLeft\", left)\n this.setStyleProperty(\"marginRight\", right)\n this.setStyleProperty(\"marginBottom\", bottom)\n this.setStyleProperty(\"marginTop\", top)\n \n const bounds = this.bounds\n if (bounds.height != previousBounds.height || bounds.width != previousBounds.width) {\n this.setNeedsLayout()\n this.boundsDidChange()\n }\n \n }\n \n setPadding(padding?: number | string) {\n \n const previousBounds = this.bounds\n \n this.setStyleProperty(\"padding\", padding)\n \n const bounds = this.bounds\n if (bounds.height != previousBounds.height || bounds.width != previousBounds.width) {\n this.setNeedsLayout()\n this.boundsDidChange()\n }\n \n }\n \n setPaddings(left?: number | string, right?: number | string, bottom?: number | string, top?: number | string) {\n \n const previousBounds = this.bounds\n \n this.setStyleProperty(\"paddingLeft\", left)\n this.setStyleProperty(\"paddingRight\", right)\n this.setStyleProperty(\"paddingBottom\", bottom)\n this.setStyleProperty(\"paddingTop\", top)\n \n const bounds = this.bounds\n if (bounds.height != previousBounds.height || bounds.width != previousBounds.width) {\n this.setNeedsLayout()\n this.boundsDidChange()\n }\n \n }\n \n \n setBorder(\n radius: number | string = nil,\n width: number | string = 1,\n color: UIColor = UIColor.blackColor,\n style: string = \"solid\"\n ) {\n \n this.setStyleProperty(\"borderStyle\", style)\n \n this.setStyleProperty(\"borderRadius\", radius)\n \n this.setStyleProperty(\"borderColor\", color.stringValue)\n \n this.setStyleProperty(\"borderWidth\", width)\n \n }\n \n \n setStyleProperty(propertyName: string, value?: number | string) {\n \n try {\n \n if (IS_NIL(value)) {\n return\n }\n if (IS_DEFINED(value) && (value as Number).isANumber) {\n value = \"\" + (value as number).integerValue + \"px\"\n }\n \n // @ts-ignore\n this.style[propertyName] = value\n \n } catch (exception) {\n \n console.log(exception)\n \n }\n \n }\n \n \n get userInteractionEnabled() {\n return (this.style.pointerEvents != \"none\")\n }\n \n set userInteractionEnabled(userInteractionEnabled) {\n if (userInteractionEnabled) {\n this.style.pointerEvents = \"\"\n }\n else {\n this.style.pointerEvents = \"none\"\n }\n }\n \n \n get backgroundColor() {\n return this._backgroundColor\n }\n \n set backgroundColor(backgroundColor: UIColor) {\n this._backgroundColor = backgroundColor\n this.style.backgroundColor = backgroundColor.stringValue\n }\n \n \n get alpha() {\n return 1 * (this.style.opacity as any)\n }\n \n set alpha(alpha) {\n this.style.opacity = \"\" + alpha\n }\n \n \n static animateViewOrViewsWithDurationDelayAndFunction(\n viewOrViews: UIView | HTMLElement | UIView[] | HTMLElement[],\n duration: number,\n delay: number,\n timingStyle = \"cubic-bezier(0.25,0.1,0.25,1)\",\n transformFunction: Function,\n transitioncompletionFunction: Function\n ) {\n \n function callTransitioncompletionFunction() {\n (transitioncompletionFunction || nil)();\n (viewOrViews as UIView[] | HTMLElement[]).forEach(view => {\n if (view instanceof UIView) {\n view.animationDidFinish()\n }\n })\n }\n \n if (IS_FIREFOX) {\n \n // Firefox does not fire the transition completion event properly\n new UIObject().performFunctionWithDelay(delay + duration, callTransitioncompletionFunction)\n \n }\n \n \n if (!(viewOrViews instanceof Array)) {\n viewOrViews = [viewOrViews] as any\n }\n \n const transitionStyles: any[] = []\n const transitionDurations: any[] = []\n const transitionDelays: any[] = []\n const transitionTimings: any[] = []\n \n function isUIView(view: any): view is UIView {\n return IS(view.viewHTMLElement)\n }\n \n for (var i = 0; i < (viewOrViews as any).length; i++) {\n \n let view = (viewOrViews as UIView[] | HTMLElement[])[i]\n \n if (isUIView(view)) {\n view = view.viewHTMLElement\n }\n \n // @ts-ignore\n view.addEventListener(\"transitionend\", transitionDidFinish, true)\n \n transitionStyles.push(view.style.transition)\n transitionDurations.push(view.style.transitionDuration)\n transitionDelays.push(view.style.transitionDelay)\n transitionTimings.push(view.style.transitionTimingFunction)\n \n view.style.transition = \"all\"\n view.style.transitionDuration = \"\" + duration + \"s\"\n view.style.transitionDelay = \"\" + delay + \"s\"\n view.style.transitionTimingFunction = timingStyle\n \n }\n \n transformFunction()\n \n const transitionObject = {\n \"finishImmediately\": finishTransitionImmediately,\n \"didFinish\": transitionDidFinishManually,\n \"views\": viewOrViews,\n \"registrationTime\": Date.now()\n }\n \n function finishTransitionImmediately() {\n for (var i = 0; i < (viewOrViews as any).length; i++) {\n let view = (viewOrViews as UIView[] | HTMLElement[])[i]\n if (isUIView(view)) {\n view = view.viewHTMLElement\n }\n view.style.transition = \"all\"\n view.style.transitionDuration = \"\" + duration + \"s\"\n view.style.transitionDelay = \"\" + delay + \"s\"\n view.style.transition = transitionStyles[i]\n view.style.transitionDuration = transitionDurations[i]\n view.style.transitionDelay = transitionDelays[i]\n view.style.transitionTimingFunction = transitionTimings[i]\n }\n }\n \n function transitionDidFinish(this: HTMLElement, event: { srcElement: HTMLElement | UIView }) {\n let view = event.srcElement\n if (!view) {\n return\n }\n if (isUIView(view)) {\n view = view.viewHTMLElement\n }\n view.style.transition = transitionStyles[i]\n view.style.transitionDuration = transitionDurations[i]\n view.style.transitionDelay = transitionDelays[i]\n view.style.transitionTimingFunction = transitionTimings[i]\n \n callTransitioncompletionFunction()\n \n // @ts-ignore\n view.removeEventListener(\"transitionend\", transitionDidFinish, true)\n \n }\n \n function transitionDidFinishManually() {\n for (let i = 0; i < (viewOrViews as any).length; i++) {\n \n let view = (viewOrViews as UIView[] | HTMLElement[])[i]\n \n if (isUIView(view)) {\n view = view.viewHTMLElement\n }\n \n view.style.transition = transitionStyles[i]\n view.style.transitionDuration = transitionDurations[i]\n view.style.transitionDelay = transitionDelays[i]\n view.style.transitionTimingFunction = transitionTimings[i]\n \n // @ts-ignore\n view.removeEventListener(\"transitionend\", transitionDidFinish, true)\n \n }\n \n \n }\n \n return transitionObject\n \n }\n \n \n animationDidFinish() {\n \n \n }\n \n \n static _transformAttribute = ((\"transform\" in document.documentElement.style) ? \"transform\" : undefined) ||\n ((\"-webkit-transform\" in document.documentElement.style) ? \"-webkit-transform\" : \"undefined\") ||\n ((\"-moz-transform\" in document.documentElement.style) ? \"-moz-transform\" : \"undefined\") ||\n ((\"-ms-transform\" in document.documentElement.style) ? \"-ms-transform\" : \"undefined\") ||\n ((\"-o-transform\" in document.documentElement.style) ? \"-o-transform\" : \"undefined\")\n \n static _setAbsoluteSizeAndPosition(\n element: HTMLElement & LooseObject,\n left: number,\n top: number,\n width: string | number,\n height: string | number,\n zIndex = 0\n ) {\n \n if (!IS(element) || !element.obeyAutolayout && !element.getAttribute(\"obeyAutolayout\")) {\n return\n }\n \n if (IS(height)) {\n height = height.integerValue + \"px\"\n }\n \n if (IS(width)) {\n width = width.integerValue + \"px\"\n }\n \n let str = element.style.cssText\n \n const frameTransform = UIView._transformAttribute + \": translate3d(\" + (left).integerValue + \"px, \" +\n (top).integerValue + \"px, 0px)\"\n \n if (element.UIView) {\n \n str = str + frameTransform +\n (element.style.transform.match(\n new RegExp(\"scale\\\\(.*\\\\)\", \"g\")\n )?.firstElement ?? \"\") + \";\"\n \n }\n \n if (IS_NIL(height)) {\n str = str + \" height: unset;\"\n }\n else {\n str = str + \" height:\" + height + \";\"\n }\n \n if (IS_NIL(width)) {\n str = str + \" width: unset;\"\n }\n else {\n str = str + \" width:\" + width + \";\"\n }\n \n if (IS_NIL(zIndex)) {\n str = str + \" z-index: unset;\"\n }\n else {\n str = str + \" z-index:\" + zIndex + \";\"\n }\n \n element.style.cssText = element.style.cssText + str\n \n }\n \n \n static performAutoLayout(\n parentElement: HTMLElement & LooseObject,\n visualFormatArray: string | any[] | null,\n constraintsArray: string | any[]\n ) {\n \n const view = new AutoLayout.View()\n \n if (IS(visualFormatArray) && IS(visualFormatArray.length)) {\n view.addConstraints(AutoLayout.VisualFormat.parse(visualFormatArray, { extended: true }))\n }\n \n if (IS(constraintsArray) && IS(constraintsArray.length)) {\n view.addConstraints(constraintsArray)\n }\n \n const elements: Record<string, HTMLElement> = {}\n for (var key in view.subViews) {\n \n if (!view.subViews.hasOwnProperty(key)) {\n continue\n }\n \n var element = nil\n \n try {\n \n element = parentElement.querySelector(\"#\" + key)\n \n } catch (error) {\n \n //console.log(\"Error occurred \" + error);\n \n }\n \n if (!(element && !element.obeyAutolayout && !element.getAttribute(\"obeyAutolayout\")) && element) {\n element.className += element.className ? \" abs\" : \"abs\"\n elements[key] = element\n }\n \n }\n \n let parentUIView = nil\n \n if (parentElement.UIView) {\n parentUIView = parentElement.UIView\n }\n \n const updateLayout = function () {\n view.setSize(\n parentElement ? parentElement.clientWidth : window.innerWidth,\n parentElement ? parentElement.clientHeight : window.innerHeight\n )\n for (key in view.subViews) {\n \n if (!view.subViews.hasOwnProperty(key)) {\n continue\n }\n \n const subView = view.subViews[key]\n \n if (elements[key]) {\n UIView._setAbsoluteSizeAndPosition(\n elements[key],\n subView.left,\n subView.top,\n subView.width,\n subView.height\n )\n }\n }\n \n parentUIView.didLayoutSubviews()\n \n }\n \n updateLayout()\n return updateLayout\n \n }\n \n \n static runFunctionBeforeNextFrame(step: () => void) {\n \n if (IS_SAFARI) {\n \n // This creates a microtask\n Promise.resolve().then(step)\n \n }\n else {\n \n window.requestAnimationFrame(step)\n \n }\n \n }\n \n \n static scheduleLayoutViewsIfNeeded() {\n \n UIView.runFunctionBeforeNextFrame(UIView.layoutViewsIfNeeded)\n \n }\n \n \n static layoutViewsIfNeeded() {\n for (var i = 0; i < UIView._viewsToLayout.length; i++) {\n const view = UIView._viewsToLayout[i]\n view.layoutIfNeeded()\n }\n UIView._viewsToLayout = []\n }\n \n \n setNeedsLayout() {\n \n if (this._shouldLayout) {\n return\n }\n \n this._shouldLayout = YES\n \n // Register view for layout before next frame\n UIView._viewsToLayout.push(this)\n \n if (UIView._viewsToLayout.length == 1) {\n UIView.scheduleLayoutViewsIfNeeded()\n }\n \n }\n \n \n get needsLayout() {\n \n return this._shouldLayout\n \n }\n \n \n layoutIfNeeded() {\n \n if (!this._shouldLayout) {\n return\n }\n \n this._shouldLayout = NO\n \n try {\n \n this.layoutSubviews()\n \n } catch (exception) {\n \n console.log(exception)\n \n }\n \n }\n \n \n layoutSubviews() {\n \n this.willLayoutSubviews()\n \n this._shouldLayout = NO\n \n // Autolayout\n if (this.constraints.length) {\n this._updateLayoutFunction = UIView.performAutoLayout(this.viewHTMLElement, null, this.constraints)\n }\n this._updateLayoutFunction()\n \n this.viewController.layoutViewSubviews()\n \n this.applyClassesAndStyles()\n \n for (let i = 0; i < this.subviews.length; i++) {\n \n const subview = this.subviews[i]\n subview.calculateAndSetViewFrame()\n \n }\n \n this.didLayoutSubviews()\n \n }\n \n \n applyClassesAndStyles() {\n for (let i = 0; i < this.styleClasses.length; i++) {\n const styleClass = this.styleClasses[i]\n if (styleClass) {\n this.viewHTMLElement.classList.add(styleClass)\n }\n }\n }\n \n willLayoutSubviews() {\n \n this.viewController.viewWillLayoutSubviews()\n \n }\n \n didLayoutSubviews() {\n \n this.viewController.viewDidLayoutSubviews()\n \n }\n \n get constraints() {\n return this._constraints\n }\n \n set constraints(constraints) {\n this._constraints = constraints\n }\n \n addConstraint(constraint: any) {\n this.constraints.push(constraint)\n }\n \n \n addConstraintsWithVisualFormat(visualFormatArray: string[]) {\n this.constraints = this.constraints.concat(AutoLayout.VisualFormat.parse(\n visualFormatArray,\n { extended: true }\n ))\n }\n \n static constraintWithView(\n view: { isKindOfClass: (arg0: typeof UIView) => any; viewHTMLElement: any; id: any },\n attribute: any,\n relation: any,\n toView: { isKindOfClass: any; viewHTMLElement: any; id: any },\n toAttribute: any,\n multiplier: number,\n constant: number,\n priority: number\n ): Constraint {\n \n let UIViewObject = nil\n let viewID = null\n if (view) {\n if (view.isKindOfClass && view.isKindOfClass(UIView)) {\n UIViewObject = view\n view = view.viewHTMLElement\n }\n viewID = view.id\n }\n \n let toUIViewObject = nil\n let toViewID = null\n if (toView) {\n if (toView.isKindOfClass && view.isKindOfClass(UIView)) {\n toUIViewObject = toView\n toView = toView.viewHTMLElement\n }\n toViewID = toView.id\n }\n \n const constraint = {\n \n view1: viewID,\n attr1: attribute,\n relation: relation,\n view2: toViewID,\n attr2: toAttribute,\n multiplier: multiplier,\n constant: constant,\n priority: priority\n \n }\n \n return constraint\n \n }\n \n static constraintAttribute = {\n \n \"left\": AutoLayout.Attribute.LEFT,\n \"right\": AutoLayout.Attribute.RIGHT,\n \"bottom\": AutoLayout.Attribute.BOTTOM,\n \"top\": AutoLayout.Attribute.TOP,\n \"centerX\": AutoLayout.Attribute.CENTERX,\n \"centerY\": AutoLayout.Attribute.CENTERY,\n \"height\": AutoLayout.Attribute.HEIGHT,\n \"width\": AutoLayout.Attribute.WIDTH,\n \"zIndex\": AutoLayout.Attribute.ZINDEX,\n // Not sure what these are for\n \"constant\": AutoLayout.Attribute.NOTANATTRIBUTE,\n \"variable\": AutoLayout.Attribute.VARIABLE\n \n }\n \n static constraintRelation = {\n \n \"equal\": AutoLayout.Relation.EQU,\n \"lessThanOrEqual\": AutoLayout.Relation.LEQ,\n \"greaterThanOrEqual\": AutoLayout.Relation.GEQ\n \n }\n \n \n subviewWithID(viewID: string): UIView {\n let resultHTMLElement = nil\n \n try {\n resultHTMLElement = this.viewHTMLElement.querySelector(\"#\" + viewID)\n } catch (error) {\n console.log(error)\n }\n \n if (resultHTMLElement && resultHTMLElement.UIView) {\n return resultHTMLElement.UIView\n }\n return nil\n }\n \n \n rectangleContainingSubviews() {\n const center = this.bounds.center\n let result = new UIRectangle(center.x, center.y, 0, 0)\n for (let i = 0; i < this.subviews.length; i++) {\n const subview = this.subviews[i]\n let frame = subview.frame\n const rectangleContainingSubviews = subview.rectangleContainingSubviews()\n frame = frame.concatenateWithRectangle(rectangleContainingSubviews)\n result = result.concatenateWithRectangle(frame)\n }\n return result\n }\n \n \n hasSubview(view: UIView) {\n \n // This is for performance reasons\n if (!IS(view)) {\n return NO\n }\n \n for (let i = 0; i < this.subviews.length; i++) {\n const subview = this.subviews[i]\n if (subview == view) {\n return YES\n }\n }\n return NO\n }\n \n get viewBelowThisView() {\n const result: UIView = (this.viewHTMLElement.previousElementSibling as any || {}).UIView\n return result\n }\n \n get viewAboveThisView() {\n const result: UIView = (this.viewHTMLElement.nextElementSibling as any || {}).UIView\n return result\n }\n \n addSubview(view: UIView, aboveView?: UIView) {\n \n if (!this.hasSubview(view) && IS(view)) {\n \n view.willMoveToSuperview(this)\n \n if (IS(aboveView)) {\n this.viewHTMLElement.insertBefore(view.viewHTMLElement, aboveView.viewHTMLElement.nextSibling)\n this.subviews.insertElementAtIndex(this.subviews.indexOf(aboveView), view)\n }\n else {\n this.viewHTMLElement.appendChild(view.viewHTMLElement)\n this.subviews.push(view)\n }\n \n view.core = this.core\n view.didMoveToSuperview(this)\n \n if (this.superview && this.isMemberOfViewTree) {\n \n view.broadcastEventInSubtree({\n name: UIView.broadcastEventName.AddedToViewTree,\n parameters: nil\n })\n \n }\n \n this.setNeedsLayout()\n \n }\n \n }\n \n addSubviews(views: UIView[]) {\n views.forEach(view => this.addSubview(view))\n }\n \n \n addedAsSubviewToView(view: UIView, aboveView?: UIView) {\n view.addSubview(this, aboveView)\n return this\n }\n \n \n moveToBottomOfSuperview() {\n \n if (IS(this.superview)) {\n \n const bottomView = this.superview.subviews.firstElement\n \n if (bottomView == this) {\n return\n }\n \n this.superview.subviews.removeElement(this)\n this.superview.subviews.insertElementAtIndex(0, this)\n this.superview.viewHTMLElement.insertBefore(this.viewHTMLElement, bottomView.viewHTMLElement)\n \n }\n \n }\n \n moveToTopOfSuperview() {\n \n if (IS(this.superview)) {\n \n const topView = this.superview.subviews.lastElement\n \n if (topView == this) {\n return\n }\n \n this.superview.subviews.removeElement(this)\n this.superview.subviews.push(this)\n this.superview.viewHTMLElement.appendChild(this.viewHTMLElement)\n \n }\n \n }\n \n \n removeFromSuperview() {\n if (IS(this.superview)) {\n this.forEachViewInSubtree(view => view.blur())\n const index = this.superview.subviews.indexOf(this)\n if (index > -1) {\n this.superview.subviews.splice(index, 1)\n this.superview.viewHTMLElement.removeChild(this.viewHTMLElement)\n this.superview = nil\n this.broadcastEventInSubtree({\n name: UIView.broadcastEventName.RemovedFromViewTree,\n parameters: nil\n })\n \n }\n }\n }\n \n \n willAppear() {\n \n \n }\n \n \n willMoveToSuperview(superview: UIView) {\n this._setInnerHTMLFromKeyIfPossible()\n this._setInnerHTMLFromLocalizedTextObjectIfPossible()\n }\n \n didMoveToSuperview(superview: UIView) {\n this.superview = superview\n }\n \n wasAddedToViewTree() {\n \n }\n \n wasRemovedFromViewTree() {\n \n }\n \n get isMemberOfViewTree() {\n let element: HTMLElement & LooseObject | null = this.viewHTMLElement\n for (let i = 0; element; i = i) {\n if (element.parentElement && element.parentElement == document.body) {\n return YES\n }\n element = element.parentElement\n }\n return NO\n }\n \n \n get withAllSuperviews() {\n const result = []\n let view: UIView = this\n for (let i = 0; IS(view); i = i) {\n result.push(view)\n view = view.superview\n }\n return result\n }\n \n \n setNeedsLayoutOnAllSuperviews() {\n this.withAllSuperviews.reverse().everyElement.setNeedsLayout()\n }\n \n \n setNeedsLayoutUpToRootView() {\n this.setNeedsLayoutOnAllSuperviews()\n this.setNeedsLayout()\n }\n \n \n focus() {\n this.viewHTMLElement.focus()\n }\n \n \n blur() {\n this.viewHTMLElement.blur()\n }\n \n \n static async shouldCallPointerUpInsideOnView(view: UIView) {\n \n return YES\n \n }\n \n static async shouldCallPointerHoverOnView(view: UIView) {\n \n return YES\n \n }\n \n static async shouldCallPointerLeaveOnView(view: UIView) {\n \n return YES\n \n }\n \n static async shouldCallPointerCancelOnView(view: UIView) {\n \n return YES\n \n }\n \n \n shouldCallPointerUpInside() {\n return UIView.shouldCallPointerUpInsideOnView(this)\n }\n \n shouldCallPointerCancel() {\n return UIView.shouldCallPointerCancelOnView(this)\n }\n \n shouldCallPointerHover() {\n return UIView.shouldCallPointerHoverOnView(this)\n }\n \n shouldCallPointerLeave() {\n return UIView.shouldCallPointerLeaveOnView(this)\n }\n \n \n protected _loadUIEvents() {\n \n \n const isTouchEventClassDefined: boolean = NO || (window as any).TouchEvent\n \n const pauseEvent = (event: Event, forced = NO) => {\n \n if (this.pausesPointerEvents || forced) {\n \n if (event.stopPropagation) {\n event.stopPropagation()\n }\n if (event.preventDefault) {\n event.preventDefault()\n }\n event.cancelBubble = true\n event.returnValue = false\n return false\n \n }\n \n if (event.stopPropagation && this.stopsPointerEventPropagation) {\n event.stopPropagation()\n }\n \n }\n \n const onMouseDown = (event: MouseEvent) => {\n \n if ((this.ignoresTouches && isTouchEventClassDefined && event instanceof TouchEvent) ||\n ((this.ignoresMouse || (IS(this._touchEventTime) && (Date.now() - this._touchEventTime) > 500)) &&\n event instanceof MouseEvent)) {\n return\n }\n \n this.sendControlEventForKey(UIView.controlEvent.PointerDown, event)\n \n this._isPointerInside = YES\n this._isPointerValid = YES\n this._isPointerDown = YES\n this._initialPointerPosition = new UIPoint(event.clientX, event.clientY)\n if (isTouchEventClassDefined && event instanceof TouchEvent) {\n this._touchEventTime = Date.now()\n this._initialPointerPosition = new UIPoint(event.touches[0].clientX, event.touches[0].clientY)\n if (event.touches.length > 1) {\n onTouchCancel(event)\n return\n }\n }\n else {\n this._touchEventTime = nil\n pauseEvent(event)\n }\n \n this._hasPointerDragged = NO\n \n const windowMouseMoveFunction = (event: MouseEvent) => {\n onMouseMove(event)\n //pauseEvent(event, YES)\n }\n const windowMouseUpOrLeaveFunction = (event: MouseEvent) => {\n \n window.removeEventListener(\"mousemove\", windowMouseMoveFunction, true)\n window.removeEventListener(\"mouseup\", windowMouseUpOrLeaveFunction, true)\n document.body.removeEventListener(\"mouseleave\", windowMouseUpOrLeaveFunction)\n onmouseup(event)\n \n }\n window.addEventListener(\"mousemove\", windowMouseMoveFunction, true)\n window.addEventListener(\"mouseup\", windowMouseUpOrLeaveFunction, true)\n document.body.addEventListener(\"mouseleave\", windowMouseUpOrLeaveFunction)\n \n const windowTouchFunction = () => {\n window.removeEventListener(\"touchmove\", onTouchMove, true)\n window.removeEventListener(\"mouseup\", windowTouchFunction, true)\n }\n window.addEventListener(\"touchmove\", onTouchMove, true)\n window.addEventListener(\"mouseup\", windowTouchFunction, true)\n \n }\n \n const onTouchStart = onMouseDown as any\n \n const onmouseup = async (event: MouseEvent) => {\n \n this._isPointerDown = NO\n \n if (!this._isPointerValid) {\n return\n }\n \n if ((this.ignoresTouches && isTouchEventClassDefined && event instanceof TouchEvent) ||\n (this.ignoresMouse && event instanceof MouseEvent)) {\n return\n }\n \n if (this._isPointerInside && await this.shouldCallPointerUpInside()) {\n onPointerUpInside(event)\n if (!this._hasPointerDragged) {\n this.sendControlEventForKey(UIView.controlEvent.PointerTap, event)\n }\n }\n \n // This has to be sent after the more specific event so that UIButton can ignore it when not highlighted\n this.sendControlEventForKey(UIView.controlEvent.PointerUp, event)\n \n pauseEvent(event)\n \n }\n \n const onTouchEnd = onmouseup\n \n const onmouseout = async (event: MouseEvent) => {\n \n if ((this.ignoresTouches && isTouchEventClassDefined && event instanceof TouchEvent) ||\n (this.ignoresMouse && event instanceof MouseEvent)) {\n return\n }\n \n if (await this.shouldCallPointerLeave()) {\n this.sendControlEventForKey(UIView.controlEvent.PointerLeave, event)\n }\n \n this._isPointerInside = NO\n \n pauseEvent(event)\n \n }\n \n const onTouchLeave = onmouseout\n \n const onmouseover = async (event: MouseEvent) => {\n \n if ((this.ignoresTouches && isTouchEventClassDefined && event instanceof TouchEvent) ||\n (this.ignoresMouse && event instanceof MouseEvent)) {\n return\n }\n \n if (await this.shouldCallPointerHover()) {\n this.sendControlEventForKey(UIView.controlEvent.PointerHover, event)\n }\n \n this._isPointerInside = YES\n this._isPointerValid = YES\n \n pauseEvent(event)\n \n }\n \n const onMouseMove = (event: MouseEvent) => {\n \n // if (this._isPointerDown) {\n //\n // console.log(\"Mouse move\")\n //\n // }\n \n if (!this._isPointerValid) {\n return\n }\n \n if ((this.ignoresTouches && isTouchEventClassDefined && event instanceof TouchEvent) ||\n (this.ignoresMouse && event instanceof MouseEvent)) {\n return\n }\n \n const clientPoint = new UIPoint(\n event.clientX,\n event.clientY\n )\n if (IS_NOT(this._initialPointerPosition)) {\n this._initialPointerPosition = clientPoint\n }\n \n const distanceToInitialPoint = clientPoint.to(this._initialPointerPosition).length\n if (distanceToInitialPoint > this._pointerDragThreshold) {\n this._hasPointerDragged = YES\n }\n \n this.sendControlEventForKey(UIView.controlEvent.PointerMove, event)\n \n if (this._hasPointerDragged && this._isPointerDown) {\n const movementPoint = this._previousClientPoint.to(clientPoint)\n this.pointerDraggingPoint = new UIPoint(movementPoint.x, movementPoint.y).scale(1 / UIView.pageScale)\n .add(this.pointerDraggingPoint)\n this.sendControlEventForKey(UIView.controlEvent.PointerDrag, event)\n }\n \n this._previousClientPoint = clientPoint\n \n pauseEvent(event)\n \n }\n \n const onTouchMove = async (event: TouchEvent) => {\n \n if (!this._isPointerValid) {\n return\n }\n \n if ((this.ignoresTouches && isTouchEventClassDefined && event instanceof TouchEvent) ||\n (this.ignoresMouse && event instanceof MouseEvent)) {\n return\n }\n \n if (event.touches.length > 1) {\n onTouchZoom(event)\n return\n }\n \n const touch = event.touches[0]\n \n const clientPoint = new UIPoint(\n touch.clientX,\n touch.clientY\n )\n const distanceToInitialPoint = clientPoint.to(this._initialPointerPosition!).length\n if (distanceToInitialPoint > this._pointerDragThreshold) {\n this._hasPointerDragged = YES\n }\n \n if (this._isPointerInside && this.viewHTMLElement !=\n document.elementFromPoint(touch.clientX, touch.clientY)) {\n this._isPointerInside = NO\n if (await this.shouldCallPointerLeave()) {\n this.sendControlEventForKey(UIView.controlEvent.PointerLeave, event)\n }\n }\n \n this.sendControlEventForKey(UIView.controlEvent.PointerMove, event)\n \n \n if (this._hasPointerDragged) {\n const movementPoint = this._previousClientPoint.to(clientPoint)\n this.pointerDraggingPoint = new UIPoint(movementPoint.x, movementPoint.y).scale(1 / UIView.pageScale)\n .add(this.pointerDraggingPoint)\n this.sendControlEventForKey(UIView.controlEvent.PointerDrag, event)\n }\n \n this._previousClientPoint = clientPoint\n \n }\n \n const onTouchZoom = (event: TouchEvent) => {\n this.sendControlEventForKey(UIView.controlEvent.MultipleTouches, event)\n }\n const onPointerUpInside = (event: Event) => {\n \n pauseEvent(event)\n this._isPointerDown = NO\n this.sendControlEventForKey(UIView.controlEvent.PointerUpInside, event)\n \n \n }\n \n const onTouchCancel = async (event: Event) => {\n \n if (!this._isPointerValid) {\n return\n }\n \n if ((this.ignoresTouches && isTouchEventClassDefined && event instanceof TouchEvent) ||\n (this.ignoresMouse && event instanceof MouseEvent)) {\n return\n }\n \n this._isPointerValid = NO\n this._isPointerDown = NO\n \n if (await this.shouldCallPointerCancel()) {\n this.sendControlEventForKey(UIView.controlEvent.PointerCancel, event)\n }\n \n }\n \n function eventKeyIsEnter(event: { keyCode: number }) {\n if (event.keyCode !== 13) {\n return NO\n }\n return YES\n }\n \n function eventKeyIsTab(event: { keyCode: number }) {\n if (event.keyCode !== 9) {\n return NO\n }\n return YES\n }\n \n function eventKeyIsEsc(event: { key: string; keyCode: number }) {\n let result: boolean\n if (\"key\" in event) {\n result = (event.key == \"Escape\" || event.key == \"Esc\")\n }\n else {\n // @ts-ignore\n result = (event.keyCode == 27)\n }\n return result\n }\n \n function eventKeyIsLeft(event: KeyboardEvent) {\n if (event.keyCode != 37) {\n return NO\n }\n return YES\n }\n \n function eventKeyIsRight(event: KeyboardEvent) {\n if (event.keyCode != 39) {\n return NO\n }\n return YES\n }\n \n function eventKeyIsDown(event: KeyboardEvent) {\n if (event.keyCode != 40) {\n return NO\n }\n return YES\n }\n \n function eventKeyIsUp(event: KeyboardEvent) {\n if (event.keyCode != 38) {\n return NO\n }\n return YES\n }\n \n const onKeyDown = (event: KeyboardEvent) => {\n \n if (eventKeyIsEnter(event)) {\n this.sendControlEventForKey(UIView.controlEvent.EnterDown, event)\n }\n \n if (eventKeyIsEsc(event)) {\n this.sendControlEventForKey(UIView.controlEvent.EscDown, event)\n }\n \n if (eventKeyIsTab(event) && this._controlEventTargets.TabDown && this._controlEventTargets.TabDown.length) {\n this.sendControlEventForKey(UIView.controlEvent.TabDown, event)\n pauseEvent(event, YES)\n }\n \n if (eventKeyIsLeft(event)) {\n this.sendControlEventForKey(UIView.controlEvent.LeftArrowDown, event)\n }\n \n if (eventKeyIsRight(event)) {\n this.sendControlEventForKey(UIView.controlEvent.RightArrowDown, event)\n }\n \n if (eventKeyIsDown(event)) {\n this.sendControlEventForKey(UIView.controlEvent.DownArrowDown, event)\n }\n \n if (eventKeyIsUp(event)) {\n this.sendControlEventForKey(UIView.controlEvent.UpArrowDown, event)\n }\n \n }\n \n const onKeyUp = (event: KeyboardEvent) => {\n \n if (eventKeyIsEnter(event)) {\n this.sendControlEventForKey(UIView.controlEvent.EnterUp, event)\n }\n \n }\n \n \n const onfocus = (event: Event) => {\n this.sendControlEventForKey(UIView.controlEvent.Focus, event)\n }\n \n const onblur = (event: Event) => {\n this.sendControlEventForKey(UIView.controlEvent.Blur, event)\n }\n \n \n // Mouse and touch start events\n // this._viewHTMLElement.onmousedown = onMouseDown\n // this._viewHTMLElement.ontouchstart = onTouchStart\n this.viewHTMLElement.addEventListener(\"mousedown\", onMouseDown, false)\n this.viewHTMLElement.addEventListener(\"touchstart\", onTouchStart, false)\n // //this.viewHTMLElement.addEventListener(\"mouseenter\", onMouseEnter.bind(this), false);\n \n // Mouse and touch move events\n // this._viewHTMLElement.onmousemove = onMouseMove\n // this._viewHTMLElement.ontouchmove = onTouchMove\n //this.viewHTMLElement.addEventListener(\"mousemove\", onMouseMove, false)\n this.viewHTMLElement.addEventListener(\"touchmove\", onTouchMove, false)\n \n //this.viewHTMLElement.addEventListener(\"mousewheel\", onmousewheel.bind(this), false)\n \n this._viewHTMLElement.onmouseover = onmouseover\n // this.viewHTMLElement.addEventListener(\"mouseover\", onmouseover.bind(this), false)\n \n // Mouse and touch end events\n // this._viewHTMLElement.onmouseup = onmouseup\n // // @ts-ignore\n // this._viewHTMLElement.ontouchend = onTouchEnd\n // this._viewHTMLElement.ontouchcancel = onTouchCancel\n this.viewHTMLElement.addEventListener(\"mouseup\", onmouseup, false)\n // @ts-ignore\n this.viewHTMLElement.addEventListener(\"touchend\", onTouchEnd, false)\n this.viewHTMLElement.addEventListener(\"touchcancel\", onTouchCancel, false)\n \n //this._viewHTMLElement.onmouseout = onmouseout\n this.viewHTMLElement.addEventListener(\"mouseout\", onmouseout, false)\n // @ts-ignore\n this._viewHTMLElement.addEventListener(\"touchleave\", onTouchLeave, true)\n \n // this.viewHTMLElement.onkeydown = onkeydown\n // this.viewHTMLElement.onkeyup = onkeyup\n this._viewHTMLElement.addEventListener(\"keydown\", onKeyDown, false)\n this._viewHTMLElement.addEventListener(\"keyup\", onKeyUp, false)\n \n // Focus events\n this._viewHTMLElement.onfocus = onfocus\n this._viewHTMLElement.onblur = onblur\n // this.viewHTMLElement.addEventListener(\"focus\", onfocus, true)\n // this.viewHTMLElement.addEventListener(\"blur\", onblur, true)\n \n \n }\n \n public static controlEvent = {\n \n \"PointerDown\": \"PointerDown\",\n \"PointerMove\": \"PointerMove\",\n \"PointerDrag\": \"PointerDrag\",\n \"PointerLeave\": \"PointerLeave\",\n \"PointerEnter\": \"PointerEnter\",\n \"PointerUpInside\": \"PointerUpInside\",\n \"PointerTap\": \"PointerTap\",\n \"PointerUp\": \"PointerUp\",\n \"MultipleTouches\": \"PointerZoom\",\n \"PointerCancel\": \"PointerCancel\",\n \"PointerHover\": \"PointerHover\",\n \"EnterDown\": \"EnterDown\",\n \"EnterUp\": \"EnterUp\",\n \"EscDown\": \"EscDown\",\n \"TabDown\": \"TabDown\",\n \"LeftArrowDown\": \"LeftArrowDown\",\n \"RightArrowDown\": \"RightArrowDown\",\n \"DownArrowDown\": \"DownArrowDown\",\n \"UpArrowDown\": \"UpArrowDown\",\n \"Focus\": \"Focus\",\n \"Blur\": \"Blur\"\n \n }\n \n controlEvent = UIView.controlEvent\n \n \n public get controlEventTargetAccumulator(): UIViewAddControlEventTargetObject<UIView> {\n \n const eventKeys: string[] = []\n \n const result: any = new Proxy(\n (this.constructor as any).controlEvent,\n {\n \n get: (target, key: string, _receiver) => {\n \n eventKeys.push(key)\n \n return result\n \n },\n set: (target, key: string, value, _receiver) => {\n \n eventKeys.push(key)\n this.addTargetForControlEvents(eventKeys, value)\n \n return true\n \n }\n \n }\n )\n \n return result\n \n }\n \n \n addTargetForControlEvents(eventKeys: string[], targetFunction: (sender: UIView, event: Event) => void) {\n eventKeys.forEach(key => this.addTargetForControlEvent(key, targetFunction))\n }\n \n \n addTargetForControlEvent(eventKey: string, targetFunction: (sender: UIView, event: Event) => void) {\n \n let targets = this._controlEventTargets[eventKey]\n \n if (!targets) {\n // @ts-ignore\n targets = []\n this._controlEventTargets[eventKey] = targets\n }\n \n if (targets.indexOf(targetFunction) == -1) {\n targets.push(targetFunction)\n }\n \n }\n \n removeTargetForControlEvent(eventKey: string, targetFunction: (sender: UIView, event: Event) => void) {\n const targets = this._controlEventTargets[eventKey]\n if (!targets) {\n return\n }\n const index = targets.indexOf(targetFunction)\n if (index != -1) {\n targets.splice(index, 1)\n }\n }\n \n removeTargetForControlEvents(eventKeys: string[], targetFunction: (sender: UIView, event: Event) => void) {\n eventKeys.forEach(key => this.removeTargetForControlEvent(key, targetFunction))\n }\n \n sendControlEventForKey(eventKey: string, nativeEvent: Event) {\n let targets = this._controlEventTargets[eventKey]\n if (!targets) {\n return\n }\n targets = targets.copy()\n for (let i = 0; i < targets.length; i++) {\n const target = targets[i]\n target(this, nativeEvent)\n }\n }\n \n \n static broadcastEventName = {\n \n \"LanguageChanged\": \"LanguageChanged\",\n \"RemovedFromViewTree\": \"RemovedFromViewTree\",\n \"AddedToViewTree\": \"AddedToViewTree\",\n \"PageDidScroll\": \"PageDidScroll\"\n \n }\n \n \n broadcastEventInSubtree(event: UIViewBroadcastEvent) {\n this.forEachViewInSubtree(view => {\n view.didReceiveBroadcastEvent(event)\n if (IS(view.viewController)) {\n view.viewController.viewDidReceiveBroadcastEvent(event)\n }\n })\n }\n \n didReceiveBroadcastEvent(event: UIViewBroadcastEvent) {\n \n if (event.name == UIView.broadcastEventName.PageDidScroll) {\n this._isPointerValid = NO\n }\n \n if (event.name == UIView.broadcastEventName.AddedToViewTree) {\n this.wasAddedToViewTree()\n }\n \n if (event.name == UIView.broadcastEventName.RemovedFromViewTree) {\n this.wasRemovedFromViewTree()\n }\n \n if (event.name == UIView.broadcastEventName.LanguageChanged || event.name ==\n UIView.broadcastEventName.AddedToViewTree) {\n this._setInnerHTMLFromKeyIfPossible()\n this._setInnerHTMLFromLocalizedTextObjectIfPossible()\n }\n \n }\n \n \n forEachViewInSubtree(functionToCall: (view: UIView) => void) {\n functionToCall(this)\n this.subviews.everyElement.forEachViewInSubtree(functionToCall)\n }\n \n \n rectangleInView(rectangle: UIRectangle, view: UIView) {\n if (!view.isMemberOfViewTree || !this.isMemberOfViewTree) {\n return nil\n }\n \n const viewClientRectangle = view.viewHTMLElement.getBoundingClientRect()\n const viewLocation = new UIPoint(viewClientRectangle.left, viewClientRectangle.top)\n \n const selfClientRectangle = this.viewHTMLElement.getBoundingClientRect()\n const selfLocation = new UIPoint(selfClientRectangle.left, selfClientRectangle.top)\n \n const offsetPoint = selfLocation.subtract(viewLocation)\n \n return rectangle.copy().offsetByPoint(offsetPoint)\n }\n \n rectangleFromView(rectangle: UIRectangle, view: UIView) {\n return view.rectangleInView(rectangle, this)\n }\n \n \n intrinsicContentSizeWithConstraints(constrainingHeight: number = 0, constrainingWidth: number = 0) {\n \n // This works but is slow\n \n const result = new UIRectangle(0, 0, 0, 0)\n if (this.rootView.forceIntrinsicSizeZero) {\n return result\n }\n \n let temporarilyInViewTree = NO\n let nodeAboveThisView: Node | null = null\n if (!this.isMemberOfViewTree) {\n document.body.appendChild(this.viewHTMLElement)\n temporarilyInViewTree = YES\n nodeAboveThisView = this.viewHTMLElement.nextSibling\n }\n \n const height = this.style.height\n const width = this.style.width\n \n this.style.height = \"\" + constrainingHeight\n this.style.width = \"\" + constrainingWidth\n \n \n const left = this.style.left\n const right = this.style.right\n const bottom = this.style.bottom\n const top = this.style.top\n \n this.style.left = \"\"\n this.style.right = \"\"\n this.style.bottom = \"\"\n this.style.top = \"\"\n \n \n const resultHeight = this.viewHTMLElement.scrollHeight\n \n \n const whiteSpace = this.style.whiteSpace\n this.style.whiteSpace = \"nowrap\"\n \n const resultWidth = this.viewHTMLElement.scrollWidth\n \n this.style.whiteSpace = whiteSpace\n \n \n this.style.height = height\n this.style.width = width\n \n this.style.left = left\n this.style.right = right\n this.style.bottom = bottom\n this.style.top = top\n \n if (temporarilyInViewTree) {\n document.body.removeChild(this.viewHTMLElement)\n if (this.superview) {\n if (nodeAboveThisView) {\n this.superview.viewHTMLElement.insertBefore(this.viewHTMLElement, nodeAboveThisView)\n }\n else {\n this.superview.viewHTMLElement.appendChild(this.viewHTMLElement)\n }\n }\n }\n \n result.height = resultHeight\n result.width = resultWidth\n \n \n return result\n \n }\n \n \n intrinsicContentWidth(constrainingHeight: number = 0): number {\n \n return this.intrinsicContentSizeWithConstraints(constrainingHeight).width\n \n }\n \n intrinsicContentHeight(constrainingWidth: number = 0): number {\n \n return this.intrinsicContentSizeWithConstraints(undefined, constrainingWidth).height\n \n \n }\n \n intrinsicContentSize(): UIRectangle {\n \n return nil\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\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AQ;AAEZ;AAxnES,OA8sEF,qBAAqB;AAAA,EAExB,mBAAmB;AAAA,EACnB,uBAAuB;AAAA,EACvB,mBAAmB;AAAA,EACnB,iBAAiB;AAErB;",
6
6
  "names": ["selector", "i", "event"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uicore-ts",
3
- "version": "1.0.145",
3
+ "version": "1.0.152",
4
4
  "description": "UICore is a library to build native-like user interfaces using pure Typescript. No HTML is needed at all. Components are described as TS classes and all user interactions are handled explicitly. This library is strongly inspired by the UIKit framework that is used in IOS. In addition, UICore has tools to handle URL based routing, array sorting and filtering and adds a number of other utilities for convenience.",
5
5
  "main": "compiledScripts/index.js",
6
6
  "types": "compiledScripts/index.d.ts",
@@ -452,7 +452,10 @@ export class UIObject {
452
452
  }
453
453
 
454
454
 
455
- static configureWithObject<T extends object>(configurationTarget: T, object: UIInitializerObject<T>) {
455
+ static configureWithObject<TargetObjectType extends object, ConfigurationObjectType extends UIInitializerObject<TargetObjectType>>(
456
+ configurationTarget: TargetObjectType,
457
+ object: ConfigurationObjectType
458
+ ): ConfigurationObjectType {
456
459
 
457
460
  const isAnObject = (item: any) => (item && typeof item === "object" && !Array.isArray(item) && !(item instanceof UICoreExtensionValueObject))
458
461
  const isAPureObject = (item: any) => isAnObject(item) && Object.getPrototypeOf(item) === Object.getPrototypeOf({})
@@ -468,7 +471,7 @@ export class UIObject {
468
471
  propertyNames.includes("prototype"))
469
472
  }
470
473
 
471
- const result = {}
474
+ const result = {} as ConfigurationObjectType
472
475
 
473
476
  let keyPathsAndValues: { value: any, keyPath: string }[] = []
474
477
 
package/scripts/UIView.ts CHANGED
@@ -451,7 +451,7 @@ export class UIView extends UIObject {
451
451
 
452
452
  get propertyDescriptors(): { object: UIObject; name: string }[] {
453
453
  let result: any[] = []
454
- this.allSuperviews.forEach(view => {
454
+ this.withAllSuperviews.forEach(view => {
455
455
  FIRST_OR_NIL(view.viewController).forEach((value, key, stopLooping) => {
456
456
  if (this == value) {
457
457
  result.push({ object: view.viewController, name: key })
@@ -1748,7 +1748,7 @@ export class UIView extends UIObject {
1748
1748
  }
1749
1749
 
1750
1750
 
1751
- get allSuperviews() {
1751
+ get withAllSuperviews() {
1752
1752
  const result = []
1753
1753
  let view: UIView = this
1754
1754
  for (let i = 0; IS(view); i = i) {
@@ -1760,7 +1760,7 @@ export class UIView extends UIObject {
1760
1760
 
1761
1761
 
1762
1762
  setNeedsLayoutOnAllSuperviews() {
1763
- this.allSuperviews.reverse().everyElement.setNeedsLayout()
1763
+ this.withAllSuperviews.reverse().everyElement.setNeedsLayout()
1764
1764
  }
1765
1765
 
1766
1766