uicore-ts 1.1.25 → 1.1.27

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.
@@ -70,8 +70,8 @@ export declare class UIRectangle extends UIObject {
70
70
  distributeViewsAlongHeight(views: UIView[], weights?: number | number[], paddings?: number | number[], absoluteHeights?: number | number[]): this;
71
71
  distributeViewsEquallyAlongWidth(views: UIView[], padding: number): this;
72
72
  distributeViewsEquallyAlongHeight(views: UIView[], padding: number): this;
73
- rectangleForNextRow(padding?: number, height?: number | ((constrainingWidth: number) => number)): UIRectangle;
74
- rectangleForNextColumn(padding?: number, width?: number | ((constrainingHeight: number) => number)): UIRectangle;
73
+ rectangleForNextRow(padding?: number, height?: number | ((constrainingWidth: number) => number) | UIView): UIRectangle;
74
+ rectangleForNextColumn(padding?: number, width?: number | ((constrainingHeight: number) => number) | UIView): UIRectangle;
75
75
  rectangleForPreviousRow(padding?: number): UIRectangle;
76
76
  rectangleForPreviousColumn(padding?: number): UIRectangle;
77
77
  assignedAsFrameOfView(view: UIView): this;
@@ -23,6 +23,7 @@ __export(UIRectangle_exports, {
23
23
  module.exports = __toCommonJS(UIRectangle_exports);
24
24
  var import_UIObject = require("./UIObject");
25
25
  var import_UIPoint = require("./UIPoint");
26
+ var import_UIView = require("./UIView");
26
27
  class UIRectangle extends import_UIObject.UIObject {
27
28
  constructor(x = 0, y = 0, height = 0, width = 0) {
28
29
  super();
@@ -441,6 +442,9 @@ class UIRectangle extends import_UIObject.UIObject {
441
442
  if (height instanceof Function) {
442
443
  height = height(this.width);
443
444
  }
445
+ if (height instanceof import_UIView.UIView) {
446
+ height = height.intrinsicContentHeight(this.width);
447
+ }
444
448
  const result = this.rectangleWithY(this.max.y + padding);
445
449
  if (height != this.height) {
446
450
  result.height = height;
@@ -451,6 +455,9 @@ class UIRectangle extends import_UIObject.UIObject {
451
455
  if (width instanceof Function) {
452
456
  width = width(this.height);
453
457
  }
458
+ if (width instanceof import_UIView.UIView) {
459
+ width = width.intrinsicContentWidth(this.height);
460
+ }
454
461
  const result = this.rectangleWithX(this.max.x + padding);
455
462
  if (width != this.width) {
456
463
  result.width = width;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../scripts/UIRectangle.ts"],
4
- "sourcesContent": ["import { FIRST_OR_NIL, IS, IS_NIL, IS_NOT_NIL, nil, NO, UIObject, YES } from \"./UIObject\"\nimport { UIPoint } from \"./UIPoint\"\nimport { UIView } from \"./UIView\"\n\n\nexport class UIRectangle extends UIObject {\n \n _isBeingUpdated: boolean\n rectanglePointDidChange?: (b: any) => void\n max: UIPoint\n min: UIPoint\n \n \n constructor(x: number = 0, y: number = 0, height: number = 0, width: number = 0) {\n \n super()\n \n this.min = new UIPoint(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY)\n this.max = new UIPoint(Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY)\n \n this.min.didChange = (point) => {\n this.rectanglePointDidChange?.(point)\n this._rectanglePointDidChange()\n }\n this.max.didChange = (point) => {\n this.rectanglePointDidChange?.(point)\n this._rectanglePointDidChange()\n }\n \n this._isBeingUpdated = NO\n \n this.min = new UIPoint(x, y)\n this.max = new UIPoint(x + width, y + height)\n \n if (IS_NIL(height)) {\n this.max.y = height\n }\n \n if (IS_NIL(width)) {\n this.max.x = width\n }\n \n }\n \n \n copy() {\n return new UIRectangle(this.x, this.y, this.height, this.width)\n }\n \n isEqualTo(rectangle: UIRectangle | null | undefined) {\n return (IS(rectangle) && this.min.isEqualTo(rectangle.min) && this.max.isEqualTo(rectangle.max))\n }\n \n static zero() {\n return new UIRectangle(0, 0, 0, 0)\n }\n \n containsPoint(point: UIPoint) {\n return this.min.x <= point.x && this.min.y <= point.y &&\n point.x <= this.max.x && point.y <= this.max.y\n }\n \n updateByAddingPoint(point: UIPoint) {\n \n if (!point) {\n point = new UIPoint(0, 0)\n }\n \n this.beginUpdates()\n \n const min = this.min.copy()\n if (min.x === nil) {\n min.x = this.max.x\n }\n if (min.y === nil) {\n min.y = this.max.y\n }\n \n const max = this.max.copy()\n if (max.x === nil) {\n max.x = this.min.x\n }\n if (max.y === nil) {\n max.y = this.min.y\n }\n \n this.min.x = Math.min(min.x, point.x)\n this.min.y = Math.min(min.y, point.y)\n this.max.x = Math.max(max.x, point.x)\n this.max.y = Math.max(max.y, point.y)\n \n this.finishUpdates()\n \n }\n \n scale(scale: number) {\n if (IS_NOT_NIL(this.max.y)) {\n this.height = this.height * scale\n }\n if (IS_NOT_NIL(this.max.x)) {\n this.width = this.width * scale\n }\n }\n \n get height() {\n if (this.max.y === nil) {\n return nil\n }\n return this.max.y - this.min.y\n }\n \n set height(height: number) {\n this.max.y = this.min.y + height\n }\n \n \n get width() {\n if (this.max.x === nil) {\n return nil\n }\n return this.max.x - this.min.x\n }\n \n set width(width: number) {\n this.max.x = this.min.x + width\n }\n \n \n get x() {\n return this.min.x\n }\n \n set x(x: number) {\n \n this.beginUpdates()\n \n const width = this.width\n this.min.x = x\n this.max.x = this.min.x + width\n \n this.finishUpdates()\n \n }\n \n \n get y() {\n return this.min.y\n }\n \n \n set y(y: number) {\n \n this.beginUpdates()\n \n const height = this.height\n this.min.y = y\n this.max.y = this.min.y + height\n \n this.finishUpdates()\n \n }\n \n \n get topLeft() {\n return this.min.copy()\n }\n \n get topRight() {\n return new UIPoint(this.max.x, this.y)\n }\n \n get bottomLeft() {\n return new UIPoint(this.x, this.max.y)\n }\n \n get bottomRight() {\n return this.max.copy()\n }\n \n \n get center() {\n return this.min.copy().add(this.min.to(this.max).scale(0.5))\n }\n \n set center(center: UIPoint) {\n const offset = this.center.to(center)\n this.offsetByPoint(offset)\n }\n \n offsetByPoint(offset: UIPoint) {\n this.min.add(offset)\n this.max.add(offset)\n \n return this\n }\n \n \n concatenateWithRectangle(rectangle: UIRectangle) {\n this.updateByAddingPoint(rectangle.bottomRight)\n this.updateByAddingPoint(rectangle.topLeft)\n return this\n }\n \n rectangleByConcatenatingWithRectangle(rectangle: UIRectangle) {\n return this.copy().concatenateWithRectangle(rectangle)\n }\n \n \n intersectionRectangleWithRectangle(rectangle: UIRectangle): UIRectangle {\n \n const result = this.copy()\n \n result.beginUpdates()\n \n const min = result.min\n if (min.x === nil) {\n min.x = rectangle.max.x - Math.min(result.width, rectangle.width)\n }\n if (min.y === nil) {\n min.y = rectangle.max.y - Math.min(result.height, rectangle.height)\n }\n \n const max = result.max\n if (max.x === nil) {\n max.x = rectangle.min.x + Math.min(result.width, rectangle.width)\n }\n if (max.y === nil) {\n max.y = rectangle.min.y + Math.min(result.height, rectangle.height)\n }\n \n result.min.x = Math.max(result.min.x, rectangle.min.x)\n result.min.y = Math.max(result.min.y, rectangle.min.y)\n result.max.x = Math.min(result.max.x, rectangle.max.x)\n result.max.y = Math.min(result.max.y, rectangle.max.y)\n \n \n if (result.height < 0) {\n \n const averageY = (this.center.y + rectangle.center.y) * 0.5\n result.min.y = averageY\n result.max.y = averageY\n \n }\n \n if (result.width < 0) {\n \n const averageX = (this.center.x + rectangle.center.x) * 0.5\n result.min.x = averageX\n result.max.x = averageX\n \n }\n \n result.finishUpdates()\n \n return result\n \n }\n \n \n get area() {\n return this.height * this.width\n }\n \n \n intersectsWithRectangle(rectangle: UIRectangle) {\n return (this.intersectionRectangleWithRectangle(rectangle).area != 0)\n }\n \n \n // add some space around the rectangle\n rectangleWithInsets(left: number, right: number, bottom: number, top: number) {\n const result = this.copy()\n result.min.x = this.min.x + left\n result.max.x = this.max.x - right\n result.min.y = this.min.y + top\n result.max.y = this.max.y - bottom\n return result\n }\n \n rectangleWithInset(inset: number) {\n return this.rectangleWithInsets(inset, inset, inset, inset)\n }\n \n rectangleWithHeight(height: number, centeredOnPosition: number = nil) {\n \n if (isNaN(centeredOnPosition)) {\n centeredOnPosition = nil\n }\n \n const result = this.copy()\n result.height = height\n \n if (centeredOnPosition != nil) {\n const change = height - this.height\n result.offsetByPoint(new UIPoint(0, change * centeredOnPosition).scale(-1))\n }\n \n return result\n \n }\n \n rectangleWithWidth(width: number, centeredOnPosition: number = nil) {\n \n if (isNaN(centeredOnPosition)) {\n centeredOnPosition = nil\n }\n \n const result = this.copy()\n result.width = width\n \n if (centeredOnPosition != nil) {\n const change = width - this.width\n result.offsetByPoint(new UIPoint(change * centeredOnPosition, 0).scale(-1))\n }\n \n return result\n \n }\n \n rectangleWithHeightRelativeToWidth(heightRatio: number = 1, centeredOnPosition: number = nil) {\n return this.rectangleWithHeight(this.width * heightRatio, centeredOnPosition)\n }\n \n rectangleWithWidthRelativeToHeight(widthRatio: number = 1, centeredOnPosition: number = nil) {\n return this.rectangleWithWidth(this.height * widthRatio, centeredOnPosition)\n }\n \n rectangleWithX(x: number, centeredOnPosition: number = 0) {\n \n const result = this.copy()\n result.x = x - result.width * centeredOnPosition\n \n return result\n \n }\n \n rectangleWithY(y: number, centeredOnPosition: number = 0) {\n \n const result = this.copy()\n result.y = y - result.height * centeredOnPosition\n \n return result\n \n }\n \n \n rectangleByAddingX(x: number) {\n \n const result = this.copy()\n result.x = this.x + x\n \n return result\n \n }\n \n rectangleByAddingY(y: number) {\n \n const result = this.copy()\n result.y = this.y + y\n \n return result\n \n }\n \n \n rectangleWithRelativeValues(\n relativeXPosition: number,\n widthMultiplier: number,\n relativeYPosition: number,\n heightMultiplier: number\n ) {\n \n const result = this.copy()\n \n const width = result.width\n const height = result.height\n \n result.width = widthMultiplier * width\n result.height = heightMultiplier * height\n \n result.center = new UIPoint(\n relativeXPosition * width,\n relativeYPosition * height\n )\n \n return result\n \n }\n \n \n /**\n * Returns a rectangle with a maximum width constraint\n * If current width exceeds max, centers the constrained width\n */\n rectangleWithMaxWidth(maxWidth: number, centeredOnPosition: number = 0): UIRectangle {\n if (this.width <= maxWidth) {\n return this.copy()\n }\n return this.rectangleWithWidth(maxWidth, centeredOnPosition)\n }\n \n /**\n * Returns a rectangle with a maximum height constraint\n */\n rectangleWithMaxHeight(maxHeight: number, centeredOnPosition: number = 0): UIRectangle {\n if (this.height <= maxHeight) {\n return this.copy()\n }\n return this.rectangleWithHeight(maxHeight, centeredOnPosition)\n }\n \n /**\n * Returns a rectangle with minimum width constraint\n */\n rectangleWithMinWidth(minWidth: number, centeredOnPosition: number = 0): UIRectangle {\n if (this.width >= minWidth) {\n return this.copy()\n }\n return this.rectangleWithWidth(minWidth, centeredOnPosition)\n }\n \n /**\n * Returns a rectangle with minimum height constraint\n */\n rectangleWithMinHeight(minHeight: number, centeredOnPosition: number = 0): UIRectangle {\n if (this.height >= minHeight) {\n return this.copy()\n }\n return this.rectangleWithHeight(minHeight, centeredOnPosition)\n }\n \n // Returns a new rectangle that is positioned relative to the reference rectangle\n // By default, it makes a copy of this rectangle taht is centered in the target rectangle\n rectangleByCenteringInRectangle(referenceRectangle: UIRectangle, xPosition = 0.5, yPosition = 0.5) {\n const result = this.copy()\n result.center = referenceRectangle.topLeft\n .pointByAddingX(xPosition * referenceRectangle.width)\n .pointByAddingY(yPosition * referenceRectangle.height)\n return result\n }\n \n \n rectanglesBySplittingWidth(\n weights: number[],\n paddings: number | number[] = 0,\n absoluteWidths: number | number[] = nil\n ) {\n \n if (IS_NIL(paddings)) {\n paddings = 1\n }\n if (!((paddings as any) instanceof Array)) {\n paddings = [paddings].arrayByRepeating(weights.length - 1)\n }\n paddings = (paddings as number[]).arrayByTrimmingToLengthIfLonger(weights.length - 1)\n if (!(absoluteWidths instanceof Array) && IS_NOT_NIL(absoluteWidths)) {\n absoluteWidths = [absoluteWidths].arrayByRepeating(weights.length)\n }\n \n const result: UIRectangle[] = []\n const sumOfWeights = weights.reduce(\n (a, b, index) => {\n if (IS_NOT_NIL((absoluteWidths as number[])[index])) {\n b = 0\n }\n return a + b\n },\n 0\n )\n const sumOfPaddings = paddings.summedValue\n const sumOfAbsoluteWidths = (absoluteWidths as number[]).summedValue\n const totalRelativeWidth = this.width - sumOfPaddings - sumOfAbsoluteWidths\n let previousCellMaxX = this.x\n \n for (let i = 0; i < weights.length; i++) {\n \n let resultWidth: number\n if (IS_NOT_NIL(absoluteWidths[i])) {\n resultWidth = absoluteWidths[i] || 0\n }\n else {\n resultWidth = totalRelativeWidth * (weights[i] / sumOfWeights)\n }\n \n const rectangle = this.rectangleWithWidth(resultWidth)\n \n let padding = 0\n if (paddings.length > i && paddings[i]) {\n padding = paddings[i]\n }\n \n rectangle.x = previousCellMaxX\n previousCellMaxX = rectangle.max.x + padding\n result.push(rectangle)\n \n }\n \n return result\n \n }\n \n rectanglesBySplittingHeight(\n weights: number[],\n paddings: number | number[] = 0,\n absoluteHeights: number | number[] = nil\n ) {\n \n if (IS_NIL(paddings)) {\n paddings = 1\n }\n if (!((paddings as any) instanceof Array)) {\n paddings = [paddings].arrayByRepeating(weights.length - 1)\n }\n paddings = (paddings as number[]).arrayByTrimmingToLengthIfLonger(weights.length - 1)\n if (!(absoluteHeights instanceof Array) && IS_NOT_NIL(absoluteHeights)) {\n absoluteHeights = [absoluteHeights].arrayByRepeating(weights.length)\n }\n \n const result: UIRectangle[] = []\n const sumOfWeights = weights.reduce(\n (a, b, index) => {\n if (IS_NOT_NIL((absoluteHeights as number[])[index])) {\n b = 0\n }\n return a + b\n },\n 0\n )\n const sumOfPaddings = paddings.summedValue\n const sumOfAbsoluteHeights = (absoluteHeights as number[]).summedValue\n const totalRelativeHeight = this.height - sumOfPaddings - sumOfAbsoluteHeights\n var previousCellMaxY = this.y\n \n for (var i = 0; i < weights.length; i++) {\n var resultHeight: number\n if (IS_NOT_NIL(absoluteHeights[i])) {\n \n resultHeight = absoluteHeights[i] || 0\n \n }\n else {\n \n resultHeight = totalRelativeHeight * (weights[i] / sumOfWeights)\n \n }\n \n const rectangle = this.rectangleWithHeight(resultHeight)\n \n var padding = 0\n if (paddings.length > i && paddings[i]) {\n padding = paddings[i]\n }\n \n rectangle.y = previousCellMaxY\n previousCellMaxY = rectangle.max.y + padding\n //rectangle = rectangle.rectangleWithInsets(0, 0, padding, 0);\n result.push(rectangle)\n }\n \n return result\n \n }\n \n \n rectanglesByEquallySplittingWidth(numberOfFrames: number, padding: number = 0) {\n const result: UIRectangle[] = []\n const totalPadding = padding * (numberOfFrames - 1)\n const resultWidth = (this.width - totalPadding) / numberOfFrames\n for (var i = 0; i < numberOfFrames; i++) {\n const rectangle = this.rectangleWithWidth(resultWidth, i / (numberOfFrames - 1))\n result.push(rectangle)\n }\n return result\n }\n \n rectanglesByEquallySplittingHeight(numberOfFrames: number, padding: number = 0) {\n const result: UIRectangle[] = []\n const totalPadding = padding * (numberOfFrames - 1)\n const resultHeight = (this.height - totalPadding) / numberOfFrames\n for (var i = 0; i < numberOfFrames; i++) {\n const rectangle = this.rectangleWithHeight(resultHeight, i / (numberOfFrames - 1))\n result.push(rectangle)\n }\n return result\n }\n \n \n distributeViewsAlongWidth(\n views: UIView[],\n weights: number | number[] = 1,\n paddings?: number | number[],\n absoluteWidths?: number | number[]\n ) {\n if (!(weights instanceof Array)) {\n weights = [weights].arrayByRepeating(views.length)\n }\n const frames = this.rectanglesBySplittingWidth(weights, paddings, absoluteWidths)\n frames.forEach((frame, index) => FIRST_OR_NIL(views[index]).frame = frame)\n return this\n }\n \n distributeViewsAlongHeight(\n views: UIView[],\n weights: number | number[] = 1,\n paddings?: number | number[],\n absoluteHeights?: number | number[]\n ) {\n if (!(weights instanceof Array)) {\n weights = [weights].arrayByRepeating(views.length)\n }\n const frames = this.rectanglesBySplittingHeight(weights, paddings, absoluteHeights)\n frames.forEach((frame, index) => FIRST_OR_NIL(views[index]).frame = frame)\n return this\n }\n \n \n distributeViewsEquallyAlongWidth(views: UIView[], padding: number) {\n const frames = this.rectanglesByEquallySplittingWidth(views.length, padding)\n frames.forEach((frame, index) => views[index].frame = frame)\n return this\n }\n \n distributeViewsEquallyAlongHeight(views: UIView[], padding: number) {\n const frames = this.rectanglesByEquallySplittingHeight(views.length, padding)\n frames.forEach((frame, index) => views[index].frame = frame)\n return this\n }\n \n \n rectangleForNextRow(padding: number = 0, height: number | ((constrainingWidth: number) => number) = this.height) {\n if (height instanceof Function) {\n height = height(this.width)\n }\n const result = this.rectangleWithY(this.max.y + padding)\n if (height != this.height) {\n result.height = height\n }\n return result\n }\n \n rectangleForNextColumn(padding: number = 0, width: number | ((constrainingHeight: number) => number) = this.width) {\n if (width instanceof Function) {\n width = width(this.height)\n }\n const result = this.rectangleWithX(this.max.x + padding)\n if (width != this.width) {\n result.width = width\n }\n return result\n }\n \n rectangleForPreviousRow(padding: number = 0) {\n return this.rectangleWithY(this.min.y - this.height - padding)\n }\n \n rectangleForPreviousColumn(padding: number = 0) {\n return this.rectangleWithX(this.min.x - this.width - padding)\n }\n \n \n assignedAsFrameOfView(view: UIView) {\n view.frame = this\n return this\n }\n \n \n // Bounding box\n static boundingBoxForPoints(points: string | any[]) {\n const result = new UIRectangle()\n for (let i = 0; i < points.length; i++) {\n result.updateByAddingPoint(points[i])\n }\n return result\n }\n \n \n beginUpdates() {\n this._isBeingUpdated = YES\n }\n \n finishUpdates() {\n this._isBeingUpdated = NO\n this.didChange()\n }\n \n \n didChange() {\n \n // Callback to be set by delegate\n \n }\n \n _rectanglePointDidChange() {\n if (!this._isBeingUpdated) {\n this.didChange()\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,sBAA6E;AAC7E,qBAAwB;AAIjB,MAAM,oBAAoB,yBAAS;AAAA,EAQtC,YAAY,IAAY,GAAG,IAAY,GAAG,SAAiB,GAAG,QAAgB,GAAG;AAE7E,UAAM;AAEN,SAAK,MAAM,IAAI,uBAAQ,OAAO,mBAAmB,OAAO,iBAAiB;AACzE,SAAK,MAAM,IAAI,uBAAQ,OAAO,mBAAmB,OAAO,iBAAiB;AAEzE,SAAK,IAAI,YAAY,CAAC,UAAU;AApBxC;AAqBY,iBAAK,4BAAL,8BAA+B;AAC/B,WAAK,yBAAyB;AAAA,IAClC;AACA,SAAK,IAAI,YAAY,C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K,eAAe,KAAK,IAAI,IAAI,KAAK,QAAQ,OAAO;AAAA,EAChE;AAAA,EAGA,sBAAsB,MAAc;AAChC,SAAK,QAAQ;AACb,WAAO;AAAA,EACX;AAAA,EAIA,OAAO,qBAAqB,QAAwB;AAChD,UAAM,SAAS,IAAI,YAAY;AAC/B,aAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;AACpC,aAAO,oBAAoB,OAAO,EAAE;AAAA,IACxC;AACA,WAAO;AAAA,EACX;AAAA,EAGA,eAAe;AACX,SAAK,kBAAkB;AAAA,EAC3B;AAAA,EAEA,gBAAgB;AACZ,SAAK,kBAAkB;AACvB,SAAK,UAAU;AAAA,EACnB;AAAA,EAGA,YAAY;AAAA,EAIZ;AAAA,EAEA,2BAA2B;AACvB,QAAI,CAAC,KAAK,iBAAiB;AACvB,WAAK,UAAU;AAAA,IACnB;AAAA,EACJ;AAGJ;",
4
+ "sourcesContent": ["import { FIRST_OR_NIL, IS, IS_NIL, IS_NOT_NIL, nil, NO, UIObject, YES } from \"./UIObject\"\nimport { UIPoint } from \"./UIPoint\"\nimport { UIView } from \"./UIView\"\n\n\nexport class UIRectangle extends UIObject {\n \n _isBeingUpdated: boolean\n rectanglePointDidChange?: (b: any) => void\n max: UIPoint\n min: UIPoint\n \n \n constructor(x: number = 0, y: number = 0, height: number = 0, width: number = 0) {\n \n super()\n \n this.min = new UIPoint(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY)\n this.max = new UIPoint(Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY)\n \n this.min.didChange = (point) => {\n this.rectanglePointDidChange?.(point)\n this._rectanglePointDidChange()\n }\n this.max.didChange = (point) => {\n this.rectanglePointDidChange?.(point)\n this._rectanglePointDidChange()\n }\n \n this._isBeingUpdated = NO\n \n this.min = new UIPoint(x, y)\n this.max = new UIPoint(x + width, y + height)\n \n if (IS_NIL(height)) {\n this.max.y = height\n }\n \n if (IS_NIL(width)) {\n this.max.x = width\n }\n \n }\n \n \n copy() {\n return new UIRectangle(this.x, this.y, this.height, this.width)\n }\n \n isEqualTo(rectangle: UIRectangle | null | undefined) {\n return (IS(rectangle) && this.min.isEqualTo(rectangle.min) && this.max.isEqualTo(rectangle.max))\n }\n \n static zero() {\n return new UIRectangle(0, 0, 0, 0)\n }\n \n containsPoint(point: UIPoint) {\n return this.min.x <= point.x && this.min.y <= point.y &&\n point.x <= this.max.x && point.y <= this.max.y\n }\n \n updateByAddingPoint(point: UIPoint) {\n \n if (!point) {\n point = new UIPoint(0, 0)\n }\n \n this.beginUpdates()\n \n const min = this.min.copy()\n if (min.x === nil) {\n min.x = this.max.x\n }\n if (min.y === nil) {\n min.y = this.max.y\n }\n \n const max = this.max.copy()\n if (max.x === nil) {\n max.x = this.min.x\n }\n if (max.y === nil) {\n max.y = this.min.y\n }\n \n this.min.x = Math.min(min.x, point.x)\n this.min.y = Math.min(min.y, point.y)\n this.max.x = Math.max(max.x, point.x)\n this.max.y = Math.max(max.y, point.y)\n \n this.finishUpdates()\n \n }\n \n scale(scale: number) {\n if (IS_NOT_NIL(this.max.y)) {\n this.height = this.height * scale\n }\n if (IS_NOT_NIL(this.max.x)) {\n this.width = this.width * scale\n }\n }\n \n get height() {\n if (this.max.y === nil) {\n return nil\n }\n return this.max.y - this.min.y\n }\n \n set height(height: number) {\n this.max.y = this.min.y + height\n }\n \n \n get width() {\n if (this.max.x === nil) {\n return nil\n }\n return this.max.x - this.min.x\n }\n \n set width(width: number) {\n this.max.x = this.min.x + width\n }\n \n \n get x() {\n return this.min.x\n }\n \n set x(x: number) {\n \n this.beginUpdates()\n \n const width = this.width\n this.min.x = x\n this.max.x = this.min.x + width\n \n this.finishUpdates()\n \n }\n \n \n get y() {\n return this.min.y\n }\n \n \n set y(y: number) {\n \n this.beginUpdates()\n \n const height = this.height\n this.min.y = y\n this.max.y = this.min.y + height\n \n this.finishUpdates()\n \n }\n \n \n get topLeft() {\n return this.min.copy()\n }\n \n get topRight() {\n return new UIPoint(this.max.x, this.y)\n }\n \n get bottomLeft() {\n return new UIPoint(this.x, this.max.y)\n }\n \n get bottomRight() {\n return this.max.copy()\n }\n \n \n get center() {\n return this.min.copy().add(this.min.to(this.max).scale(0.5))\n }\n \n set center(center: UIPoint) {\n const offset = this.center.to(center)\n this.offsetByPoint(offset)\n }\n \n offsetByPoint(offset: UIPoint) {\n this.min.add(offset)\n this.max.add(offset)\n \n return this\n }\n \n \n concatenateWithRectangle(rectangle: UIRectangle) {\n this.updateByAddingPoint(rectangle.bottomRight)\n this.updateByAddingPoint(rectangle.topLeft)\n return this\n }\n \n rectangleByConcatenatingWithRectangle(rectangle: UIRectangle) {\n return this.copy().concatenateWithRectangle(rectangle)\n }\n \n \n intersectionRectangleWithRectangle(rectangle: UIRectangle): UIRectangle {\n \n const result = this.copy()\n \n result.beginUpdates()\n \n const min = result.min\n if (min.x === nil) {\n min.x = rectangle.max.x - Math.min(result.width, rectangle.width)\n }\n if (min.y === nil) {\n min.y = rectangle.max.y - Math.min(result.height, rectangle.height)\n }\n \n const max = result.max\n if (max.x === nil) {\n max.x = rectangle.min.x + Math.min(result.width, rectangle.width)\n }\n if (max.y === nil) {\n max.y = rectangle.min.y + Math.min(result.height, rectangle.height)\n }\n \n result.min.x = Math.max(result.min.x, rectangle.min.x)\n result.min.y = Math.max(result.min.y, rectangle.min.y)\n result.max.x = Math.min(result.max.x, rectangle.max.x)\n result.max.y = Math.min(result.max.y, rectangle.max.y)\n \n \n if (result.height < 0) {\n \n const averageY = (this.center.y + rectangle.center.y) * 0.5\n result.min.y = averageY\n result.max.y = averageY\n \n }\n \n if (result.width < 0) {\n \n const averageX = (this.center.x + rectangle.center.x) * 0.5\n result.min.x = averageX\n result.max.x = averageX\n \n }\n \n result.finishUpdates()\n \n return result\n \n }\n \n \n get area() {\n return this.height * this.width\n }\n \n \n intersectsWithRectangle(rectangle: UIRectangle) {\n return (this.intersectionRectangleWithRectangle(rectangle).area != 0)\n }\n \n \n // add some space around the rectangle\n rectangleWithInsets(left: number, right: number, bottom: number, top: number) {\n const result = this.copy()\n result.min.x = this.min.x + left\n result.max.x = this.max.x - right\n result.min.y = this.min.y + top\n result.max.y = this.max.y - bottom\n return result\n }\n \n rectangleWithInset(inset: number) {\n return this.rectangleWithInsets(inset, inset, inset, inset)\n }\n \n rectangleWithHeight(height: number, centeredOnPosition: number = nil) {\n \n if (isNaN(centeredOnPosition)) {\n centeredOnPosition = nil\n }\n \n const result = this.copy()\n result.height = height\n \n if (centeredOnPosition != nil) {\n const change = height - this.height\n result.offsetByPoint(new UIPoint(0, change * centeredOnPosition).scale(-1))\n }\n \n return result\n \n }\n \n rectangleWithWidth(width: number, centeredOnPosition: number = nil) {\n \n if (isNaN(centeredOnPosition)) {\n centeredOnPosition = nil\n }\n \n const result = this.copy()\n result.width = width\n \n if (centeredOnPosition != nil) {\n const change = width - this.width\n result.offsetByPoint(new UIPoint(change * centeredOnPosition, 0).scale(-1))\n }\n \n return result\n \n }\n \n rectangleWithHeightRelativeToWidth(heightRatio: number = 1, centeredOnPosition: number = nil) {\n return this.rectangleWithHeight(this.width * heightRatio, centeredOnPosition)\n }\n \n rectangleWithWidthRelativeToHeight(widthRatio: number = 1, centeredOnPosition: number = nil) {\n return this.rectangleWithWidth(this.height * widthRatio, centeredOnPosition)\n }\n \n rectangleWithX(x: number, centeredOnPosition: number = 0) {\n \n const result = this.copy()\n result.x = x - result.width * centeredOnPosition\n \n return result\n \n }\n \n rectangleWithY(y: number, centeredOnPosition: number = 0) {\n \n const result = this.copy()\n result.y = y - result.height * centeredOnPosition\n \n return result\n \n }\n \n \n rectangleByAddingX(x: number) {\n \n const result = this.copy()\n result.x = this.x + x\n \n return result\n \n }\n \n rectangleByAddingY(y: number) {\n \n const result = this.copy()\n result.y = this.y + y\n \n return result\n \n }\n \n \n rectangleWithRelativeValues(\n relativeXPosition: number,\n widthMultiplier: number,\n relativeYPosition: number,\n heightMultiplier: number\n ) {\n \n const result = this.copy()\n \n const width = result.width\n const height = result.height\n \n result.width = widthMultiplier * width\n result.height = heightMultiplier * height\n \n result.center = new UIPoint(\n relativeXPosition * width,\n relativeYPosition * height\n )\n \n return result\n \n }\n \n \n /**\n * Returns a rectangle with a maximum width constraint\n * If current width exceeds max, centers the constrained width\n */\n rectangleWithMaxWidth(maxWidth: number, centeredOnPosition: number = 0): UIRectangle {\n if (this.width <= maxWidth) {\n return this.copy()\n }\n return this.rectangleWithWidth(maxWidth, centeredOnPosition)\n }\n \n /**\n * Returns a rectangle with a maximum height constraint\n */\n rectangleWithMaxHeight(maxHeight: number, centeredOnPosition: number = 0): UIRectangle {\n if (this.height <= maxHeight) {\n return this.copy()\n }\n return this.rectangleWithHeight(maxHeight, centeredOnPosition)\n }\n \n /**\n * Returns a rectangle with minimum width constraint\n */\n rectangleWithMinWidth(minWidth: number, centeredOnPosition: number = 0): UIRectangle {\n if (this.width >= minWidth) {\n return this.copy()\n }\n return this.rectangleWithWidth(minWidth, centeredOnPosition)\n }\n \n /**\n * Returns a rectangle with minimum height constraint\n */\n rectangleWithMinHeight(minHeight: number, centeredOnPosition: number = 0): UIRectangle {\n if (this.height >= minHeight) {\n return this.copy()\n }\n return this.rectangleWithHeight(minHeight, centeredOnPosition)\n }\n \n // Returns a new rectangle that is positioned relative to the reference rectangle\n // By default, it makes a copy of this rectangle taht is centered in the target rectangle\n rectangleByCenteringInRectangle(referenceRectangle: UIRectangle, xPosition = 0.5, yPosition = 0.5) {\n const result = this.copy()\n result.center = referenceRectangle.topLeft\n .pointByAddingX(xPosition * referenceRectangle.width)\n .pointByAddingY(yPosition * referenceRectangle.height)\n return result\n }\n \n \n rectanglesBySplittingWidth(\n weights: number[],\n paddings: number | number[] = 0,\n absoluteWidths: number | number[] = nil\n ) {\n \n if (IS_NIL(paddings)) {\n paddings = 1\n }\n if (!((paddings as any) instanceof Array)) {\n paddings = [paddings].arrayByRepeating(weights.length - 1)\n }\n paddings = (paddings as number[]).arrayByTrimmingToLengthIfLonger(weights.length - 1)\n if (!(absoluteWidths instanceof Array) && IS_NOT_NIL(absoluteWidths)) {\n absoluteWidths = [absoluteWidths].arrayByRepeating(weights.length)\n }\n \n const result: UIRectangle[] = []\n const sumOfWeights = weights.reduce(\n (a, b, index) => {\n if (IS_NOT_NIL((absoluteWidths as number[])[index])) {\n b = 0\n }\n return a + b\n },\n 0\n )\n const sumOfPaddings = paddings.summedValue\n const sumOfAbsoluteWidths = (absoluteWidths as number[]).summedValue\n const totalRelativeWidth = this.width - sumOfPaddings - sumOfAbsoluteWidths\n let previousCellMaxX = this.x\n \n for (let i = 0; i < weights.length; i++) {\n \n let resultWidth: number\n if (IS_NOT_NIL(absoluteWidths[i])) {\n resultWidth = absoluteWidths[i] || 0\n }\n else {\n resultWidth = totalRelativeWidth * (weights[i] / sumOfWeights)\n }\n \n const rectangle = this.rectangleWithWidth(resultWidth)\n \n let padding = 0\n if (paddings.length > i && paddings[i]) {\n padding = paddings[i]\n }\n \n rectangle.x = previousCellMaxX\n previousCellMaxX = rectangle.max.x + padding\n result.push(rectangle)\n \n }\n \n return result\n \n }\n \n rectanglesBySplittingHeight(\n weights: number[],\n paddings: number | number[] = 0,\n absoluteHeights: number | number[] = nil\n ) {\n \n if (IS_NIL(paddings)) {\n paddings = 1\n }\n if (!((paddings as any) instanceof Array)) {\n paddings = [paddings].arrayByRepeating(weights.length - 1)\n }\n paddings = (paddings as number[]).arrayByTrimmingToLengthIfLonger(weights.length - 1)\n if (!(absoluteHeights instanceof Array) && IS_NOT_NIL(absoluteHeights)) {\n absoluteHeights = [absoluteHeights].arrayByRepeating(weights.length)\n }\n \n const result: UIRectangle[] = []\n const sumOfWeights = weights.reduce(\n (a, b, index) => {\n if (IS_NOT_NIL((absoluteHeights as number[])[index])) {\n b = 0\n }\n return a + b\n },\n 0\n )\n const sumOfPaddings = paddings.summedValue\n const sumOfAbsoluteHeights = (absoluteHeights as number[]).summedValue\n const totalRelativeHeight = this.height - sumOfPaddings - sumOfAbsoluteHeights\n var previousCellMaxY = this.y\n \n for (var i = 0; i < weights.length; i++) {\n var resultHeight: number\n if (IS_NOT_NIL(absoluteHeights[i])) {\n \n resultHeight = absoluteHeights[i] || 0\n \n }\n else {\n \n resultHeight = totalRelativeHeight * (weights[i] / sumOfWeights)\n \n }\n \n const rectangle = this.rectangleWithHeight(resultHeight)\n \n var padding = 0\n if (paddings.length > i && paddings[i]) {\n padding = paddings[i]\n }\n \n rectangle.y = previousCellMaxY\n previousCellMaxY = rectangle.max.y + padding\n //rectangle = rectangle.rectangleWithInsets(0, 0, padding, 0);\n result.push(rectangle)\n }\n \n return result\n \n }\n \n \n rectanglesByEquallySplittingWidth(numberOfFrames: number, padding: number = 0) {\n const result: UIRectangle[] = []\n const totalPadding = padding * (numberOfFrames - 1)\n const resultWidth = (this.width - totalPadding) / numberOfFrames\n for (var i = 0; i < numberOfFrames; i++) {\n const rectangle = this.rectangleWithWidth(resultWidth, i / (numberOfFrames - 1))\n result.push(rectangle)\n }\n return result\n }\n \n rectanglesByEquallySplittingHeight(numberOfFrames: number, padding: number = 0) {\n const result: UIRectangle[] = []\n const totalPadding = padding * (numberOfFrames - 1)\n const resultHeight = (this.height - totalPadding) / numberOfFrames\n for (var i = 0; i < numberOfFrames; i++) {\n const rectangle = this.rectangleWithHeight(resultHeight, i / (numberOfFrames - 1))\n result.push(rectangle)\n }\n return result\n }\n \n \n distributeViewsAlongWidth(\n views: UIView[],\n weights: number | number[] = 1,\n paddings?: number | number[],\n absoluteWidths?: number | number[]\n ) {\n if (!(weights instanceof Array)) {\n weights = [weights].arrayByRepeating(views.length)\n }\n const frames = this.rectanglesBySplittingWidth(weights, paddings, absoluteWidths)\n frames.forEach((frame, index) => FIRST_OR_NIL(views[index]).frame = frame)\n return this\n }\n \n distributeViewsAlongHeight(\n views: UIView[],\n weights: number | number[] = 1,\n paddings?: number | number[],\n absoluteHeights?: number | number[]\n ) {\n if (!(weights instanceof Array)) {\n weights = [weights].arrayByRepeating(views.length)\n }\n const frames = this.rectanglesBySplittingHeight(weights, paddings, absoluteHeights)\n frames.forEach((frame, index) => FIRST_OR_NIL(views[index]).frame = frame)\n return this\n }\n \n \n distributeViewsEquallyAlongWidth(views: UIView[], padding: number) {\n const frames = this.rectanglesByEquallySplittingWidth(views.length, padding)\n frames.forEach((frame, index) => views[index].frame = frame)\n return this\n }\n \n distributeViewsEquallyAlongHeight(views: UIView[], padding: number) {\n const frames = this.rectanglesByEquallySplittingHeight(views.length, padding)\n frames.forEach((frame, index) => views[index].frame = frame)\n return this\n }\n \n \n rectangleForNextRow(padding: number = 0, height: number | ((constrainingWidth: number) => number) | UIView = this.height) {\n if (height instanceof Function) {\n height = height(this.width)\n }\n if (height instanceof UIView) {\n height = height.intrinsicContentHeight(this.width)\n }\n const result = this.rectangleWithY(this.max.y + padding)\n if (height != this.height) {\n result.height = height\n }\n return result\n }\n \n rectangleForNextColumn(padding: number = 0, width: number | ((constrainingHeight: number) => number) | UIView = this.width) {\n if (width instanceof Function) {\n width = width(this.height)\n }\n if (width instanceof UIView) {\n width = width.intrinsicContentWidth(this.height)\n }\n const result = this.rectangleWithX(this.max.x + padding)\n if (width != this.width) {\n result.width = width\n }\n return result\n }\n \n rectangleForPreviousRow(padding: number = 0) {\n return this.rectangleWithY(this.min.y - this.height - padding)\n }\n \n rectangleForPreviousColumn(padding: number = 0) {\n return this.rectangleWithX(this.min.x - this.width - padding)\n }\n \n \n assignedAsFrameOfView(view: UIView) {\n view.frame = this\n return this\n }\n \n \n // Bounding box\n static boundingBoxForPoints(points: string | any[]) {\n const result = new UIRectangle()\n for (let i = 0; i < points.length; i++) {\n result.updateByAddingPoint(points[i])\n }\n return result\n }\n \n \n beginUpdates() {\n this._isBeingUpdated = YES\n }\n \n finishUpdates() {\n this._isBeingUpdated = NO\n this.didChange()\n }\n \n \n didChange() {\n \n // Callback to be set by delegate\n \n }\n \n _rectanglePointDidChange() {\n if (!this._isBeingUpdated) {\n this.didChange()\n }\n }\n \n \n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\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
7
  }
@@ -60,6 +60,6 @@ export declare class UITableView extends UINativeScrollView {
60
60
  private _layoutAllRows;
61
61
  private _animateLayoutAllRows;
62
62
  layoutSubviews(): void;
63
- intrinsicContentHeight: (constrainingWidth?: number) => number;
63
+ intrinsicContentHeight(constrainingWidth?: number): number;
64
64
  }
65
65
  export {};
@@ -42,14 +42,6 @@ class UITableView extends import_UINativeScrollView.UINativeScrollView {
42
42
  this._needsDrawingOfVisibleRowsBeforeLayout = import_UIObject.NO;
43
43
  this._isDrawVisibleRowsScheduled = import_UIObject.NO;
44
44
  this.animationDuration = 0.25;
45
- this.intrinsicContentHeight = (constrainingWidth = 0) => {
46
- var result = 0;
47
- this._calculateAllPositions();
48
- if (this._rowPositions.length) {
49
- result = this._rowPositions[this._rowPositions.length - 1].bottomY;
50
- }
51
- return result;
52
- };
53
45
  this._fullHeightView = new import_UIView.UIView();
54
46
  this._fullHeightView.hidden = import_UIObject.YES;
55
47
  this._fullHeightView.userInteractionEnabled = import_UIObject.NO;
@@ -375,6 +367,14 @@ class UITableView extends import_UINativeScrollView.UINativeScrollView {
375
367
  this._layoutAllRows();
376
368
  }
377
369
  }
370
+ intrinsicContentHeight(constrainingWidth = 0) {
371
+ var result = 0;
372
+ this._calculateAllPositions();
373
+ if (this._rowPositions.length) {
374
+ result = this._rowPositions[this._rowPositions.length - 1].bottomY;
375
+ }
376
+ return result;
377
+ }
378
378
  }
379
379
  // Annotate the CommonJS export names for ESM import in node:
380
380
  0 && (module.exports = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../scripts/UITableView.ts"],
4
- "sourcesContent": ["import { UIButton } from \"./UIButton\"\nimport { UINativeScrollView } from \"./UINativeScrollView\"\nimport { FIRST_OR_NIL, IS, IS_DEFINED, nil, NO, YES } from \"./UIObject\"\nimport { UIPoint } from \"./UIPoint\"\nimport { UIRectangle } from \"./UIRectangle\"\nimport { UIView, UIViewBroadcastEvent } from \"./UIView\"\n\n\ninterface UITableViewRowView extends UIView {\n \n _UITableViewRowIndex?: number;\n \n}\n\n\nexport interface UITableViewReusableViewsContainerObject {\n \n [key: string]: UIView[];\n \n}\n\n\nexport interface UITableViewReusableViewPositionObject {\n \n bottomY: number;\n topY: number;\n \n isValid: boolean;\n \n}\n\n\nexport class UITableView extends UINativeScrollView {\n \n \n allRowsHaveEqualHeight: boolean = NO\n _visibleRows: UITableViewRowView[] = []\n _firstLayoutVisibleRows: UITableViewRowView[] = []\n \n _rowPositions: UITableViewReusableViewPositionObject[] = []\n \n _highestValidRowPositionIndex: number = 0\n \n _reusableViews: UITableViewReusableViewsContainerObject = {}\n _removedReusableViews: UITableViewReusableViewsContainerObject = {}\n \n _fullHeightView: UIView\n _rowIDIndex: number = 0\n reloadsOnLanguageChange = YES\n sidePadding = 0\n \n cellWeights?: number[]\n \n _persistedData: any[] = []\n _needsDrawingOfVisibleRowsBeforeLayout = NO\n _isDrawVisibleRowsScheduled = NO\n _shouldAnimateNextLayout?: boolean\n \n override animationDuration = 0.25\n \n \n constructor(elementID?: string) {\n \n super(elementID)\n \n this._fullHeightView = new UIView()\n this._fullHeightView.hidden = YES\n this._fullHeightView.userInteractionEnabled = NO\n this.addSubview(this._fullHeightView)\n \n this.scrollsX = NO\n \n }\n \n \n loadData() {\n \n this._persistedData = []\n \n this._calculatePositionsUntilIndex(this.numberOfRows() - 1)\n this._needsDrawingOfVisibleRowsBeforeLayout = YES\n \n this.setNeedsLayout()\n \n }\n \n reloadData() {\n \n this._removeVisibleRows()\n this._removeAllReusableRows()\n \n this._rowPositions = []\n this._highestValidRowPositionIndex = 0\n \n this.loadData()\n \n }\n \n \n highlightChanges(previousData: any[], newData: any[]) {\n \n previousData = previousData.map(dataPoint => JSON.stringify(dataPoint))\n newData = newData.map(dataPoint => JSON.stringify(dataPoint))\n \n const newIndexes: number[] = []\n \n newData.forEach((value, index) => {\n \n if (!previousData.contains(value)) {\n \n newIndexes.push(index)\n \n }\n \n })\n \n newIndexes.forEach(index => {\n \n if (this.isRowWithIndexVisible(index)) {\n this.highlightRowAsNew(this.visibleRowWithIndex(index) as UIView)\n }\n \n })\n \n }\n \n \n highlightRowAsNew(row: UIView) {\n \n \n }\n \n \n invalidateSizeOfRowWithIndex(index: number, animateChange = NO) {\n \n if (this._rowPositions[index]) {\n this._rowPositions[index].isValid = NO\n }\n \n this._highestValidRowPositionIndex = Math.min(this._highestValidRowPositionIndex, index - 1)\n \n // if (index == 0) {\n \n // this._highestValidRowPositionIndex = 0;\n \n // this._rowPositions = [];\n \n // }\n \n this._needsDrawingOfVisibleRowsBeforeLayout = YES\n \n this._shouldAnimateNextLayout = animateChange\n \n }\n \n \n _calculateAllPositions() {\n this._calculatePositionsUntilIndex(this.numberOfRows() - 1)\n }\n \n _calculatePositionsUntilIndex(maxIndex: number) {\n \n var validPositionObject = this._rowPositions[this._highestValidRowPositionIndex]\n if (!IS(validPositionObject)) {\n validPositionObject = {\n bottomY: 0,\n topY: 0,\n isValid: YES\n }\n }\n \n var previousBottomY = validPositionObject.bottomY\n \n if (!this._rowPositions.length) {\n \n this._highestValidRowPositionIndex = -1\n \n }\n \n for (var i = this._highestValidRowPositionIndex + 1; i <= maxIndex; i++) {\n \n var height: number\n \n const rowPositionObject = this._rowPositions[i]\n \n if (IS((rowPositionObject || nil).isValid)) {\n \n height = rowPositionObject.bottomY - rowPositionObject.topY\n \n }\n else {\n \n height = this.heightForRowWithIndex(i)\n \n }\n \n \n const positionObject: UITableViewReusableViewPositionObject = {\n bottomY: previousBottomY + height,\n topY: previousBottomY,\n isValid: YES\n }\n \n if (i < this._rowPositions.length) {\n this._rowPositions[i] = positionObject\n }\n else {\n this._rowPositions.push(positionObject)\n }\n this._highestValidRowPositionIndex = i\n previousBottomY = previousBottomY + height\n \n }\n \n }\n \n \n indexesForVisibleRows(paddingRatio = 0.5): number[] {\n \n const firstVisibleY = this.contentOffset.y - this.bounds.height * paddingRatio\n const lastVisibleY = firstVisibleY + this.bounds.height * (1 + paddingRatio)\n \n const numberOfRows = this.numberOfRows()\n \n if (this.allRowsHaveEqualHeight) {\n \n const rowHeight = this.heightForRowWithIndex(0)\n \n var firstIndex = firstVisibleY / rowHeight\n var lastIndex = lastVisibleY / rowHeight\n \n firstIndex = Math.trunc(firstIndex)\n lastIndex = Math.trunc(lastIndex) + 1\n \n firstIndex = Math.max(firstIndex, 0)\n lastIndex = Math.min(lastIndex, numberOfRows - 1)\n \n var result = []\n for (var i = firstIndex; i < lastIndex + 1; i++) {\n result.push(i)\n }\n return result\n }\n \n var accumulatedHeight = 0\n var result = []\n \n this._calculateAllPositions()\n \n const rowPositions = this._rowPositions\n \n for (var i = 0; i < numberOfRows; i++) {\n \n const height = rowPositions[i].bottomY - rowPositions[i].topY // this.heightForRowWithIndex(i)\n \n accumulatedHeight = accumulatedHeight + height\n if (accumulatedHeight >= firstVisibleY) {\n result.push(i)\n }\n if (accumulatedHeight >= lastVisibleY) {\n break\n }\n \n }\n \n return result\n \n }\n \n \n _removeVisibleRows() {\n \n const visibleRows: UITableViewRowView[] = []\n this._visibleRows.forEach((row: UIView) => {\n \n this._persistedData[row._UITableViewRowIndex as number] = this.persistenceDataItemForRowWithIndex(\n row._UITableViewRowIndex as number,\n row\n )\n row.removeFromSuperview()\n this._removedReusableViews[row?._UITableViewReusabilityIdentifier]?.push(row)\n \n \n })\n this._visibleRows = visibleRows\n \n }\n \n \n _removeAllReusableRows() {\n this._reusableViews.forEach((rows: UIView[]) =>\n rows.forEach((row: UIView) => {\n \n this._persistedData[row._UITableViewRowIndex as number] = this.persistenceDataItemForRowWithIndex(\n row._UITableViewRowIndex as number,\n row\n )\n row.removeFromSuperview()\n \n this._markReusableViewAsUnused(row)\n \n })\n )\n }\n \n \n _markReusableViewAsUnused(row: UIView) {\n if (!this._removedReusableViews[row._UITableViewReusabilityIdentifier].contains(row)) {\n this._removedReusableViews[row._UITableViewReusabilityIdentifier].push(row)\n }\n }\n \n _drawVisibleRows() {\n \n if (!this.isMemberOfViewTree) {\n return\n }\n \n const visibleIndexes = this.indexesForVisibleRows()\n \n const minIndex = visibleIndexes[0]\n const maxIndex = visibleIndexes[visibleIndexes.length - 1]\n \n const removedViews: UITableViewRowView[] = []\n \n const visibleRows: UITableViewRowView[] = []\n this._visibleRows.forEach((row) => {\n if (IS_DEFINED(row._UITableViewRowIndex) && (row._UITableViewRowIndex < minIndex || row._UITableViewRowIndex > maxIndex)) {\n \n //row.removeFromSuperview();\n \n this._persistedData[row._UITableViewRowIndex] = this.persistenceDataItemForRowWithIndex(\n row._UITableViewRowIndex,\n row\n )\n \n this._removedReusableViews[row._UITableViewReusabilityIdentifier].push(row)\n \n removedViews.push(row)\n \n }\n else {\n visibleRows.push(row)\n }\n })\n this._visibleRows = visibleRows\n \n visibleIndexes.forEach((rowIndex: number) => {\n \n if (this.isRowWithIndexVisible(rowIndex)) {\n return\n }\n const view: UITableViewRowView = this.viewForRowWithIndex(rowIndex)\n //view._UITableViewRowIndex = rowIndex;\n this._firstLayoutVisibleRows.push(view)\n this._visibleRows.push(view)\n this.addSubview(view)\n \n })\n \n for (let i = 0; i < removedViews.length; i++) {\n \n const view = removedViews[i]\n if (this._visibleRows.indexOf(view) == -1) {\n \n //this._persistedData[view._UITableViewRowIndex] = this.persistenceDataItemForRowWithIndex(view._UITableViewRowIndex, view);\n view.removeFromSuperview()\n \n //this._removedReusableViews[view._UITableViewReusabilityIdentifier].push(view);\n \n }\n \n }\n \n //this.setNeedsLayout();\n \n }\n \n \n visibleRowWithIndex(rowIndex: number | undefined): UIView {\n for (var i = 0; i < this._visibleRows.length; i++) {\n const row = this._visibleRows[i]\n if (row._UITableViewRowIndex == rowIndex) {\n return row\n }\n }\n return nil\n }\n \n \n isRowWithIndexVisible(rowIndex: number) {\n return IS(this.visibleRowWithIndex(rowIndex))\n }\n \n \n reusableViewForIdentifier(identifier: string, rowIndex: number): UITableViewRowView {\n \n if (!this._removedReusableViews[identifier]) {\n this._removedReusableViews[identifier] = []\n }\n \n if (this._removedReusableViews[identifier] && this._removedReusableViews[identifier].length) {\n \n const view = this._removedReusableViews[identifier].pop() as UITableViewRowView\n view._UITableViewRowIndex = rowIndex\n Object.assign(view, this._persistedData[rowIndex] || this.defaultRowPersistenceDataItem())\n return view\n \n }\n \n if (!this._reusableViews[identifier]) {\n this._reusableViews[identifier] = []\n }\n \n const newView = this.newReusableViewForIdentifier(identifier, this._rowIDIndex) as UITableViewRowView\n this._rowIDIndex = this._rowIDIndex + 1\n \n newView._UITableViewReusabilityIdentifier = identifier\n newView._UITableViewRowIndex = rowIndex\n \n Object.assign(newView, this._persistedData[rowIndex] || this.defaultRowPersistenceDataItem())\n this._reusableViews[identifier].push(newView)\n \n return newView\n \n }\n \n \n // Functions that should be overridden to draw the correct content START\n newReusableViewForIdentifier(identifier: string, rowIDIndex: number): UIView {\n \n const view = new UIButton(this.elementID + \"Row\" + rowIDIndex)\n \n view.stopsPointerEventPropagation = NO\n view.pausesPointerEvents = NO\n \n return view\n \n }\n \n heightForRowWithIndex(index: number): number {\n return 50\n }\n \n numberOfRows() {\n return 10000\n }\n \n defaultRowPersistenceDataItem(): any {\n \n \n }\n \n persistenceDataItemForRowWithIndex(rowIndex: number, row: UIView): any {\n \n \n }\n \n viewForRowWithIndex(rowIndex: number): UITableViewRowView {\n const row = this.reusableViewForIdentifier(\"Row\", rowIndex)\n row._UITableViewRowIndex = rowIndex\n FIRST_OR_NIL((row as unknown as UIButton).titleLabel).text = \"Row \" + rowIndex\n return row\n }\n \n // Functions that should be overridden to draw the correct content END\n \n \n // Functions that trigger redrawing of the content\n override didScrollToPosition(offsetPosition: UIPoint) {\n \n super.didScrollToPosition(offsetPosition)\n \n this.forEachViewInSubtree(function (view: UIView) {\n \n view._isPointerValid = NO\n \n })\n \n if (!this._isDrawVisibleRowsScheduled) {\n \n this._isDrawVisibleRowsScheduled = YES\n \n UIView.runFunctionBeforeNextFrame(function (this: UITableView) {\n \n this._calculateAllPositions()\n \n this._drawVisibleRows()\n \n this.setNeedsLayout()\n \n this._isDrawVisibleRowsScheduled = NO\n \n }.bind(this))\n \n }\n \n }\n \n override wasAddedToViewTree() {\n this.loadData()\n }\n \n override setFrame(rectangle: UIRectangle, zIndex?: number, performUncheckedLayout?: boolean) {\n \n const frame = this.frame\n super.setFrame(rectangle, zIndex, performUncheckedLayout)\n if (frame.isEqualTo(rectangle) && !performUncheckedLayout) {\n return\n }\n \n this._needsDrawingOfVisibleRowsBeforeLayout = YES\n \n }\n \n \n override didReceiveBroadcastEvent(event: UIViewBroadcastEvent) {\n \n super.didReceiveBroadcastEvent(event)\n \n if (event.name == UIView.broadcastEventName.LanguageChanged && this.reloadsOnLanguageChange) {\n \n this.reloadData()\n \n }\n \n \n }\n \n \n private _layoutAllRows(positions = this._rowPositions) {\n \n const bounds = this.bounds\n \n this._visibleRows.sort((rowA, rowB) => rowA._UITableViewRowIndex! - rowB._UITableViewRowIndex!)\n .forEach(row => {\n \n const frame = bounds.copy()\n \n const positionObject = positions[row._UITableViewRowIndex!]\n frame.min.y = positionObject.topY\n frame.max.y = positionObject.bottomY\n row.frame = frame\n \n row.style.width = \"\" + (bounds.width - this.sidePadding * 2).integerValue + \"px\"\n row.style.left = \"\" + this.sidePadding.integerValue + \"px\"\n \n // This is to reorder the elements in the DOM\n this.viewHTMLElement.appendChild(row.viewHTMLElement)\n \n })\n \n this._fullHeightView.frame = bounds.rectangleWithHeight((positions.lastElement ||\n nil).bottomY).rectangleWithWidth(bounds.width * 0.5)\n \n this._firstLayoutVisibleRows = []\n \n }\n \n private _animateLayoutAllRows() {\n \n UIView.animateViewOrViewsWithDurationDelayAndFunction(\n this._visibleRows,\n this.animationDuration,\n 0,\n undefined,\n function (this: UITableView) {\n \n this._layoutAllRows()\n \n }.bind(this),\n function (this: UITableView) {\n \n // this._calculateAllPositions()\n // this._layoutAllRows()\n \n }.bind(this)\n )\n \n }\n \n \n override layoutSubviews() {\n \n const previousPositions: UITableViewReusableViewPositionObject[] = JSON.parse(JSON.stringify(this._rowPositions))\n \n const previousVisibleRowsLength = this._visibleRows.length\n \n if (this._needsDrawingOfVisibleRowsBeforeLayout) {\n \n //this._calculateAllPositions()\n \n this._drawVisibleRows()\n \n this._needsDrawingOfVisibleRowsBeforeLayout = NO\n \n }\n \n \n super.layoutSubviews()\n \n \n if (!this.numberOfRows() || !this.isMemberOfViewTree) {\n \n return\n \n }\n \n \n if (this._shouldAnimateNextLayout) {\n \n \n // Need to do layout with the previous positions\n \n this._layoutAllRows(previousPositions)\n \n \n if (previousVisibleRowsLength < this._visibleRows.length) {\n \n \n UIView.runFunctionBeforeNextFrame(function (this: UITableView) {\n \n this._animateLayoutAllRows()\n \n }.bind(this))\n \n }\n else {\n \n this._animateLayoutAllRows()\n \n }\n \n \n this._shouldAnimateNextLayout = NO\n \n }\n else {\n \n // if (this._needsDrawingOfVisibleRowsBeforeLayout) {\n \n // this._drawVisibleRows();\n \n // this._needsDrawingOfVisibleRowsBeforeLayout = NO;\n \n // }\n \n this._calculateAllPositions()\n \n this._layoutAllRows()\n \n \n }\n \n \n }\n \n \n override intrinsicContentHeight = (constrainingWidth = 0) => {\n \n \n var result = 0\n \n this._calculateAllPositions()\n \n if (this._rowPositions.length) {\n \n result = this._rowPositions[this._rowPositions.length - 1].bottomY\n \n }\n \n return result\n \n }\n \n \n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAyB;AACzB,gCAAmC;AACnC,sBAA2D;AAG3D,oBAA6C;AA2BtC,MAAM,oBAAoB,6CAAmB;AAAA,EA6BhD,YAAY,WAAoB;AAE5B,UAAM,SAAS;AA5BnB,kCAAkC;AAClC,wBAAqC,CAAC;AACtC,mCAAgD,CAAC;AAEjD,yBAAyD,CAAC;AAE1D,yCAAwC;AAExC,0BAA0D,CAAC;AAC3D,iCAAiE,CAAC;AAGlE,uBAAsB;AACtB,mC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ACK;AAED,aAAK,sBAAsB;AAAA,MAE/B;AAGA,WAAK,2BAA2B;AAAA,IAEpC,OACK;AAUD,WAAK,uBAAuB;AAE5B,WAAK,eAAe;AAAA,IAGxB;AAAA,EAGJ;AAqBJ;",
4
+ "sourcesContent": ["import { UIButton } from \"./UIButton\"\nimport { UINativeScrollView } from \"./UINativeScrollView\"\nimport { FIRST_OR_NIL, IS, IS_DEFINED, nil, NO, YES } from \"./UIObject\"\nimport { UIPoint } from \"./UIPoint\"\nimport { UIRectangle } from \"./UIRectangle\"\nimport { UIView, UIViewBroadcastEvent } from \"./UIView\"\n\n\ninterface UITableViewRowView extends UIView {\n \n _UITableViewRowIndex?: number;\n \n}\n\n\nexport interface UITableViewReusableViewsContainerObject {\n \n [key: string]: UIView[];\n \n}\n\n\nexport interface UITableViewReusableViewPositionObject {\n \n bottomY: number;\n topY: number;\n \n isValid: boolean;\n \n}\n\n\nexport class UITableView extends UINativeScrollView {\n \n \n allRowsHaveEqualHeight: boolean = NO\n _visibleRows: UITableViewRowView[] = []\n _firstLayoutVisibleRows: UITableViewRowView[] = []\n \n _rowPositions: UITableViewReusableViewPositionObject[] = []\n \n _highestValidRowPositionIndex: number = 0\n \n _reusableViews: UITableViewReusableViewsContainerObject = {}\n _removedReusableViews: UITableViewReusableViewsContainerObject = {}\n \n _fullHeightView: UIView\n _rowIDIndex: number = 0\n reloadsOnLanguageChange = YES\n sidePadding = 0\n \n cellWeights?: number[]\n \n _persistedData: any[] = []\n _needsDrawingOfVisibleRowsBeforeLayout = NO\n _isDrawVisibleRowsScheduled = NO\n _shouldAnimateNextLayout?: boolean\n \n override animationDuration = 0.25\n \n \n constructor(elementID?: string) {\n \n super(elementID)\n \n this._fullHeightView = new UIView()\n this._fullHeightView.hidden = YES\n this._fullHeightView.userInteractionEnabled = NO\n this.addSubview(this._fullHeightView)\n \n this.scrollsX = NO\n \n }\n \n \n loadData() {\n \n this._persistedData = []\n \n this._calculatePositionsUntilIndex(this.numberOfRows() - 1)\n this._needsDrawingOfVisibleRowsBeforeLayout = YES\n \n this.setNeedsLayout()\n \n }\n \n reloadData() {\n \n this._removeVisibleRows()\n this._removeAllReusableRows()\n \n this._rowPositions = []\n this._highestValidRowPositionIndex = 0\n \n this.loadData()\n \n }\n \n \n highlightChanges(previousData: any[], newData: any[]) {\n \n previousData = previousData.map(dataPoint => JSON.stringify(dataPoint))\n newData = newData.map(dataPoint => JSON.stringify(dataPoint))\n \n const newIndexes: number[] = []\n \n newData.forEach((value, index) => {\n \n if (!previousData.contains(value)) {\n \n newIndexes.push(index)\n \n }\n \n })\n \n newIndexes.forEach(index => {\n \n if (this.isRowWithIndexVisible(index)) {\n this.highlightRowAsNew(this.visibleRowWithIndex(index) as UIView)\n }\n \n })\n \n }\n \n \n highlightRowAsNew(row: UIView) {\n \n \n }\n \n \n invalidateSizeOfRowWithIndex(index: number, animateChange = NO) {\n \n if (this._rowPositions[index]) {\n this._rowPositions[index].isValid = NO\n }\n \n this._highestValidRowPositionIndex = Math.min(this._highestValidRowPositionIndex, index - 1)\n \n // if (index == 0) {\n \n // this._highestValidRowPositionIndex = 0;\n \n // this._rowPositions = [];\n \n // }\n \n this._needsDrawingOfVisibleRowsBeforeLayout = YES\n \n this._shouldAnimateNextLayout = animateChange\n \n }\n \n \n _calculateAllPositions() {\n this._calculatePositionsUntilIndex(this.numberOfRows() - 1)\n }\n \n _calculatePositionsUntilIndex(maxIndex: number) {\n \n var validPositionObject = this._rowPositions[this._highestValidRowPositionIndex]\n if (!IS(validPositionObject)) {\n validPositionObject = {\n bottomY: 0,\n topY: 0,\n isValid: YES\n }\n }\n \n var previousBottomY = validPositionObject.bottomY\n \n if (!this._rowPositions.length) {\n \n this._highestValidRowPositionIndex = -1\n \n }\n \n for (var i = this._highestValidRowPositionIndex + 1; i <= maxIndex; i++) {\n \n var height: number\n \n const rowPositionObject = this._rowPositions[i]\n \n if (IS((rowPositionObject || nil).isValid)) {\n \n height = rowPositionObject.bottomY - rowPositionObject.topY\n \n }\n else {\n \n height = this.heightForRowWithIndex(i)\n \n }\n \n \n const positionObject: UITableViewReusableViewPositionObject = {\n bottomY: previousBottomY + height,\n topY: previousBottomY,\n isValid: YES\n }\n \n if (i < this._rowPositions.length) {\n this._rowPositions[i] = positionObject\n }\n else {\n this._rowPositions.push(positionObject)\n }\n this._highestValidRowPositionIndex = i\n previousBottomY = previousBottomY + height\n \n }\n \n }\n \n \n indexesForVisibleRows(paddingRatio = 0.5): number[] {\n \n const firstVisibleY = this.contentOffset.y - this.bounds.height * paddingRatio\n const lastVisibleY = firstVisibleY + this.bounds.height * (1 + paddingRatio)\n \n const numberOfRows = this.numberOfRows()\n \n if (this.allRowsHaveEqualHeight) {\n \n const rowHeight = this.heightForRowWithIndex(0)\n \n var firstIndex = firstVisibleY / rowHeight\n var lastIndex = lastVisibleY / rowHeight\n \n firstIndex = Math.trunc(firstIndex)\n lastIndex = Math.trunc(lastIndex) + 1\n \n firstIndex = Math.max(firstIndex, 0)\n lastIndex = Math.min(lastIndex, numberOfRows - 1)\n \n var result = []\n for (var i = firstIndex; i < lastIndex + 1; i++) {\n result.push(i)\n }\n return result\n }\n \n var accumulatedHeight = 0\n var result = []\n \n this._calculateAllPositions()\n \n const rowPositions = this._rowPositions\n \n for (var i = 0; i < numberOfRows; i++) {\n \n const height = rowPositions[i].bottomY - rowPositions[i].topY // this.heightForRowWithIndex(i)\n \n accumulatedHeight = accumulatedHeight + height\n if (accumulatedHeight >= firstVisibleY) {\n result.push(i)\n }\n if (accumulatedHeight >= lastVisibleY) {\n break\n }\n \n }\n \n return result\n \n }\n \n \n _removeVisibleRows() {\n \n const visibleRows: UITableViewRowView[] = []\n this._visibleRows.forEach((row: UIView) => {\n \n this._persistedData[row._UITableViewRowIndex as number] = this.persistenceDataItemForRowWithIndex(\n row._UITableViewRowIndex as number,\n row\n )\n row.removeFromSuperview()\n this._removedReusableViews[row?._UITableViewReusabilityIdentifier]?.push(row)\n \n \n })\n this._visibleRows = visibleRows\n \n }\n \n \n _removeAllReusableRows() {\n this._reusableViews.forEach((rows: UIView[]) =>\n rows.forEach((row: UIView) => {\n \n this._persistedData[row._UITableViewRowIndex as number] = this.persistenceDataItemForRowWithIndex(\n row._UITableViewRowIndex as number,\n row\n )\n row.removeFromSuperview()\n \n this._markReusableViewAsUnused(row)\n \n })\n )\n }\n \n \n _markReusableViewAsUnused(row: UIView) {\n if (!this._removedReusableViews[row._UITableViewReusabilityIdentifier].contains(row)) {\n this._removedReusableViews[row._UITableViewReusabilityIdentifier].push(row)\n }\n }\n \n _drawVisibleRows() {\n \n if (!this.isMemberOfViewTree) {\n return\n }\n \n const visibleIndexes = this.indexesForVisibleRows()\n \n const minIndex = visibleIndexes[0]\n const maxIndex = visibleIndexes[visibleIndexes.length - 1]\n \n const removedViews: UITableViewRowView[] = []\n \n const visibleRows: UITableViewRowView[] = []\n this._visibleRows.forEach((row) => {\n if (IS_DEFINED(row._UITableViewRowIndex) && (row._UITableViewRowIndex < minIndex || row._UITableViewRowIndex > maxIndex)) {\n \n //row.removeFromSuperview();\n \n this._persistedData[row._UITableViewRowIndex] = this.persistenceDataItemForRowWithIndex(\n row._UITableViewRowIndex,\n row\n )\n \n this._removedReusableViews[row._UITableViewReusabilityIdentifier].push(row)\n \n removedViews.push(row)\n \n }\n else {\n visibleRows.push(row)\n }\n })\n this._visibleRows = visibleRows\n \n visibleIndexes.forEach((rowIndex: number) => {\n \n if (this.isRowWithIndexVisible(rowIndex)) {\n return\n }\n const view: UITableViewRowView = this.viewForRowWithIndex(rowIndex)\n //view._UITableViewRowIndex = rowIndex;\n this._firstLayoutVisibleRows.push(view)\n this._visibleRows.push(view)\n this.addSubview(view)\n \n })\n \n for (let i = 0; i < removedViews.length; i++) {\n \n const view = removedViews[i]\n if (this._visibleRows.indexOf(view) == -1) {\n \n //this._persistedData[view._UITableViewRowIndex] = this.persistenceDataItemForRowWithIndex(view._UITableViewRowIndex, view);\n view.removeFromSuperview()\n \n //this._removedReusableViews[view._UITableViewReusabilityIdentifier].push(view);\n \n }\n \n }\n \n //this.setNeedsLayout();\n \n }\n \n \n visibleRowWithIndex(rowIndex: number | undefined): UIView {\n for (var i = 0; i < this._visibleRows.length; i++) {\n const row = this._visibleRows[i]\n if (row._UITableViewRowIndex == rowIndex) {\n return row\n }\n }\n return nil\n }\n \n \n isRowWithIndexVisible(rowIndex: number) {\n return IS(this.visibleRowWithIndex(rowIndex))\n }\n \n \n reusableViewForIdentifier(identifier: string, rowIndex: number): UITableViewRowView {\n \n if (!this._removedReusableViews[identifier]) {\n this._removedReusableViews[identifier] = []\n }\n \n if (this._removedReusableViews[identifier] && this._removedReusableViews[identifier].length) {\n \n const view = this._removedReusableViews[identifier].pop() as UITableViewRowView\n view._UITableViewRowIndex = rowIndex\n Object.assign(view, this._persistedData[rowIndex] || this.defaultRowPersistenceDataItem())\n return view\n \n }\n \n if (!this._reusableViews[identifier]) {\n this._reusableViews[identifier] = []\n }\n \n const newView = this.newReusableViewForIdentifier(identifier, this._rowIDIndex) as UITableViewRowView\n this._rowIDIndex = this._rowIDIndex + 1\n \n newView._UITableViewReusabilityIdentifier = identifier\n newView._UITableViewRowIndex = rowIndex\n \n Object.assign(newView, this._persistedData[rowIndex] || this.defaultRowPersistenceDataItem())\n this._reusableViews[identifier].push(newView)\n \n return newView\n \n }\n \n \n // Functions that should be overridden to draw the correct content START\n newReusableViewForIdentifier(identifier: string, rowIDIndex: number): UIView {\n \n const view = new UIButton(this.elementID + \"Row\" + rowIDIndex)\n \n view.stopsPointerEventPropagation = NO\n view.pausesPointerEvents = NO\n \n return view\n \n }\n \n heightForRowWithIndex(index: number): number {\n return 50\n }\n \n numberOfRows() {\n return 10000\n }\n \n defaultRowPersistenceDataItem(): any {\n \n \n }\n \n persistenceDataItemForRowWithIndex(rowIndex: number, row: UIView): any {\n \n \n }\n \n viewForRowWithIndex(rowIndex: number): UITableViewRowView {\n const row = this.reusableViewForIdentifier(\"Row\", rowIndex)\n row._UITableViewRowIndex = rowIndex\n FIRST_OR_NIL((row as unknown as UIButton).titleLabel).text = \"Row \" + rowIndex\n return row\n }\n \n // Functions that should be overridden to draw the correct content END\n \n \n // Functions that trigger redrawing of the content\n override didScrollToPosition(offsetPosition: UIPoint) {\n \n super.didScrollToPosition(offsetPosition)\n \n this.forEachViewInSubtree(function (view: UIView) {\n \n view._isPointerValid = NO\n \n })\n \n if (!this._isDrawVisibleRowsScheduled) {\n \n this._isDrawVisibleRowsScheduled = YES\n \n UIView.runFunctionBeforeNextFrame(function (this: UITableView) {\n \n this._calculateAllPositions()\n \n this._drawVisibleRows()\n \n this.setNeedsLayout()\n \n this._isDrawVisibleRowsScheduled = NO\n \n }.bind(this))\n \n }\n \n }\n \n override wasAddedToViewTree() {\n this.loadData()\n }\n \n override setFrame(rectangle: UIRectangle, zIndex?: number, performUncheckedLayout?: boolean) {\n \n const frame = this.frame\n super.setFrame(rectangle, zIndex, performUncheckedLayout)\n if (frame.isEqualTo(rectangle) && !performUncheckedLayout) {\n return\n }\n \n this._needsDrawingOfVisibleRowsBeforeLayout = YES\n \n }\n \n \n override didReceiveBroadcastEvent(event: UIViewBroadcastEvent) {\n \n super.didReceiveBroadcastEvent(event)\n \n if (event.name == UIView.broadcastEventName.LanguageChanged && this.reloadsOnLanguageChange) {\n \n this.reloadData()\n \n }\n \n \n }\n \n \n private _layoutAllRows(positions = this._rowPositions) {\n \n const bounds = this.bounds\n \n this._visibleRows.sort((rowA, rowB) => rowA._UITableViewRowIndex! - rowB._UITableViewRowIndex!)\n .forEach(row => {\n \n const frame = bounds.copy()\n \n const positionObject = positions[row._UITableViewRowIndex!]\n frame.min.y = positionObject.topY\n frame.max.y = positionObject.bottomY\n row.frame = frame\n \n row.style.width = \"\" + (bounds.width - this.sidePadding * 2).integerValue + \"px\"\n row.style.left = \"\" + this.sidePadding.integerValue + \"px\"\n \n // This is to reorder the elements in the DOM\n this.viewHTMLElement.appendChild(row.viewHTMLElement)\n \n })\n \n this._fullHeightView.frame = bounds.rectangleWithHeight((positions.lastElement ||\n nil).bottomY).rectangleWithWidth(bounds.width * 0.5)\n \n this._firstLayoutVisibleRows = []\n \n }\n \n private _animateLayoutAllRows() {\n \n UIView.animateViewOrViewsWithDurationDelayAndFunction(\n this._visibleRows,\n this.animationDuration,\n 0,\n undefined,\n function (this: UITableView) {\n \n this._layoutAllRows()\n \n }.bind(this),\n function (this: UITableView) {\n \n // this._calculateAllPositions()\n // this._layoutAllRows()\n \n }.bind(this)\n )\n \n }\n \n \n override layoutSubviews() {\n \n const previousPositions: UITableViewReusableViewPositionObject[] = JSON.parse(JSON.stringify(this._rowPositions))\n \n const previousVisibleRowsLength = this._visibleRows.length\n \n if (this._needsDrawingOfVisibleRowsBeforeLayout) {\n \n //this._calculateAllPositions()\n \n this._drawVisibleRows()\n \n this._needsDrawingOfVisibleRowsBeforeLayout = NO\n \n }\n \n \n super.layoutSubviews()\n \n \n if (!this.numberOfRows() || !this.isMemberOfViewTree) {\n \n return\n \n }\n \n \n if (this._shouldAnimateNextLayout) {\n \n \n // Need to do layout with the previous positions\n \n this._layoutAllRows(previousPositions)\n \n \n if (previousVisibleRowsLength < this._visibleRows.length) {\n \n \n UIView.runFunctionBeforeNextFrame(function (this: UITableView) {\n \n this._animateLayoutAllRows()\n \n }.bind(this))\n \n }\n else {\n \n this._animateLayoutAllRows()\n \n }\n \n \n this._shouldAnimateNextLayout = NO\n \n }\n else {\n \n // if (this._needsDrawingOfVisibleRowsBeforeLayout) {\n \n // this._drawVisibleRows();\n \n // this._needsDrawingOfVisibleRowsBeforeLayout = NO;\n \n // }\n \n this._calculateAllPositions()\n \n this._layoutAllRows()\n \n \n }\n \n \n }\n \n \n override intrinsicContentHeight(constrainingWidth = 0) {\n \n \n var result = 0\n \n this._calculateAllPositions()\n \n if (this._rowPositions.length) {\n \n result = this._rowPositions[this._rowPositions.length - 1].bottomY\n \n }\n \n return result\n \n }\n \n \n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n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BAA0B;AAK/B,WAAK,eAAe,iBAAiB;AAGrC,UAAI,4BAA4B,KAAK,aAAa,QAAQ;AAGtD,6BAAO,2BAA2B,WAA6B;AAE3D,eAAK,sBAAsB;AAAA,QAE/B,EAAE,KAAK,IAAI,CAAC;AAAA,MAEhB,OACK;AAED,aAAK,sBAAsB;AAAA,MAE/B;AAGA,WAAK,2BAA2B;AAAA,IAEpC,OACK;AAUD,WAAK,uBAAuB;AAE5B,WAAK,eAAe;AAAA,IAGxB;AAAA,EAGJ;AAAA,EAGS,uBAAuB,oBAAoB,GAAG;AAGnD,QAAI,SAAS;AAEb,SAAK,uBAAuB;AAE5B,QAAI,KAAK,cAAc,QAAQ;AAE3B,eAAS,KAAK,cAAc,KAAK,cAAc,SAAS,GAAG;AAAA,IAE/D;AAEA,WAAO;AAAA,EAEX;AAGJ;",
6
6
  "names": []
7
7
  }
@@ -84,7 +84,7 @@ export declare class UITextView extends UIView {
84
84
  didReceiveBroadcastEvent(event: UIViewBroadcastEvent): void;
85
85
  willMoveToSuperview(superview: UIView): void;
86
86
  layoutSubviews(): void;
87
- intrinsicContentHeight: (constrainingWidth?: number) => any;
88
- intrinsicContentWidth: (constrainingHeight?: number) => any;
89
- intrinsicContentSize: () => UIRectangle;
87
+ intrinsicContentHeight(constrainingWidth?: number): any;
88
+ intrinsicContentWidth(constrainingHeight?: number): any;
89
+ intrinsicContentSize(): UIRectangle;
90
90
  }
@@ -37,42 +37,6 @@ const _UITextView = class extends import_UIView.UIView {
37
37
  this.changesOften = import_UIObject.NO;
38
38
  this._intrinsicHeightCache = new import_UIObject.UIObject();
39
39
  this._intrinsicWidthCache = new import_UIObject.UIObject();
40
- this.intrinsicContentHeight = (constrainingWidth = 0) => {
41
- const keyPath = (this.viewHTMLElement.innerHTML + "_csf_" + this.computedStyle.font).replace(new RegExp(
42
- "\\.",
43
- "g"
44
- ), "_") + "." + ("" + constrainingWidth).replace(new RegExp("\\.", "g"), "_");
45
- let cacheObject = _UITextView._intrinsicHeightCache;
46
- if (this.changesOften) {
47
- cacheObject = this._intrinsicHeightCache;
48
- }
49
- var result = cacheObject.valueForKeyPath(keyPath);
50
- if ((0, import_UIObject.IS_LIKE_NULL)(result)) {
51
- result = import_UIView.UIView.prototype.intrinsicContentHeight.call(this, constrainingWidth);
52
- cacheObject.setValueForKeyPath(keyPath, result);
53
- }
54
- return result;
55
- };
56
- this.intrinsicContentWidth = (constrainingHeight = 0) => {
57
- const keyPath = (this.viewHTMLElement.innerHTML + "_csf_" + this.computedStyle.font).replace(new RegExp(
58
- "\\.",
59
- "g"
60
- ), "_") + "." + ("" + constrainingHeight).replace(new RegExp("\\.", "g"), "_");
61
- let cacheObject = _UITextView._intrinsicWidthCache;
62
- if (this.changesOften) {
63
- cacheObject = this._intrinsicWidthCache;
64
- }
65
- var result = cacheObject.valueForKeyPath(keyPath);
66
- if ((0, import_UIObject.IS_LIKE_NULL)(result)) {
67
- result = import_UIView.UIView.prototype.intrinsicContentWidth.call(this, constrainingHeight);
68
- cacheObject.setValueForKeyPath(keyPath, result);
69
- }
70
- return result;
71
- };
72
- this.intrinsicContentSize = () => {
73
- const result = this.intrinsicContentSizeWithConstraints(import_UIObject.nil, import_UIObject.nil);
74
- return result;
75
- };
76
40
  this.text = "";
77
41
  this.style.overflow = "hidden";
78
42
  this.style.textOverflow = "ellipsis";
@@ -218,6 +182,42 @@ const _UITextView = class extends import_UIView.UIView {
218
182
  );
219
183
  }
220
184
  }
185
+ intrinsicContentHeight(constrainingWidth = 0) {
186
+ const keyPath = (this.viewHTMLElement.innerHTML + "_csf_" + this.computedStyle.font).replace(new RegExp(
187
+ "\\.",
188
+ "g"
189
+ ), "_") + "." + ("" + constrainingWidth).replace(new RegExp("\\.", "g"), "_");
190
+ let cacheObject = _UITextView._intrinsicHeightCache;
191
+ if (this.changesOften) {
192
+ cacheObject = this._intrinsicHeightCache;
193
+ }
194
+ var result = cacheObject.valueForKeyPath(keyPath);
195
+ if ((0, import_UIObject.IS_LIKE_NULL)(result)) {
196
+ result = super.intrinsicContentHeight(constrainingWidth);
197
+ cacheObject.setValueForKeyPath(keyPath, result);
198
+ }
199
+ return result;
200
+ }
201
+ intrinsicContentWidth(constrainingHeight = 0) {
202
+ const keyPath = (this.viewHTMLElement.innerHTML + "_csf_" + this.computedStyle.font).replace(new RegExp(
203
+ "\\.",
204
+ "g"
205
+ ), "_") + "." + ("" + constrainingHeight).replace(new RegExp("\\.", "g"), "_");
206
+ let cacheObject = _UITextView._intrinsicWidthCache;
207
+ if (this.changesOften) {
208
+ cacheObject = this._intrinsicWidthCache;
209
+ }
210
+ var result = cacheObject.valueForKeyPath(keyPath);
211
+ if ((0, import_UIObject.IS_LIKE_NULL)(result)) {
212
+ result = super.intrinsicContentWidth(constrainingHeight);
213
+ cacheObject.setValueForKeyPath(keyPath, result);
214
+ }
215
+ return result;
216
+ }
217
+ intrinsicContentSize() {
218
+ const result = this.intrinsicContentSizeWithConstraints(import_UIObject.nil, import_UIObject.nil);
219
+ return result;
220
+ }
221
221
  };
222
222
  let UITextView = _UITextView;
223
223
  UITextView.defaultTextColor = import_UIColor.UIColor.blackColor;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../scripts/UITextView.ts"],
4
- "sourcesContent": ["import { UIColor } from \"./UIColor\"\nimport { UILocalizedTextObject } from \"./UIInterfaces\"\nimport { FIRST, IS_LIKE_NULL, nil, NO, UIObject, YES } from \"./UIObject\"\nimport { UIRectangle } from \"./UIRectangle\"\nimport type { ValueOf } from \"./UIObject\"\nimport { UIView, UIViewBroadcastEvent } from \"./UIView\"\n\n\nexport class UITextView extends UIView {\n \n \n _textColor: UIColor = UITextView.defaultTextColor\n _textAlignment?: ValueOf<typeof UITextView.textAlignment>\n \n _isSingleLine = YES\n \n textPrefix = \"\"\n textSuffix = \"\"\n \n _notificationAmount = 0\n \n _minFontSize?: number\n _maxFontSize?: number\n \n _automaticFontSizeSelection = NO\n \n changesOften = NO\n \n static defaultTextColor = UIColor.blackColor\n static notificationTextColor = UIColor.redColor\n \n static _intrinsicHeightCache: { [x: string]: { [x: string]: number; }; } & UIObject = new UIObject() as any\n static _intrinsicWidthCache: { [x: string]: { [x: string]: number; }; } & UIObject = new UIObject() as any\n \n _intrinsicHeightCache: { [x: string]: { [x: string]: number; }; } & UIObject = new UIObject() as any\n _intrinsicWidthCache: { [x: string]: { [x: string]: number; }; } & UIObject = new UIObject() as any\n \n \n static _ptToPx: number\n static _pxToPt: number\n _text?: string\n \n \n constructor(\n elementID?: string,\n textViewType: string | ValueOf<typeof UITextView.type> = UITextView.type.paragraph,\n viewHTMLElement = null\n ) {\n \n super(elementID, viewHTMLElement, textViewType)\n \n this.text = \"\"\n \n this.style.overflow = \"hidden\"\n this.style.textOverflow = \"ellipsis\"\n this.isSingleLine = YES\n \n this.textColor = this.textColor\n \n this.userInteractionEnabled = YES\n \n \n if (textViewType == UITextView.type.textArea) {\n \n this.pausesPointerEvents = YES\n \n this.addTargetForControlEvent(\n UIView.controlEvent.PointerUpInside,\n (sender, event) => sender.focus()\n )\n \n \n }\n \n \n }\n \n \n static _determinePXAndPTRatios() {\n \n if (UITextView._ptToPx) {\n return\n }\n \n const o = document.createElement(\"div\")\n o.style.width = \"1000pt\"\n document.body.appendChild(o)\n UITextView._ptToPx = o.clientWidth / 1000\n document.body.removeChild(o)\n UITextView._pxToPt = 1 / UITextView._ptToPx\n \n }\n \n \n static type = {\n \n \"paragraph\": \"p\",\n \"header1\": \"h1\",\n \"header2\": \"h2\",\n \"header3\": \"h3\",\n \"header4\": \"h4\",\n \"header5\": \"h5\",\n \"header6\": \"h6\",\n \"textArea\": \"textarea\",\n \"textField\": \"input\",\n \"span\": \"span\",\n \"label\": \"label\"\n \n } as const\n \n \n static textAlignment = {\n \n \"left\": \"left\",\n \"center\": \"center\",\n \"right\": \"right\",\n \"justify\": \"justify\"\n \n } as const\n \n get textAlignment() {\n // @ts-ignore\n return this.style.textAlign\n }\n \n set textAlignment(textAlignment: ValueOf<typeof UITextView.textAlignment>) {\n this._textAlignment = textAlignment\n this.style.textAlign = textAlignment\n }\n \n \n get textColor() {\n return this._textColor\n }\n \n set textColor(color: UIColor) {\n \n this._textColor = color || UITextView.defaultTextColor\n this.style.color = this._textColor.stringValue\n \n }\n \n \n get isSingleLine() {\n \n return this._isSingleLine\n \n }\n \n set isSingleLine(isSingleLine: boolean) {\n \n this._isSingleLine = isSingleLine\n \n this._intrinsicHeightCache = new UIObject() as any\n this._intrinsicWidthCache = new UIObject() as any\n \n if (isSingleLine) {\n \n this.style.whiteSpace = \"pre\"\n \n return\n \n }\n \n this.style.whiteSpace = \"pre-wrap\"\n \n }\n \n \n get notificationAmount() {\n \n return this._notificationAmount\n \n }\n \n set notificationAmount(notificationAmount: number) {\n \n if (this._notificationAmount == notificationAmount) {\n \n return\n \n }\n \n this._notificationAmount = notificationAmount\n \n this.text = this.text\n \n this.setNeedsLayoutUpToRootView()\n \n this.notificationAmountDidChange(notificationAmount)\n \n }\n \n notificationAmountDidChange(notificationAmount: number) {\n \n \n }\n \n \n get text() {\n \n return (this._text || this.viewHTMLElement.innerHTML)\n \n }\n \n set text(text) {\n \n this._text = text\n \n var notificationText = \"\"\n \n if (this.notificationAmount) {\n \n notificationText = \"<span style=\\\"color: \" + UITextView.notificationTextColor.stringValue + \";\\\">\" +\n (\" (\" + this.notificationAmount + \")\").bold() + \"</span>\"\n \n }\n \n if (this.viewHTMLElement.innerHTML != this.textPrefix + text + this.textSuffix + notificationText) {\n \n this.viewHTMLElement.innerHTML = this.textPrefix + FIRST(text, \"\") + this.textSuffix + notificationText\n \n }\n \n if (this.changesOften) {\n \n this._intrinsicHeightCache = new UIObject() as any\n this._intrinsicWidthCache = new UIObject() as any\n \n }\n \n this.setNeedsLayout()\n \n }\n \n override set innerHTML(innerHTML: string) {\n \n this.text = innerHTML\n \n }\n \n override get innerHTML() {\n \n return this.viewHTMLElement.innerHTML\n \n }\n \n \n setText(key: string, defaultString: string, parameters?: { [x: string]: string | UILocalizedTextObject }) {\n \n this.setInnerHTML(key, defaultString, parameters)\n \n }\n \n \n get fontSize() {\n \n const style = window.getComputedStyle(this.viewHTMLElement, null).fontSize\n \n const result = (parseFloat(style) * UITextView._pxToPt)\n \n return result\n \n }\n \n set fontSize(fontSize: number) {\n \n \n this.style.fontSize = \"\" + fontSize + \"pt\"\n \n this._intrinsicHeightCache = new UIObject() as any\n this._intrinsicWidthCache = new UIObject() as any // MEETOD LUUA!!!!\n \n \n }\n \n \n useAutomaticFontSize(minFontSize: number = nil, maxFontSize: number = nil) {\n \n \n this._automaticFontSizeSelection = YES\n \n \n this._minFontSize = minFontSize\n \n this._maxFontSize = maxFontSize\n \n this.setNeedsLayout()\n \n \n }\n \n \n static automaticallyCalculatedFontSize(\n bounds: UIRectangle,\n currentSize: UIRectangle,\n currentFontSize: number,\n minFontSize?: number,\n maxFontSize?: number\n ) {\n \n minFontSize = FIRST(minFontSize, 1)\n \n maxFontSize = FIRST(maxFontSize, 100000000000)\n \n \n const heightMultiplier = bounds.height / (currentSize.height + 1)\n \n const widthMultiplier = bounds.width / (currentSize.width + 1)\n \n \n var multiplier = heightMultiplier\n \n if (heightMultiplier > widthMultiplier) {\n \n multiplier = widthMultiplier\n \n \n }\n \n \n const maxFittingFontSize = currentFontSize * multiplier\n \n \n if (maxFittingFontSize > maxFontSize) {\n \n return maxFontSize\n \n }\n \n if (minFontSize > maxFittingFontSize) {\n \n return minFontSize\n \n }\n \n \n return maxFittingFontSize\n \n \n }\n \n \n override didReceiveBroadcastEvent(event: UIViewBroadcastEvent) {\n \n super.didReceiveBroadcastEvent(event)\n \n }\n \n \n override willMoveToSuperview(superview: UIView) {\n \n super.willMoveToSuperview(superview)\n \n }\n \n \n override layoutSubviews() {\n \n super.layoutSubviews()\n \n \n if (this._automaticFontSizeSelection) {\n \n this.fontSize = UITextView.automaticallyCalculatedFontSize(\n new UIRectangle(0, 0, 1 *\n this.viewHTMLElement.offsetHeight, 1 *\n this.viewHTMLElement.offsetWidth),\n this.intrinsicContentSize(),\n this.fontSize,\n this._minFontSize,\n this._maxFontSize\n )\n \n \n }\n \n \n }\n \n \n override intrinsicContentHeight = (constrainingWidth = 0) => {\n \n const keyPath = (this.viewHTMLElement.innerHTML + \"_csf_\" + this.computedStyle.font).replace(new RegExp(\n \"\\\\.\",\n \"g\"\n ), \"_\") + \".\" +\n (\"\" + constrainingWidth).replace(new RegExp(\"\\\\.\", \"g\"), \"_\")\n \n let cacheObject = UITextView._intrinsicHeightCache\n \n if (this.changesOften) {\n \n // @ts-ignore\n cacheObject = this._intrinsicHeightCache\n \n \n }\n \n \n var result = cacheObject.valueForKeyPath(keyPath)\n \n \n if (IS_LIKE_NULL(result)) {\n \n result = UIView.prototype.intrinsicContentHeight.call(this, constrainingWidth)\n \n cacheObject.setValueForKeyPath(keyPath, result)\n \n \n }\n \n \n return result\n \n }\n \n override intrinsicContentWidth = (constrainingHeight = 0) => {\n \n const keyPath = (this.viewHTMLElement.innerHTML + \"_csf_\" + this.computedStyle.font).replace(new RegExp(\n \"\\\\.\",\n \"g\"\n ), \"_\") + \".\" +\n (\"\" + constrainingHeight).replace(new RegExp(\"\\\\.\", \"g\"), \"_\")\n \n let cacheObject = UITextView._intrinsicWidthCache\n \n if (this.changesOften) {\n \n // @ts-ignore\n cacheObject = this._intrinsicWidthCache\n \n \n }\n \n \n var result = cacheObject.valueForKeyPath(keyPath)\n \n \n if (IS_LIKE_NULL(result)) {\n \n result = UIView.prototype.intrinsicContentWidth.call(this, constrainingHeight)\n \n cacheObject.setValueForKeyPath(keyPath, result)\n \n \n }\n \n \n return result\n \n }\n \n \n override intrinsicContentSize = () => {\n \n // This works but is slow\n const result = this.intrinsicContentSizeWithConstraints(nil, nil)\n \n return result\n \n }\n \n \n}\n\n\nUITextView._determinePXAndPTRatios()\n\n\n// /**\n// * Uses canvas.measureText to compute and return the width of the given text of given font in pixels.\n// * \n// * @param {String} text The text to be rendered.\n// * @param {String} font The css font descriptor that text is to be rendered with (e.g. \"bold 14px verdana\").\n// * \n// * @see https://stackoverflow.com/questions/118241/calculate-text-width-with-javascript/21015393#21015393\n// */\n// function getTextMetrics(text, font) {\n// // re-use canvas object for better performance\n// var canvas = getTextMetrics.canvas || (getTextMetrics.canvas = document.createElement(\"canvas\"));\n// var context = canvas.getContext(\"2d\");\n// context.font = font;\n// var metrics = context.measureText(text);\n// return metrics;\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;AAExB,sBAA4D;AAC5D,yBAA4B;AAE5B,oBAA6C;AAGtC,MAAM,cAAN,cAAyB,qBAAO;AAAA,EAmCnC,YACI,WACA,eAAyD,YAAW,KAAK,WACzE,kBAAkB,MACpB;AAEE,UAAM,WAAW,iBAAiB,YAAY;AAtClD,sBAAsB,YAAW;AAGjC,yBAAgB;AAEhB,sBAAa;AACb,sBAAa;AAEb,+BAAsB;AAKtB,uCAA8B;AAE9B,wBAAe;AAQf,iCAA+E,IAAI,yBAAS;AAC5F,gCAA8E,IAAI,yBAAS;AA0V3F,SAAS,yBAAyB,CAAC,oBAAoB,MAAM;AAEzD,YAAM,WAAW,KAAK,gBAAgB,YAAY,UAAU,KAAK,cAAc,MAAM,QAAQ,IAAI;AAAA,QACzF;AAAA,QACA;AAAA,MACJ,GAAG,GAAG,IAAI,OACT,KAAK,mBAAmB,QAAQ,IAAI,OAAO,OAAO,GAAG,GAAG,GAAG;AAEhE,UAAI,cAAc,YAAW;AAE7B,UAAI,KAAK,cAAc;AAGnB,sBAAc,KAAK;AAAA,MAGvB;AAGA,UAAI,SAAS,YAAY,gBAAgB,OAAO;AAGhD,cAAI,8BAAa,MAAM,GAAG;AAEtB,iBAAS,qBAAO,UAAU,uBAAuB,KAAK,MAAM,iBAAiB;AAE7E,oBAAY,mBAAmB,SAAS,MAAM;AAAA,MAGl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AqB,aAAa;AAElC,aAAO;AAAA,IAEX;AAEA,QAAI,cAAc,oBAAoB;AAElC,aAAO;AAAA,IAEX;AAGA,WAAO;AAAA,EAGX;AAAA,EAGS,yBAAyB,OAA6B;AAE3D,UAAM,yBAAyB,KAAK;AAAA,EAExC;AAAA,EAGS,oBAAoB,WAAmB;AAE5C,UAAM,oBAAoB,SAAS;AAAA,EAEvC;AAAA,EAGS,iBAAiB;AAEtB,UAAM,eAAe;AAGrB,QAAI,KAAK,6BAA6B;AAElC,WAAK,WAAW,YAAW;AAAA,QACvB,IAAI,+BAAY,GAAG,GAAG,IAClB,KAAK,gBAAgB,cAAc,IACnC,KAAK,gBAAgB,WAAW;AAAA,QACpC,KAAK,qBAAqB;AAAA,QAC1B,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AAAA,MACT;AAAA,IAGJ;AAAA,EAGJ;AAsFJ;AAxcO,IAAM,aAAN;AAAM,WAoBF,mBAAmB,uBAAQ;AApBzB,WAqBF,wBAAwB,uBAAQ;AArB9B,WAuBF,wBAA+E,IAAI,yBAAS;AAvB1F,WAwBF,uBAA8E,IAAI,yBAAS;AAxBzF,WAsFF,OAAO;AAAA,EAEV,aAAa;AAAA,EACb,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,SAAS;AAEb;AApGS,WAuGF,gBAAgB;AAAA,EAEnB,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,SAAS;AAAA,EACT,WAAW;AAEf;AA6VJ,WAAW,wBAAwB;",
4
+ "sourcesContent": ["import { UIColor } from \"./UIColor\"\nimport { UILocalizedTextObject } from \"./UIInterfaces\"\nimport { FIRST, IS_LIKE_NULL, nil, NO, UIObject, YES } from \"./UIObject\"\nimport { UIRectangle } from \"./UIRectangle\"\nimport type { ValueOf } from \"./UIObject\"\nimport { UIView, UIViewBroadcastEvent } from \"./UIView\"\n\n\nexport class UITextView extends UIView {\n \n \n _textColor: UIColor = UITextView.defaultTextColor\n _textAlignment?: ValueOf<typeof UITextView.textAlignment>\n \n _isSingleLine = YES\n \n textPrefix = \"\"\n textSuffix = \"\"\n \n _notificationAmount = 0\n \n _minFontSize?: number\n _maxFontSize?: number\n \n _automaticFontSizeSelection = NO\n \n changesOften = NO\n \n static defaultTextColor = UIColor.blackColor\n static notificationTextColor = UIColor.redColor\n \n static _intrinsicHeightCache: { [x: string]: { [x: string]: number; }; } & UIObject = new UIObject() as any\n static _intrinsicWidthCache: { [x: string]: { [x: string]: number; }; } & UIObject = new UIObject() as any\n \n _intrinsicHeightCache: { [x: string]: { [x: string]: number; }; } & UIObject = new UIObject() as any\n _intrinsicWidthCache: { [x: string]: { [x: string]: number; }; } & UIObject = new UIObject() as any\n \n \n static _ptToPx: number\n static _pxToPt: number\n _text?: string\n \n \n constructor(\n elementID?: string,\n textViewType: string | ValueOf<typeof UITextView.type> = UITextView.type.paragraph,\n viewHTMLElement = null\n ) {\n \n super(elementID, viewHTMLElement, textViewType)\n \n this.text = \"\"\n \n this.style.overflow = \"hidden\"\n this.style.textOverflow = \"ellipsis\"\n this.isSingleLine = YES\n \n this.textColor = this.textColor\n \n this.userInteractionEnabled = YES\n \n \n if (textViewType == UITextView.type.textArea) {\n \n this.pausesPointerEvents = YES\n \n this.addTargetForControlEvent(\n UIView.controlEvent.PointerUpInside,\n (sender, event) => sender.focus()\n )\n \n \n }\n \n \n }\n \n \n static _determinePXAndPTRatios() {\n \n if (UITextView._ptToPx) {\n return\n }\n \n const o = document.createElement(\"div\")\n o.style.width = \"1000pt\"\n document.body.appendChild(o)\n UITextView._ptToPx = o.clientWidth / 1000\n document.body.removeChild(o)\n UITextView._pxToPt = 1 / UITextView._ptToPx\n \n }\n \n \n static type = {\n \n \"paragraph\": \"p\",\n \"header1\": \"h1\",\n \"header2\": \"h2\",\n \"header3\": \"h3\",\n \"header4\": \"h4\",\n \"header5\": \"h5\",\n \"header6\": \"h6\",\n \"textArea\": \"textarea\",\n \"textField\": \"input\",\n \"span\": \"span\",\n \"label\": \"label\"\n \n } as const\n \n \n static textAlignment = {\n \n \"left\": \"left\",\n \"center\": \"center\",\n \"right\": \"right\",\n \"justify\": \"justify\"\n \n } as const\n \n get textAlignment() {\n // @ts-ignore\n return this.style.textAlign\n }\n \n set textAlignment(textAlignment: ValueOf<typeof UITextView.textAlignment>) {\n this._textAlignment = textAlignment\n this.style.textAlign = textAlignment\n }\n \n \n get textColor() {\n return this._textColor\n }\n \n set textColor(color: UIColor) {\n \n this._textColor = color || UITextView.defaultTextColor\n this.style.color = this._textColor.stringValue\n \n }\n \n \n get isSingleLine() {\n \n return this._isSingleLine\n \n }\n \n set isSingleLine(isSingleLine: boolean) {\n \n this._isSingleLine = isSingleLine\n \n this._intrinsicHeightCache = new UIObject() as any\n this._intrinsicWidthCache = new UIObject() as any\n \n if (isSingleLine) {\n \n this.style.whiteSpace = \"pre\"\n \n return\n \n }\n \n this.style.whiteSpace = \"pre-wrap\"\n \n }\n \n \n get notificationAmount() {\n \n return this._notificationAmount\n \n }\n \n set notificationAmount(notificationAmount: number) {\n \n if (this._notificationAmount == notificationAmount) {\n \n return\n \n }\n \n this._notificationAmount = notificationAmount\n \n this.text = this.text\n \n this.setNeedsLayoutUpToRootView()\n \n this.notificationAmountDidChange(notificationAmount)\n \n }\n \n notificationAmountDidChange(notificationAmount: number) {\n \n \n }\n \n \n get text() {\n \n return (this._text || this.viewHTMLElement.innerHTML)\n \n }\n \n set text(text) {\n \n this._text = text\n \n var notificationText = \"\"\n \n if (this.notificationAmount) {\n \n notificationText = \"<span style=\\\"color: \" + UITextView.notificationTextColor.stringValue + \";\\\">\" +\n (\" (\" + this.notificationAmount + \")\").bold() + \"</span>\"\n \n }\n \n if (this.viewHTMLElement.innerHTML != this.textPrefix + text + this.textSuffix + notificationText) {\n \n this.viewHTMLElement.innerHTML = this.textPrefix + FIRST(text, \"\") + this.textSuffix + notificationText\n \n }\n \n if (this.changesOften) {\n \n this._intrinsicHeightCache = new UIObject() as any\n this._intrinsicWidthCache = new UIObject() as any\n \n }\n \n this.setNeedsLayout()\n \n }\n \n override set innerHTML(innerHTML: string) {\n \n this.text = innerHTML\n \n }\n \n override get innerHTML() {\n \n return this.viewHTMLElement.innerHTML\n \n }\n \n \n setText(key: string, defaultString: string, parameters?: { [x: string]: string | UILocalizedTextObject }) {\n \n this.setInnerHTML(key, defaultString, parameters)\n \n }\n \n \n get fontSize() {\n \n const style = window.getComputedStyle(this.viewHTMLElement, null).fontSize\n \n const result = (parseFloat(style) * UITextView._pxToPt)\n \n return result\n \n }\n \n set fontSize(fontSize: number) {\n \n \n this.style.fontSize = \"\" + fontSize + \"pt\"\n \n this._intrinsicHeightCache = new UIObject() as any\n this._intrinsicWidthCache = new UIObject() as any // MEETOD LUUA!!!!\n \n \n }\n \n \n useAutomaticFontSize(minFontSize: number = nil, maxFontSize: number = nil) {\n \n \n this._automaticFontSizeSelection = YES\n \n \n this._minFontSize = minFontSize\n \n this._maxFontSize = maxFontSize\n \n this.setNeedsLayout()\n \n \n }\n \n \n static automaticallyCalculatedFontSize(\n bounds: UIRectangle,\n currentSize: UIRectangle,\n currentFontSize: number,\n minFontSize?: number,\n maxFontSize?: number\n ) {\n \n minFontSize = FIRST(minFontSize, 1)\n \n maxFontSize = FIRST(maxFontSize, 100000000000)\n \n \n const heightMultiplier = bounds.height / (currentSize.height + 1)\n \n const widthMultiplier = bounds.width / (currentSize.width + 1)\n \n \n var multiplier = heightMultiplier\n \n if (heightMultiplier > widthMultiplier) {\n \n multiplier = widthMultiplier\n \n \n }\n \n \n const maxFittingFontSize = currentFontSize * multiplier\n \n \n if (maxFittingFontSize > maxFontSize) {\n \n return maxFontSize\n \n }\n \n if (minFontSize > maxFittingFontSize) {\n \n return minFontSize\n \n }\n \n \n return maxFittingFontSize\n \n \n }\n \n \n override didReceiveBroadcastEvent(event: UIViewBroadcastEvent) {\n \n super.didReceiveBroadcastEvent(event)\n \n }\n \n \n override willMoveToSuperview(superview: UIView) {\n \n super.willMoveToSuperview(superview)\n \n }\n \n \n override layoutSubviews() {\n \n super.layoutSubviews()\n \n \n if (this._automaticFontSizeSelection) {\n \n this.fontSize = UITextView.automaticallyCalculatedFontSize(\n new UIRectangle(0, 0, 1 *\n this.viewHTMLElement.offsetHeight, 1 *\n this.viewHTMLElement.offsetWidth),\n this.intrinsicContentSize(),\n this.fontSize,\n this._minFontSize,\n this._maxFontSize\n )\n \n \n }\n \n \n }\n \n \n override intrinsicContentHeight(constrainingWidth = 0) {\n \n const keyPath = (this.viewHTMLElement.innerHTML + \"_csf_\" + this.computedStyle.font).replace(new RegExp(\n \"\\\\.\",\n \"g\"\n ), \"_\") + \".\" +\n (\"\" + constrainingWidth).replace(new RegExp(\"\\\\.\", \"g\"), \"_\")\n \n let cacheObject = UITextView._intrinsicHeightCache\n \n if (this.changesOften) {\n \n // @ts-ignore\n cacheObject = this._intrinsicHeightCache\n \n \n }\n \n \n var result = cacheObject.valueForKeyPath(keyPath)\n \n \n if (IS_LIKE_NULL(result)) {\n \n result = super.intrinsicContentHeight(constrainingWidth)\n \n cacheObject.setValueForKeyPath(keyPath, result)\n \n \n }\n \n \n return result\n \n }\n \n override intrinsicContentWidth(constrainingHeight = 0) {\n \n const keyPath = (this.viewHTMLElement.innerHTML + \"_csf_\" + this.computedStyle.font).replace(new RegExp(\n \"\\\\.\",\n \"g\"\n ), \"_\") + \".\" +\n (\"\" + constrainingHeight).replace(new RegExp(\"\\\\.\", \"g\"), \"_\")\n \n let cacheObject = UITextView._intrinsicWidthCache\n \n if (this.changesOften) {\n \n // @ts-ignore\n cacheObject = this._intrinsicWidthCache\n \n \n }\n \n \n var result = cacheObject.valueForKeyPath(keyPath)\n \n \n if (IS_LIKE_NULL(result)) {\n \n result = super.intrinsicContentWidth(constrainingHeight)\n \n cacheObject.setValueForKeyPath(keyPath, result)\n \n \n }\n \n \n return result\n \n }\n \n \n override intrinsicContentSize() {\n \n // This works but is slow\n const result = this.intrinsicContentSizeWithConstraints(nil, nil)\n \n return result\n \n }\n \n \n}\n\n\nUITextView._determinePXAndPTRatios()\n\n\n// /**\n// * Uses canvas.measureText to compute and return the width of the given text of given font in pixels.\n// * \n// * @param {String} text The text to be rendered.\n// * @param {String} font The css font descriptor that text is to be rendered with (e.g. \"bold 14px verdana\").\n// * \n// * @see https://stackoverflow.com/questions/118241/calculate-text-width-with-javascript/21015393#21015393\n// */\n// function getTextMetrics(text, font) {\n// // re-use canvas object for better performance\n// var canvas = getTextMetrics.canvas || (getTextMetrics.canvas = document.createElement(\"canvas\"));\n// var context = canvas.getContext(\"2d\");\n// context.font = font;\n// var metrics = context.measureText(text);\n// return metrics;\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;AAExB,sBAA4D;AAC5D,yBAA4B;AAE5B,oBAA6C;AAGtC,MAAM,cAAN,cAAyB,qBAAO;AAAA,EAmCnC,YACI,WACA,eAAyD,YAAW,KAAK,WACzE,kBAAkB,MACpB;AAEE,UAAM,WAAW,iBAAiB,YAAY;AAtClD,sBAAsB,YAAW;AAGjC,yBAAgB;AAEhB,sBAAa;AACb,sBAAa;AAEb,+BAAsB;AAKtB,uCAA8B;AAE9B,wBAAe;AAQf,iCAA+E,IAAI,yBAAS;AAC5F,gCAA8E,IAAI,yBAAS;AAgBvF,SAAK,OAAO;AAEZ,SAAK,MAAM,WAAW;AACtB,SAAK,MAAM,eAAe;AAC1B,SAAK,eAAe;AAEpB,SAAK,YAAY,KAAK;AAEtB,SAAK,yBAAyB;AAG9B,QAAI,gBAAgB,YAAW,KAAK,UAAU;AAE1C,WAAK,sBAAsB;AAE3B,WAAK;AAAA,QACD,qBAAO,aAAa;AAAA,QACpB,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6
  "names": []
7
7
  }
@@ -387,9 +387,9 @@ export declare class UIView extends UIObject {
387
387
  forEachViewInSubtree(functionToCall: (view: UIView) => void): void;
388
388
  rectangleInView(rectangle: UIRectangle, view: UIView): any;
389
389
  rectangleFromView(rectangle: UIRectangle, view: UIView): any;
390
- intrinsicContentSizeWithConstraints: (constrainingHeight?: number, constrainingWidth?: number) => UIRectangle;
391
- intrinsicContentWidth: (constrainingHeight?: number) => number;
392
- intrinsicContentHeight: (constrainingWidth?: number) => number;
393
- intrinsicContentSize: () => UIRectangle;
390
+ intrinsicContentSizeWithConstraints(constrainingHeight?: number, constrainingWidth?: number): UIRectangle;
391
+ intrinsicContentWidth(constrainingHeight?: number): number;
392
+ intrinsicContentHeight(constrainingWidth?: number): number;
393
+ intrinsicContentSize(): UIRectangle;
394
394
  }
395
395
  export {};