uicore-ts 1.1.127 → 1.1.141
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiledScripts/UIRectangle.d.ts +1 -1
- package/compiledScripts/UIRectangle.js +2 -1
- package/compiledScripts/UIRectangle.js.map +2 -2
- package/compiledScripts/UIRootViewController.d.ts +6 -1
- package/compiledScripts/UIRootViewController.js +48 -13
- package/compiledScripts/UIRootViewController.js.map +2 -2
- package/compiledScripts/UITableView.d.ts +1 -1
- package/compiledScripts/UITableView.js +3 -2
- package/compiledScripts/UITableView.js.map +2 -2
- package/compiledScripts/UIView.d.ts +7 -0
- package/compiledScripts/UIView.js +10 -1
- package/compiledScripts/UIView.js.map +2 -2
- package/package.json +1 -1
- package/scripts/UIRectangle.ts +2 -1
- package/scripts/UIRootViewController.ts +70 -19
- package/scripts/UITableView.ts +3 -2
- package/scripts/UIView.ts +15 -1
|
@@ -118,7 +118,7 @@ export declare class UIRectangle extends UIObject {
|
|
|
118
118
|
settingMaxHeight(maxHeight?: number): this;
|
|
119
119
|
settingMaxWidth(maxWidth?: number): this;
|
|
120
120
|
rectangleByEnforcingMinAndMaxSizes(centeredOnXPosition?: number, centeredOnYPosition?: number): UIRectangle;
|
|
121
|
-
assignedAsFrameOfView(view: UIView): this;
|
|
121
|
+
assignedAsFrameOfView(view: UIView, isWeakFrame?: boolean): this;
|
|
122
122
|
toString(): string;
|
|
123
123
|
get [Symbol.toStringTag](): string;
|
|
124
124
|
IF(condition: boolean): UIRectangleConditionalChain<UIRectangle>;
|
|
@@ -628,8 +628,9 @@ class UIRectangle extends import_UIObject.UIObject {
|
|
|
628
628
|
centeredOnXPosition
|
|
629
629
|
);
|
|
630
630
|
}
|
|
631
|
-
assignedAsFrameOfView(view) {
|
|
631
|
+
assignedAsFrameOfView(view, isWeakFrame = view.hasWeakFrame) {
|
|
632
632
|
view.frame = this;
|
|
633
|
+
view.hasWeakFrame = isWeakFrame;
|
|
633
634
|
return this;
|
|
634
635
|
}
|
|
635
636
|
toString() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../scripts/UIRectangle.ts"],
|
|
4
|
-
"sourcesContent": ["import { FIRST_OR_NIL, IS, IS_DEFINED, IS_NIL, IS_NOT_LIKE_NULL, IS_NOT_NIL, nil, NO, UIObject, YES } from \"./UIObject\"\nimport { UIPoint } from \"./UIPoint\"\nimport { UIView } from \"./UIView\"\n\n\nexport type SizeNumberOrFunctionOrView = number | ((constrainingOrthogonalSize: number) => number) | UIView\n\nexport class UIRectangle extends UIObject {\n \n _isBeingUpdated: boolean\n rectanglePointDidChange?: (b: any) => void\n max: UIPoint\n min: UIPoint\n \n // The min and max values are just for storage.\n // You need to call rectangleByEnforcingMinAndMaxSizes to make use of them.\n minHeight?: number\n maxHeight?: number\n minWidth?: number\n maxWidth?: number\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 \n const result = new UIRectangle(this.x, this.y, this.height, this.width)\n \n result.minHeight = this.minHeight\n result.minWidth = this.minWidth\n result.maxHeight = this.maxHeight\n result.maxWidth = this.maxWidth\n \n return result\n \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: SizeNumberOrFunctionOrView, centeredOnPosition: number = nil) {\n \n height = this._heightNumberFromSizeNumberOrFunctionOrView(height)\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: SizeNumberOrFunctionOrView, centeredOnPosition: number = nil) {\n \n width = this._widthNumberFromSizeNumberOrFunctionOrView(width)\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 rectangleByAddingWidth(widthToAdd: number, centeredOnPosition = 0) {\n \n const result = this.rectangleWithWidth(this.width + widthToAdd, centeredOnPosition)\n \n return result\n \n }\n \n rectangleByAddingHeight(heightToAdd: number, centeredOnPosition = 0) {\n \n const result = this.rectangleWithHeight(this.height + heightToAdd, centeredOnPosition)\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: SizeNumberOrFunctionOrView[],\n paddings: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[] = 0,\n absoluteWidths: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[] = 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 any[]).arrayByTrimmingToLengthIfLonger(weights.length - 1)\n paddings = paddings.map(padding => this._widthNumberFromSizeNumberOrFunctionOrView(padding))\n if (!(absoluteWidths instanceof Array) && IS_NOT_NIL(absoluteWidths)) {\n absoluteWidths = [absoluteWidths].arrayByRepeating(weights.length)\n }\n absoluteWidths = absoluteWidths.map(\n width => this._widthNumberFromSizeNumberOrFunctionOrView(width)\n )\n \n weights = weights.map(weight => this._widthNumberFromSizeNumberOrFunctionOrView(weight))\n const result: UIRectangle[] = []\n const sumOfWeights = (weights as number[]).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 as number\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) as number\n }\n else {\n resultWidth = totalRelativeWidth * (weights[i] as number / 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] as number\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: SizeNumberOrFunctionOrView[],\n paddings: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[] = 0,\n absoluteHeights: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[] = 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 paddings = paddings.map(padding => this._heightNumberFromSizeNumberOrFunctionOrView(padding))\n if (!(absoluteHeights instanceof Array) && IS_NOT_NIL(absoluteHeights)) {\n absoluteHeights = [absoluteHeights].arrayByRepeating(weights.length)\n }\n absoluteHeights = absoluteHeights.map(\n height => this._heightNumberFromSizeNumberOrFunctionOrView(height)\n )\n \n weights = weights.map(weight => this._heightNumberFromSizeNumberOrFunctionOrView(weight))\n const result: UIRectangle[] = []\n const sumOfWeights = (weights as number[]).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 as number\n const sumOfAbsoluteHeights = (absoluteHeights as number[]).summedValue\n const totalRelativeHeight = this.height - sumOfPaddings - sumOfAbsoluteHeights\n let previousCellMaxY = this.y\n \n for (let i = 0; i < weights.length; i++) {\n let resultHeight: number\n if (IS_NOT_NIL(absoluteHeights[i])) {\n \n resultHeight = (absoluteHeights[i] || 0) as number\n \n }\n else {\n \n resultHeight = totalRelativeHeight * (weights[i] as number / sumOfWeights)\n \n }\n \n const rectangle = this.rectangleWithHeight(resultHeight)\n \n let padding = 0\n if (paddings.length > i && paddings[i]) {\n padding = paddings[i] as number\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: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[] = 1,\n paddings?: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[],\n absoluteWidths?: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[]\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: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[] = 1,\n paddings?: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[],\n absoluteHeights?: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[]\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 _heightNumberFromSizeNumberOrFunctionOrView(height: SizeNumberOrFunctionOrView) {\n if (height instanceof Function) {\n return height(this.width)\n }\n if (height instanceof UIView) {\n return height.intrinsicContentHeight(this.width)\n }\n return height\n }\n \n _widthNumberFromSizeNumberOrFunctionOrView(width: SizeNumberOrFunctionOrView) {\n if (width instanceof Function) {\n return width(this.height)\n }\n if (width instanceof UIView) {\n return width.intrinsicContentWidth(this.height)\n }\n return width\n }\n \n rectangleForNextRow(padding: number = 0, height: SizeNumberOrFunctionOrView = this.height) {\n const heightNumber = this._heightNumberFromSizeNumberOrFunctionOrView(height)\n const result = this.rectangleWithY(this.max.y + padding)\n if (heightNumber != this.height) {\n result.height = heightNumber\n }\n return result\n }\n \n rectangleForNextColumn(padding: number = 0, width: SizeNumberOrFunctionOrView = this.width) {\n const widthNumber = this._widthNumberFromSizeNumberOrFunctionOrView(width)\n const result = this.rectangleWithX(this.max.x + padding)\n if (widthNumber != this.width) {\n result.width = widthNumber\n }\n return result\n }\n \n rectangleForPreviousRow(padding: number = 0, height: SizeNumberOrFunctionOrView = this.height) {\n const heightNumber = this._heightNumberFromSizeNumberOrFunctionOrView(height)\n const result = this.rectangleWithY(this.min.y - heightNumber - padding)\n if (heightNumber != this.height) {\n result.height = heightNumber\n }\n return result\n }\n \n rectangleForPreviousColumn(padding: number = 0, width: SizeNumberOrFunctionOrView = this.width) {\n const widthNumber = this._widthNumberFromSizeNumberOrFunctionOrView(width)\n const result = this.rectangleWithX(this.min.x - widthNumber - padding)\n if (widthNumber != this.width) {\n result.width = widthNumber\n }\n return result\n \n }\n \n /**\n * Distributes views vertically as a column, assigning frames and returning them.\n * Each view is positioned below the previous one with optional padding between them.\n * @param views - Array of views to distribute\n * @param paddings - Padding between views (single value or array of values)\n * @param absoluteHeights - Optional fixed heights for views (overrides intrinsic height)\n * @returns Array of rectangles representing the frame for each view\n */\n framesByDistributingViewsAsColumn(\n views: UIView[],\n paddings: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[] = 0,\n absoluteHeights: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[] = nil\n ) {\n const frames: UIRectangle[] = []\n let currentRectangle = this.copy()\n \n if (!(paddings instanceof Array)) {\n paddings = [paddings].arrayByRepeating(views.length - 1)\n }\n paddings = paddings.map(padding => this._heightNumberFromSizeNumberOrFunctionOrView(padding))\n \n if (!(absoluteHeights instanceof Array) && IS_NOT_NIL(absoluteHeights)) {\n absoluteHeights = [absoluteHeights].arrayByRepeating(views.length)\n }\n absoluteHeights = absoluteHeights.map(\n height => this._heightNumberFromSizeNumberOrFunctionOrView(height)\n )\n \n for (let i = 0; i < views.length; i++) {\n const frame = currentRectangle.rectangleWithHeight(views[i])\n \n if (IS_NOT_NIL(absoluteHeights[i])) {\n frame.height = absoluteHeights[i] as number\n }\n \n views[i].frame = frame\n frames.push(frame)\n \n const padding = (paddings[i] || 0) as number\n currentRectangle = frame.rectangleForNextRow(padding)\n }\n \n return frames\n }\n \n /**\n * Distributes views horizontally as a row, assigning frames and returning them.\n * Each view is positioned to the right of the previous one with optional padding between them.\n * @param views - Array of views to distribute\n * @param paddings - Padding between views (single value or array of values)\n * @param absoluteWidths - Optional fixed widths for views (overrides intrinsic width)\n * @returns Array of rectangles representing the frame for each view\n */\n framesByDistributingViewsAsRow(\n views: UIView[],\n paddings: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[] = 0,\n absoluteWidths: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[] = nil\n ) {\n const frames: UIRectangle[] = []\n let currentRectangle = this.copy()\n \n if (!(paddings instanceof Array)) {\n paddings = [paddings].arrayByRepeating(views.length - 1)\n }\n paddings = paddings.map(padding => this._widthNumberFromSizeNumberOrFunctionOrView(padding))\n \n if (!(absoluteWidths instanceof Array) && IS_NOT_NIL(absoluteWidths)) {\n absoluteWidths = [absoluteWidths].arrayByRepeating(views.length)\n }\n absoluteWidths = absoluteWidths.map(\n width => this._widthNumberFromSizeNumberOrFunctionOrView(width)\n )\n \n for (let i = 0; i < views.length; i++) {\n const frame = currentRectangle.rectangleWithWidth(views[i])\n \n if (IS_NOT_NIL(absoluteWidths[i])) {\n frame.width = absoluteWidths[i] as number\n }\n \n views[i].frame = frame\n frames.push(frame)\n \n const padding = (paddings[i] || 0) as number\n currentRectangle = frame.rectangleForNextColumn(padding)\n }\n \n return frames\n }\n \n /**\n * Distributes views as a grid (2D array), assigning frames and returning them.\n * The first index represents rows (vertical), the second index represents columns (horizontal).\n * Example: views[0] is the first row, views[0][0] is the first column in the first row.\n * Each row is laid out horizontally, and rows are stacked vertically.\n * @param views - 2D array where views[row][column] represents the grid structure\n * @param paddings - Vertical padding between rows (single value or array of values)\n * @param absoluteHeights - Optional fixed heights for each row (overrides intrinsic height)\n * @returns 2D array of rectangles where frames[row][column] matches views[row][column]\n */\n framesByDistributingViewsAsGrid(\n views: UIView[][],\n paddings: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[] = 0,\n absoluteHeights: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[] = nil\n ) {\n const frames: UIRectangle[][] = []\n let currentRowRectangle = this.copy()\n \n if (!(paddings instanceof Array)) {\n paddings = [paddings].arrayByRepeating(views.length - 1)\n }\n paddings = paddings.map(padding => this._heightNumberFromSizeNumberOrFunctionOrView(padding))\n \n if (!(absoluteHeights instanceof Array) && IS_NOT_NIL(absoluteHeights)) {\n absoluteHeights = [absoluteHeights].arrayByRepeating(views.length)\n }\n absoluteHeights = absoluteHeights.map(\n height => this._heightNumberFromSizeNumberOrFunctionOrView(height)\n )\n \n for (let i = 0; i < views.length; i++) {\n const rowViews = views[i]\n const rowFrames = currentRowRectangle.framesByDistributingViewsAsRow(rowViews)\n \n if (IS_NOT_NIL(absoluteHeights[i])) {\n const heightNumber = absoluteHeights[i] as number\n rowFrames.forEach((frame, j) => {\n frame.height = heightNumber\n rowViews[j].frame = frame\n })\n }\n \n frames.push(rowFrames)\n \n const padding = (paddings[i] || 0) as number\n const maxHeight = Math.max(...rowFrames.map(f => f.height))\n currentRowRectangle = currentRowRectangle.rectangleForNextRow(padding, maxHeight)\n }\n \n return frames\n }\n \n rectangleWithIntrinsicContentSizeForView(view: UIView, centeredOnXPosition = 0, centeredOnYPosition = 0) {\n const intrinsicContentSize = view.intrinsicContentSize()\n return this.rectangleWithHeight(intrinsicContentSize.height, centeredOnYPosition)\n .rectangleWithWidth(intrinsicContentSize.width, centeredOnXPosition)\n }\n \n settingMinHeight(minHeight?: number) {\n this.minHeight = minHeight\n return this\n }\n \n settingMinWidth(minWidth?: number) {\n this.minWidth = minWidth\n return this\n }\n \n settingMaxHeight(maxHeight?: number) {\n this.maxHeight = maxHeight\n return this\n }\n \n settingMaxWidth(maxWidth?: number) {\n this.maxWidth = maxWidth\n return this\n }\n \n rectangleByEnforcingMinAndMaxSizes(centeredOnXPosition = 0, centeredOnYPosition = 0) {\n return this.rectangleWithHeight(\n [\n [this.height, this.maxHeight].filter(value => IS_NOT_LIKE_NULL(value)).min(),\n this.minHeight\n ].filter(value => IS_NOT_LIKE_NULL(value)).max(),\n centeredOnYPosition\n ).rectangleWithWidth(\n [\n [this.width, this.maxWidth].filter(value => IS_NOT_LIKE_NULL(value)).min(),\n this.minWidth\n ].filter(value => IS_NOT_LIKE_NULL(value)).max(),\n centeredOnXPosition\n )\n }\n \n \n assignedAsFrameOfView(view: UIView) {\n view.frame = this\n return this\n }\n \n \n override toString() {\n \n const result = \"[\" + this.class.name + \"] { x: \" + this.x + \", y: \" + this.y + \", \" +\n \"height: \" + this.height.toFixed(2) + \", width: \" + this.height.toFixed(2) + \" }\"\n \n return result\n \n }\n \n get [Symbol.toStringTag]() {\n return this.toString()\n }\n \n \n IF(condition: boolean): UIRectangleConditionalChain<UIRectangle> {\n const conditionalBlock = new UIRectangleConditionalBlock(this, condition)\n // @ts-ignore\n return conditionalBlock.getProxy()\n }\n \n // These will be intercepted by the proxy, but we define them for TypeScript\n ELSE_IF(condition: boolean): UIRectangle {\n return this\n }\n \n ELSE(): UIRectangle {\n return this\n }\n \n ENDIF(): this\n ENDIF<T, R>(performFunction: (result: T) => R): R\n ENDIF<T, R>(performFunction?: (result: T) => R): R | this {\n if (performFunction) {\n return performFunction(this as any)\n }\n return this\n }\n \n \n // Bounding box\n static boundingBoxForPoints(points: UIPoint[]) {\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 static boundingBoxForRectanglesAndPoints(rectanglesAndPoints: (UIPoint | UIRectangle)[]) {\n const result = new UIRectangle()\n for (let i = 0; i < rectanglesAndPoints.length; i++) {\n const rectangleOrPoint = rectanglesAndPoints[i]\n if (rectangleOrPoint instanceof UIRectangle) {\n result.updateByAddingPoint(rectangleOrPoint.min)\n result.updateByAddingPoint(rectangleOrPoint.max)\n }\n else {\n result.updateByAddingPoint(rectangleOrPoint)\n }\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// 1. Methods available when holding a UIRectangle\ntype RectangleChainMethods<TResult> = {\n [K in keyof UIRectangle as (\n K extends 'IF' | 'ELSE' | 'ELSE_IF' | 'ENDIF' ? never : K\n )]:\n UIRectangle[K] extends (...args: infer Args) => infer R\n ? R extends UIRectangle | UIRectangle[]\n // CHANGE: We do NOT add 'R' to 'TResult' here. We only update the current state (R).\n ? (...args: Args) => UIRectangleConditionalChain<R, TResult>\n : never\n : never\n};\n\n// 2. Methods available when holding a UIRectangle[]\ntype ArrayChainMethods<TResult> = {\n [K in keyof UIRectangle[]]:\n UIRectangle[][K] extends UIRectangle\n ? UIRectangleConditionalChain<UIRectangle, TResult> // No accumulation for properties\n : UIRectangle[][K] extends (...args: infer Args) => infer R\n ? R extends UIRectangle | UIRectangle[]\n // CHANGE: We do NOT add 'R' to 'TResult' here either.\n ? (...args: Args) => UIRectangleConditionalChain<R, TResult>\n : never\n : never\n};\n\n// 3. Methods available in both states (Control Flow + Transform)\ntype SharedChainMethods<TCurrent, TResult> = {\n // TRANSFORM acts as a standard method, it should not leak intermediate types into TResult\n TRANSFORM<R extends UIRectangle>(fn: (current: TCurrent) => R): UIRectangleConditionalChain<R, TResult>;\n \n // ELSE_IF marks the end of a branch. We MUST capture the current state (TCurrent) and add it to TResult.\n // The new chain starts with the original UIRectangle state for the next branch.\n ELSE_IF(condition: boolean): UIRectangleConditionalChain<UIRectangle, TResult | TCurrent>;\n \n // ELSE marks the end of a branch. Same logic as ELSE_IF.\n ELSE(): UIRectangleConditionalChain<UIRectangle, TResult | TCurrent>;\n \n // ENDIF marks the end of the block. Same logic: capture TCurrent into TResult.\n ENDIF(): TResult | TCurrent;\n ENDIF<R>(performFunction: (result: TResult | TCurrent) => R): R;\n};\n\n// 4. The Main Type (No changes needed here, just re-stating for context)\ntype UIRectangleConditionalChain<TCurrent, TResult = TCurrent> =\n (TCurrent extends UIRectangle ? RectangleChainMethods<TResult> : {}) &\n (TCurrent extends UIRectangle[] ? ArrayChainMethods<TResult> : {}) &\n SharedChainMethods<TCurrent, TResult>;\n\n\nclass UIRectangleConditionalBlock {\n // The value we are currently chaining on (can be UIRectangle or UIRectangle[])\n private currentResult: any\n // The value where the IF block started (needed to reset for ELSE branches)\n private originalResult: any\n private conditionMet: boolean\n \n constructor(initialResult: UIRectangle, condition: boolean) {\n this.originalResult = initialResult\n this.currentResult = initialResult\n this.conditionMet = condition\n }\n \n private createProxy(): UIRectangleConditionalChain<any, any> {\n const self = this\n \n // The target is irrelevant; we delegate everything to self.currentResult\n return new Proxy({}, {\n get(_, prop) {\n \n // 1. Control Flow Methods\n \n if (prop === 'TRANSFORM') {\n return <R extends UIRectangle>(fn: (current: any) => R) => {\n if (self.conditionMet) {\n const result = fn(self.currentResult)\n self.currentResult = result\n }\n return self.createProxy()\n }\n }\n \n if (prop === 'ELSE_IF') {\n return <U>(condition: boolean) => {\n // Only enter this branch if no previous branch has run\n if (!self.conditionMet) {\n self.conditionMet = condition\n // Reset the state to the original starting point for this new branch\n self.currentResult = self.originalResult\n }\n return self.createProxy()\n }\n }\n \n if (prop === 'ELSE') {\n return <U>() => {\n if (!self.conditionMet) {\n self.conditionMet = true\n // Reset the state to the original starting point\n self.currentResult = self.originalResult\n }\n return self.createProxy()\n }\n }\n \n if (prop === 'ENDIF') {\n function endif(): any\n function endif<R>(performFunction: (result: any) => R): R\n function endif<R>(performFunction?: (result: any) => R): R | any {\n return performFunction ? performFunction(self.currentResult) : self.currentResult\n }\n return endif\n }\n \n // 2. Forwarding to currentResult (Rectangle or Array)\n \n const value = self.currentResult[prop]\n \n // Case A: It's a function (method call)\n if (typeof value === 'function') {\n return (...args: any[]) => {\n if (self.conditionMet) {\n // Call the method on the CURRENT object, and update the state\n const result = value.apply(self.currentResult, args)\n self.currentResult = result\n }\n return self.createProxy()\n }\n }\n \n // Case B: It's a property (getter)\n // Accessing a property acts as a transition (e.g. accessing .lastElement)\n if (self.conditionMet) {\n self.currentResult = value\n }\n \n return self.createProxy()\n }\n }) as any\n }\n \n getProxy(): UIRectangleConditionalChain<any, any> {\n return this.createProxy()\n }\n \n}\n\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,sBAA2G;AAC3G,qBAAwB;AACxB,oBAAuB;AAKhB,MAAM,oBAAoB,yBAAS;AAAA,EAetC,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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A,SAAT,SAAkB,iBAA+C;AAC7D,mBAAO,kBAAkB,gBAAgB,KAAK,aAAa,IAAI,KAAK;AAAA,UACxE;AAFS,sBAAAA;AAGT,iBAAOA;AAAA,QACX;AAIA,cAAM,QAAQ,KAAK,cAAc;AAGjC,YAAI,OAAO,UAAU,YAAY;AAC7B,iBAAO,IAAI,SAAgB;AACvB,gBAAI,KAAK,cAAc;AAEnB,oBAAM,SAAS,MAAM,MAAM,KAAK,eAAe,IAAI;AACnD,mBAAK,gBAAgB;AAAA,YACzB;AACA,mBAAO,KAAK,YAAY;AAAA,UAC5B;AAAA,QACJ;AAIA,YAAI,KAAK,cAAc;AACnB,eAAK,gBAAgB;AAAA,QACzB;AAEA,eAAO,KAAK,YAAY;AAAA,MAC5B;AAAA,IACJ,CAAC;AAAA,EACL;AAAA,EAEA,WAAkD;AAC9C,WAAO,KAAK,YAAY;AAAA,EAC5B;AAEJ;",
|
|
4
|
+
"sourcesContent": ["import { FIRST_OR_NIL, IS, IS_DEFINED, IS_NIL, IS_NOT_LIKE_NULL, IS_NOT_NIL, nil, NO, UIObject, YES } from \"./UIObject\"\nimport { UIPoint } from \"./UIPoint\"\nimport { UIView } from \"./UIView\"\n\n\nexport type SizeNumberOrFunctionOrView = number | ((constrainingOrthogonalSize: number) => number) | UIView\n\nexport class UIRectangle extends UIObject {\n \n _isBeingUpdated: boolean\n rectanglePointDidChange?: (b: any) => void\n max: UIPoint\n min: UIPoint\n \n // The min and max values are just for storage.\n // You need to call rectangleByEnforcingMinAndMaxSizes to make use of them.\n minHeight?: number\n maxHeight?: number\n minWidth?: number\n maxWidth?: number\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 \n const result = new UIRectangle(this.x, this.y, this.height, this.width)\n \n result.minHeight = this.minHeight\n result.minWidth = this.minWidth\n result.maxHeight = this.maxHeight\n result.maxWidth = this.maxWidth\n \n return result\n \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: SizeNumberOrFunctionOrView, centeredOnPosition: number = nil) {\n \n height = this._heightNumberFromSizeNumberOrFunctionOrView(height)\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: SizeNumberOrFunctionOrView, centeredOnPosition: number = nil) {\n \n width = this._widthNumberFromSizeNumberOrFunctionOrView(width)\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 rectangleByAddingWidth(widthToAdd: number, centeredOnPosition = 0) {\n \n const result = this.rectangleWithWidth(this.width + widthToAdd, centeredOnPosition)\n \n return result\n \n }\n \n rectangleByAddingHeight(heightToAdd: number, centeredOnPosition = 0) {\n \n const result = this.rectangleWithHeight(this.height + heightToAdd, centeredOnPosition)\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: SizeNumberOrFunctionOrView[],\n paddings: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[] = 0,\n absoluteWidths: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[] = 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 any[]).arrayByTrimmingToLengthIfLonger(weights.length - 1)\n paddings = paddings.map(padding => this._widthNumberFromSizeNumberOrFunctionOrView(padding))\n if (!(absoluteWidths instanceof Array) && IS_NOT_NIL(absoluteWidths)) {\n absoluteWidths = [absoluteWidths].arrayByRepeating(weights.length)\n }\n absoluteWidths = absoluteWidths.map(\n width => this._widthNumberFromSizeNumberOrFunctionOrView(width)\n )\n \n weights = weights.map(weight => this._widthNumberFromSizeNumberOrFunctionOrView(weight))\n const result: UIRectangle[] = []\n const sumOfWeights = (weights as number[]).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 as number\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) as number\n }\n else {\n resultWidth = totalRelativeWidth * (weights[i] as number / 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] as number\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: SizeNumberOrFunctionOrView[],\n paddings: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[] = 0,\n absoluteHeights: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[] = 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 paddings = paddings.map(padding => this._heightNumberFromSizeNumberOrFunctionOrView(padding))\n if (!(absoluteHeights instanceof Array) && IS_NOT_NIL(absoluteHeights)) {\n absoluteHeights = [absoluteHeights].arrayByRepeating(weights.length)\n }\n absoluteHeights = absoluteHeights.map(\n height => this._heightNumberFromSizeNumberOrFunctionOrView(height)\n )\n \n weights = weights.map(weight => this._heightNumberFromSizeNumberOrFunctionOrView(weight))\n const result: UIRectangle[] = []\n const sumOfWeights = (weights as number[]).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 as number\n const sumOfAbsoluteHeights = (absoluteHeights as number[]).summedValue\n const totalRelativeHeight = this.height - sumOfPaddings - sumOfAbsoluteHeights\n let previousCellMaxY = this.y\n \n for (let i = 0; i < weights.length; i++) {\n let resultHeight: number\n if (IS_NOT_NIL(absoluteHeights[i])) {\n \n resultHeight = (absoluteHeights[i] || 0) as number\n \n }\n else {\n \n resultHeight = totalRelativeHeight * (weights[i] as number / sumOfWeights)\n \n }\n \n const rectangle = this.rectangleWithHeight(resultHeight)\n \n let padding = 0\n if (paddings.length > i && paddings[i]) {\n padding = paddings[i] as number\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: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[] = 1,\n paddings?: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[],\n absoluteWidths?: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[]\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: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[] = 1,\n paddings?: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[],\n absoluteHeights?: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[]\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 _heightNumberFromSizeNumberOrFunctionOrView(height: SizeNumberOrFunctionOrView) {\n if (height instanceof Function) {\n return height(this.width)\n }\n if (height instanceof UIView) {\n return height.intrinsicContentHeight(this.width)\n }\n return height\n }\n \n _widthNumberFromSizeNumberOrFunctionOrView(width: SizeNumberOrFunctionOrView) {\n if (width instanceof Function) {\n return width(this.height)\n }\n if (width instanceof UIView) {\n return width.intrinsicContentWidth(this.height)\n }\n return width\n }\n \n rectangleForNextRow(padding: number = 0, height: SizeNumberOrFunctionOrView = this.height) {\n const heightNumber = this._heightNumberFromSizeNumberOrFunctionOrView(height)\n const result = this.rectangleWithY(this.max.y + padding)\n if (heightNumber != this.height) {\n result.height = heightNumber\n }\n return result\n }\n \n rectangleForNextColumn(padding: number = 0, width: SizeNumberOrFunctionOrView = this.width) {\n const widthNumber = this._widthNumberFromSizeNumberOrFunctionOrView(width)\n const result = this.rectangleWithX(this.max.x + padding)\n if (widthNumber != this.width) {\n result.width = widthNumber\n }\n return result\n }\n \n rectangleForPreviousRow(padding: number = 0, height: SizeNumberOrFunctionOrView = this.height) {\n const heightNumber = this._heightNumberFromSizeNumberOrFunctionOrView(height)\n const result = this.rectangleWithY(this.min.y - heightNumber - padding)\n if (heightNumber != this.height) {\n result.height = heightNumber\n }\n return result\n }\n \n rectangleForPreviousColumn(padding: number = 0, width: SizeNumberOrFunctionOrView = this.width) {\n const widthNumber = this._widthNumberFromSizeNumberOrFunctionOrView(width)\n const result = this.rectangleWithX(this.min.x - widthNumber - padding)\n if (widthNumber != this.width) {\n result.width = widthNumber\n }\n return result\n \n }\n \n /**\n * Distributes views vertically as a column, assigning frames and returning them.\n * Each view is positioned below the previous one with optional padding between them.\n * @param views - Array of views to distribute\n * @param paddings - Padding between views (single value or array of values)\n * @param absoluteHeights - Optional fixed heights for views (overrides intrinsic height)\n * @returns Array of rectangles representing the frame for each view\n */\n framesByDistributingViewsAsColumn(\n views: UIView[],\n paddings: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[] = 0,\n absoluteHeights: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[] = nil\n ) {\n const frames: UIRectangle[] = []\n let currentRectangle = this.copy()\n \n if (!(paddings instanceof Array)) {\n paddings = [paddings].arrayByRepeating(views.length - 1)\n }\n paddings = paddings.map(padding => this._heightNumberFromSizeNumberOrFunctionOrView(padding))\n \n if (!(absoluteHeights instanceof Array) && IS_NOT_NIL(absoluteHeights)) {\n absoluteHeights = [absoluteHeights].arrayByRepeating(views.length)\n }\n absoluteHeights = absoluteHeights.map(\n height => this._heightNumberFromSizeNumberOrFunctionOrView(height)\n )\n \n for (let i = 0; i < views.length; i++) {\n const frame = currentRectangle.rectangleWithHeight(views[i])\n \n if (IS_NOT_NIL(absoluteHeights[i])) {\n frame.height = absoluteHeights[i] as number\n }\n \n views[i].frame = frame\n frames.push(frame)\n \n const padding = (paddings[i] || 0) as number\n currentRectangle = frame.rectangleForNextRow(padding)\n }\n \n return frames\n }\n \n /**\n * Distributes views horizontally as a row, assigning frames and returning them.\n * Each view is positioned to the right of the previous one with optional padding between them.\n * @param views - Array of views to distribute\n * @param paddings - Padding between views (single value or array of values)\n * @param absoluteWidths - Optional fixed widths for views (overrides intrinsic width)\n * @returns Array of rectangles representing the frame for each view\n */\n framesByDistributingViewsAsRow(\n views: UIView[],\n paddings: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[] = 0,\n absoluteWidths: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[] = nil\n ) {\n const frames: UIRectangle[] = []\n let currentRectangle = this.copy()\n \n if (!(paddings instanceof Array)) {\n paddings = [paddings].arrayByRepeating(views.length - 1)\n }\n paddings = paddings.map(padding => this._widthNumberFromSizeNumberOrFunctionOrView(padding))\n \n if (!(absoluteWidths instanceof Array) && IS_NOT_NIL(absoluteWidths)) {\n absoluteWidths = [absoluteWidths].arrayByRepeating(views.length)\n }\n absoluteWidths = absoluteWidths.map(\n width => this._widthNumberFromSizeNumberOrFunctionOrView(width)\n )\n \n for (let i = 0; i < views.length; i++) {\n const frame = currentRectangle.rectangleWithWidth(views[i])\n \n if (IS_NOT_NIL(absoluteWidths[i])) {\n frame.width = absoluteWidths[i] as number\n }\n \n views[i].frame = frame\n frames.push(frame)\n \n const padding = (paddings[i] || 0) as number\n currentRectangle = frame.rectangleForNextColumn(padding)\n }\n \n return frames\n }\n \n /**\n * Distributes views as a grid (2D array), assigning frames and returning them.\n * The first index represents rows (vertical), the second index represents columns (horizontal).\n * Example: views[0] is the first row, views[0][0] is the first column in the first row.\n * Each row is laid out horizontally, and rows are stacked vertically.\n * @param views - 2D array where views[row][column] represents the grid structure\n * @param paddings - Vertical padding between rows (single value or array of values)\n * @param absoluteHeights - Optional fixed heights for each row (overrides intrinsic height)\n * @returns 2D array of rectangles where frames[row][column] matches views[row][column]\n */\n framesByDistributingViewsAsGrid(\n views: UIView[][],\n paddings: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[] = 0,\n absoluteHeights: SizeNumberOrFunctionOrView | SizeNumberOrFunctionOrView[] = nil\n ) {\n const frames: UIRectangle[][] = []\n let currentRowRectangle = this.copy()\n \n if (!(paddings instanceof Array)) {\n paddings = [paddings].arrayByRepeating(views.length - 1)\n }\n paddings = paddings.map(padding => this._heightNumberFromSizeNumberOrFunctionOrView(padding))\n \n if (!(absoluteHeights instanceof Array) && IS_NOT_NIL(absoluteHeights)) {\n absoluteHeights = [absoluteHeights].arrayByRepeating(views.length)\n }\n absoluteHeights = absoluteHeights.map(\n height => this._heightNumberFromSizeNumberOrFunctionOrView(height)\n )\n \n for (let i = 0; i < views.length; i++) {\n const rowViews = views[i]\n const rowFrames = currentRowRectangle.framesByDistributingViewsAsRow(rowViews)\n \n if (IS_NOT_NIL(absoluteHeights[i])) {\n const heightNumber = absoluteHeights[i] as number\n rowFrames.forEach((frame, j) => {\n frame.height = heightNumber\n rowViews[j].frame = frame\n })\n }\n \n frames.push(rowFrames)\n \n const padding = (paddings[i] || 0) as number\n const maxHeight = Math.max(...rowFrames.map(f => f.height))\n currentRowRectangle = currentRowRectangle.rectangleForNextRow(padding, maxHeight)\n }\n \n return frames\n }\n \n rectangleWithIntrinsicContentSizeForView(view: UIView, centeredOnXPosition = 0, centeredOnYPosition = 0) {\n const intrinsicContentSize = view.intrinsicContentSize()\n return this.rectangleWithHeight(intrinsicContentSize.height, centeredOnYPosition)\n .rectangleWithWidth(intrinsicContentSize.width, centeredOnXPosition)\n }\n \n settingMinHeight(minHeight?: number) {\n this.minHeight = minHeight\n return this\n }\n \n settingMinWidth(minWidth?: number) {\n this.minWidth = minWidth\n return this\n }\n \n settingMaxHeight(maxHeight?: number) {\n this.maxHeight = maxHeight\n return this\n }\n \n settingMaxWidth(maxWidth?: number) {\n this.maxWidth = maxWidth\n return this\n }\n \n rectangleByEnforcingMinAndMaxSizes(centeredOnXPosition = 0, centeredOnYPosition = 0) {\n return this.rectangleWithHeight(\n [\n [this.height, this.maxHeight].filter(value => IS_NOT_LIKE_NULL(value)).min(),\n this.minHeight\n ].filter(value => IS_NOT_LIKE_NULL(value)).max(),\n centeredOnYPosition\n ).rectangleWithWidth(\n [\n [this.width, this.maxWidth].filter(value => IS_NOT_LIKE_NULL(value)).min(),\n this.minWidth\n ].filter(value => IS_NOT_LIKE_NULL(value)).max(),\n centeredOnXPosition\n )\n }\n \n \n assignedAsFrameOfView(view: UIView, isWeakFrame = view.hasWeakFrame) {\n view.frame = this\n view.hasWeakFrame = isWeakFrame\n return this\n }\n \n \n override toString() {\n \n const result = \"[\" + this.class.name + \"] { x: \" + this.x + \", y: \" + this.y + \", \" +\n \"height: \" + this.height.toFixed(2) + \", width: \" + this.height.toFixed(2) + \" }\"\n \n return result\n \n }\n \n get [Symbol.toStringTag]() {\n return this.toString()\n }\n \n \n IF(condition: boolean): UIRectangleConditionalChain<UIRectangle> {\n const conditionalBlock = new UIRectangleConditionalBlock(this, condition)\n // @ts-ignore\n return conditionalBlock.getProxy()\n }\n \n // These will be intercepted by the proxy, but we define them for TypeScript\n ELSE_IF(condition: boolean): UIRectangle {\n return this\n }\n \n ELSE(): UIRectangle {\n return this\n }\n \n ENDIF(): this\n ENDIF<T, R>(performFunction: (result: T) => R): R\n ENDIF<T, R>(performFunction?: (result: T) => R): R | this {\n if (performFunction) {\n return performFunction(this as any)\n }\n return this\n }\n \n \n // Bounding box\n static boundingBoxForPoints(points: UIPoint[]) {\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 static boundingBoxForRectanglesAndPoints(rectanglesAndPoints: (UIPoint | UIRectangle)[]) {\n const result = new UIRectangle()\n for (let i = 0; i < rectanglesAndPoints.length; i++) {\n const rectangleOrPoint = rectanglesAndPoints[i]\n if (rectangleOrPoint instanceof UIRectangle) {\n result.updateByAddingPoint(rectangleOrPoint.min)\n result.updateByAddingPoint(rectangleOrPoint.max)\n }\n else {\n result.updateByAddingPoint(rectangleOrPoint)\n }\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// 1. Methods available when holding a UIRectangle\ntype RectangleChainMethods<TResult> = {\n [K in keyof UIRectangle as (\n K extends 'IF' | 'ELSE' | 'ELSE_IF' | 'ENDIF' ? never : K\n )]:\n UIRectangle[K] extends (...args: infer Args) => infer R\n ? R extends UIRectangle | UIRectangle[]\n // CHANGE: We do NOT add 'R' to 'TResult' here. We only update the current state (R).\n ? (...args: Args) => UIRectangleConditionalChain<R, TResult>\n : never\n : never\n};\n\n// 2. Methods available when holding a UIRectangle[]\ntype ArrayChainMethods<TResult> = {\n [K in keyof UIRectangle[]]:\n UIRectangle[][K] extends UIRectangle\n ? UIRectangleConditionalChain<UIRectangle, TResult> // No accumulation for properties\n : UIRectangle[][K] extends (...args: infer Args) => infer R\n ? R extends UIRectangle | UIRectangle[]\n // CHANGE: We do NOT add 'R' to 'TResult' here either.\n ? (...args: Args) => UIRectangleConditionalChain<R, TResult>\n : never\n : never\n};\n\n// 3. Methods available in both states (Control Flow + Transform)\ntype SharedChainMethods<TCurrent, TResult> = {\n // TRANSFORM acts as a standard method, it should not leak intermediate types into TResult\n TRANSFORM<R extends UIRectangle>(fn: (current: TCurrent) => R): UIRectangleConditionalChain<R, TResult>;\n \n // ELSE_IF marks the end of a branch. We MUST capture the current state (TCurrent) and add it to TResult.\n // The new chain starts with the original UIRectangle state for the next branch.\n ELSE_IF(condition: boolean): UIRectangleConditionalChain<UIRectangle, TResult | TCurrent>;\n \n // ELSE marks the end of a branch. Same logic as ELSE_IF.\n ELSE(): UIRectangleConditionalChain<UIRectangle, TResult | TCurrent>;\n \n // ENDIF marks the end of the block. Same logic: capture TCurrent into TResult.\n ENDIF(): TResult | TCurrent;\n ENDIF<R>(performFunction: (result: TResult | TCurrent) => R): R;\n};\n\n// 4. The Main Type (No changes needed here, just re-stating for context)\ntype UIRectangleConditionalChain<TCurrent, TResult = TCurrent> =\n (TCurrent extends UIRectangle ? RectangleChainMethods<TResult> : {}) &\n (TCurrent extends UIRectangle[] ? ArrayChainMethods<TResult> : {}) &\n SharedChainMethods<TCurrent, TResult>;\n\n\nclass UIRectangleConditionalBlock {\n // The value we are currently chaining on (can be UIRectangle or UIRectangle[])\n private currentResult: any\n // The value where the IF block started (needed to reset for ELSE branches)\n private originalResult: any\n private conditionMet: boolean\n \n constructor(initialResult: UIRectangle, condition: boolean) {\n this.originalResult = initialResult\n this.currentResult = initialResult\n this.conditionMet = condition\n }\n \n private createProxy(): UIRectangleConditionalChain<any, any> {\n const self = this\n \n // The target is irrelevant; we delegate everything to self.currentResult\n return new Proxy({}, {\n get(_, prop) {\n \n // 1. Control Flow Methods\n \n if (prop === 'TRANSFORM') {\n return <R extends UIRectangle>(fn: (current: any) => R) => {\n if (self.conditionMet) {\n const result = fn(self.currentResult)\n self.currentResult = result\n }\n return self.createProxy()\n }\n }\n \n if (prop === 'ELSE_IF') {\n return <U>(condition: boolean) => {\n // Only enter this branch if no previous branch has run\n if (!self.conditionMet) {\n self.conditionMet = condition\n // Reset the state to the original starting point for this new branch\n self.currentResult = self.originalResult\n }\n return self.createProxy()\n }\n }\n \n if (prop === 'ELSE') {\n return <U>() => {\n if (!self.conditionMet) {\n self.conditionMet = true\n // Reset the state to the original starting point\n self.currentResult = self.originalResult\n }\n return self.createProxy()\n }\n }\n \n if (prop === 'ENDIF') {\n function endif(): any\n function endif<R>(performFunction: (result: any) => R): R\n function endif<R>(performFunction?: (result: any) => R): R | any {\n return performFunction ? performFunction(self.currentResult) : self.currentResult\n }\n return endif\n }\n \n // 2. Forwarding to currentResult (Rectangle or Array)\n \n const value = self.currentResult[prop]\n \n // Case A: It's a function (method call)\n if (typeof value === 'function') {\n return (...args: any[]) => {\n if (self.conditionMet) {\n // Call the method on the CURRENT object, and update the state\n const result = value.apply(self.currentResult, args)\n self.currentResult = result\n }\n return self.createProxy()\n }\n }\n \n // Case B: It's a property (getter)\n // Accessing a property acts as a transition (e.g. accessing .lastElement)\n if (self.conditionMet) {\n self.currentResult = value\n }\n \n return self.createProxy()\n }\n }) as any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boolean> | boolean);
|
|
9
9
|
isInitialized: boolean;
|
|
10
|
+
deleteOnUnload: boolean;
|
|
11
|
+
deleteInstance: () => void;
|
|
10
12
|
}
|
|
11
13
|
export interface UIRootViewControllerLazyViewControllersObject {
|
|
12
14
|
[x: string]: UIRootViewControllerLazyViewControllerObject<typeof UIViewController>;
|
|
@@ -24,7 +26,10 @@ export declare class UIRootViewController extends UIViewController {
|
|
|
24
26
|
_detailsViewController?: UIViewController;
|
|
25
27
|
detailsViewControllers: UIRootViewControllerLazyViewControllersObject;
|
|
26
28
|
constructor(view: UIView);
|
|
27
|
-
lazyViewControllerObjectWithClass<T extends typeof UIViewController>(classObject: T,
|
|
29
|
+
lazyViewControllerObjectWithClass<T extends typeof UIViewController>(classObject: T, options?: {
|
|
30
|
+
shouldShow?: () => (Promise<boolean> | boolean);
|
|
31
|
+
deleteOnUnload?: boolean;
|
|
32
|
+
}): UIRootViewControllerLazyViewControllerObject<T>;
|
|
28
33
|
handleRoute(route: UIRoute): Promise<void>;
|
|
29
34
|
setContentViewControllerForRoute(route: UIRoute): Promise<void>;
|
|
30
35
|
setDetailsViewControllerForRoute(route: UIRoute): Promise<void>;
|
|
@@ -79,23 +79,36 @@ class UIRootViewController extends import_UIViewController.UIViewController {
|
|
|
79
79
|
this.detailsViewControllers = {};
|
|
80
80
|
this.view.addSubview(this.backgroundView);
|
|
81
81
|
}
|
|
82
|
-
lazyViewControllerObjectWithClass(classObject,
|
|
82
|
+
lazyViewControllerObjectWithClass(classObject, options = {}) {
|
|
83
|
+
var _a, _b;
|
|
84
|
+
const shouldShow = (_a = options.shouldShow) != null ? _a : () => import_UIObject.YES;
|
|
85
|
+
const deleteOnUnload = (_b = options.deleteOnUnload) != null ? _b : import_UIObject.NO;
|
|
83
86
|
const result = {
|
|
84
87
|
class: classObject,
|
|
85
88
|
instance: import_UIObject.nil,
|
|
86
89
|
shouldShow,
|
|
87
|
-
isInitialized: import_UIObject.NO
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
return new classObject(
|
|
94
|
-
new import_UIView.UIView(classObject.name.replace("ViewController", "View"))
|
|
95
|
-
);
|
|
90
|
+
isInitialized: import_UIObject.NO,
|
|
91
|
+
deleteOnUnload,
|
|
92
|
+
deleteInstance: () => {
|
|
93
|
+
if (result.isInitialized) {
|
|
94
|
+
result.isInitialized = import_UIObject.NO;
|
|
95
|
+
initializeLazyInstance();
|
|
96
96
|
}
|
|
97
|
-
|
|
98
|
-
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const initializeLazyInstance = () => {
|
|
100
|
+
import_UIObject.UIObject.configureWithObject(result, {
|
|
101
|
+
instance: (0, import_UIObject.LAZY_VALUE)(
|
|
102
|
+
() => {
|
|
103
|
+
result.isInitialized = import_UIObject.YES;
|
|
104
|
+
return new classObject(
|
|
105
|
+
new import_UIView.UIView(classObject.name.replace("ViewController", "View"))
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
initializeLazyInstance();
|
|
99
112
|
return result;
|
|
100
113
|
}
|
|
101
114
|
handleRoute(route) {
|
|
@@ -116,6 +129,14 @@ class UIRootViewController extends import_UIViewController.UIViewController {
|
|
|
116
129
|
),
|
|
117
130
|
this.contentViewControllers.mainViewController
|
|
118
131
|
);
|
|
132
|
+
if ((0, import_UIObject.IS)(this._contentViewController) && this._contentViewController !== contentViewControllerObject.instance) {
|
|
133
|
+
const oldViewControllerObject = this.contentViewControllers.allValues.find(
|
|
134
|
+
(value) => value.isInitialized && value.instance === this._contentViewController
|
|
135
|
+
);
|
|
136
|
+
if (oldViewControllerObject == null ? void 0 : oldViewControllerObject.deleteOnUnload) {
|
|
137
|
+
oldViewControllerObject.deleteInstance();
|
|
138
|
+
}
|
|
139
|
+
}
|
|
119
140
|
this.contentViewController = contentViewControllerObject.instance;
|
|
120
141
|
});
|
|
121
142
|
}
|
|
@@ -129,12 +150,26 @@ class UIRootViewController extends import_UIViewController.UIViewController {
|
|
|
129
150
|
)
|
|
130
151
|
);
|
|
131
152
|
if ((0, import_UIObject.IS)(route) && (0, import_UIObject.IS)(this.detailsViewController) && (0, import_UIObject.IS_NOT)(detailsViewControllerObject)) {
|
|
153
|
+
const oldViewControllerObject = this.detailsViewControllers.allValues.find(
|
|
154
|
+
(value) => value.isInitialized && value.instance === this._detailsViewController
|
|
155
|
+
);
|
|
156
|
+
if (oldViewControllerObject == null ? void 0 : oldViewControllerObject.deleteOnUnload) {
|
|
157
|
+
oldViewControllerObject.deleteInstance();
|
|
158
|
+
}
|
|
132
159
|
this.detailsViewController = void 0;
|
|
133
160
|
this._detailsDialogView.dismiss();
|
|
134
161
|
this.view.setNeedsLayout();
|
|
135
162
|
return;
|
|
136
163
|
}
|
|
137
|
-
this.
|
|
164
|
+
if ((0, import_UIObject.IS)(this._detailsViewController) && this._detailsViewController !== (detailsViewControllerObject == null ? void 0 : detailsViewControllerObject.instance)) {
|
|
165
|
+
const oldViewControllerObject = this.detailsViewControllers.allValues.find(
|
|
166
|
+
(value) => value.isInitialized && value.instance === this._detailsViewController
|
|
167
|
+
);
|
|
168
|
+
if (oldViewControllerObject == null ? void 0 : oldViewControllerObject.deleteOnUnload) {
|
|
169
|
+
oldViewControllerObject.deleteInstance();
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
this.detailsViewController = detailsViewControllerObject == null ? void 0 : detailsViewControllerObject.instance;
|
|
138
173
|
});
|
|
139
174
|
}
|
|
140
175
|
get contentViewController() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../scripts/UIRootViewController.ts"],
|
|
4
|
-
"sourcesContent": ["import { UIColor } from \"./UIColor\"\nimport { UICore } from \"./UICore\"\nimport { UIDialogView } from \"./UIDialogView\"\nimport { EXTEND, FIRST, FIRST_OR_NIL, IS, IS_NOT, LAZY_VALUE, nil, NO, UIObject, wrapInNil, YES } from \"./UIObject\"\nimport { UIRectangle } from \"./UIRectangle\"\nimport { UIRoute } from \"./UIRoute\"\nimport { UIView } from \"./UIView\"\nimport { UIViewController } from \"./UIViewController\"\n\n\nexport interface UIRootViewControllerLazyViewControllerObject<T extends typeof UIViewController> {\n instance: InstanceType<T>;\n class: T;\n shouldShow: () => (Promise<boolean> | boolean);\n isInitialized: boolean\n}\n\n\nexport interface UIRootViewControllerLazyViewControllersObject {\n [x: string]: UIRootViewControllerLazyViewControllerObject<typeof UIViewController>\n}\n\n\nexport interface UIRootViewControllerLazyContentViewControllersObject extends UIRootViewControllerLazyViewControllersObject {\n mainViewController: UIRootViewControllerLazyViewControllerObject<typeof UIViewController>\n}\n\n\nexport class UIRootViewController extends UIViewController {\n \n topBarView?: UIView\n backgroundView: UIView = new UIView(this.view.elementID + \"BackgroundView\").configuredWithObject({\n style: {\n background: \"linear-gradient(\" + UIColor.whiteColor.stringValue + \", \" + UIColor.blueColor.stringValue + \")\",\n backgroundSize: \"cover\",\n backgroundRepeat: \"no-repeat\"\n }\n })\n bottomBarView?: UIView\n \n _contentViewController?: UIViewController\n contentViewControllers: UIRootViewControllerLazyContentViewControllersObject = {\n mainViewController: this.lazyViewControllerObjectWithClass(UIViewController)\n }\n \n _detailsDialogView: UIDialogView = new UIDialogView(this.view.elementID + \"DetailsDialogView\")\n .configuredWithObject({\n dismiss: EXTEND(() => {\n const route = UIRoute.currentRoute\n this.detailsViewControllers.allValues.forEach(\n value => route.routeByRemovingComponentNamed(value.class.routeComponentName)\n )\n route.apply()\n }\n )\n })\n _detailsViewController?: UIViewController\n detailsViewControllers: UIRootViewControllerLazyViewControllersObject = {}\n \n \n constructor(view: UIView) {\n \n super(view)\n \n this.view.addSubview(this.backgroundView)\n \n }\n \n \n lazyViewControllerObjectWithClass<T extends typeof UIViewController>(\n classObject: T,\n shouldShow: () => (Promise<boolean> | boolean) = () => YES\n ): UIRootViewControllerLazyViewControllerObject<T> {\n const result: UIRootViewControllerLazyViewControllerObject<T> = {\n class: classObject,\n instance: nil,\n shouldShow: shouldShow,\n isInitialized: NO\n }\n UIObject.configureWithObject(result, {\n // @ts-ignore\n instance: LAZY_VALUE(\n () => {\n result.isInitialized = YES\n return new classObject(\n new UIView(classObject.name.replace(\"ViewController\", \"View\"))\n )\n }\n )\n })\n return result\n }\n \n \n override async handleRoute(route: UIRoute) {\n \n await super.handleRoute(route)\n \n UICore.languageService.updateCurrentLanguageKey()\n \n // Show content view\n await this.setContentViewControllerForRoute(route)\n \n await this.setDetailsViewControllerForRoute(route)\n \n }\n \n \n async setContentViewControllerForRoute(route: UIRoute) {\n const contentViewControllerObject = FIRST(\n await this.contentViewControllers.allValues.findAsyncSequential(\n async value => IS(route.componentWithViewController(value.class)) && await value.shouldShow()\n ),\n this.contentViewControllers.mainViewController\n )\n this.contentViewController = contentViewControllerObject.instance\n }\n \n async setDetailsViewControllerForRoute(route: UIRoute) {\n const detailsViewControllerObject = FIRST_OR_NIL(\n await this.detailsViewControllers.allValues.findAsyncSequential(\n async value => IS(route.componentWithViewController(value.class)) && await value.shouldShow()\n )\n )\n if (IS(route) && IS(this.detailsViewController) && IS_NOT(detailsViewControllerObject)) {\n this.detailsViewController = undefined\n this._detailsDialogView.dismiss()\n this.view.setNeedsLayout()\n return\n }\n this.detailsViewController = detailsViewControllerObject.instance\n }\n \n get contentViewController(): UIViewController | undefined {\n return this._contentViewController\n }\n \n set contentViewController(controller: UIViewController) {\n \n if (this.contentViewController == controller) {\n return\n }\n \n if (this.contentViewController) {\n this.removeChildViewController(this.contentViewController)\n }\n \n this._contentViewController = controller\n this.addChildViewControllerInContainer(controller, this.backgroundView)\n this._triggerLayoutViewSubviews()\n \n if (this.contentViewController) {\n this.contentViewController.view.style.boxShadow = \"0 3px 6px 0 rgba(0, 0, 0, 0.1)\"\n }\n \n this.view.setNeedsLayout()\n \n }\n \n \n get detailsViewController(): UIViewController | undefined {\n return this._detailsViewController\n }\n \n set detailsViewController(controller: UIViewController | undefined) {\n \n if (this.detailsViewController == controller) {\n return\n }\n \n if (IS(this.detailsViewController)) {\n this.removeChildViewController(this.detailsViewController)\n }\n \n this._detailsViewController = controller\n \n if (!IS(controller)) {\n return\n }\n \n this.addChildViewControllerInDialogView(controller, this._detailsDialogView)\n this._triggerLayoutViewSubviews()\n \n FIRST_OR_NIL(this.detailsViewController).view.style.borderRadius = \"5px\"\n \n this._detailsDialogView.showInView(this.view, YES)\n \n }\n \n updatePageScale(\n {\n minScaleWidth = 700,\n maxScaleWidth = 1500,\n minScale = 0.7,\n maxScale = 1\n } = {}\n ) {\n const actualPageWidth = window.innerWidth ?? (UIView.pageWidth * UIView.pageScale).integerValue\n let scale = minScale + (maxScale - minScale) *\n ((actualPageWidth - minScaleWidth) / (maxScaleWidth - minScaleWidth))\n scale = Math.min(scale, maxScale)\n scale = Math.max(scale, minScale)\n UIView.pageScale = scale\n }\n \n \n performDefaultLayout(\n {\n paddingLength = 20,\n contentViewMaxWidth = 1000,\n topBarHeight = 65,\n bottomBarMinHeight = 100\n } = {}\n ) {\n \n // View bounds\n const bounds = this.view.bounds\n \n if (this.topBarView) {\n this.topBarView.frame = new UIRectangle(0, 0, topBarHeight, bounds.width)\n }\n \n this.backgroundView.style.top = \"\" + (this.topBarView?.frame.height.integerValue ?? 0) + \"px\"\n this.backgroundView.style.width = \"100%\"\n this.backgroundView.style.height = \"fit-content\"\n this.backgroundView.style.minHeight = \"\" +\n (bounds.height - (this.topBarView?.frame.height ?? 0) - (this.bottomBarView?.frame.height ?? 0)).integerValue + \"px\"\n \n const contentView: UIView = this.contentViewController?.view ?? nil\n \n //var contentViewStyleString = contentView.viewHTMLElement.style.cssText\n \n contentView.style.position = \"relative\"\n contentView.style.bottom = \"0\"\n contentView.style.top = \"0\"\n contentView.style.width = \"100%\"\n contentView.setPaddings(nil, nil, paddingLength, nil)\n \n \n if (contentViewMaxWidth < this.backgroundView.bounds.width) {\n \n contentView.style.marginBottom = \"\" +\n Math.min(\n (this.backgroundView.bounds.width - contentViewMaxWidth) * 0.5,\n paddingLength\n ).integerValue + \"px\"\n contentView.style.marginTop = \"\" +\n Math.min(\n (this.backgroundView.bounds.width - contentViewMaxWidth) * 0.5,\n paddingLength\n ).integerValue + \"px\"\n contentView.style.maxWidth = contentViewMaxWidth + \"px\"\n \n contentView.style.left = \"\" +\n ((this.backgroundView.bounds.width - contentView.bounds.width) * 0.5).integerValue +\n \"px\"\n \n }\n else {\n \n contentView.style.margin = \"\"\n contentView.style.left = \"\"\n contentView.style.maxWidth = \"\"\n \n }\n \n // if (contentViewStyleString != contentView.style.cssText) {\n //\n // contentView.setNeedsLayout()\n //\n // }\n \n \n \n // Triggering immediate layout to ensure that the intrinsicContentHeight calculations work well\n this.contentViewController?._triggerLayoutViewSubviews()\n \n let contentViewControllerViewHeight = contentView.intrinsicContentHeight(\n contentView.bounds.width\n )\n \n const detailsViewControllerViewHeight = FIRST_OR_NIL(this.detailsViewController).view.intrinsicContentHeight(\n contentView.bounds.width)\n if (detailsViewControllerViewHeight > contentViewControllerViewHeight) {\n contentViewControllerViewHeight = detailsViewControllerViewHeight\n }\n \n \n contentView.style.height = \"\" + contentViewControllerViewHeight.integerValue + \"px\"\n //contentView.setNeedsLayout()\n \n if (IS(this.detailsViewController)) {\n \n contentView.style.transform = \"translateX(\" + 0 + \"px)\"\n \n this.detailsViewController.view.frame = this.backgroundView.frame.rectangleWithInset(\n paddingLength\n ).rectangleWithWidth(\n contentView.bounds.width,\n 0.5\n ).rectangleWithHeight(\n Math.max(\n this.detailsViewController.view.intrinsicContentHeight(\n this.detailsViewController.view.bounds.width\n ),\n contentView.bounds.height\n )\n )\n \n }\n else {\n \n contentView.style.transform = \"translateX(\" + 0 + \"px)\"\n \n }\n \n if (this.bottomBarView) {\n this.bottomBarView.frame = this.backgroundView.frame.rectangleWithY(\n this.backgroundView.frame.max.y\n ).rectangleWithHeight(\n Math.max(bottomBarMinHeight, this.bottomBarView.intrinsicContentHeight(this.backgroundView.frame.width))\n )\n }\n \n \n wrapInNil(this._detailsDialogView).setMaxSizes(this.bottomBarView?.frame.max.y ?? 0)\n \n }\n \n \n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAwB;AACxB,oBAAuB;AACvB,0BAA6B;AAC7B,sBAAuG;AACvG,yBAA4B;AAC5B,qBAAwB;AACxB,oBAAuB;AACvB,8BAAiC;
|
|
4
|
+
"sourcesContent": ["import { UIColor } from \"./UIColor\"\nimport { UICore } from \"./UICore\"\nimport { UIDialogView } from \"./UIDialogView\"\nimport { EXTEND, FIRST, FIRST_OR_NIL, IS, IS_NOT, LAZY_VALUE, nil, NO, UIObject, wrapInNil, YES } from \"./UIObject\"\nimport { UIRectangle } from \"./UIRectangle\"\nimport { UIRoute } from \"./UIRoute\"\nimport { UIView } from \"./UIView\"\nimport { UIViewController } from \"./UIViewController\"\n\n\nexport interface UIRootViewControllerLazyViewControllerObject<T extends typeof UIViewController> {\n instance: InstanceType<T>;\n class: T;\n shouldShow: () => (Promise<boolean> | boolean);\n isInitialized: boolean;\n deleteOnUnload: boolean;\n deleteInstance: () => void\n}\n\n\nexport interface UIRootViewControllerLazyViewControllersObject {\n [x: string]: UIRootViewControllerLazyViewControllerObject<typeof UIViewController>\n}\n\n\nexport interface UIRootViewControllerLazyContentViewControllersObject extends UIRootViewControllerLazyViewControllersObject {\n mainViewController: UIRootViewControllerLazyViewControllerObject<typeof UIViewController>\n}\n\n\nexport class UIRootViewController extends UIViewController {\n \n topBarView?: UIView\n backgroundView: UIView = new UIView(this.view.elementID + \"BackgroundView\").configuredWithObject({\n style: {\n background: \"linear-gradient(\" + UIColor.whiteColor.stringValue + \", \" + UIColor.blueColor.stringValue + \")\",\n backgroundSize: \"cover\",\n backgroundRepeat: \"no-repeat\"\n }\n })\n bottomBarView?: UIView\n \n _contentViewController?: UIViewController\n contentViewControllers: UIRootViewControllerLazyContentViewControllersObject = {\n mainViewController: this.lazyViewControllerObjectWithClass(UIViewController)\n }\n \n _detailsDialogView: UIDialogView = new UIDialogView(this.view.elementID + \"DetailsDialogView\")\n .configuredWithObject({\n dismiss: EXTEND(() => {\n const route = UIRoute.currentRoute\n this.detailsViewControllers.allValues.forEach(\n value => route.routeByRemovingComponentNamed(value.class.routeComponentName)\n )\n route.apply()\n }\n )\n })\n _detailsViewController?: UIViewController\n detailsViewControllers: UIRootViewControllerLazyViewControllersObject = {}\n \n \n constructor(view: UIView) {\n \n super(view)\n \n this.view.addSubview(this.backgroundView)\n \n }\n \n \n lazyViewControllerObjectWithClass<T extends typeof UIViewController>(\n classObject: T,\n options: {\n shouldShow?: () => (Promise<boolean> | boolean),\n deleteOnUnload?: boolean\n } = {}\n ): UIRootViewControllerLazyViewControllerObject<T> {\n const shouldShow = options.shouldShow ?? (() => YES)\n const deleteOnUnload = options.deleteOnUnload ?? NO\n \n const result: UIRootViewControllerLazyViewControllerObject<T> = {\n class: classObject,\n instance: nil,\n shouldShow: shouldShow,\n isInitialized: NO,\n deleteOnUnload: deleteOnUnload,\n deleteInstance: () => {\n if (result.isInitialized) {\n result.isInitialized = NO\n initializeLazyInstance()\n }\n }\n }\n \n const initializeLazyInstance = () => {\n UIObject.configureWithObject(result, {\n // @ts-ignore\n instance: LAZY_VALUE(\n () => {\n result.isInitialized = YES\n return new classObject(\n new UIView(classObject.name.replace(\"ViewController\", \"View\"))\n )\n }\n )\n })\n }\n \n initializeLazyInstance()\n \n return result\n }\n \n \n override async handleRoute(route: UIRoute) {\n \n await super.handleRoute(route)\n \n UICore.languageService.updateCurrentLanguageKey()\n \n // Show content view\n await this.setContentViewControllerForRoute(route)\n \n await this.setDetailsViewControllerForRoute(route)\n \n }\n \n \n async setContentViewControllerForRoute(route: UIRoute) {\n const contentViewControllerObject = FIRST(\n await this.contentViewControllers.allValues.findAsyncSequential(\n async value => IS(route.componentWithViewController(value.class)) && await value.shouldShow()\n ),\n this.contentViewControllers.mainViewController\n )\n \n // Delete old view controller if it has deleteOnUnload flag set\n if (IS(this._contentViewController) && this._contentViewController !== contentViewControllerObject.instance) {\n const oldViewControllerObject = this.contentViewControllers.allValues.find(\n value => value.isInitialized && value.instance === this._contentViewController\n )\n if (oldViewControllerObject?.deleteOnUnload) {\n oldViewControllerObject.deleteInstance()\n }\n }\n \n this.contentViewController = contentViewControllerObject.instance\n }\n \n async setDetailsViewControllerForRoute(route: UIRoute) {\n const detailsViewControllerObject = FIRST_OR_NIL(\n await this.detailsViewControllers.allValues.findAsyncSequential(\n async value => IS(route.componentWithViewController(value.class)) && await value.shouldShow()\n )\n )\n if (IS(route) && IS(this.detailsViewController) && IS_NOT(detailsViewControllerObject)) {\n // Delete old details view controller if it has deleteOnUnload flag set\n const oldViewControllerObject = this.detailsViewControllers.allValues.find(\n value => value.isInitialized && value.instance === this._detailsViewController\n )\n if (oldViewControllerObject?.deleteOnUnload) {\n oldViewControllerObject.deleteInstance()\n }\n \n this.detailsViewController = undefined\n this._detailsDialogView.dismiss()\n this.view.setNeedsLayout()\n return\n }\n \n // Delete old details view controller if it has deleteOnUnload flag set and is being replaced\n if (IS(this._detailsViewController) && this._detailsViewController !== detailsViewControllerObject?.instance) {\n const oldViewControllerObject = this.detailsViewControllers.allValues.find(\n value => value.isInitialized && value.instance === this._detailsViewController\n )\n if (oldViewControllerObject?.deleteOnUnload) {\n oldViewControllerObject.deleteInstance()\n }\n }\n \n this.detailsViewController = detailsViewControllerObject?.instance\n }\n \n get contentViewController(): UIViewController | undefined {\n return this._contentViewController\n }\n \n set contentViewController(controller: UIViewController) {\n \n if (this.contentViewController == controller) {\n return\n }\n \n if (this.contentViewController) {\n this.removeChildViewController(this.contentViewController)\n }\n \n this._contentViewController = controller\n this.addChildViewControllerInContainer(controller, this.backgroundView)\n this._triggerLayoutViewSubviews()\n \n if (this.contentViewController) {\n this.contentViewController.view.style.boxShadow = \"0 3px 6px 0 rgba(0, 0, 0, 0.1)\"\n }\n \n this.view.setNeedsLayout()\n \n }\n \n \n get detailsViewController(): UIViewController | undefined {\n return this._detailsViewController\n }\n \n set detailsViewController(controller: UIViewController | undefined) {\n \n if (this.detailsViewController == controller) {\n return\n }\n \n if (IS(this.detailsViewController)) {\n this.removeChildViewController(this.detailsViewController)\n }\n \n this._detailsViewController = controller\n \n if (!IS(controller)) {\n return\n }\n \n this.addChildViewControllerInDialogView(controller, this._detailsDialogView)\n this._triggerLayoutViewSubviews()\n \n FIRST_OR_NIL(this.detailsViewController).view.style.borderRadius = \"5px\"\n \n this._detailsDialogView.showInView(this.view, YES)\n \n }\n \n updatePageScale(\n {\n minScaleWidth = 700,\n maxScaleWidth = 1500,\n minScale = 0.7,\n maxScale = 1\n } = {}\n ) {\n const actualPageWidth = window.innerWidth ?? (UIView.pageWidth * UIView.pageScale).integerValue\n let scale = minScale + (maxScale - minScale) *\n ((actualPageWidth - minScaleWidth) / (maxScaleWidth - minScaleWidth))\n scale = Math.min(scale, maxScale)\n scale = Math.max(scale, minScale)\n UIView.pageScale = scale\n }\n \n \n performDefaultLayout(\n {\n paddingLength = 20,\n contentViewMaxWidth = 1000,\n topBarHeight = 65,\n bottomBarMinHeight = 100\n } = {}\n ) {\n \n // View bounds\n const bounds = this.view.bounds\n \n if (this.topBarView) {\n this.topBarView.frame = new UIRectangle(0, 0, topBarHeight, bounds.width)\n }\n \n this.backgroundView.style.top = \"\" + (this.topBarView?.frame.height.integerValue ?? 0) + \"px\"\n this.backgroundView.style.width = \"100%\"\n this.backgroundView.style.height = \"fit-content\"\n this.backgroundView.style.minHeight = \"\" +\n (bounds.height - (this.topBarView?.frame.height ?? 0) - (this.bottomBarView?.frame.height ?? 0)).integerValue + \"px\"\n \n const contentView: UIView = this.contentViewController?.view ?? nil\n \n //var contentViewStyleString = contentView.viewHTMLElement.style.cssText\n \n contentView.style.position = \"relative\"\n contentView.style.bottom = \"0\"\n contentView.style.top = \"0\"\n contentView.style.width = \"100%\"\n contentView.setPaddings(nil, nil, paddingLength, nil)\n \n \n if (contentViewMaxWidth < this.backgroundView.bounds.width) {\n \n contentView.style.marginBottom = \"\" +\n Math.min(\n (this.backgroundView.bounds.width - contentViewMaxWidth) * 0.5,\n paddingLength\n ).integerValue + \"px\"\n contentView.style.marginTop = \"\" +\n Math.min(\n (this.backgroundView.bounds.width - contentViewMaxWidth) * 0.5,\n paddingLength\n ).integerValue + \"px\"\n contentView.style.maxWidth = contentViewMaxWidth + \"px\"\n \n contentView.style.left = \"\" +\n ((this.backgroundView.bounds.width - contentView.bounds.width) * 0.5).integerValue +\n \"px\"\n \n }\n else {\n \n contentView.style.margin = \"\"\n contentView.style.left = \"\"\n contentView.style.maxWidth = \"\"\n \n }\n \n // if (contentViewStyleString != contentView.style.cssText) {\n //\n // contentView.setNeedsLayout()\n //\n // }\n \n \n \n // Triggering immediate layout to ensure that the intrinsicContentHeight calculations work well\n this.contentViewController?._triggerLayoutViewSubviews()\n \n let contentViewControllerViewHeight = contentView.intrinsicContentHeight(\n contentView.bounds.width\n )\n \n const detailsViewControllerViewHeight = FIRST_OR_NIL(this.detailsViewController).view.intrinsicContentHeight(\n contentView.bounds.width)\n if (detailsViewControllerViewHeight > contentViewControllerViewHeight) {\n contentViewControllerViewHeight = detailsViewControllerViewHeight\n }\n \n \n contentView.style.height = \"\" + contentViewControllerViewHeight.integerValue + \"px\"\n //contentView.setNeedsLayout()\n \n if (IS(this.detailsViewController)) {\n \n contentView.style.transform = \"translateX(\" + 0 + \"px)\"\n \n this.detailsViewController.view.frame = this.backgroundView.frame.rectangleWithInset(\n paddingLength\n ).rectangleWithWidth(\n contentView.bounds.width,\n 0.5\n ).rectangleWithHeight(\n Math.max(\n this.detailsViewController.view.intrinsicContentHeight(\n this.detailsViewController.view.bounds.width\n ),\n contentView.bounds.height\n )\n )\n \n }\n else {\n \n contentView.style.transform = \"translateX(\" + 0 + \"px)\"\n \n }\n \n if (this.bottomBarView) {\n this.bottomBarView.frame = this.backgroundView.frame.rectangleWithY(\n this.backgroundView.frame.max.y\n ).rectangleWithHeight(\n Math.max(bottomBarMinHeight, this.bottomBarView.intrinsicContentHeight(this.backgroundView.frame.width))\n )\n }\n \n \n wrapInNil(this._detailsDialogView).setMaxSizes(this.bottomBarView?.frame.max.y ?? 0)\n \n }\n \n \n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAwB;AACxB,oBAAuB;AACvB,0BAA6B;AAC7B,sBAAuG;AACvG,yBAA4B;AAC5B,qBAAwB;AACxB,oBAAuB;AACvB,8BAAiC;AAuB1B,MAAM,6BAA6B,yCAAiB;AAAA,EAgCvD,YAAY,MAAc;AAEtB,UAAM,IAAI;AA/Bd,0BAAyB,IAAI,qBAAO,KAAK,KAAK,YAAY,gBAAgB,EAAE,qBAAqB;AAAA,MAC7F,OAAO;AAAA,QACH,YAAY,qBAAqB,uBAAQ,WAAW,cAAc,OAAO,uBAAQ,UAAU,cAAc;AAAA,QACzG,gBAAgB;AAAA,QAChB,kBAAkB;AAAA,MACtB;AAAA,IACJ,CAAC;AAID,kCAA+E;AAAA,MAC3E,oBAAoB,KAAK,kCAAkC,wCAAgB;AAAA,IAC/E;AAEA,8BAAmC,IAAI,iCAAa,KAAK,KAAK,YAAY,mBAAmB,EACxF,qBAAqB;AAAA,MAClB,aAAS;AAAA,QAAO,MAAM;AACd,gBAAM,QAAQ,uBAAQ;AACtB,eAAK,uBAAuB,UAAU;AAAA,YAClC,WAAS,MAAM,8BAA8B,MAAM,MAAM,kBAAkB;AAAA,UAC/E;AACA,gBAAM,MAAM;AAAA,QAChB;AAAA,MACJ;AAAA,IACJ,CAAC;AAEL,kCAAwE,CAAC;AAOrE,SAAK,KAAK,WAAW,KAAK,cAAc;AAAA,EAE5C;AAAA,EAGA,kCACI,aACA,UAGI,CAAC,GAC0C;AA7EvD;AA8EQ,UAAM,cAAa,aAAQ,eAAR,YAAuB,MAAM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C;AAAA,IACtC;AAGA,gBAAY,MAAM,SAAS,KAAK,gCAAgC,eAAe;AAG/E,YAAI,oBAAG,KAAK,qBAAqB,GAAG;AAEhC,kBAAY,MAAM,YAAY,gBAAgB,IAAI;AAElD,WAAK,sBAAsB,KAAK,QAAQ,KAAK,eAAe,MAAM;AAAA,QAC9D;AAAA,MACJ,EAAE;AAAA,QACE,YAAY,OAAO;AAAA,QACnB;AAAA,MACJ,EAAE;AAAA,QACE,KAAK;AAAA,UACD,KAAK,sBAAsB,KAAK;AAAA,YAC5B,KAAK,sBAAsB,KAAK,OAAO;AAAA,UAC3C;AAAA,UACA,YAAY,OAAO;AAAA,QACvB;AAAA,MACJ;AAAA,IAEJ,OACK;AAED,kBAAY,MAAM,YAAY,gBAAgB,IAAI;AAAA,IAEtD;AAEA,QAAI,KAAK,eAAe;AACpB,WAAK,cAAc,QAAQ,KAAK,eAAe,MAAM;AAAA,QACjD,KAAK,eAAe,MAAM,IAAI;AAAA,MAClC,EAAE;AAAA,QACE,KAAK,IAAI,oBAAoB,KAAK,cAAc,uBAAuB,KAAK,eAAe,MAAM,KAAK,CAAC;AAAA,MAC3G;AAAA,IACJ;AAGA,mCAAU,KAAK,kBAAkB,EAAE,aAAY,gBAAK,kBAAL,mBAAoB,MAAM,IAAI,MAA9B,YAAmC,CAAC;AAAA,EAEvF;AAGJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -66,7 +66,7 @@ export declare class UITableView extends UINativeScrollView {
|
|
|
66
66
|
wasRemovedFromViewTree(): void;
|
|
67
67
|
setFrame(rectangle: UIRectangle, zIndex?: number, performUncheckedLayout?: boolean): void;
|
|
68
68
|
didReceiveBroadcastEvent(event: UIViewBroadcastEvent): void;
|
|
69
|
-
|
|
69
|
+
clearIntrinsicSizeCache(): void;
|
|
70
70
|
private _layoutAllRows;
|
|
71
71
|
private _animateLayoutAllRows;
|
|
72
72
|
layoutSubviews(): void;
|
|
@@ -131,6 +131,7 @@ class UITableView extends import_UINativeScrollView.UINativeScrollView {
|
|
|
131
131
|
var _a;
|
|
132
132
|
if ((_a = this._rowPositions) == null ? void 0 : _a[index]) {
|
|
133
133
|
this._rowPositions[index].isValid = import_UIObject.NO;
|
|
134
|
+
this._rowPositions.slice(index, -1).everyElement.isValid = import_UIObject.NO;
|
|
134
135
|
}
|
|
135
136
|
this._highestValidRowPositionIndex = Math.min(this._highestValidRowPositionIndex, index - 1);
|
|
136
137
|
this._needsDrawingOfVisibleRowsBeforeLayout = import_UIObject.YES;
|
|
@@ -400,8 +401,8 @@ class UITableView extends import_UINativeScrollView.UINativeScrollView {
|
|
|
400
401
|
this.reloadData();
|
|
401
402
|
}
|
|
402
403
|
}
|
|
403
|
-
|
|
404
|
-
super.
|
|
404
|
+
clearIntrinsicSizeCache() {
|
|
405
|
+
super.clearIntrinsicSizeCache();
|
|
405
406
|
this.invalidateSizeOfRowWithIndex(0);
|
|
406
407
|
}
|
|
407
408
|
_layoutAllRows(positions = this._rowPositions) {
|