uicore-ts 1.0.557 → 1.0.561

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.
@@ -160,7 +160,7 @@ class UIDialogView extends import_UIView.UIView {
160
160
  return (_b2 = (_a2 = this.superview) == null ? void 0 : _a2.frame.height) != null ? _b2 : 0;
161
161
  }),
162
162
  import_UIView.UIView.pageHeight
163
- ),
163
+ ) / import_UIView.UIView.pageScale,
164
164
  "100%"
165
165
  );
166
166
  const bounds = this.bounds;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../scripts/UIDialogView.ts"],
4
- "sourcesContent": ["import { IS_FIREFOX } from \"./ClientCheckers\"\nimport { UIColor } from \"./UIColor\"\nimport { UICore } from \"./UICore\"\nimport { UINativeScrollView } from \"./UINativeScrollView\"\nimport { FIRST, IF, IS, nil, NO, YES } from \"./UIObject\"\nimport { UIScrollView } from \"./UIScrollView\"\nimport { UIView, UIViewBroadcastEvent } from \"./UIView\"\n\n\nexport class UIDialogView<ViewType extends UIView = UIView> extends UIView {\n \n _isAUIDialogView = YES\n _view: ViewType = new UIView() as any\n _appearedAnimated?: boolean\n animationDuration: number = 0.25\n _zIndex: number = 100\n isVisible: boolean = NO\n dismissesOnTapOutside = YES\n \n constructor(elementID?: string, viewHTMLElement?: HTMLElement) {\n \n \n super(elementID, viewHTMLElement)\n \n this.addTargetForControlEvent(\n UIView.controlEvent.PointerTap,\n function (this: UIDialogView, sender: UIView, event: Event) {\n \n this.didDetectTapOutside(sender, event)\n \n }.bind(this)\n )\n \n this.backgroundColor = UIColor.colorWithRGBA(0, 10, 25).colorWithAlpha(0.75) //CBColor.primaryContentColor.colorWithAlpha(0.75)\n \n this.zIndex = this._zIndex\n \n }\n \n \n didDetectTapOutside(sender: UIView, event: Event) {\n \n if (event.target == this.viewHTMLElement && this.dismissesOnTapOutside) {\n this.dismiss(this._appearedAnimated)\n }\n \n }\n \n \n set zIndex(zIndex: number) {\n \n this._zIndex = zIndex\n this.style.zIndex = \"\" + zIndex\n \n }\n \n get zIndex() {\n \n return this._zIndex\n \n }\n \n \n set view(view: ViewType) {\n \n this._view?.removeFromSuperview()\n \n this._view = view\n \n this.addSubview(view)\n \n }\n \n \n get view(): ViewType {\n \n return this._view\n \n }\n \n \n override willAppear(animated: boolean = NO) {\n \n if (animated) {\n \n this.style.opacity = \"0\"\n \n }\n \n this.style.height = \"\"\n \n this._frame = nil\n \n }\n \n \n animateAppearing() {\n \n this.style.opacity = \"1\"\n \n }\n \n animateDisappearing() {\n \n this.style.opacity = \"0\"\n \n }\n \n \n showInView(containerView: UIView, animated: boolean) {\n \n \n animated = (animated && !IS_FIREFOX)\n \n this._appearedAnimated = animated\n \n this.willAppear(animated)\n \n \n containerView.addSubview(this)\n \n if (animated) {\n \n this.layoutSubviews()\n \n UIView.animateViewOrViewsWithDurationDelayAndFunction(\n this,\n this.animationDuration,\n 0,\n undefined,\n () => this.animateAppearing(),\n nil\n )\n \n \n }\n else {\n \n this.setNeedsLayout()\n \n }\n \n this.isVisible = YES\n \n }\n \n \n showInRootView(animated: boolean) {\n \n this.showInView(UICore.main.rootViewController.view, animated)\n \n }\n \n \n dismiss(animated?: boolean) {\n \n if (!this.isVisible) {\n return\n }\n \n animated = (animated && !IS_FIREFOX)\n \n if (animated == undefined) {\n \n animated = this._appearedAnimated\n \n }\n \n if (animated) {\n \n UIView.animateViewOrViewsWithDurationDelayAndFunction(\n this,\n this.animationDuration,\n 0,\n undefined,\n (() => {\n \n this.animateDisappearing()\n \n }).bind(this),\n () => {\n \n if (this.isVisible == NO) {\n \n this.removeFromSuperview()\n \n }\n \n }\n )\n \n }\n else {\n \n this.removeFromSuperview()\n \n }\n \n this.isVisible = NO\n \n }\n \n \n override didReceiveBroadcastEvent(event: UIViewBroadcastEvent) {\n \n super.didReceiveBroadcastEvent(event)\n \n if (event.name == UICore.broadcastEventName.WindowDidResize) {\n \n this.setNeedsLayout()\n \n }\n \n }\n \n \n override layoutSubviews() {\n \n \n if (!IS(this.view)) {\n \n return\n \n }\n \n //this.frame = this.superview.bounds;\n \n this.setPosition(0, 0, 0, 0, 0, \"100%\")\n this.setPosition(\n 0,\n 0,\n 0,\n 0,\n FIRST(\n IF(this.superview?.isKindOfClass(UINativeScrollView))(() => this.superview?.scrollSize.height ?? 0)\n .ELSE_IF(this.superview?.isKindOfClass(UIScrollView))(() => this.superview?.scrollSize.height ?? 0)\n .ELSE(() => this.superview?.frame.height ?? 0),\n UIView.pageHeight\n ),\n \"100%\"\n )\n \n const bounds = this.bounds\n \n const margin = 20\n \n //this.view.centerInContainer();\n \n this.view.style.position = \"relative\"\n \n this.view.style.zIndex = \"\" + this.zIndex\n \n // this.view.style.maxHeight = \"\" + (bounds.height - margin * 2).integerValue + \"px\";\n // this.view.style.maxWidth = \"\" + (bounds.width - margin * 2).integerValue + \"px\";\n \n \n // var viewIntrinsicRectangle = this.view.intrinsicContentSize();\n // this.view.frame = new UIRectangle((bounds.width - viewIntrinsicRectangle.width)*0.5, )\n \n super.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"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA2B;AAC3B,qBAAwB;AACxB,oBAAuB;AACvB,gCAAmC;AACnC,sBAA4C;AAC5C,0BAA6B;AAC7B,oBAA6C;AAGtC,MAAM,qBAAuD,qBAAO;AAAA,EAUvE,YAAY,WAAoB,iBAA+B;AAG3D,UAAM,WAAW,eAAe;AAXpC,4BAAmB;AACnB,iBAAkB,IAAI,qBAAO;AAE7B,6BAA4B;AAC5B,mBAAkB;AAClB,qBAAqB;AACrB,iCAAwB;AAOpB,SAAK;AAAA,MACD,qBAAO,aAAa;AAAA,MACpB,SAA8B,QAAgB,OAAc;AAExD,aAAK,oBAAoB,QAAQ,KAAK;AAAA,MAE1C,EAAE,KAAK,IAAI;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AAAD,MAAA,KAAK,cAAL,gBAAAA,IAAgB,WAAW,WAA3B,OAAAC,MAAqC;AAAA,SAAC,EACjG,KAAK,MAAG;AA5O7B,cAAAD,KAAAC;AA4OgC,kBAAAA,OAAAD,MAAA,KAAK,cAAL,gBAAAA,IAAgB,MAAM,WAAtB,OAAAC,MAAgC;AAAA,SAAC;AAAA,QACjD,qBAAO;AAAA,MACX;AAAA,MACA;AAAA,IACJ;AAEA,UAAM,SAAS,KAAK;AAEpB,UAAM,SAAS;AAIf,SAAK,KAAK,MAAM,WAAW;AAE3B,SAAK,KAAK,MAAM,SAAS,KAAK,KAAK;AASnC,UAAM,eAAe;AAAA,EAEzB;AAGJ;",
4
+ "sourcesContent": ["import { IS_FIREFOX } from \"./ClientCheckers\"\nimport { UIColor } from \"./UIColor\"\nimport { UICore } from \"./UICore\"\nimport { UINativeScrollView } from \"./UINativeScrollView\"\nimport { FIRST, IF, IS, nil, NO, YES } from \"./UIObject\"\nimport { UIScrollView } from \"./UIScrollView\"\nimport { UIView, UIViewBroadcastEvent } from \"./UIView\"\n\n\nexport class UIDialogView<ViewType extends UIView = UIView> extends UIView {\n \n _isAUIDialogView = YES\n _view: ViewType = new UIView() as any\n _appearedAnimated?: boolean\n animationDuration: number = 0.25\n _zIndex: number = 100\n isVisible: boolean = NO\n dismissesOnTapOutside = YES\n \n constructor(elementID?: string, viewHTMLElement?: HTMLElement) {\n \n \n super(elementID, viewHTMLElement)\n \n this.addTargetForControlEvent(\n UIView.controlEvent.PointerTap,\n function (this: UIDialogView, sender: UIView, event: Event) {\n \n this.didDetectTapOutside(sender, event)\n \n }.bind(this)\n )\n \n this.backgroundColor = UIColor.colorWithRGBA(0, 10, 25).colorWithAlpha(0.75) //CBColor.primaryContentColor.colorWithAlpha(0.75)\n \n this.zIndex = this._zIndex\n \n }\n \n \n didDetectTapOutside(sender: UIView, event: Event) {\n \n if (event.target == this.viewHTMLElement && this.dismissesOnTapOutside) {\n this.dismiss(this._appearedAnimated)\n }\n \n }\n \n \n set zIndex(zIndex: number) {\n \n this._zIndex = zIndex\n this.style.zIndex = \"\" + zIndex\n \n }\n \n get zIndex() {\n \n return this._zIndex\n \n }\n \n \n set view(view: ViewType) {\n \n this._view?.removeFromSuperview()\n \n this._view = view\n \n this.addSubview(view)\n \n }\n \n \n get view(): ViewType {\n \n return this._view\n \n }\n \n \n override willAppear(animated: boolean = NO) {\n \n if (animated) {\n \n this.style.opacity = \"0\"\n \n }\n \n this.style.height = \"\"\n \n this._frame = nil\n \n }\n \n \n animateAppearing() {\n \n this.style.opacity = \"1\"\n \n }\n \n animateDisappearing() {\n \n this.style.opacity = \"0\"\n \n }\n \n \n showInView(containerView: UIView, animated: boolean) {\n \n \n animated = (animated && !IS_FIREFOX)\n \n this._appearedAnimated = animated\n \n this.willAppear(animated)\n \n \n containerView.addSubview(this)\n \n if (animated) {\n \n this.layoutSubviews()\n \n UIView.animateViewOrViewsWithDurationDelayAndFunction(\n this,\n this.animationDuration,\n 0,\n undefined,\n () => this.animateAppearing(),\n nil\n )\n \n \n }\n else {\n \n this.setNeedsLayout()\n \n }\n \n this.isVisible = YES\n \n }\n \n \n showInRootView(animated: boolean) {\n \n this.showInView(UICore.main.rootViewController.view, animated)\n \n }\n \n \n dismiss(animated?: boolean) {\n \n if (!this.isVisible) {\n return\n }\n \n animated = (animated && !IS_FIREFOX)\n \n if (animated == undefined) {\n \n animated = this._appearedAnimated\n \n }\n \n if (animated) {\n \n UIView.animateViewOrViewsWithDurationDelayAndFunction(\n this,\n this.animationDuration,\n 0,\n undefined,\n (() => {\n \n this.animateDisappearing()\n \n }).bind(this),\n () => {\n \n if (this.isVisible == NO) {\n \n this.removeFromSuperview()\n \n }\n \n }\n )\n \n }\n else {\n \n this.removeFromSuperview()\n \n }\n \n this.isVisible = NO\n \n }\n \n \n override didReceiveBroadcastEvent(event: UIViewBroadcastEvent) {\n \n super.didReceiveBroadcastEvent(event)\n \n if (event.name == UICore.broadcastEventName.WindowDidResize) {\n \n this.setNeedsLayout()\n \n }\n \n }\n \n \n override layoutSubviews() {\n \n \n if (!IS(this.view)) {\n \n return\n \n }\n \n //this.frame = this.superview.bounds;\n \n this.setPosition(0, 0, 0, 0, 0, \"100%\")\n this.setPosition(\n 0,\n 0,\n 0,\n 0,\n FIRST(\n IF(this.superview?.isKindOfClass(UINativeScrollView))(() => this.superview?.scrollSize.height ?? 0)\n .ELSE_IF(this.superview?.isKindOfClass(UIScrollView))(() => this.superview?.scrollSize.height ?? 0)\n .ELSE(() => this.superview?.frame.height ?? 0),\n UIView.pageHeight\n ) / UIView.pageScale,\n \"100%\"\n )\n \n const bounds = this.bounds\n \n const margin = 20\n \n //this.view.centerInContainer();\n \n this.view.style.position = \"relative\"\n \n this.view.style.zIndex = \"\" + this.zIndex\n \n // this.view.style.maxHeight = \"\" + (bounds.height - margin * 2).integerValue + \"px\";\n // this.view.style.maxWidth = \"\" + (bounds.width - margin * 2).integerValue + \"px\";\n \n \n // var viewIntrinsicRectangle = this.view.intrinsicContentSize();\n // this.view.frame = new UIRectangle((bounds.width - viewIntrinsicRectangle.width)*0.5, )\n \n super.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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA2B;AAC3B,qBAAwB;AACxB,oBAAuB;AACvB,gCAAmC;AACnC,sBAA4C;AAC5C,0BAA6B;AAC7B,oBAA6C;AAGtC,MAAM,qBAAuD,qBAAO;AAAA,EAUvE,YAAY,WAAoB,iBAA+B;AAG3D,UAAM,WAAW,eAAe;AAXpC,4BAAmB;AACnB,iBAAkB,IAAI,qBAAO;AAE7B,6BAA4B;AAC5B,mBAAkB;AAClB,qBAAqB;AACrB,iCAAwB;AAOpB,SAAK;AAAA,MACD,qBAAO,aAAa;AAAA,MACpB,SAA8B,QAAgB,OAAc;AAExD,aAAK,oBAAoB,QAAQ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A3O7E,cAAAD,KAAAC;AA2OgF,kBAAAA,OAAAD,MAAA,KAAK,cAAL,gBAAAA,IAAgB,WAAW,WAA3B,OAAAC,MAAqC;AAAA,SAAC,EACjG,KAAK,MAAG;AA5O7B,cAAAD,KAAAC;AA4OgC,kBAAAA,OAAAD,MAAA,KAAK,cAAL,gBAAAA,IAAgB,MAAM,WAAtB,OAAAC,MAAgC;AAAA,SAAC;AAAA,QACjD,qBAAO;AAAA,MACX,IAAI,qBAAO;AAAA,MACX;AAAA,IACJ;AAEA,UAAM,SAAS,KAAK;AAEpB,UAAM,SAAS;AAIf,SAAK,KAAK,MAAM,WAAW;AAE3B,SAAK,KAAK,MAAM,SAAS,KAAK,KAAK;AASnC,UAAM,eAAe;AAAA,EAEzB;AAGJ;",
6
6
  "names": ["_a", "_b"]
7
7
  }
@@ -57,9 +57,9 @@ function sortData(data, sortingInstructions) {
57
57
  };
58
58
  sortingInstructions.forEach((instruction) => {
59
59
  if (instruction.dataType == "string") {
60
- result[instruction.keyPath] = JSON.stringify(valueForKeyPath("" + instruction.keyPath, dataItem) || {}).toLowerCase();
60
+ result[instruction.keyPath] = JSON.stringify(valueForKeyPath("" + instruction.keyPath, dataItem) || "").toLowerCase();
61
61
  } else if (instruction.dataType == "number") {
62
- result[instruction.keyPath] = JSON.stringify(valueForKeyPath("" + instruction.keyPath, dataItem) || {}).toLowerCase().numericalValue;
62
+ result[instruction.keyPath] = valueForKeyPath("" + instruction.keyPath, dataItem);
63
63
  }
64
64
  });
65
65
  return result;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../scripts/UIKeyValueSorterWebWorker.worker.ts"],
4
- "sourcesContent": ["onmessage = function (event) {\n \n //console.log('Message received from main script');\n const workerResult = sortData(\n event.data.data,\n event.data.sortingInstructions\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 valueForKeyPath(keyPath: string, object: any) {\n \n var keys = keyPath.split(\".\")\n var currentObject = object\n \n for (var i = 0; i < keys.length; i++) {\n \n var 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 \n currentObject = currentObject[key.substring(2)]\n \n // CurrentObject is now an array\n \n var remainingKeyPath = keys.slice(i + 1).join(\".\")\n \n var currentArray = currentObject\n \n currentObject = currentArray.map(function (subObject: any, index: any, array: any) {\n \n var result = valueForKeyPath(remainingKeyPath, subObject)\n \n return result\n \n })\n \n break\n \n }\n \n currentObject = (currentObject || {})[key]\n \n \n }\n \n return currentObject\n \n}\n\n\nfunction compare(\n firstObject: { [x: string]: any },\n secondObject: { [x: string]: any },\n sortingInstructions: string | any[]\n): number {\n \n if (sortingInstructions.length == 0) {\n return 0\n }\n \n const sortingInstruction = sortingInstructions[0]\n \n let directionMultiplier = 1\n if (sortingInstruction.direction == \"descending\") {\n directionMultiplier = -1\n }\n \n const firstDataString = firstObject[sortingInstruction.keyPath]\n const secondDataString = secondObject[sortingInstruction.keyPath]\n \n if (firstDataString < secondDataString) {\n return -1 * directionMultiplier\n }\n \n if (firstDataString > secondDataString) {\n return directionMultiplier\n }\n \n if (sortingInstructions.length > 1) {\n const remainingSortingInstructions = sortingInstructions.slice(1)\n return compare(firstObject, secondObject, remainingSortingInstructions)\n }\n \n return 0\n \n}\n\n\nfunction sortData(data: any[], sortingInstructions: any[]) {\n \n \n const sortingObjects = data.map(function (dataItem: any, index: any, array: any) {\n \n const result: { _UIKeyValueStringSorterWebWorkerSortingObjectIndex: any } & Record<string, string | number> = {\n \n \"_UIKeyValueStringSorterWebWorkerSortingObjectIndex\": index\n \n }\n \n \n sortingInstructions.forEach((instruction: { keyPath: string | number, dataType:string }) => {\n \n if (instruction.dataType == \"string\") {\n \n result[instruction.keyPath] = JSON.stringify(valueForKeyPath(\"\" + instruction.keyPath, dataItem) || {})\n .toLowerCase()\n \n }\n else if (instruction.dataType == \"number\") {\n \n result[instruction.keyPath] = JSON.stringify(valueForKeyPath(\"\" + instruction.keyPath, dataItem) || {})\n .toLowerCase().numericalValue\n \n }\n \n })\n \n return result\n \n })\n \n \n const sortedData = sortingObjects.sort((firstObject: any, secondObject: any) => compare(\n firstObject,\n secondObject,\n sortingInstructions\n ))\n \n const sortedIndexes = sortedData.map((\n object: { _UIKeyValueStringSorterWebWorkerSortingObjectIndex: any }\n ) => object._UIKeyValueStringSorterWebWorkerSortingObjectIndex)\n \n return {\n \n \"sortedData\": sortedIndexes.map(sortedIndex => data[sortedIndex]),\n \"sortedIndexes\": sortedIndexes\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,YAAY,SAAU,OAAO;AAGzB,QAAM,eAAe;AAAA,IACjB,MAAM,KAAK;AAAA,IACX,MAAM,KAAK;AAAA,EACf;AAGA,eAAa,aAAa,MAAM,KAAK;AAErC,eAAa,qBAAqB,MAAM,KAAK;AAI7C,cAAY,YAAY;AAE5B;AAGA,SAAS,gBAAgB,SAAiB,QAAa;AAEnD,MAAI,OAAO,QAAQ,MAAM,GAAG;AAC5B,MAAI,gBAAgB;AAEpB,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AAElC,QAAI,MAAM,KAAK;AAEf,QAAI,IAAI,UAAU,GAAG,CAAC,KAAK,MAAM;AAI7B,sBAAgB,cAAc,IAAI,UAAU,CAAC;AAI7C,UAAI,mBAAmB,KAAK,MAAM,IAAI,CAAC,EAAE,KAAK,GAAG;AAEjD,UAAI,eAAe;AAEnB,sBAAgB,aAAa,IAAI,SAAU,WAAgB,OAAY,OAAY;AAE/E,YAAI,SAAS,gBAAgB,kBAAkB,SAAS;AAExD,eAAO;AAAA,MAEX,CAAC;AAED;AAAA,IAEJ;AAEA,qBAAiB,iBAAiB,CAAC,GAAG;AAAA,EAG1C;AAEA,SAAO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EH,cAAc,cAAc,IAAI,iBAAe,KAAK,YAAY;AAAA,IAChE,iBAAiB;AAAA,EAErB;AAGJ;",
4
+ "sourcesContent": ["onmessage = function (event) {\n \n //console.log('Message received from main script');\n const workerResult = sortData(\n event.data.data,\n event.data.sortingInstructions\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 valueForKeyPath(keyPath: string, object: any) {\n \n var keys = keyPath.split(\".\")\n var currentObject = object\n \n for (var i = 0; i < keys.length; i++) {\n \n var 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 \n currentObject = currentObject[key.substring(2)]\n \n // CurrentObject is now an array\n \n var remainingKeyPath = keys.slice(i + 1).join(\".\")\n \n var currentArray = currentObject\n \n currentObject = currentArray.map(function (subObject: any, index: any, array: any) {\n \n var result = valueForKeyPath(remainingKeyPath, subObject)\n \n return result\n \n })\n \n break\n \n }\n \n currentObject = (currentObject || {})[key]\n \n \n }\n \n return currentObject\n \n}\n\n\nfunction compare(\n firstObject: { [x: string]: any },\n secondObject: { [x: string]: any },\n sortingInstructions: string | any[]\n): number {\n \n if (sortingInstructions.length == 0) {\n return 0\n }\n \n const sortingInstruction = sortingInstructions[0]\n \n let directionMultiplier = 1\n if (sortingInstruction.direction == \"descending\") {\n directionMultiplier = -1\n }\n \n const firstDataString = firstObject[sortingInstruction.keyPath]\n const secondDataString = secondObject[sortingInstruction.keyPath]\n \n if (firstDataString < secondDataString) {\n return -1 * directionMultiplier\n }\n \n if (firstDataString > secondDataString) {\n return directionMultiplier\n }\n \n if (sortingInstructions.length > 1) {\n const remainingSortingInstructions = sortingInstructions.slice(1)\n return compare(firstObject, secondObject, remainingSortingInstructions)\n }\n \n return 0\n \n}\n\n\nfunction sortData(data: any[], sortingInstructions: any[]) {\n \n \n const sortingObjects = data.map(function (dataItem: any, index: any, array: any) {\n \n const result: { _UIKeyValueStringSorterWebWorkerSortingObjectIndex: any } & Record<string, string | number> = {\n \n \"_UIKeyValueStringSorterWebWorkerSortingObjectIndex\": index\n \n }\n \n \n sortingInstructions.forEach((instruction: { keyPath: string | number, dataType:string }) => {\n \n if (instruction.dataType == \"string\") {\n \n result[instruction.keyPath] = JSON.stringify(valueForKeyPath(\"\" + instruction.keyPath, dataItem) || \"\")\n .toLowerCase()\n \n }\n else if (instruction.dataType == \"number\") {\n \n result[instruction.keyPath] = valueForKeyPath(\"\" + instruction.keyPath, dataItem)\n \n }\n \n })\n \n return result\n \n })\n \n \n const sortedData = sortingObjects.sort((firstObject: any, secondObject: any) => compare(\n firstObject,\n secondObject,\n sortingInstructions\n ))\n \n const sortedIndexes = sortedData.map((\n object: { _UIKeyValueStringSorterWebWorkerSortingObjectIndex: any }\n ) => object._UIKeyValueStringSorterWebWorkerSortingObjectIndex)\n \n return {\n \n \"sortedData\": sortedIndexes.map(sortedIndex => data[sortedIndex]),\n \"sortedIndexes\": sortedIndexes\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,YAAY,SAAU,OAAO;AAGzB,QAAM,eAAe;AAAA,IACjB,MAAM,KAAK;AAAA,IACX,MAAM,KAAK;AAAA,EACf;AAGA,eAAa,aAAa,MAAM,KAAK;AAErC,eAAa,qBAAqB,MAAM,KAAK;AAI7C,cAAY,YAAY;AAE5B;AAGA,SAAS,gBAAgB,SAAiB,QAAa;AAEnD,MAAI,OAAO,QAAQ,MAAM,GAAG;AAC5B,MAAI,gBAAgB;AAEpB,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AAElC,QAAI,MAAM,KAAK;AAEf,QAAI,IAAI,UAAU,GAAG,CAAC,KAAK,MAAM;AAI7B,sBAAgB,cAAc,IAAI,UAAU,CAAC;AAI7C,UAAI,mBAAmB,KAAK,M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;AAAA,EAEX,CAAC;AAGD,QAAM,aAAa,eAAe,KAAK,CAAC,aAAkB,iBAAsB;AAAA,IAC5E;AAAA,IACA;AAAA,IACA;AAAA,EACJ,CAAC;AAED,QAAM,gBAAgB,WAAW,IAAI,CACjC,WACC,OAAO,kDAAkD;AAE9D,SAAO;AAAA,IAEH,cAAc,cAAc,IAAI,iBAAe,KAAK,YAAY;AAAA,IAChE,iBAAiB;AAAA,EAErB;AAGJ;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uicore-ts",
3
- "version": "1.0.557",
3
+ "version": "1.0.561",
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",
@@ -236,7 +236,7 @@ export class UIDialogView<ViewType extends UIView = UIView> extends UIView {
236
236
  .ELSE_IF(this.superview?.isKindOfClass(UIScrollView))(() => this.superview?.scrollSize.height ?? 0)
237
237
  .ELSE(() => this.superview?.frame.height ?? 0),
238
238
  UIView.pageHeight
239
- ),
239
+ ) / UIView.pageScale,
240
240
  "100%"
241
241
  )
242
242
 
@@ -115,14 +115,13 @@ function sortData(data: any[], sortingInstructions: any[]) {
115
115
 
116
116
  if (instruction.dataType == "string") {
117
117
 
118
- result[instruction.keyPath] = JSON.stringify(valueForKeyPath("" + instruction.keyPath, dataItem) || {})
118
+ result[instruction.keyPath] = JSON.stringify(valueForKeyPath("" + instruction.keyPath, dataItem) || "")
119
119
  .toLowerCase()
120
120
 
121
121
  }
122
122
  else if (instruction.dataType == "number") {
123
123
 
124
- result[instruction.keyPath] = JSON.stringify(valueForKeyPath("" + instruction.keyPath, dataItem) || {})
125
- .toLowerCase().numericalValue
124
+ result[instruction.keyPath] = valueForKeyPath("" + instruction.keyPath, dataItem)
126
125
 
127
126
  }
128
127