uicore-ts 1.0.578 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiledScripts/UICoreExtensions.d.ts +2 -2
- package/compiledScripts/UICoreExtensions.js.map +1 -1
- package/compiledScripts/UIKeyValueStringFilterWebWorker.worker.js.map +2 -2
- package/compiledScripts/UILinkButton.js +3 -1
- package/compiledScripts/UILinkButton.js.map +2 -2
- package/compiledScripts/UITextField.d.ts +1 -2
- package/compiledScripts/UITextField.js +0 -3
- package/compiledScripts/UITextField.js.map +2 -2
- package/compiledScripts/UIView.d.ts +1 -1
- package/compiledScripts/UIView.js +35 -26
- package/compiledScripts/UIView.js.map +2 -2
- package/package.json +1 -1
- package/scripts/UICoreExtensions.ts +2 -2
- package/scripts/UIKeyValueStringFilterWebWorker.worker.ts +2 -2
- package/scripts/UILinkButton.ts +3 -1
- package/scripts/UITextField.ts +0 -4
- package/scripts/UIView.ts +52 -33
|
@@ -6,10 +6,10 @@ declare global {
|
|
|
6
6
|
replaceElementAtIndex(index: number, element: T): void;
|
|
7
7
|
contains(element: T): boolean;
|
|
8
8
|
findAsyncSequential(functionToCall: (value: any) => Promise<boolean>): Promise<any>;
|
|
9
|
-
groupedBy
|
|
9
|
+
groupedBy(keyFunction: (item: T) => any): {
|
|
10
10
|
[key: string]: Array<T>;
|
|
11
11
|
} & Object;
|
|
12
|
-
uniqueMap<
|
|
12
|
+
uniqueMap<R>(keyFunction: (item: T) => R): R[];
|
|
13
13
|
copy(): Array<T>;
|
|
14
14
|
arrayByRepeating(numberOfRepetitions: number): Array<T>;
|
|
15
15
|
arrayByTrimmingToLengthIfLonger(maxLength: number): Array<T>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../scripts/UICoreExtensions.ts"],
|
|
4
|
-
"sourcesContent": ["import { UICoreExtensionValueObject } from \"./UICoreExtensionValueObject\"\nimport { UIObject } from \"./UIObject\"\n\n\ndeclare global {\n \n \n interface Array<T> {\n \n removeElementAtIndex(index: number): void;\n \n removeElement(element: T): void;\n \n insertElementAtIndex(index: number, element: T): void;\n \n replaceElementAtIndex(index: number, element: T): void;\n \n \n contains(element: T): boolean;\n \n findAsyncSequential(functionToCall: (value: any) => Promise<boolean>): Promise<any>;\n \n groupedBy<T>(keyFunction: (item: T) => any): { [key: string]: Array<T> } & Object;\n \n uniqueMap<T, R>(keyFunction: (item: T) => R): R[]; \n \n copy(): Array<T>;\n \n arrayByRepeating(numberOfRepetitions: number): Array<T>;\n \n arrayByTrimmingToLengthIfLonger(maxLength: number): Array<T>;\n \n anyMatch(predicate: (value: T, index: number, obj: T[]) => boolean): boolean\n \n noneMatch(predicate: (value: T, index: number, obj: T[]) => boolean): boolean\n \n allMatch(predicate: (value: T, index: number, obj: T[]) => boolean): boolean\n \n firstElement: T;\n lastElement: T;\n readonly summedValue: T;\n \n everyElement: UIEveryElementItem<T>;\n \n max(): number;\n \n min(): number;\n \n average(): number;\n \n isEqualToArray(array: Array<T>, keyPath?: string): boolean;\n \n }\n \n \n interface String {\n \n contains(string: string): boolean;\n \n readonly numericalValue: number;\n readonly integerValue: number;\n isAString: boolean;\n \n }\n \n \n interface Number {\n \n isANumber: boolean;\n \n readonly integerValue: number;\n \n constrainedValue(min: number, max: number): number;\n \n }\n \n \n interface Date {\n \n readonly dateString: string;\n \n }\n \n \n interface Object {\n \n forEach(callbackFunction: (value: any, key: string, stopLooping: () => void) => void): void;\n \n objectByCopyingValuesRecursivelyFromObject<T extends object>(object: T): T & this;\n \n readonly allValues: Array<any>;\n readonly allKeys: (keyof this)[];\n \n }\n \n}\n\nexport {}\n\nconst YES = true\nconst NO = false\n\nif (\"removeElementAtIndex\" in Array.prototype == NO) {\n \n (Array.prototype as any).removeElementAtIndex = function (this: Array<any>, index: number) {\n \n // @ts-ignore\n if (index >= 0 && index < this.length) {\n this.splice(index, 1)\n }\n \n }\n \n}\n\n\n// interface Array<T> {\n//\n// removeElementAtIndex(index: number);\n//\n// }\n\n\nif (\"removeElement\" in Array.prototype == NO) {\n \n (Array.prototype as any).removeElement = function (this: Array<any>, element: any) {\n this.removeElementAtIndex(this.indexOf(element))\n }\n \n}\n\n\n// interface Array<T> {\n//\n// removeElement(element: T);\n//\n// }\n\n\nif (\"insertElementAtIndex\" in Array.prototype == NO) {\n \n (Array.prototype as any).insertElementAtIndex = function (this: Array<any>, index: number, element: any) {\n \n if (index >= 0 && index <= this.length) {\n this.splice(index, 0, element)\n }\n \n }\n \n}\n\n\n// interface Array<T> {\n//\n// insertElementAtIndex(index: number, element: T);\n//\n// }\n\n\nif (\"replaceElementAtIndex\" in Array.prototype == NO) {\n \n (Array.prototype as any).replaceElementAtIndex = function (this: Array<any>, index: number, element: any) {\n \n this.removeElementAtIndex(index)\n this.insertElementAtIndex(index, element)\n \n }\n \n}\n\n\n// interface Array<T> {\n//\n// replaceElementAtIndex(index: number, element: T);\n//\n// }\n\n\nif (\"contains\" in Array.prototype == NO) {\n \n (Array.prototype as any).contains = function (this: Array<any>, element: any) {\n return (this.indexOf(element) != -1)\n }\n \n}\n\nif (\"containsAny\" in Array.prototype == NO) {\n \n (Array.prototype as any).containsAny = function (this: Array<any>, elements: any[]) {\n return this.anyMatch(element => elements.contains(element))\n }\n \n}\n\n\n// interface Array<T> {\n//\n// contains(element: T): boolean;\n//\n// containsAny(element: T[]): boolean;\n//\n// }\n\n\nif (\"anyMatch\" in Array.prototype == NO) {\n \n (Array.prototype as any).anyMatch = function (\n this: Array<any>,\n functionToCall: (value: any, index: number, array: any[]) => boolean\n ) {\n // @ts-ignore\n return (this.findIndex(functionToCall) > -1)\n }\n \n}\n\nif (\"noneMatch\" in Array.prototype == NO) {\n \n (Array.prototype as any).noneMatch = function (\n this: Array<any>,\n functionToCall: (value: any, index: number, array: any[]) => boolean\n ) {\n // @ts-ignore\n return (this.findIndex(functionToCall) == -1)\n }\n \n}\n\nif (\"allMatch\" in Array.prototype == NO) {\n \n (Array.prototype as any).allMatch = function (\n this: Array<any>,\n functionToCall: (value: any, index: number, array: any[]) => boolean\n ) {\n \n function reversedFunction(value: any, index: number, array: any[]) {\n return !functionToCall(value, index, array)\n }\n \n // @ts-ignore\n return (this.findIndex(reversedFunction) == -1)\n \n }\n \n}\n\nif (\"findAsyncSequential\" in Array.prototype == NO) {\n \n (Array.prototype as any).findAsyncSequential = function (\n this: Array<any>,\n functionToCall: (value: any) => Promise<boolean>\n ) {\n \n // https://stackoverflow.com/questions/55601062/using-an-async-function-in-array-find\n async function findAsyncSequential<T>(\n array: T[],\n predicate: (t: T) => Promise<boolean>\n ): Promise<T | undefined> {\n for (const t of array) {\n if (await predicate(t)) {\n return t\n }\n }\n return undefined\n }\n \n return findAsyncSequential(this, functionToCall)\n \n }\n \n}\n\n\n// interface Array<T> {\n//\n// anyMatch(predicate: (value: T, index: number, obj: T[]) => boolean): boolean\n//\n// noneMatch(predicate: (value: T, index: number, obj: T[]) => boolean): boolean\n//\n// allMatch(predicate: (value: T, index: number, obj: T[]) => boolean): boolean\n//\n// }\n\n\nif (\"groupedBy\" in Array.prototype == NO) {\n \n Array.prototype.groupedBy = function (this: Array<any>, funcProp) {\n return this.reduce(function (acc, val) {\n (acc[funcProp(val)] = acc[funcProp(val)] || []).push(val)\n return acc\n }, {})\n }\n \n}\n\nif (\"uniqueMap\" in Array.prototype == NO) {\n \n Array.prototype.uniqueMap = function (this: Array<any>, funcProp) {\n \n const result: any[] = []\n \n for (let i = 0; i < this.length; i++){\n \n const element = this[i]\n const elementResult = funcProp(element)\n \n if (!result.contains(elementResult)) {\n result.push(elementResult);\n }\n \n }\n \n return result;\n \n }\n \n}\n\n\n// interface Array<T> {\n//\n// groupedBy(keyFunction: (item: T) => any): { [key: string]: Array<T> };\n//\n// }\n\n\nif (\"firstElement\" in Array.prototype == NO) {\n Object.defineProperty(Array.prototype, \"firstElement\", {\n get: function firstElement(this: Array<any>) {\n return this[0]\n },\n set: function (this: Array<any>, element: any) {\n if (this.length == 0) {\n this.push(element)\n return\n }\n this[0] = element\n }\n })\n}\n\nif (\"lastElement\" in Array.prototype == NO) {\n Object.defineProperty(Array.prototype, \"lastElement\", {\n get: function lastElement(this: Array<any>) {\n return this[this.length - 1]\n },\n set: function (this: Array<any>, element: any) {\n if (this.length == 0) {\n this.push(element)\n return\n }\n this[this.length - 1] = element\n }\n })\n}\n\nif (\"everyElement\" in Array.prototype == NO) {\n \n Object.defineProperty(Array.prototype, \"everyElement\", {\n \n get: function everyElement(this: Array<any>) {\n \n const valueKeys: string[] = []\n \n const targetFunction = (objects: any) => {\n \n return this.map((element) => {\n \n const thisObject = UIObject.valueForKeyPath(\n valueKeys.arrayByTrimmingToLengthIfLonger(valueKeys.length - 1).join(\".\"),\n element\n ) || element\n \n const elementFunction = (UIObject.valueForKeyPath(valueKeys.join(\".\"), element) as Function)?.bind(\n thisObject,\n objects\n )\n \n return elementFunction?.()\n \n })\n \n }\n \n const result: any = new Proxy(\n targetFunction,\n {\n \n get: (target, key: string, _receiver) => {\n \n if (key == \"UI_elementValues\") {\n return this.map(element => UIObject.valueForKeyPath(\n valueKeys.join(\".\"),\n element\n ))\n }\n \n valueKeys.push(key)\n \n return result\n \n },\n set: (target, key: string, value, _receiver) => {\n \n valueKeys.push(key)\n this.forEach(element => UIObject.setValueForKeyPath(valueKeys.join(\".\"), value, element, YES))\n return true\n \n }\n \n }\n )\n \n return result\n \n },\n set: function (this: Array<any>, element: any) {\n for (let i = 0; i < this.length; ++i) {\n this[i] = element\n }\n }\n \n })\n \n}\n\n\nexport type UIEveryElementItem<T> = {\n \n [P in keyof T]: UIEveryElementItem<T[P]>\n \n} & {\n \n UI_elementValues?: T[];\n \n} & T\n\n// interface Array<T> {\n//\n// firstElement: T;\n// lastElement: T;\n//\n// everyElement: UIEveryElementItem<T>;\n//\n// }\n\n\nif (\"copy\" in Array.prototype == NO) {\n \n (Array.prototype as any).copy = function (this: Array<any>) {\n return this.slice(0)\n }\n \n}\n\n\n// interface Array<T> {\n//\n// copy(): Array<T>;\n//\n// }\n\n\nif (\"arrayByRepeating\" in Array.prototype == NO) {\n \n (Array.prototype as any).arrayByRepeating = function (this: Array<any>, numberOfRepetitions: number) {\n const result: any[] = []\n for (let i = 0; i < numberOfRepetitions; i++) {\n this.forEach(element => result.push(element))\n }\n return result\n }\n \n}\n\n\n// interface Array<T> {\n//\n// arrayByRepeating(numberOfRepetitions: number): Array<T>;\n//\n// }\n\n\nif (\"arrayByTrimmingToLengthIfLonger\" in Array.prototype == NO) {\n (Array.prototype as any).arrayByTrimmingToLengthIfLonger = function (this: Array<any>, maxLength: number) {\n const result = []\n for (let i = 0; i < maxLength && i < this.length; i++) {\n result.push(this[i])\n }\n return result\n }\n}\n\n\n// interface Array<T> {\n//\n// arrayByTrimmingToLengthIfLonger(maxLength: number): Array<T>;\n//\n// }\n\n\nif (\"summedValue\" in Array.prototype == NO) {\n \n Object.defineProperty(Array.prototype, \"summedValue\", {\n get: function summedValue(this: Array<any>) {\n return this.reduce(function (a, b) {\n return a + b\n }, 0)\n }\n })\n \n}\n\n\n// interface Array<T> {\n//\n// readonly summedValue: T;\n//\n// max(): number;\n// min(): number;\n//\n//\n// }\n\nArray.prototype.max = function () {\n return Math.max.apply(null, this)\n}\n\nArray.prototype.min = function () {\n return Math.min.apply(null, this)\n}\n\nif (!Array.prototype.average) {\n \n Array.prototype.average = function () {\n if (this.length == 0) {\n return 0;\n }\n const sum = this.reduce((a, b) => a + b, 0)\n return sum / this.length\n }\n \n}\n\n// interface Array<T> {\n//\n// isEqualToArray(array: Array<T>, keyPath?: string): boolean;\n//\n// }\n\n\nif (\"isEqualToArray\" in Array.prototype == NO) {\n \n // attach the .equals method to Array's prototype to call it on any array\n Array.prototype.isEqualToArray = function (array: any[], keyPath?: string) {\n \n // if the other array is a falsy value, return\n if (!array) {\n return false\n }\n \n // compare lengths - can save a lot of time\n if (this.length != array.length) {\n return false\n }\n \n var i = 0\n const l = this.length\n for (; i < l; i++) {\n \n // Check if we have nested arrays\n if (this[i] instanceof Array && array[i] instanceof Array && !keyPath) {\n \n // recurse into the nested arrays\n if (!this[i].isEqualToArray(array[i])) {\n return false\n }\n \n }\n else if (keyPath && UIObject.valueForKeyPath(keyPath, this[i]) != UIObject.valueForKeyPath(\n keyPath,\n array[i]\n )) {\n \n return false\n \n }\n else if (this[i] != array[i]) {\n \n // Warning - two different object instances will never be equal: {x:20} != {x:20}\n return false\n \n }\n \n }\n \n return true\n \n }\n \n // Hide method from for-in loops\n Object.defineProperty(Array.prototype, \"isEqualToArray\", { enumerable: false })\n \n}\n\n\nif (\"forEach\" in Object.prototype == NO) {\n \n (Object.prototype as any).forEach = function (\n this: Record<string, any>,\n callbackFunction: (\n value: any,\n key: string,\n stopLooping: Function\n ) => void\n ) {\n const keys = Object.keys(this)\n let shouldStopLooping = NO\n \n function stopLooping() {\n shouldStopLooping = YES\n }\n \n keys.anyMatch(key => {\n callbackFunction(this[key], key, stopLooping)\n return shouldStopLooping\n })\n }\n \n // Hide method from for-in loops\n Object.defineProperty(Object.prototype, \"forEach\", { enumerable: false })\n \n}\n\n\n// interface Object {\n//\n// forEach(callbackFunction: (value: any, key: string) => void): void;\n//\n// }\n\n\nif (\"allValues\" in Object.prototype == NO) {\n Object.defineProperty(Object.prototype, \"allValues\", {\n get: function (this: Object) {\n const values: any[] = []\n this.forEach((value: any) => {\n values.push(value)\n })\n return values\n },\n enumerable: NO\n })\n}\n\n\n// interface Object {\n//\n// readonly allValues: Array<any>;\n//\n// }\n\n\nif (\"allKeys\" in Object.prototype == NO) {\n Object.defineProperty(Object.prototype, \"allKeys\", {\n get: function (this: Object) {\n return Object.keys(this)\n },\n enumerable: NO\n })\n}\n\n\n// interface Object {\n//\n// readonly allKeys: string[];\n//\n// }\n\n\nif (\"objectByCopyingValuesRecursivelyFromObject\" in Object.prototype == NO) {\n \n (Object.prototype as any).objectByCopyingValuesRecursivelyFromObject = function (this: Object, object: any) {\n \n \n function isAnObject(item: any) {\n return (item && typeof item === \"object\" && !Array.isArray(item))\n }\n \n function mergeRecursively(target: any, source: any) {\n \n const output = Object.assign({}, target)\n \n if (isAnObject(target) && isAnObject(source)) {\n \n Object.keys(source).forEach(function (key) {\n \n if (isAnObject(source[key])) {\n \n // if (!(key in target)) {\n \n // Object.assign(output, { [key]: source[key] });\n \n // }\n // else {\n \n output[key] = mergeRecursively(target[key] ?? {}, source[key])\n \n //}\n \n }\n else {\n \n Object.assign(output, { [key]: source[key] })\n \n }\n \n })\n \n }\n \n return output\n \n }\n \n return mergeRecursively(this, object)\n \n }\n \n // Hide method from for-in loops\n Object.defineProperty(Object.prototype, \"objectByCopyingValuesRecursivelyFromObject\", { enumerable: false })\n \n}\n\n\nif (\"asValueObject\" in Object.prototype == NO) {\n \n (Object.prototype as any).asValueObject = function () {\n \n return new UICoreExtensionValueObject(this)\n \n }\n \n // Hide method from for-in loops\n Object.defineProperty(Object.prototype, \"asValueObject\", { enumerable: false })\n \n}\n\n\n// interface Object {\n//\n// objectByCopyingValuesRecursivelyFromObject<T>(object: T): this & T;\n//\n// asValueObject(): this;\n//\n// }\n\n// export type Unpacked<T> =\n// T extends (infer U)[]\n// ? U\n// : T extends (...args: any[]) => infer U\n// ? U\n// : T extends Promise<infer U>\n// ? U\n// : T\n//\n// export type UnpackedObject<T> = {\n// [P in keyof T]: Unpacked<T[P]>\n// }\n\n// export function promisedProperties<ObjectType extends Record<string, any>>(object: ObjectType): UnpackedObject<ObjectType> {\n//\n// let promisedProperties: any[] = []\n// const objectKeys = Object.keys(object)\n//\n// objectKeys.forEach((key) => promisedProperties.push(object[key]))\n//\n// // @ts-ignore\n// return Promise.all(promisedProperties)\n// .then((resolvedValues) => {\n// return resolvedValues.reduce((resolvedObject, property, index) => {\n// resolvedObject[objectKeys[index]] = property\n// return resolvedObject\n// }, object)\n// })\n//\n// }\n\n// if (\"promisedProperties\" in Object.prototype == NO) {\n//\n// (Object.prototype as any).promisedProperties = function () {\n//\n// const result = promisedProperties(this);\n//\n// return result\n//\n// }\n//\n// // Hide method from for-in loops\n// Object.defineProperty(Object.prototype, \"promisedProperties\", { enumerable: false });\n//\n// }\n//\n//\n// interface Object {\n//\n// readonly promisedProperties: UnpackedObject<this>;\n//\n// }\n\n\nif (\"contains\" in String.prototype == NO) {\n \n (String.prototype as any).contains = function (this: String, string: string) {\n return (this.indexOf(string) != -1)\n }\n \n // Hide method from for-in loops\n Object.defineProperty(Object.prototype, \"contains\", { enumerable: false })\n \n}\n\n\n// interface String {\n//\n// contains(string): boolean;\n//\n// }\n\n\nif (\"capitalizedString\" in String.prototype == NO) {\n Object.defineProperty(Object.prototype, \"capitalizedString\", {\n get: function (this: String) {\n return this.charAt(0).toUpperCase() + this.slice(1).toLowerCase()\n },\n enumerable: NO\n })\n}\n\n\n// interface String {\n//\n// readonly capitalizedString: string;\n//\n// }\n\n\nif (\"numericalValue\" in String.prototype == NO) {\n Object.defineProperty(String.prototype, \"numericalValue\", {\n get: function numericalValue(this: string) {\n return Number(this)\n }\n })\n}\n\nif (\"integerValue\" in String.prototype == NO) {\n Object.defineProperty(String.prototype, \"integerValue\", {\n get: function integerValue(this: string) {\n return Number(this).integerValue\n }\n })\n}\n\n\n// interface String {\n//\n// readonly numericalValue: number;\n//\n// }\n\n\nif (\"isAString\" in String.prototype == NO) {\n \n (String.prototype as any).isAString = YES\n \n}\n\n\n// interface String {\n//\n// isAString: boolean;\n//\n// }\n\n\nif (\"isANumber\" in Number.prototype == NO) {\n \n (Number.prototype as any).isANumber = YES\n \n}\n\n\n// interface Number {\n//\n// isANumber: boolean;\n//\n// }\n\n\nif (\"integerValue\" in Number.prototype == NO) {\n Object.defineProperty(Number.prototype, \"integerValue\", {\n get: function (this: number) {\n return parseInt(\"\" + (Math.round(this) + 0.5))\n },\n enumerable: NO\n })\n}\n\nif (\"constrainedValue\" in Number.prototype == NO) {\n \n (Number.prototype as any).constrainedValue = function (this: number, min: number, max: number) {\n if (this < min) {\n return min;\n }\n if (this > max) {\n return max;\n }\n return this\n }\n \n // Hide method from for-in loops\n Object.defineProperty(Number.prototype, \"constrainedValue\", {\n enumerable: NO\n })\n \n}\n\n\n// interface Number {\n//\n// readonly integerValue: number;\n//\n// }\n\n\nif (\"integerValue\" in Boolean.prototype == NO) {\n \n Object.defineProperty(Boolean.prototype, \"integerValue\", {\n get: function (this: boolean) {\n if (this == true) {\n return 1\n }\n return 0\n }\n })\n \n}\n\n\n// interface Boolean {\n//\n// readonly integerValue: number;\n//\n// }\n\n\nif (\"dateString\" in Date.prototype == NO) {\n \n Object.defineProperty(Date.prototype, \"dateString\", {\n get: function dateString(this: Date) {\n return (\"0\" + this.getDate()).slice(-2) + \"-\" + (\"0\" + (this.getMonth() + 1)).slice(-2) + \"-\" +\n this.getFullYear() + \" \" + (\"0\" + this.getHours()).slice(-2) + \":\" +\n (\"0\" + this.getMinutes()).slice(-2)\n }\n })\n \n \n}\n\n\n// interface Date {\n//\n// readonly dateString: string;\n//\n// }\n\n\n\n\n\n\n\n\n"],
|
|
4
|
+
"sourcesContent": ["import { UICoreExtensionValueObject } from \"./UICoreExtensionValueObject\"\nimport { UIObject } from \"./UIObject\"\n\n\ndeclare global {\n \n \n interface Array<T> {\n \n removeElementAtIndex(index: number): void;\n \n removeElement(element: T): void;\n \n insertElementAtIndex(index: number, element: T): void;\n \n replaceElementAtIndex(index: number, element: T): void;\n \n \n contains(element: T): boolean;\n \n findAsyncSequential(functionToCall: (value: any) => Promise<boolean>): Promise<any>;\n \n groupedBy(keyFunction: (item: T) => any): { [key: string]: Array<T> } & Object;\n \n uniqueMap<R>(keyFunction: (item: T) => R): R[];\n \n copy(): Array<T>;\n \n arrayByRepeating(numberOfRepetitions: number): Array<T>;\n \n arrayByTrimmingToLengthIfLonger(maxLength: number): Array<T>;\n \n anyMatch(predicate: (value: T, index: number, obj: T[]) => boolean): boolean\n \n noneMatch(predicate: (value: T, index: number, obj: T[]) => boolean): boolean\n \n allMatch(predicate: (value: T, index: number, obj: T[]) => boolean): boolean\n \n firstElement: T;\n lastElement: T;\n readonly summedValue: T;\n \n everyElement: UIEveryElementItem<T>;\n \n max(): number;\n \n min(): number;\n \n average(): number;\n \n isEqualToArray(array: Array<T>, keyPath?: string): boolean;\n \n }\n \n \n interface String {\n \n contains(string: string): boolean;\n \n readonly numericalValue: number;\n readonly integerValue: number;\n isAString: boolean;\n \n }\n \n \n interface Number {\n \n isANumber: boolean;\n \n readonly integerValue: number;\n \n constrainedValue(min: number, max: number): number;\n \n }\n \n \n interface Date {\n \n readonly dateString: string;\n \n }\n \n \n interface Object {\n \n forEach(callbackFunction: (value: any, key: string, stopLooping: () => void) => void): void;\n \n objectByCopyingValuesRecursivelyFromObject<T extends object>(object: T): T & this;\n \n readonly allValues: Array<any>;\n readonly allKeys: (keyof this)[];\n \n }\n \n}\n\nexport {}\n\nconst YES = true\nconst NO = false\n\nif (\"removeElementAtIndex\" in Array.prototype == NO) {\n \n (Array.prototype as any).removeElementAtIndex = function (this: Array<any>, index: number) {\n \n // @ts-ignore\n if (index >= 0 && index < this.length) {\n this.splice(index, 1)\n }\n \n }\n \n}\n\n\n// interface Array<T> {\n//\n// removeElementAtIndex(index: number);\n//\n// }\n\n\nif (\"removeElement\" in Array.prototype == NO) {\n \n (Array.prototype as any).removeElement = function (this: Array<any>, element: any) {\n this.removeElementAtIndex(this.indexOf(element))\n }\n \n}\n\n\n// interface Array<T> {\n//\n// removeElement(element: T);\n//\n// }\n\n\nif (\"insertElementAtIndex\" in Array.prototype == NO) {\n \n (Array.prototype as any).insertElementAtIndex = function (this: Array<any>, index: number, element: any) {\n \n if (index >= 0 && index <= this.length) {\n this.splice(index, 0, element)\n }\n \n }\n \n}\n\n\n// interface Array<T> {\n//\n// insertElementAtIndex(index: number, element: T);\n//\n// }\n\n\nif (\"replaceElementAtIndex\" in Array.prototype == NO) {\n \n (Array.prototype as any).replaceElementAtIndex = function (this: Array<any>, index: number, element: any) {\n \n this.removeElementAtIndex(index)\n this.insertElementAtIndex(index, element)\n \n }\n \n}\n\n\n// interface Array<T> {\n//\n// replaceElementAtIndex(index: number, element: T);\n//\n// }\n\n\nif (\"contains\" in Array.prototype == NO) {\n \n (Array.prototype as any).contains = function (this: Array<any>, element: any) {\n return (this.indexOf(element) != -1)\n }\n \n}\n\nif (\"containsAny\" in Array.prototype == NO) {\n \n (Array.prototype as any).containsAny = function (this: Array<any>, elements: any[]) {\n return this.anyMatch(element => elements.contains(element))\n }\n \n}\n\n\n// interface Array<T> {\n//\n// contains(element: T): boolean;\n//\n// containsAny(element: T[]): boolean;\n//\n// }\n\n\nif (\"anyMatch\" in Array.prototype == NO) {\n \n (Array.prototype as any).anyMatch = function (\n this: Array<any>,\n functionToCall: (value: any, index: number, array: any[]) => boolean\n ) {\n // @ts-ignore\n return (this.findIndex(functionToCall) > -1)\n }\n \n}\n\nif (\"noneMatch\" in Array.prototype == NO) {\n \n (Array.prototype as any).noneMatch = function (\n this: Array<any>,\n functionToCall: (value: any, index: number, array: any[]) => boolean\n ) {\n // @ts-ignore\n return (this.findIndex(functionToCall) == -1)\n }\n \n}\n\nif (\"allMatch\" in Array.prototype == NO) {\n \n (Array.prototype as any).allMatch = function (\n this: Array<any>,\n functionToCall: (value: any, index: number, array: any[]) => boolean\n ) {\n \n function reversedFunction(value: any, index: number, array: any[]) {\n return !functionToCall(value, index, array)\n }\n \n // @ts-ignore\n return (this.findIndex(reversedFunction) == -1)\n \n }\n \n}\n\nif (\"findAsyncSequential\" in Array.prototype == NO) {\n \n (Array.prototype as any).findAsyncSequential = function (\n this: Array<any>,\n functionToCall: (value: any) => Promise<boolean>\n ) {\n \n // https://stackoverflow.com/questions/55601062/using-an-async-function-in-array-find\n async function findAsyncSequential<T>(\n array: T[],\n predicate: (t: T) => Promise<boolean>\n ): Promise<T | undefined> {\n for (const t of array) {\n if (await predicate(t)) {\n return t\n }\n }\n return undefined\n }\n \n return findAsyncSequential(this, functionToCall)\n \n }\n \n}\n\n\n// interface Array<T> {\n//\n// anyMatch(predicate: (value: T, index: number, obj: T[]) => boolean): boolean\n//\n// noneMatch(predicate: (value: T, index: number, obj: T[]) => boolean): boolean\n//\n// allMatch(predicate: (value: T, index: number, obj: T[]) => boolean): boolean\n//\n// }\n\n\nif (\"groupedBy\" in Array.prototype == NO) {\n \n Array.prototype.groupedBy = function (this: Array<any>, funcProp) {\n return this.reduce(function (acc, val) {\n (acc[funcProp(val)] = acc[funcProp(val)] || []).push(val)\n return acc\n }, {})\n }\n \n}\n\nif (\"uniqueMap\" in Array.prototype == NO) {\n \n Array.prototype.uniqueMap = function (this: Array<any>, funcProp) {\n \n const result: any[] = []\n \n for (let i = 0; i < this.length; i++){\n \n const element = this[i]\n const elementResult = funcProp(element)\n \n if (!result.contains(elementResult)) {\n result.push(elementResult);\n }\n \n }\n \n return result;\n \n }\n \n}\n\n\n// interface Array<T> {\n//\n// groupedBy(keyFunction: (item: T) => any): { [key: string]: Array<T> };\n//\n// }\n\n\nif (\"firstElement\" in Array.prototype == NO) {\n Object.defineProperty(Array.prototype, \"firstElement\", {\n get: function firstElement(this: Array<any>) {\n return this[0]\n },\n set: function (this: Array<any>, element: any) {\n if (this.length == 0) {\n this.push(element)\n return\n }\n this[0] = element\n }\n })\n}\n\nif (\"lastElement\" in Array.prototype == NO) {\n Object.defineProperty(Array.prototype, \"lastElement\", {\n get: function lastElement(this: Array<any>) {\n return this[this.length - 1]\n },\n set: function (this: Array<any>, element: any) {\n if (this.length == 0) {\n this.push(element)\n return\n }\n this[this.length - 1] = element\n }\n })\n}\n\nif (\"everyElement\" in Array.prototype == NO) {\n \n Object.defineProperty(Array.prototype, \"everyElement\", {\n \n get: function everyElement(this: Array<any>) {\n \n const valueKeys: string[] = []\n \n const targetFunction = (objects: any) => {\n \n return this.map((element) => {\n \n const thisObject = UIObject.valueForKeyPath(\n valueKeys.arrayByTrimmingToLengthIfLonger(valueKeys.length - 1).join(\".\"),\n element\n ) || element\n \n const elementFunction = (UIObject.valueForKeyPath(valueKeys.join(\".\"), element) as Function)?.bind(\n thisObject,\n objects\n )\n \n return elementFunction?.()\n \n })\n \n }\n \n const result: any = new Proxy(\n targetFunction,\n {\n \n get: (target, key: string, _receiver) => {\n \n if (key == \"UI_elementValues\") {\n return this.map(element => UIObject.valueForKeyPath(\n valueKeys.join(\".\"),\n element\n ))\n }\n \n valueKeys.push(key)\n \n return result\n \n },\n set: (target, key: string, value, _receiver) => {\n \n valueKeys.push(key)\n this.forEach(element => UIObject.setValueForKeyPath(valueKeys.join(\".\"), value, element, YES))\n return true\n \n }\n \n }\n )\n \n return result\n \n },\n set: function (this: Array<any>, element: any) {\n for (let i = 0; i < this.length; ++i) {\n this[i] = element\n }\n }\n \n })\n \n}\n\n\nexport type UIEveryElementItem<T> = {\n \n [P in keyof T]: UIEveryElementItem<T[P]>\n \n} & {\n \n UI_elementValues?: T[];\n \n} & T\n\n// interface Array<T> {\n//\n// firstElement: T;\n// lastElement: T;\n//\n// everyElement: UIEveryElementItem<T>;\n//\n// }\n\n\nif (\"copy\" in Array.prototype == NO) {\n \n (Array.prototype as any).copy = function (this: Array<any>) {\n return this.slice(0)\n }\n \n}\n\n\n// interface Array<T> {\n//\n// copy(): Array<T>;\n//\n// }\n\n\nif (\"arrayByRepeating\" in Array.prototype == NO) {\n \n (Array.prototype as any).arrayByRepeating = function (this: Array<any>, numberOfRepetitions: number) {\n const result: any[] = []\n for (let i = 0; i < numberOfRepetitions; i++) {\n this.forEach(element => result.push(element))\n }\n return result\n }\n \n}\n\n\n// interface Array<T> {\n//\n// arrayByRepeating(numberOfRepetitions: number): Array<T>;\n//\n// }\n\n\nif (\"arrayByTrimmingToLengthIfLonger\" in Array.prototype == NO) {\n (Array.prototype as any).arrayByTrimmingToLengthIfLonger = function (this: Array<any>, maxLength: number) {\n const result = []\n for (let i = 0; i < maxLength && i < this.length; i++) {\n result.push(this[i])\n }\n return result\n }\n}\n\n\n// interface Array<T> {\n//\n// arrayByTrimmingToLengthIfLonger(maxLength: number): Array<T>;\n//\n// }\n\n\nif (\"summedValue\" in Array.prototype == NO) {\n \n Object.defineProperty(Array.prototype, \"summedValue\", {\n get: function summedValue(this: Array<any>) {\n return this.reduce(function (a, b) {\n return a + b\n }, 0)\n }\n })\n \n}\n\n\n// interface Array<T> {\n//\n// readonly summedValue: T;\n//\n// max(): number;\n// min(): number;\n//\n//\n// }\n\nArray.prototype.max = function () {\n return Math.max.apply(null, this)\n}\n\nArray.prototype.min = function () {\n return Math.min.apply(null, this)\n}\n\nif (!Array.prototype.average) {\n \n Array.prototype.average = function () {\n if (this.length == 0) {\n return 0;\n }\n const sum = this.reduce((a, b) => a + b, 0)\n return sum / this.length\n }\n \n}\n\n// interface Array<T> {\n//\n// isEqualToArray(array: Array<T>, keyPath?: string): boolean;\n//\n// }\n\n\nif (\"isEqualToArray\" in Array.prototype == NO) {\n \n // attach the .equals method to Array's prototype to call it on any array\n Array.prototype.isEqualToArray = function (array: any[], keyPath?: string) {\n \n // if the other array is a falsy value, return\n if (!array) {\n return false\n }\n \n // compare lengths - can save a lot of time\n if (this.length != array.length) {\n return false\n }\n \n var i = 0\n const l = this.length\n for (; i < l; i++) {\n \n // Check if we have nested arrays\n if (this[i] instanceof Array && array[i] instanceof Array && !keyPath) {\n \n // recurse into the nested arrays\n if (!this[i].isEqualToArray(array[i])) {\n return false\n }\n \n }\n else if (keyPath && UIObject.valueForKeyPath(keyPath, this[i]) != UIObject.valueForKeyPath(\n keyPath,\n array[i]\n )) {\n \n return false\n \n }\n else if (this[i] != array[i]) {\n \n // Warning - two different object instances will never be equal: {x:20} != {x:20}\n return false\n \n }\n \n }\n \n return true\n \n }\n \n // Hide method from for-in loops\n Object.defineProperty(Array.prototype, \"isEqualToArray\", { enumerable: false })\n \n}\n\n\nif (\"forEach\" in Object.prototype == NO) {\n \n (Object.prototype as any).forEach = function (\n this: Record<string, any>,\n callbackFunction: (\n value: any,\n key: string,\n stopLooping: Function\n ) => void\n ) {\n const keys = Object.keys(this)\n let shouldStopLooping = NO\n \n function stopLooping() {\n shouldStopLooping = YES\n }\n \n keys.anyMatch(key => {\n callbackFunction(this[key], key, stopLooping)\n return shouldStopLooping\n })\n }\n \n // Hide method from for-in loops\n Object.defineProperty(Object.prototype, \"forEach\", { enumerable: false })\n \n}\n\n\n// interface Object {\n//\n// forEach(callbackFunction: (value: any, key: string) => void): void;\n//\n// }\n\n\nif (\"allValues\" in Object.prototype == NO) {\n Object.defineProperty(Object.prototype, \"allValues\", {\n get: function (this: Object) {\n const values: any[] = []\n this.forEach((value: any) => {\n values.push(value)\n })\n return values\n },\n enumerable: NO\n })\n}\n\n\n// interface Object {\n//\n// readonly allValues: Array<any>;\n//\n// }\n\n\nif (\"allKeys\" in Object.prototype == NO) {\n Object.defineProperty(Object.prototype, \"allKeys\", {\n get: function (this: Object) {\n return Object.keys(this)\n },\n enumerable: NO\n })\n}\n\n\n// interface Object {\n//\n// readonly allKeys: string[];\n//\n// }\n\n\nif (\"objectByCopyingValuesRecursivelyFromObject\" in Object.prototype == NO) {\n \n (Object.prototype as any).objectByCopyingValuesRecursivelyFromObject = function (this: Object, object: any) {\n \n \n function isAnObject(item: any) {\n return (item && typeof item === \"object\" && !Array.isArray(item))\n }\n \n function mergeRecursively(target: any, source: any) {\n \n const output = Object.assign({}, target)\n \n if (isAnObject(target) && isAnObject(source)) {\n \n Object.keys(source).forEach(function (key) {\n \n if (isAnObject(source[key])) {\n \n // if (!(key in target)) {\n \n // Object.assign(output, { [key]: source[key] });\n \n // }\n // else {\n \n output[key] = mergeRecursively(target[key] ?? {}, source[key])\n \n //}\n \n }\n else {\n \n Object.assign(output, { [key]: source[key] })\n \n }\n \n })\n \n }\n \n return output\n \n }\n \n return mergeRecursively(this, object)\n \n }\n \n // Hide method from for-in loops\n Object.defineProperty(Object.prototype, \"objectByCopyingValuesRecursivelyFromObject\", { enumerable: false })\n \n}\n\n\nif (\"asValueObject\" in Object.prototype == NO) {\n \n (Object.prototype as any).asValueObject = function () {\n \n return new UICoreExtensionValueObject(this)\n \n }\n \n // Hide method from for-in loops\n Object.defineProperty(Object.prototype, \"asValueObject\", { enumerable: false })\n \n}\n\n\n// interface Object {\n//\n// objectByCopyingValuesRecursivelyFromObject<T>(object: T): this & T;\n//\n// asValueObject(): this;\n//\n// }\n\n// export type Unpacked<T> =\n// T extends (infer U)[]\n// ? U\n// : T extends (...args: any[]) => infer U\n// ? U\n// : T extends Promise<infer U>\n// ? U\n// : T\n//\n// export type UnpackedObject<T> = {\n// [P in keyof T]: Unpacked<T[P]>\n// }\n\n// export function promisedProperties<ObjectType extends Record<string, any>>(object: ObjectType): UnpackedObject<ObjectType> {\n//\n// let promisedProperties: any[] = []\n// const objectKeys = Object.keys(object)\n//\n// objectKeys.forEach((key) => promisedProperties.push(object[key]))\n//\n// // @ts-ignore\n// return Promise.all(promisedProperties)\n// .then((resolvedValues) => {\n// return resolvedValues.reduce((resolvedObject, property, index) => {\n// resolvedObject[objectKeys[index]] = property\n// return resolvedObject\n// }, object)\n// })\n//\n// }\n\n// if (\"promisedProperties\" in Object.prototype == NO) {\n//\n// (Object.prototype as any).promisedProperties = function () {\n//\n// const result = promisedProperties(this);\n//\n// return result\n//\n// }\n//\n// // Hide method from for-in loops\n// Object.defineProperty(Object.prototype, \"promisedProperties\", { enumerable: false });\n//\n// }\n//\n//\n// interface Object {\n//\n// readonly promisedProperties: UnpackedObject<this>;\n//\n// }\n\n\nif (\"contains\" in String.prototype == NO) {\n \n (String.prototype as any).contains = function (this: String, string: string) {\n return (this.indexOf(string) != -1)\n }\n \n // Hide method from for-in loops\n Object.defineProperty(Object.prototype, \"contains\", { enumerable: false })\n \n}\n\n\n// interface String {\n//\n// contains(string): boolean;\n//\n// }\n\n\nif (\"capitalizedString\" in String.prototype == NO) {\n Object.defineProperty(Object.prototype, \"capitalizedString\", {\n get: function (this: String) {\n return this.charAt(0).toUpperCase() + this.slice(1).toLowerCase()\n },\n enumerable: NO\n })\n}\n\n\n// interface String {\n//\n// readonly capitalizedString: string;\n//\n// }\n\n\nif (\"numericalValue\" in String.prototype == NO) {\n Object.defineProperty(String.prototype, \"numericalValue\", {\n get: function numericalValue(this: string) {\n return Number(this)\n }\n })\n}\n\nif (\"integerValue\" in String.prototype == NO) {\n Object.defineProperty(String.prototype, \"integerValue\", {\n get: function integerValue(this: string) {\n return Number(this).integerValue\n }\n })\n}\n\n\n// interface String {\n//\n// readonly numericalValue: number;\n//\n// }\n\n\nif (\"isAString\" in String.prototype == NO) {\n \n (String.prototype as any).isAString = YES\n \n}\n\n\n// interface String {\n//\n// isAString: boolean;\n//\n// }\n\n\nif (\"isANumber\" in Number.prototype == NO) {\n \n (Number.prototype as any).isANumber = YES\n \n}\n\n\n// interface Number {\n//\n// isANumber: boolean;\n//\n// }\n\n\nif (\"integerValue\" in Number.prototype == NO) {\n Object.defineProperty(Number.prototype, \"integerValue\", {\n get: function (this: number) {\n return parseInt(\"\" + (Math.round(this) + 0.5))\n },\n enumerable: NO\n })\n}\n\nif (\"constrainedValue\" in Number.prototype == NO) {\n \n (Number.prototype as any).constrainedValue = function (this: number, min: number, max: number) {\n if (this < min) {\n return min;\n }\n if (this > max) {\n return max;\n }\n return this\n }\n \n // Hide method from for-in loops\n Object.defineProperty(Number.prototype, \"constrainedValue\", {\n enumerable: NO\n })\n \n}\n\n\n// interface Number {\n//\n// readonly integerValue: number;\n//\n// }\n\n\nif (\"integerValue\" in Boolean.prototype == NO) {\n \n Object.defineProperty(Boolean.prototype, \"integerValue\", {\n get: function (this: boolean) {\n if (this == true) {\n return 1\n }\n return 0\n }\n })\n \n}\n\n\n// interface Boolean {\n//\n// readonly integerValue: number;\n//\n// }\n\n\nif (\"dateString\" in Date.prototype == NO) {\n \n Object.defineProperty(Date.prototype, \"dateString\", {\n get: function dateString(this: Date) {\n return (\"0\" + this.getDate()).slice(-2) + \"-\" + (\"0\" + (this.getMonth() + 1)).slice(-2) + \"-\" +\n this.getFullYear() + \" \" + (\"0\" + this.getHours()).slice(-2) + \":\" +\n (\"0\" + this.getMinutes()).slice(-2)\n }\n })\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AAK,QAAQ,GAAG,MAAM,EAAE,IAAI,OAAO,OAAO,KAAK,SAAS,IAAI,IAAI,MAAM,EAAE,IAAI,MACtF,KAAK,YAAY,IAAI,OAAO,MAAM,KAAK,SAAS,GAAG,MAAM,EAAE,IAAI,OAC9D,MAAM,KAAK,WAAW,GAAG,MAAM,EAAE;AAAA,IAC1C;AAAA,EACJ,CAAC;AAGL;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../scripts/UIKeyValueStringFilterWebWorker.worker.ts"],
|
|
4
|
-
"sourcesContent": ["// @ts-check\n\nif (\"contains\" in Array.prototype == false) {\n \n // @ts-ignore\n Array.prototype.contains = function (element) {\n \n var result = (this.indexOf(element) != -1)\n return result\n \n }\n \n}\n\nif (\"contains\" in String.prototype == false) {\n \n // @ts-ignore\n String.prototype.contains = function (string) {\n \n var result = (this.indexOf(string) != -1)\n return result\n \n }\n \n}\n\n\nonmessage = function (event) {\n \n //console.log('Message received from main script');\n var workerResult = filterKeyValuePathData(\n event.data.filteringString,\n event.data.data,\n event.data.excludedData,\n event.data.dataKeyPath\n )\n \n // @ts-ignore\n workerResult.identifier = event.data.identifier\n // @ts-ignore\n workerResult.instanceIdentifier = event.data.instanceIdentifier\n \n \n // @ts-ignore\n postMessage(workerResult)\n \n}\n\n\nfunction filterKeyValuePathData(filteringString: string, data: any[], excludedData: string | any[], dataKeyPath: any) {\n \n function valueForKeyPath(keyPath: string, object: any) {\n \n var keys = keyPath.split(\".\")\n var currentObject = object\n \n keys.forEach(function (key: string | number, index: any, array: any) {\n currentObject = currentObject[key]\n })\n \n return currentObject\n \n }\n \n var filteredData = []\n var filteredIndexes: any[] = []\n \n if (filteringString) {\n \n var filteringStringWords: any[] = []\n filteringString.split(\" \").forEach(function (word: string, index: any, array: any) {\n if (word) {\n filteringStringWords.push(word.toLowerCase())\n }\n })\n \n data.forEach(function (dataObject: any, index: any, array: any) {\n \n var dataString = valueForKeyPath(dataKeyPath, dataObject)\n \n var lowercaseDataString = dataString.toLowerCase()\n \n // Look through all the words in the input\n var wordsFound: boolean[] = []\n filteringStringWords.forEach(function (word) {\n wordsFound.push(lowercaseDataString.contains(word) && !excludedData.contains(dataString))\n })\n \n // Only show the dataString if it matches all of them\n // @ts-ignore\n if (wordsFound.contains(true) && !wordsFound.contains(false)) {\n \n filteredData.push(dataObject)\n filteredIndexes.push(index)\n \n }\n \n })\n \n \n \n }\n else if (excludedData.length) {\n \n \n data.forEach(function (dataObject: any, index: any, array: any) {\n \n if (excludedData.indexOf(dataObject) == -1) {\n \n filteredData.push(dataObject)\n filteredIndexes.push(index)\n \n }\n \n })\n \n }\n else {\n \n filteredData = data\n \n data.forEach(function (object: any, index: any, array: any) {\n \n filteredIndexes.push(index)\n \n })\n \n }\n \n \n \n return { \"filteredData\": filteredData, \"filteredIndexes\": filteredIndexes }\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": ";AAEA,IAAI,cAAc,MAAM,aAAa,OAAO;AAGxC,QAAM,UAAU,WAAW,
|
|
4
|
+
"sourcesContent": ["// @ts-check\n\nif (\"contains\" in Array.prototype == false) {\n \n // @ts-ignore\n Array.prototype.contains = function (this: Array, element) {\n \n var result = (this.indexOf(element) != -1)\n return result\n \n }\n \n}\n\nif (\"contains\" in String.prototype == false) {\n \n // @ts-ignore\n String.prototype.contains = function (this: string, string) {\n \n var result = (this.indexOf(string) != -1)\n return result\n \n }\n \n}\n\n\nonmessage = function (event) {\n \n //console.log('Message received from main script');\n var workerResult = filterKeyValuePathData(\n event.data.filteringString,\n event.data.data,\n event.data.excludedData,\n event.data.dataKeyPath\n )\n \n // @ts-ignore\n workerResult.identifier = event.data.identifier\n // @ts-ignore\n workerResult.instanceIdentifier = event.data.instanceIdentifier\n \n \n // @ts-ignore\n postMessage(workerResult)\n \n}\n\n\nfunction filterKeyValuePathData(filteringString: string, data: any[], excludedData: string | any[], dataKeyPath: any) {\n \n function valueForKeyPath(keyPath: string, object: any) {\n \n var keys = keyPath.split(\".\")\n var currentObject = object\n \n keys.forEach(function (key: string | number, index: any, array: any) {\n currentObject = currentObject[key]\n })\n \n return currentObject\n \n }\n \n var filteredData = []\n var filteredIndexes: any[] = []\n \n if (filteringString) {\n \n var filteringStringWords: any[] = []\n filteringString.split(\" \").forEach(function (word: string, index: any, array: any) {\n if (word) {\n filteringStringWords.push(word.toLowerCase())\n }\n })\n \n data.forEach(function (dataObject: any, index: any, array: any) {\n \n var dataString = valueForKeyPath(dataKeyPath, dataObject)\n \n var lowercaseDataString = dataString.toLowerCase()\n \n // Look through all the words in the input\n var wordsFound: boolean[] = []\n filteringStringWords.forEach(function (word) {\n wordsFound.push(lowercaseDataString.contains(word) && !excludedData.contains(dataString))\n })\n \n // Only show the dataString if it matches all of them\n // @ts-ignore\n if (wordsFound.contains(true) && !wordsFound.contains(false)) {\n \n filteredData.push(dataObject)\n filteredIndexes.push(index)\n \n }\n \n })\n \n \n \n }\n else if (excludedData.length) {\n \n \n data.forEach(function (dataObject: any, index: any, array: any) {\n \n if (excludedData.indexOf(dataObject) == -1) {\n \n filteredData.push(dataObject)\n filteredIndexes.push(index)\n \n }\n \n })\n \n }\n else {\n \n filteredData = data\n \n data.forEach(function (object: any, index: any, array: any) {\n \n filteredIndexes.push(index)\n \n })\n \n }\n \n \n \n return { \"filteredData\": filteredData, \"filteredIndexes\": filteredIndexes }\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": ";AAEA,IAAI,cAAc,MAAM,aAAa,OAAO;AAGxC,QAAM,UAAU,WAAW,SAAuB,SAAS;AAEvD,QAAI,SAAU,KAAK,QAAQ,OAAO,KAAK;AACvC,WAAO;AAAA,EAEX;AAEJ;AAEA,IAAI,cAAc,OAAO,aAAa,OA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KAAK,KAAK;AAAA,MAE9B;AAAA,IAEJ,CAAC;AAAA,EAIL,WACS,aAAa,QAAQ;AAG1B,SAAK,QAAQ,SAAU,YAAiB,OAAY,OAAY;AAE5D,UAAI,aAAa,QAAQ,UAAU,KAAK,IAAI;AAExC,qBAAa,KAAK,UAAU;AAC5B,wBAAgB,KAAK,KAAK;AAAA,MAE9B;AAAA,IAEJ,CAAC;AAAA,EAEL,OACK;AAED,mBAAe;AAEf,SAAK,QAAQ,SAAU,QAAa,OAAY,OAAY;AAExD,sBAAgB,KAAK,KAAK;AAAA,IAE9B,CAAC;AAAA,EAEL;AAIA,SAAO,EAAE,gBAAgB,cAAc,mBAAmB,gBAAgB;AAI9E;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -29,7 +29,9 @@ class UILinkButton extends import_UILink.UILink {
|
|
|
29
29
|
this.button = new import_UIButton.UIButton(this.elementID + "Button", elementType, titleType);
|
|
30
30
|
this.addSubview(this.button);
|
|
31
31
|
this.style.position = "absolute";
|
|
32
|
-
this.button.controlEventTargetAccumulator.EnterDown.PointerUpInside
|
|
32
|
+
this.button.controlEventTargetAccumulator.EnterDown.PointerUpInside(
|
|
33
|
+
() => window.location = this.target
|
|
34
|
+
);
|
|
33
35
|
}
|
|
34
36
|
get titleLabel() {
|
|
35
37
|
return this.button.titleLabel;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../scripts/UILinkButton.ts"],
|
|
4
|
-
"sourcesContent": ["import { UIButton, UIButtonColorSpecifier } from \"./UIButton\"\nimport { UILink } from \"./UILink\"\n\n\nexport class UILinkButton extends UILink {\n \n button: UIButton\n \n constructor(elementID?: string, elementType?: string, titleType?: string) {\n \n super(elementID)\n \n // Instance variables\n this.button = new UIButton(this.elementID + \"Button\", elementType, titleType)\n this.addSubview(this.button)\n \n this.style.position = \"absolute\"\n this.button.controlEventTargetAccumulator.EnterDown.PointerUpInside
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAiD;AACjD,oBAAuB;AAGhB,MAAM,qBAAqB,qBAAO;AAAA,EAIrC,YAAY,WAAoB,aAAsB,WAAoB;AAEtE,UAAM,SAAS;AAGf,SAAK,SAAS,IAAI,yBAAS,KAAK,YAAY,UAAU,aAAa,SAAS;AAC5E,SAAK,WAAW,KAAK,MAAM;AAE3B,SAAK,MAAM,WAAW;AACtB,SAAK,OAAO,8BAA8B,UAAU,
|
|
4
|
+
"sourcesContent": ["import { UIButton, UIButtonColorSpecifier } from \"./UIButton\"\nimport { UILink } from \"./UILink\"\n\n\nexport class UILinkButton extends UILink {\n \n button: UIButton\n \n constructor(elementID?: string, elementType?: string, titleType?: string) {\n \n super(elementID)\n \n // Instance variables\n this.button = new UIButton(this.elementID + \"Button\", elementType, titleType)\n this.addSubview(this.button)\n \n this.style.position = \"absolute\"\n this.button.controlEventTargetAccumulator.EnterDown.PointerUpInside(\n () => window.location = this.target as any\n )\n \n }\n \n \n get titleLabel() {\n return this.button.titleLabel\n }\n \n get imageView() {\n return this.button.imageView\n }\n \n \n override set colors(colors: UIButtonColorSpecifier) {\n this.button.colors = colors\n }\n \n override get colors(): UIButtonColorSpecifier {\n return this.button.colors\n }\n \n \n override get viewHTMLElement() {\n return super.viewHTMLElement as HTMLLinkElement\n }\n \n \n override set target(target: string) {\n this.viewHTMLElement.setAttribute(\"href\", target)\n }\n \n override get target() {\n return this.viewHTMLElement.getAttribute(\"href\") ?? \"\"\n }\n \n \n override layoutSubviews() {\n \n super.layoutSubviews()\n \n const bounds = this.bounds\n \n this.button.frame = bounds\n this.button.layoutSubviews()\n \n }\n \n \n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\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UIView,
|
|
3
|
+
import { UIView, UIViewBroadcastEvent } from "./UIView";
|
|
4
4
|
export declare class UITextField extends UITextView {
|
|
5
5
|
_placeholderTextKey?: string;
|
|
6
6
|
_defaultPlaceholderText?: string;
|
|
@@ -31,7 +31,6 @@ export declare class UITextField extends UITextView {
|
|
|
31
31
|
} & {
|
|
32
32
|
TextChange: string;
|
|
33
33
|
};
|
|
34
|
-
get controlEventTargetAccumulator(): UIViewAddControlEventTargetObject<typeof UITextField>;
|
|
35
34
|
get viewHTMLElement(): HTMLInputElement;
|
|
36
35
|
set text(text: string);
|
|
37
36
|
get text(): string;
|
|
@@ -42,9 +42,6 @@ const _UITextField = class extends import_UITextView.UITextView {
|
|
|
42
42
|
this.nativeSelectionEnabled = import_UIObject.YES;
|
|
43
43
|
this.pausesPointerEvents = import_UIObject.NO;
|
|
44
44
|
}
|
|
45
|
-
get controlEventTargetAccumulator() {
|
|
46
|
-
return super.controlEventTargetAccumulator;
|
|
47
|
-
}
|
|
48
45
|
get viewHTMLElement() {
|
|
49
46
|
return this._viewHTMLElement;
|
|
50
47
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../scripts/UITextField.ts"],
|
|
4
|
-
"sourcesContent": ["import { UIColor } from \"./UIColor\"\nimport { UICore } from \"./UICore\"\nimport { nil, NO, ValueOf, YES } from \"./UIObject\"\nimport { UITextView } from \"./UITextView\"\nimport { UIView, UIViewAddControlEventTargetObject, UIViewBroadcastEvent } from \"./UIView\"\n\n\nexport class UITextField extends UITextView {\n \n _placeholderTextKey?: string\n _defaultPlaceholderText?: string\n \n override _viewHTMLElement!: HTMLInputElement\n \n constructor(elementID?: string, viewHTMLElement = null, type: string | ValueOf<typeof UITextView.type> = UITextView.type.textField) {\n \n super(elementID, type, viewHTMLElement)\n \n this.viewHTMLElement.setAttribute(\"type\", \"text\")\n \n this.backgroundColor = UIColor.whiteColor\n \n this.addTargetForControlEvent(\n UIView.controlEvent.PointerUpInside,\n (sender, event) => sender.focus()\n )\n \n this.viewHTMLElement.oninput = (event) => {\n this.sendControlEventForKey(UITextField.controlEvent.TextChange, event)\n }\n \n \n this.style.webkitUserSelect = \"text\"\n \n this.nativeSelectionEnabled = YES\n \n this.pausesPointerEvents = NO\n \n \n }\n \n \n static override controlEvent = Object.assign({}, UITextView.controlEvent, {\n \n \"TextChange\": \"TextChange\"\n \n })\n \n \n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAwB;AACxB,oBAAuB;AACvB,sBAAsC;AACtC,wBAA2B;AAC3B,oBAAgF;AAGzE,MAAM,eAAN,cAA0B,6BAAW;AAAA,EAOxC,YAAY,WAAoB,kBAAkB,MAAM,OAAiD,6BAAW,KAAK,WAAW;AAEhI,UAAM,WAAW,MAAM,eAAe;AAEtC,SAAK,gBAAgB,aAAa,QAAQ,MAAM;AAEhD,SAAK,kBAAkB,uBAAQ;AAE/B,SAAK;AAAA,MACD,qBAAO,aAAa;AAAA,MACpB,CAAC,QAAQ,UAAU,OAAO,MAAM;AAAA,IACpC;AAEA,SAAK,gBAAgB,UAAU,CAAC,UAAU;AACtC,WAAK,uBAAuB,aAAY,aAAa,YAAY,KAAK;AAAA,IAC1E;AAGA,SAAK,MAAM,mBAAmB;AAE9B,SAAK,yBAAyB;AAE9B,SAAK,sBAAsB;AAAA,EAG/B;AAAA,EAUA,
|
|
4
|
+
"sourcesContent": ["import { UIColor } from \"./UIColor\"\nimport { UICore } from \"./UICore\"\nimport { nil, NO, ValueOf, YES } from \"./UIObject\"\nimport { UITextView } from \"./UITextView\"\nimport { UIView, UIViewAddControlEventTargetObject, UIViewBroadcastEvent } from \"./UIView\"\n\n\nexport class UITextField extends UITextView {\n \n _placeholderTextKey?: string\n _defaultPlaceholderText?: string\n \n override _viewHTMLElement!: HTMLInputElement\n \n constructor(elementID?: string, viewHTMLElement = null, type: string | ValueOf<typeof UITextView.type> = UITextView.type.textField) {\n \n super(elementID, type, viewHTMLElement)\n \n this.viewHTMLElement.setAttribute(\"type\", \"text\")\n \n this.backgroundColor = UIColor.whiteColor\n \n this.addTargetForControlEvent(\n UIView.controlEvent.PointerUpInside,\n (sender, event) => sender.focus()\n )\n \n this.viewHTMLElement.oninput = (event) => {\n this.sendControlEventForKey(UITextField.controlEvent.TextChange, event)\n }\n \n \n this.style.webkitUserSelect = \"text\"\n \n this.nativeSelectionEnabled = YES\n \n this.pausesPointerEvents = NO\n \n \n }\n \n \n static override controlEvent = Object.assign({}, UITextView.controlEvent, {\n \n \"TextChange\": \"TextChange\"\n \n })\n \n \n public override get viewHTMLElement() {\n return this._viewHTMLElement\n }\n \n \n public override set text(text: string) {\n \n this.viewHTMLElement.value = text\n \n }\n \n \n public override get text(): string {\n \n return this.viewHTMLElement.value\n \n }\n \n \n public set placeholderText(text: string) {\n \n this.viewHTMLElement.placeholder = text\n \n }\n \n \n public get placeholderText(): string {\n \n return this.viewHTMLElement.placeholder\n \n }\n \n \n setPlaceholderText(key: string, defaultString: string) {\n \n this._placeholderTextKey = key\n this._defaultPlaceholderText = defaultString\n \n const languageName = UICore.languageService.currentLanguageKey\n this.placeholderText = UICore.languageService.stringForKey(key, languageName, defaultString, nil)\n \n }\n \n \n override didReceiveBroadcastEvent(event: UIViewBroadcastEvent) {\n \n super.didReceiveBroadcastEvent(event)\n \n if (event.name == UIView.broadcastEventName.LanguageChanged || event.name ==\n UIView.broadcastEventName.AddedToViewTree) {\n \n this._setPlaceholderFromKeyIfPossible()\n \n }\n \n }\n \n \n override willMoveToSuperview(superview: UIView) {\n \n super.willMoveToSuperview(superview)\n \n this._setPlaceholderFromKeyIfPossible()\n \n }\n \n _setPlaceholderFromKeyIfPossible() {\n \n if (this._placeholderTextKey && this._defaultPlaceholderText) {\n \n this.setPlaceholderText(this._placeholderTextKey, this._defaultPlaceholderText)\n \n }\n \n }\n \n \n public get isSecure(): boolean {\n \n const result = (this.viewHTMLElement.type == \"password\")\n \n return result\n \n }\n \n \n \n public set isSecure(secure: boolean) {\n \n var type = \"text\"\n \n if (secure) {\n \n type = \"password\"\n \n }\n \n this.viewHTMLElement.type = type\n \n }\n \n \n \n \n \n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAwB;AACxB,oBAAuB;AACvB,sBAAsC;AACtC,wBAA2B;AAC3B,oBAAgF;AAGzE,MAAM,eAAN,cAA0B,6BAAW;AAAA,EAOxC,YAAY,WAAoB,kBAAkB,MAAM,OAAiD,6BAAW,KAAK,WAAW;AAEhI,UAAM,WAAW,MAAM,eAAe;AAEtC,SAAK,gBAAgB,aAAa,QAAQ,MAAM;AAEhD,SAAK,kBAAkB,uBAAQ;AAE/B,SAAK;AAAA,MACD,qBAAO,aAAa;AAAA,MACpB,CAAC,QAAQ,UAAU,OAAO,MAAM;AAAA,IACpC;AAEA,SAAK,gBAAgB,UAAU,CAAC,UAAU;AACtC,WAAK,uBAAuB,aAAY,aAAa,YAAY,KAAK;AAAA,IAC1E;AAGA,SAAK,MAAM,mBAAmB;AAE9B,SAAK,yBAAyB;AAE9B,SAAK,sBAAsB;AAAA,EAG/B;AAAA,EAUA,IAAoB,kBAAkB;AAClC,WAAO,KAAK;AAAA,EAChB;AAAA,EAGA,IAAoB,KAAK,MAAc;AAEnC,SAAK,gBAAgB,QAAQ;AAAA,EAEjC;AAAA,EAGA,IAAoB,OAAe;AAE/B,WAAO,KAAK,gBAAgB;AAAA,EAEhC;AAAA,EAGA,IAAW,gBAAgB,MAAc;AAErC,SAAK,gBAAgB,cAAc;AAAA,EAEvC;AAAA,EAGA,IAAW,kBAA0B;AAEjC,WAAO,KAAK,gBAAgB;AAAA,EAEhC;AAAA,EAGA,mBAAmB,KAAa,eAAuB;AAEnD,SAAK,sBAAsB;AAC3B,SAAK,0BAA0B;AAE/B,UAAM,eAAe,qBAAO,gBAAgB;AAC5C,SAAK,kBAAkB,qBAAO,gBAAgB,aAAa,KAAK,cAAc,eAAe,mBAAG;AAAA,EAEpG;AAAA,EAGS,yBAAyB,OAA6B;AAE3D,UAAM,yBAAyB,KAAK;AAEpC,QAAI,MAAM,QAAQ,qBAAO,mBAAmB,mBAAmB,MAAM,QACjE,qBAAO,mBAAmB,iBAAiB;AAE3C,WAAK,iCAAiC;AAAA,IAE1C;AAAA,EAEJ;AAAA,EAGS,oBAAoB,WAAmB;AAE5C,UAAM,oBAAoB,SAAS;AAEnC,SAAK,iCAAiC;AAAA,EAE1C;AAAA,EAEA,mCAAmC;AAE/B,QAAI,KAAK,uBAAuB,KAAK,yBAAyB;AAE1D,WAAK,mBAAmB,KAAK,qBAAqB,KAAK,uBAAuB;AAAA,IAElF;AAAA,EAEJ;AAAA,EAGA,IAAW,WAAoB;AAE3B,UAAM,SAAU,KAAK,gBAAgB,QAAQ;AAE7C,WAAO;AAAA,EAEX;AAAA,EAIA,IAAW,SAAS,QAAiB;AAEjC,QAAI,OAAO;AAEX,QAAI,QAAQ;AAER,aAAO;AAAA,IAEX;AAEA,SAAK,gBAAgB,OAAO;AAAA,EAEhC;AAMJ;AAnJO,IAAM,cAAN;AAAM,YAmCO,eAAe,OAAO,OAAO,CAAC,GAAG,6BAAW,cAAc;AAAA,EAEtE,cAAc;AAElB,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -60,7 +60,7 @@ type Mutable<T> = {
|
|
|
60
60
|
export type UIViewAddControlEventTargetObject<T extends {
|
|
61
61
|
controlEvent: Record<string, any>;
|
|
62
62
|
}> = Mutable<{
|
|
63
|
-
[K in keyof T["controlEvent"]]: ((sender:
|
|
63
|
+
[K in keyof T["controlEvent"]]: UIViewAddControlEventTargetObject<T> & ((handler: (sender: T, event: Event) => void) => void);
|
|
64
64
|
}>;
|
|
65
65
|
interface Constraint {
|
|
66
66
|
constant: number;
|
|
@@ -1202,8 +1202,8 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1202
1202
|
this._isMovable = import_UIObject.NO;
|
|
1203
1203
|
this.makeNotMovable = void 0;
|
|
1204
1204
|
};
|
|
1205
|
-
this.controlEventTargetAccumulator.PointerDrag
|
|
1206
|
-
this.controlEventTargetAccumulator.PointerUp.PointerCancel
|
|
1205
|
+
this.controlEventTargetAccumulator.PointerDrag(movementFunction);
|
|
1206
|
+
this.controlEventTargetAccumulator.PointerUp.PointerCancel(movementStopFunction);
|
|
1207
1207
|
this._isMovable = import_UIObject.YES;
|
|
1208
1208
|
this.makeNotMovable = cleanupFunction;
|
|
1209
1209
|
}
|
|
@@ -1363,8 +1363,8 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1363
1363
|
}),
|
|
1364
1364
|
pausesPointerEvents: import_UIObject.YES
|
|
1365
1365
|
});
|
|
1366
|
-
leftEdge.controlEventTargetAccumulator.PointerDrag
|
|
1367
|
-
leftEdge.controlEventTargetAccumulator.PointerUp
|
|
1366
|
+
leftEdge.controlEventTargetAccumulator.PointerDrag(PointerXDragFunction.bind(this, 1));
|
|
1367
|
+
leftEdge.controlEventTargetAccumulator.PointerUp(pointerUpFunction);
|
|
1368
1368
|
const rightEdge = new _UIView().configuredWithObject({
|
|
1369
1369
|
_viewHTMLElement: {
|
|
1370
1370
|
className: "rightEdge",
|
|
@@ -1387,8 +1387,8 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1387
1387
|
}),
|
|
1388
1388
|
pausesPointerEvents: import_UIObject.YES
|
|
1389
1389
|
});
|
|
1390
|
-
rightEdge.controlEventTargetAccumulator.PointerDrag
|
|
1391
|
-
rightEdge.controlEventTargetAccumulator.PointerUp
|
|
1390
|
+
rightEdge.controlEventTargetAccumulator.PointerDrag(PointerXDragFunction.bind(this, 0));
|
|
1391
|
+
rightEdge.controlEventTargetAccumulator.PointerUp(pointerUpFunction);
|
|
1392
1392
|
const bottomEdge = new _UIView().configuredWithObject({
|
|
1393
1393
|
_viewHTMLElement: {
|
|
1394
1394
|
className: "bottomEdge",
|
|
@@ -1411,8 +1411,8 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1411
1411
|
}),
|
|
1412
1412
|
pausesPointerEvents: import_UIObject.YES
|
|
1413
1413
|
});
|
|
1414
|
-
bottomEdge.controlEventTargetAccumulator.PointerDrag
|
|
1415
|
-
bottomEdge.controlEventTargetAccumulator.PointerUp
|
|
1414
|
+
bottomEdge.controlEventTargetAccumulator.PointerDrag(PointerYDragFunction.bind(this, 0));
|
|
1415
|
+
bottomEdge.controlEventTargetAccumulator.PointerUp(pointerUpFunction);
|
|
1416
1416
|
const topEdge = new _UIView().configuredWithObject({
|
|
1417
1417
|
_viewHTMLElement: {
|
|
1418
1418
|
className: "topEdge",
|
|
@@ -1435,8 +1435,8 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1435
1435
|
}),
|
|
1436
1436
|
pausesPointerEvents: import_UIObject.YES
|
|
1437
1437
|
});
|
|
1438
|
-
topEdge.controlEventTargetAccumulator.PointerDrag
|
|
1439
|
-
topEdge.controlEventTargetAccumulator.PointerUp
|
|
1438
|
+
topEdge.controlEventTargetAccumulator.PointerDrag(PointerYDragFunction.bind(this, 1));
|
|
1439
|
+
topEdge.controlEventTargetAccumulator.PointerUp(pointerUpFunction);
|
|
1440
1440
|
const pointerDragTLFunction = (sender, event) => {
|
|
1441
1441
|
PointerXDragFunction(1, sender, event);
|
|
1442
1442
|
PointerYDragFunction(1, sender, event);
|
|
@@ -1464,8 +1464,8 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1464
1464
|
}),
|
|
1465
1465
|
pausesPointerEvents: import_UIObject.YES
|
|
1466
1466
|
});
|
|
1467
|
-
topLeftCornerTop.controlEventTargetAccumulator.PointerDrag
|
|
1468
|
-
topLeftCornerTop.controlEventTargetAccumulator.PointerUp
|
|
1467
|
+
topLeftCornerTop.controlEventTargetAccumulator.PointerDrag(pointerDragTLFunction);
|
|
1468
|
+
topLeftCornerTop.controlEventTargetAccumulator.PointerUp(pointerUpFunction);
|
|
1469
1469
|
const topLeftCornerLeft = new _UIView().configuredWithObject({
|
|
1470
1470
|
_viewHTMLElement: {
|
|
1471
1471
|
className: "topLeftCornerLeft",
|
|
@@ -1489,8 +1489,8 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1489
1489
|
}),
|
|
1490
1490
|
pausesPointerEvents: import_UIObject.YES
|
|
1491
1491
|
});
|
|
1492
|
-
topLeftCornerLeft.controlEventTargetAccumulator.PointerDrag
|
|
1493
|
-
topLeftCornerLeft.controlEventTargetAccumulator.PointerUp
|
|
1492
|
+
topLeftCornerLeft.controlEventTargetAccumulator.PointerDrag(pointerDragTLFunction);
|
|
1493
|
+
topLeftCornerLeft.controlEventTargetAccumulator.PointerUp(pointerUpFunction);
|
|
1494
1494
|
const pointerDragBLFunction = (sender, event) => {
|
|
1495
1495
|
PointerXDragFunction(1, sender, event);
|
|
1496
1496
|
PointerYDragFunction(0, sender, event);
|
|
@@ -1518,8 +1518,8 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1518
1518
|
}),
|
|
1519
1519
|
pausesPointerEvents: import_UIObject.YES
|
|
1520
1520
|
});
|
|
1521
|
-
bottomLeftCornerLeft.controlEventTargetAccumulator.PointerDrag
|
|
1522
|
-
bottomLeftCornerLeft.controlEventTargetAccumulator.PointerUp
|
|
1521
|
+
bottomLeftCornerLeft.controlEventTargetAccumulator.PointerDrag(pointerDragBLFunction);
|
|
1522
|
+
bottomLeftCornerLeft.controlEventTargetAccumulator.PointerUp(pointerUpFunction);
|
|
1523
1523
|
const bottomLeftCornerBottom = new _UIView().configuredWithObject({
|
|
1524
1524
|
_viewHTMLElement: {
|
|
1525
1525
|
className: "bottomLeftCornerBottom",
|
|
@@ -1543,8 +1543,8 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1543
1543
|
}),
|
|
1544
1544
|
pausesPointerEvents: import_UIObject.YES
|
|
1545
1545
|
});
|
|
1546
|
-
bottomLeftCornerBottom.controlEventTargetAccumulator.PointerDrag
|
|
1547
|
-
bottomLeftCornerBottom.controlEventTargetAccumulator.PointerUp
|
|
1546
|
+
bottomLeftCornerBottom.controlEventTargetAccumulator.PointerDrag(pointerDragBLFunction);
|
|
1547
|
+
bottomLeftCornerBottom.controlEventTargetAccumulator.PointerUp(pointerUpFunction);
|
|
1548
1548
|
const pointerDragBRFunction = (sender, event) => {
|
|
1549
1549
|
PointerXDragFunction(0, sender, event);
|
|
1550
1550
|
PointerYDragFunction(0, sender, event);
|
|
@@ -1572,8 +1572,8 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1572
1572
|
}),
|
|
1573
1573
|
pausesPointerEvents: import_UIObject.YES
|
|
1574
1574
|
});
|
|
1575
|
-
bottomRightCornerBottom.controlEventTargetAccumulator.PointerDrag
|
|
1576
|
-
bottomRightCornerBottom.controlEventTargetAccumulator.PointerUp
|
|
1575
|
+
bottomRightCornerBottom.controlEventTargetAccumulator.PointerDrag(pointerDragBRFunction);
|
|
1576
|
+
bottomRightCornerBottom.controlEventTargetAccumulator.PointerUp(pointerUpFunction);
|
|
1577
1577
|
const bottomRightCornerRight = new _UIView().configuredWithObject({
|
|
1578
1578
|
_viewHTMLElement: {
|
|
1579
1579
|
className: "bottomRightCornerRight",
|
|
@@ -1597,8 +1597,8 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1597
1597
|
}),
|
|
1598
1598
|
pausesPointerEvents: import_UIObject.YES
|
|
1599
1599
|
});
|
|
1600
|
-
bottomRightCornerRight.controlEventTargetAccumulator.PointerDrag
|
|
1601
|
-
bottomRightCornerRight.controlEventTargetAccumulator.PointerUp
|
|
1600
|
+
bottomRightCornerRight.controlEventTargetAccumulator.PointerDrag(pointerDragBRFunction);
|
|
1601
|
+
bottomRightCornerRight.controlEventTargetAccumulator.PointerUp(pointerUpFunction);
|
|
1602
1602
|
const pointerDragTRFunction = (sender, event) => {
|
|
1603
1603
|
PointerXDragFunction(0, sender, event);
|
|
1604
1604
|
PointerYDragFunction(1, sender, event);
|
|
@@ -1626,8 +1626,8 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1626
1626
|
}),
|
|
1627
1627
|
pausesPointerEvents: import_UIObject.YES
|
|
1628
1628
|
});
|
|
1629
|
-
topRightCornerRight.controlEventTargetAccumulator.PointerDrag
|
|
1630
|
-
topRightCornerRight.controlEventTargetAccumulator.PointerUp
|
|
1629
|
+
topRightCornerRight.controlEventTargetAccumulator.PointerDrag(pointerDragTRFunction);
|
|
1630
|
+
topRightCornerRight.controlEventTargetAccumulator.PointerUp(pointerUpFunction);
|
|
1631
1631
|
const topRightCornerTop = new _UIView().configuredWithObject({
|
|
1632
1632
|
_viewHTMLElement: {
|
|
1633
1633
|
className: "topRightCornerTop",
|
|
@@ -1651,8 +1651,8 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1651
1651
|
}),
|
|
1652
1652
|
pausesPointerEvents: import_UIObject.YES
|
|
1653
1653
|
});
|
|
1654
|
-
topRightCornerTop.controlEventTargetAccumulator.PointerDrag
|
|
1655
|
-
topRightCornerTop.controlEventTargetAccumulator.PointerUp
|
|
1654
|
+
topRightCornerTop.controlEventTargetAccumulator.PointerDrag(pointerDragTRFunction);
|
|
1655
|
+
topRightCornerTop.controlEventTargetAccumulator.PointerUp(pointerUpFunction);
|
|
1656
1656
|
const views = [
|
|
1657
1657
|
leftEdge,
|
|
1658
1658
|
rightEdge,
|
|
@@ -1986,6 +1986,15 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1986
1986
|
eventKeys.push(key);
|
|
1987
1987
|
return result;
|
|
1988
1988
|
},
|
|
1989
|
+
apply: (_target, _thisArg, args) => {
|
|
1990
|
+
const handler = args[0];
|
|
1991
|
+
if (typeof handler === "function") {
|
|
1992
|
+
this.addTargetForControlEvents(eventKeys, handler);
|
|
1993
|
+
} else {
|
|
1994
|
+
throw "Handler must be a function, not " + handler;
|
|
1995
|
+
}
|
|
1996
|
+
return true;
|
|
1997
|
+
},
|
|
1989
1998
|
set: (target, key, value, _receiver) => {
|
|
1990
1999
|
eventKeys.push(key);
|
|
1991
2000
|
this.addTargetForControlEvents(eventKeys, value);
|