uicore-ts 1.1.328 → 1.1.335

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.
@@ -68,9 +68,9 @@ class UIRootViewController extends import_UIViewController.UIViewController {
68
68
  this._detailsDialogView = new import_UIDialogView.UIDialogView(this.view.elementID + "DetailsDialogView").configuredWithObject({
69
69
  dismiss: (0, import_UIObject.EXTEND)(
70
70
  () => {
71
- const route = import_UIRoute.UIRoute.currentRoute;
71
+ let route = import_UIRoute.UIRoute.currentRoute;
72
72
  this.detailsViewControllers.allValues.forEach(
73
- (value) => route.routeByRemovingComponentNamed(value.class.routeComponentName)
73
+ (value) => route = route.routeByRemovingComponentNamed(value.class.routeComponentName)
74
74
  );
75
75
  route.apply();
76
76
  }
@@ -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 deleteOnUnload: boolean;\n deleteOnLogout: boolean;\n /** Only applicable when the VC is registered in detailsViewControllers.\n * When YES, pressing Escape will dismiss the details dialog. */\n dismissesOnEscape: 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 deleteOnLogout?: boolean,\n /** Only applicable when the VC is registered in detailsViewControllers.\n * When YES, pressing Escape will dismiss the details dialog. */\n dismissesOnEscape?: boolean\n } = {}\n ): UIRootViewControllerLazyViewControllerObject<T> {\n const shouldShow = options.shouldShow ?? (() => YES)\n const deleteOnUnload = options.deleteOnUnload ?? NO\n const deleteOnLogout = options.deleteOnLogout ?? YES\n const dismissesOnEscape = options.dismissesOnEscape ?? NO\n \n const result: UIRootViewControllerLazyViewControllerObject<T> = {\n class: classObject,\n instance: nil,\n shouldShow: shouldShow,\n isInitialized: NO,\n deleteOnUnload: deleteOnUnload,\n deleteOnLogout: deleteOnLogout,\n dismissesOnEscape: dismissesOnEscape,\n deleteInstance: () => {\n if (result.isInitialized) {\n result.isInitialized = NO\n // Remove the view's DOM element before resetting the lazy value.\n // UIView reuses existing elements by ID, so if the element remains\n // in the DOM the next construction would attach a new controller\n // to the same stale element, causing duplicate subviews.\n const existingView = result.instance?.view\n if (existingView) {\n existingView.removeFromSuperview()\n existingView.viewHTMLElement.remove()\n }\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 const detailsWidth = Math.min(\n this.detailsViewController.view.intrinsicContentWidth() || contentView.bounds.width,\n contentView.bounds.width\n )\n this.detailsViewController.view.frame = this.backgroundView.frame.rectangleWithInset(\n paddingLength\n ).rectangleWithWidth(\n detailsWidth,\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;AA2B1B,MAAM,6BAA6B,yCAAiB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QACtB,KAAK,sBAAsB,KAAK,sBAAsB,KAAK,YAAY,OAAO;AAAA,QAC9E,YAAY,OAAO;AAAA,MACvB;AACA,WAAK,sBAAsB,KAAK,QAAQ,KAAK,eAAe,MAAM;AAAA,QAC9D;AAAA,MACJ,EAAE;AAAA,QACE;AAAA,QACA;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;",
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 deleteOnLogout: boolean;\n /** Only applicable when the VC is registered in detailsViewControllers.\n * When YES, pressing Escape will dismiss the details dialog. */\n dismissesOnEscape: 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 let route = UIRoute.currentRoute\n this.detailsViewControllers.allValues.forEach(\n value => route = 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 deleteOnLogout?: boolean,\n /** Only applicable when the VC is registered in detailsViewControllers.\n * When YES, pressing Escape will dismiss the details dialog. */\n dismissesOnEscape?: boolean\n } = {}\n ): UIRootViewControllerLazyViewControllerObject<T> {\n const shouldShow = options.shouldShow ?? (() => YES)\n const deleteOnUnload = options.deleteOnUnload ?? NO\n const deleteOnLogout = options.deleteOnLogout ?? YES\n const dismissesOnEscape = options.dismissesOnEscape ?? NO\n \n const result: UIRootViewControllerLazyViewControllerObject<T> = {\n class: classObject,\n instance: nil,\n shouldShow: shouldShow,\n isInitialized: NO,\n deleteOnUnload: deleteOnUnload,\n deleteOnLogout: deleteOnLogout,\n dismissesOnEscape: dismissesOnEscape,\n deleteInstance: () => {\n if (result.isInitialized) {\n result.isInitialized = NO\n // Remove the view's DOM element before resetting the lazy value.\n // UIView reuses existing elements by ID, so if the element remains\n // in the DOM the next construction would attach a new controller\n // to the same stale element, causing duplicate subviews.\n const existingView = result.instance?.view\n if (existingView) {\n existingView.removeFromSuperview()\n existingView.viewHTMLElement.remove()\n }\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 const detailsWidth = Math.min(\n this.detailsViewController.view.intrinsicContentWidth() || contentView.bounds.width,\n contentView.bounds.width\n )\n this.detailsViewController.view.frame = this.backgroundView.frame.rectangleWithInset(\n paddingLength\n ).rectangleWithWidth(\n detailsWidth,\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": ";;;;;;;;;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,IAAK;AAC5B,QAAI,kCAAkC,iCAAiC;AACnE,wCAAkC;AAAA,IACtC;AAGA,gBAAY,MAAM,SAAS,KAAK,gCAAgC,eAAe;AAG/E,YAAI,oBAAG,KAAK,qBAAqB,GAAG;AAEhC,kBAAY,MAAM,YAAY,gBAAgB,IAAI;AAElD,YAAM,eAAe,KAAK;AAAA,QACtB,KAAK,sBAAsB,KAAK,sBAAsB,KAAK,YAAY,OAAO;AAAA,QAC9E,YAAY,OAAO;AAAA,MACvB;AACA,WAAK,sBAAsB,KAAK,QAAQ,KAAK,eAAe,MAAM;AAAA,QAC9D;AAAA,MACJ,EAAE;AAAA,QACE;AAAA,QACA;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": ["_a"]
7
7
  }
@@ -1104,11 +1104,7 @@ const _UIView = class extends import_UIObject.UIObject {
1104
1104
  return updateLayout;
1105
1105
  }
1106
1106
  static runFunctionBeforeNextFrame(step) {
1107
- if (import_ClientCheckers.IS_SAFARI) {
1108
- Promise.resolve().then(step);
1109
- } else {
1110
- window.requestAnimationFrame(step);
1111
- }
1107
+ window.requestAnimationFrame(step);
1112
1108
  }
1113
1109
  static scheduleLayoutViewsIfNeeded() {
1114
1110
  if (_UIView._isLayoutViewsIfNeededScheduled) {