uicore-ts 1.0.35 → 1.0.51

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.
Files changed (39) hide show
  1. package/compiledScripts/UIActionIndicator.js.map +2 -2
  2. package/compiledScripts/UIBaseButton.js.map +2 -2
  3. package/compiledScripts/UIButton.js.map +2 -2
  4. package/compiledScripts/UIColor.js.map +2 -2
  5. package/compiledScripts/UIDateTimeInput.js.map +2 -2
  6. package/compiledScripts/UIDialogView.js.map +2 -2
  7. package/compiledScripts/UIImageView.js.map +2 -2
  8. package/compiledScripts/UILink.js.map +2 -2
  9. package/compiledScripts/UILinkButton.js.map +2 -2
  10. package/compiledScripts/UIObject.js +3 -2
  11. package/compiledScripts/UIObject.js.map +2 -2
  12. package/compiledScripts/UIRootViewController.js.map +2 -2
  13. package/compiledScripts/UIRoute.js.map +2 -2
  14. package/compiledScripts/UIScrollView.js.map +2 -2
  15. package/compiledScripts/UISlideScrollerView.js.map +2 -2
  16. package/compiledScripts/UITableView.js.map +2 -2
  17. package/compiledScripts/UITextArea.js.map +2 -2
  18. package/compiledScripts/UITextField.js.map +2 -2
  19. package/compiledScripts/UITextView.js.map +2 -2
  20. package/package.json +1 -1
  21. package/scripts/UIActionIndicator.ts +2 -2
  22. package/scripts/UIBaseButton.ts +8 -8
  23. package/scripts/UIButton.ts +21 -21
  24. package/scripts/UIColor.ts +1 -1
  25. package/scripts/UIDateTimeInput.ts +2 -2
  26. package/scripts/UIDialogView.ts +3 -3
  27. package/scripts/UIImageView.ts +7 -7
  28. package/scripts/UILink.ts +4 -4
  29. package/scripts/UILinkButton.ts +6 -6
  30. package/scripts/UIObject.ts +25 -18
  31. package/scripts/UIRootViewController.ts +1 -1
  32. package/scripts/UIRoute.ts +1 -1
  33. package/scripts/UIScrollView.ts +4 -4
  34. package/scripts/UISlideScrollerView.ts +5 -5
  35. package/scripts/UITableView.ts +7 -7
  36. package/scripts/UITextArea.ts +1 -1
  37. package/scripts/UITextField.ts +8 -9
  38. package/scripts/UITextView.ts +8 -8
  39. package/tsconfig.json +1 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../scripts/UIActionIndicator.ts"],
4
- "sourcesContent": ["import { NO, YES } from \"./UIObject\"\nimport { UIView } from \"./UIView\"\n\n\nexport class UIActionIndicator extends UIView {\n \n \n indicatorView: UIView\n \n _size: number = 50\n \n constructor(elementID?: string) {\n \n super(elementID)\n \n this.indicatorView = new UIView(this.elementID + \"IndicatorView\")\n this.indicatorView.viewHTMLElement.classList.add(\"LukeHaasLoader\")\n this.addSubview(this.indicatorView)\n \n this.hidden = YES\n \n }\n \n \n \n \n \n set size(size: number) {\n \n this._size = size\n \n this.setNeedsLayoutUpToRootView()\n \n }\n \n get size() {\n \n return this._size\n \n }\n \n \n \n set hidden(hidden: boolean) {\n \n super.hidden = hidden\n \n if (hidden) {\n \n this.indicatorView.removeFromSuperview()\n \n }\n else {\n \n this.addSubview(this.indicatorView)\n \n }\n \n }\n \n start() {\n \n this.hidden = NO\n \n }\n \n stop() {\n \n this.hidden = YES\n \n }\n \n \n \n layoutSubviews() {\n \n super.layoutSubviews()\n \n const bounds = this.bounds\n \n //this.indicatorView.centerInContainer();\n \n this.indicatorView.style.height = \"\" + this._size.integerValue + \"px\"\n this.indicatorView.style.width = \"\" + this._size.integerValue + \"px\"\n \n const minSize = Math.min(this.bounds.height, this.bounds.width)\n \n this.indicatorView.style.maxHeight = \"\" + minSize.integerValue + \"px\"\n this.indicatorView.style.maxWidth = \"\" + minSize.integerValue + \"px\"\n \n const size = Math.min(this._size, minSize)\n \n this.indicatorView.style.left = \"\" + ((bounds.width - size) * 0.5 - 11).integerValue + \"px\"\n this.indicatorView.style.top = \"\" + ((bounds.height - size) * 0.5 - 11).integerValue + \"px\"\n \n \n \n \n }\n \n \n \n \n \n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],
5
-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M,MAAM,OAAO,OAAO,SAAS,QAAQ,MAAM,IAAI,eAAe;AAAA,EAK3F;AAMJ;",
4
+ "sourcesContent": ["import { NO, YES } from \"./UIObject\"\nimport { UIView } from \"./UIView\"\n\n\nexport class UIActionIndicator extends UIView {\n \n \n indicatorView: UIView\n \n _size: number = 50\n \n constructor(elementID?: string) {\n \n super(elementID)\n \n this.indicatorView = new UIView(this.elementID + \"IndicatorView\")\n this.indicatorView.viewHTMLElement.classList.add(\"LukeHaasLoader\")\n this.addSubview(this.indicatorView)\n \n this.hidden = YES\n \n }\n \n \n \n \n \n set size(size: number) {\n \n this._size = size\n \n this.setNeedsLayoutUpToRootView()\n \n }\n \n get size() {\n \n return this._size\n \n }\n \n \n \n override set hidden(hidden: boolean) {\n \n super.hidden = hidden\n \n if (hidden) {\n \n this.indicatorView.removeFromSuperview()\n \n }\n else {\n \n this.addSubview(this.indicatorView)\n \n }\n \n }\n \n start() {\n \n this.hidden = NO\n \n }\n \n stop() {\n \n this.hidden = YES\n \n }\n \n \n \n override layoutSubviews() {\n \n super.layoutSubviews()\n \n const bounds = this.bounds\n \n //this.indicatorView.centerInContainer();\n \n this.indicatorView.style.height = \"\" + this._size.integerValue + \"px\"\n this.indicatorView.style.width = \"\" + this._size.integerValue + \"px\"\n \n const minSize = Math.min(this.bounds.height, this.bounds.width)\n \n this.indicatorView.style.maxHeight = \"\" + minSize.integerValue + \"px\"\n this.indicatorView.style.maxWidth = \"\" + minSize.integerValue + \"px\"\n \n const size = Math.min(this._size, minSize)\n \n this.indicatorView.style.left = \"\" + ((bounds.width - size) * 0.5 - 11).integerValue + \"px\"\n this.indicatorView.style.top = \"\" + ((bounds.height - size) * 0.5 - 11).integerValue + \"px\"\n \n \n \n \n }\n \n \n \n \n \n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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K3F;AAMJ;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../scripts/UIBaseButton.ts"],
4
- "sourcesContent": ["import { UIColor } from \"./UIColor\"\nimport { IS, nil, NO, YES } from \"./UIObject\"\nimport { UIView, UIViewBroadcastEvent } from \"./UIView\"\n\n\nexport class UIBaseButton extends UIView {\n \n _selected: boolean = NO\n _highlighted: boolean = NO\n \n _isPointerInside: boolean\n \n \n _isToggleable: boolean = NO\n _hovered?: boolean\n _focused?: boolean\n \n \n constructor(elementID?: string, elementType?: string) {\n \n super(elementID, nil, elementType)\n \n // Instance variables\n \n \n this._isPointerInside = NO\n \n \n const setHovered = () => {\n this.hovered = YES\n }\n this.addTargetForControlEvent(UIView.controlEvent.PointerHover, setHovered)\n \n const setNotHovered = () => {\n \n this.hovered = NO\n \n }\n \n this.addTargetForControlEvents([\n UIView.controlEvent.PointerLeave, UIView.controlEvent.PointerCancel, UIView.controlEvent.MultipleTouches\n ], setNotHovered)\n \n \n let highlightingTime: number\n const setHighlighted = () => {\n this.highlighted = YES\n highlightingTime = Date.now()\n }\n this.addTargetForControlEvent(UIView.controlEvent.PointerDown, setHighlighted)\n this.addTargetForControlEvent(UIView.controlEvent.PointerEnter, setHighlighted)\n \n const setNotHighlighted = () => {\n this.highlighted = NO\n }\n const setNotHighlightedWithMinimumDuration = () => {\n const minimumDurationInMilliseconds = 50\n const elapsedTime = Date.now() - highlightingTime\n if (minimumDurationInMilliseconds < elapsedTime) {\n this.highlighted = NO\n }\n else {\n setTimeout(() => {\n this.highlighted = NO\n }, minimumDurationInMilliseconds - elapsedTime)\n }\n }\n this.addTargetForControlEvents([\n UIView.controlEvent.PointerLeave, UIView.controlEvent.PointerCancel, UIView.controlEvent.MultipleTouches\n ], setNotHighlighted)\n this.addTargetForControlEvent(UIView.controlEvent.PointerUp, setNotHighlightedWithMinimumDuration)\n \n // Handle enter key press\n this.addTargetForControlEvent(UIView.controlEvent.EnterDown, () => {\n \n setHighlighted()\n setNotHighlightedWithMinimumDuration()\n \n })\n \n \n this.addTargetForControlEvent(\n UIView.controlEvent.Focus,\n (sender: UIView, event: Event) => {\n \n this.focused = YES\n \n }\n )\n \n this.addTargetForControlEvent(\n UIView.controlEvent.Blur,\n (sender: UIView, event: Event) => {\n \n this.focused = NO\n \n }\n )\n \n \n this.pausesPointerEvents = YES\n this.tabIndex = 1\n \n this.style.cursor = \"pointer\"\n \n //this.style.outline = \"none\";\n \n \n this.nativeSelectionEnabled = NO\n \n \n this.addTargetForControlEvents([\n UIView.controlEvent.EnterDown, UIView.controlEvent.PointerUpInside\n ], () => {\n \n if (this.isToggleable) {\n \n this.toggleSelectedState()\n \n }\n \n })\n \n }\n \n public set hovered(hovered: boolean) {\n this._hovered = hovered\n this.updateContentForCurrentState()\n }\n \n public get hovered(): boolean {\n return this._hovered ?? NO\n }\n \n public set highlighted(highlighted: boolean) {\n this._highlighted = highlighted\n this.updateContentForCurrentState()\n }\n \n public get highlighted(): boolean {\n return this._highlighted\n }\n \n public set focused(focused: boolean) {\n this._focused = focused\n if (focused) {\n this.focus()\n }\n else {\n this.blur()\n }\n this.updateContentForCurrentState()\n }\n \n public get focused(): boolean {\n return this._focused ?? NO\n }\n \n public set selected(selected: boolean) {\n this._selected = selected\n this.updateContentForCurrentState()\n }\n \n public get selected(): boolean {\n return this._selected\n }\n \n \n updateContentForCurrentState() {\n \n let updateFunction: Function = this.updateContentForNormalState\n if (this.selected && this.highlighted) {\n updateFunction = this.updateContentForSelectedAndHighlightedState\n }\n else if (this.selected) {\n updateFunction = this.updateContentForSelectedState\n }\n else if (this.focused) {\n updateFunction = this.updateContentForFocusedState\n }\n else if (this.highlighted) {\n updateFunction = this.updateContentForHighlightedState\n }\n else if (this.hovered) {\n updateFunction = this.updateContentForHoveredState\n }\n \n if (!IS(updateFunction)) {\n this.backgroundColor = UIColor.nilColor\n }\n else {\n updateFunction.call(this)\n }\n \n }\n \n updateContentForNormalState() {\n \n \n }\n \n updateContentForHoveredState() {\n \n this.updateContentForNormalState()\n \n }\n \n updateContentForFocusedState() {\n \n this.updateContentForHoveredState()\n \n }\n \n updateContentForHighlightedState() {\n \n \n }\n \n updateContentForSelectedState() {\n \n \n }\n \n updateContentForSelectedAndHighlightedState() {\n \n this.updateContentForSelectedState()\n \n }\n \n \n set enabled(enabled: boolean) {\n super.enabled = enabled\n this.updateContentForCurrentEnabledState()\n }\n \n get enabled() {\n return super.enabled\n }\n \n updateContentForCurrentEnabledState() {\n \n if (this.enabled) {\n this.alpha = 1\n }\n else {\n this.alpha = 0.5\n }\n \n this.userInteractionEnabled = this.enabled\n \n }\n \n \n addStyleClass(styleClassName: string) {\n \n super.addStyleClass(styleClassName)\n \n if (this.styleClassName != styleClassName) {\n \n this.updateContentForCurrentState.call(this)\n \n }\n \n }\n \n \n didReceiveBroadcastEvent(event: UIViewBroadcastEvent) {\n \n super.didReceiveBroadcastEvent(event)\n \n if (event.name == UIView.broadcastEventName.PageDidScroll || event.name ==\n UIView.broadcastEventName.AddedToViewTree) {\n \n this.hovered = NO\n \n this.highlighted = NO\n \n this.updateContentForCurrentState()\n \n }\n \n \n }\n \n \n toggleSelectedState() {\n \n \n this.selected = !this.selected\n \n \n }\n \n set isToggleable(isToggleable: boolean) {\n \n this._isToggleable = isToggleable\n \n }\n \n get isToggleable() {\n \n return this._isToggleable\n \n }\n \n \n layoutSubviews() {\n \n super.layoutSubviews()\n \n const bounds = this.bounds\n \n \n }\n \n \n sendControlEventForKey(eventKey: string, nativeEvent: Event) {\n \n if (eventKey == UIView.controlEvent.PointerUpInside && !this.highlighted) {\n \n // Do not send the event in this case\n //super.sendControlEventForKey(eventKey, nativeEvent);\n \n const asd = 1\n \n }\n else {\n \n super.sendControlEventForKey(eventKey, nativeEvent)\n \n }\n \n }\n \n \n static getEventCoordinatesInDocument(touchOrMouseEvent: any) {\n // http://www.quirksmode.org/js/events_properties.html\n var posx = 0\n var posy = 0\n var e = touchOrMouseEvent\n if (!e) {\n e = window.event\n }\n if (e.pageX || e.pageY) {\n posx = e.pageX\n posy = e.pageY\n }\n else if (e.clientX || e.clientY) {\n posx = e.clientX + document.body.scrollLeft\n + document.documentElement.scrollLeft\n posy = e.clientY + document.body.scrollTop\n + document.documentElement.scrollTop\n }\n // posx and posy contain the mouse position relative to the document\n \n const coordinates = { \"x\": posx, \"y\": posy }\n \n return coordinates\n \n }\n \n \n static getElementPositionInDocument(el: { tagName: string; offsetLeft: number; scrollLeft: number; clientLeft: number; offsetTop: number; scrollTop: number; clientTop: number; offsetParent: any }) {\n //https://www.kirupa.com/html5/getting_mouse_click_position.htm\n var xPosition = 0\n var yPosition = 0\n \n while (el) {\n if (el.tagName == \"BODY\") {\n \n // Coordinates in document are coordinates in body, therefore subtracting the scroll position of the body is not needed\n \n // // deal with browser quirks with body/window/document and page scroll\n // var xScrollPos = el.scrollLeft || document.documentElement.scrollLeft;\n // var yScrollPos = el.scrollTop || document.documentElement.scrollTop;\n //\n // xPosition += (el.offsetLeft - xScrollPos + el.clientLeft);\n // yPosition += (el.offsetTop - yScrollPos + el.clientTop);\n }\n else {\n xPosition += (el.offsetLeft - el.scrollLeft + el.clientLeft)\n yPosition += (el.offsetTop - el.scrollTop + el.clientTop)\n }\n \n el = el.offsetParent\n }\n return {\n x: xPosition,\n y: yPosition\n }\n }\n \n static convertCoordinatesFromDocumentToElement(x: number, y: number, element: any) {\n const elementPositionInDocument = this.getElementPositionInDocument(element)\n const coordinatesInElement = { \"x\": x - elementPositionInDocument.x, \"y\": y - elementPositionInDocument.y }\n return coordinatesInElement\n }\n \n static getEventCoordinatesInElement(touchOrMouseEvent: any, element: any) {\n const coordinatesInDocument = this.getEventCoordinatesInDocument(touchOrMouseEvent)\n const coordinatesInElement = this.convertCoordinatesFromDocumentToElement(\n coordinatesInDocument.x,\n coordinatesInDocument.y,\n element\n )\n return coordinatesInElement\n }\n \n \n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n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;AAAA,EAEX;AAAA,EAGA,OAAO,6BAA6B,IAAiK;AAEjM,QAAI,YAAY;AAChB,QAAI,YAAY;AAEhB,WAAO,IAAI;AACP,UAAI,GAAG,WAAW,QAAQ;AAAA,MAU1B,OACK;AACD,qBAAc,GAAG,aAAa,GAAG,aAAa,GAAG;AACjD,qBAAc,GAAG,YAAY,GAAG,YAAY,GAAG;AAAA,MACnD;AAEA,WAAK,GAAG;AAAA,IACZ;AACA,WAAO;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,IACP;AAAA,EACJ;AAAA,EAEA,OAAO,wCAAwC,GAAW,GAAW,SAAc;AAC/E,UAAM,4BAA4B,KAAK,6BAA6B,OAAO;AAC3E,UAAM,uBAAuB,EAAE,KAAK,IAAI,0BAA0B,GAAG,KAAK,IAAI,0BAA0B,EAAE;AAC1G,WAAO;AAAA,EACX;AAAA,EAEA,OAAO,6BAA6B,mBAAwB,SAAc;AACtE,UAAM,wBAAwB,KAAK,8BAA8B,iBAAiB;AAClF,UAAM,uBAAuB,KAAK;AAAA,MAC9B,sBAAsB;AAAA,MACtB,sBAAsB;AAAA,MACtB;AAAA,IACJ;AACA,WAAO;AAAA,EACX;AAGJ;",
4
+ "sourcesContent": ["import { UIColor } from \"./UIColor\"\nimport { IS, nil, NO, YES } from \"./UIObject\"\nimport { UIView, UIViewBroadcastEvent } from \"./UIView\"\n\n\nexport class UIBaseButton extends UIView {\n \n _selected: boolean = NO\n _highlighted: boolean = NO\n \n override _isPointerInside: boolean\n \n \n _isToggleable: boolean = NO\n _hovered?: boolean\n _focused?: boolean\n \n \n constructor(elementID?: string, elementType?: string) {\n \n super(elementID, nil, elementType)\n \n // Instance variables\n \n \n this._isPointerInside = NO\n \n \n const setHovered = () => {\n this.hovered = YES\n }\n this.addTargetForControlEvent(UIView.controlEvent.PointerHover, setHovered)\n \n const setNotHovered = () => {\n \n this.hovered = NO\n \n }\n \n this.addTargetForControlEvents([\n UIView.controlEvent.PointerLeave, UIView.controlEvent.PointerCancel, UIView.controlEvent.MultipleTouches\n ], setNotHovered)\n \n \n let highlightingTime: number\n const setHighlighted = () => {\n this.highlighted = YES\n highlightingTime = Date.now()\n }\n this.addTargetForControlEvent(UIView.controlEvent.PointerDown, setHighlighted)\n this.addTargetForControlEvent(UIView.controlEvent.PointerEnter, setHighlighted)\n \n const setNotHighlighted = () => {\n this.highlighted = NO\n }\n const setNotHighlightedWithMinimumDuration = () => {\n const minimumDurationInMilliseconds = 50\n const elapsedTime = Date.now() - highlightingTime\n if (minimumDurationInMilliseconds < elapsedTime) {\n this.highlighted = NO\n }\n else {\n setTimeout(() => {\n this.highlighted = NO\n }, minimumDurationInMilliseconds - elapsedTime)\n }\n }\n this.addTargetForControlEvents([\n UIView.controlEvent.PointerLeave, UIView.controlEvent.PointerCancel, UIView.controlEvent.MultipleTouches\n ], setNotHighlighted)\n this.addTargetForControlEvent(UIView.controlEvent.PointerUp, setNotHighlightedWithMinimumDuration)\n \n // Handle enter key press\n this.addTargetForControlEvent(UIView.controlEvent.EnterDown, () => {\n \n setHighlighted()\n setNotHighlightedWithMinimumDuration()\n \n })\n \n \n this.addTargetForControlEvent(\n UIView.controlEvent.Focus,\n (sender: UIView, event: Event) => {\n \n this.focused = YES\n \n }\n )\n \n this.addTargetForControlEvent(\n UIView.controlEvent.Blur,\n (sender: UIView, event: Event) => {\n \n this.focused = NO\n \n }\n )\n \n \n this.pausesPointerEvents = YES\n this.tabIndex = 1\n \n this.style.cursor = \"pointer\"\n \n //this.style.outline = \"none\";\n \n \n this.nativeSelectionEnabled = NO\n \n \n this.addTargetForControlEvents([\n UIView.controlEvent.EnterDown, UIView.controlEvent.PointerUpInside\n ], () => {\n \n if (this.isToggleable) {\n \n this.toggleSelectedState()\n \n }\n \n })\n \n }\n \n public set hovered(hovered: boolean) {\n this._hovered = hovered\n this.updateContentForCurrentState()\n }\n \n public get hovered(): boolean {\n return this._hovered ?? NO\n }\n \n public set highlighted(highlighted: boolean) {\n this._highlighted = highlighted\n this.updateContentForCurrentState()\n }\n \n public get highlighted(): boolean {\n return this._highlighted\n }\n \n public set focused(focused: boolean) {\n this._focused = focused\n if (focused) {\n this.focus()\n }\n else {\n this.blur()\n }\n this.updateContentForCurrentState()\n }\n \n public get focused(): boolean {\n return this._focused ?? NO\n }\n \n public set selected(selected: boolean) {\n this._selected = selected\n this.updateContentForCurrentState()\n }\n \n public get selected(): boolean {\n return this._selected\n }\n \n \n updateContentForCurrentState() {\n \n let updateFunction: Function = this.updateContentForNormalState\n if (this.selected && this.highlighted) {\n updateFunction = this.updateContentForSelectedAndHighlightedState\n }\n else if (this.selected) {\n updateFunction = this.updateContentForSelectedState\n }\n else if (this.focused) {\n updateFunction = this.updateContentForFocusedState\n }\n else if (this.highlighted) {\n updateFunction = this.updateContentForHighlightedState\n }\n else if (this.hovered) {\n updateFunction = this.updateContentForHoveredState\n }\n \n if (!IS(updateFunction)) {\n this.backgroundColor = UIColor.nilColor\n }\n else {\n updateFunction.call(this)\n }\n \n }\n \n updateContentForNormalState() {\n \n \n }\n \n updateContentForHoveredState() {\n \n this.updateContentForNormalState()\n \n }\n \n updateContentForFocusedState() {\n \n this.updateContentForHoveredState()\n \n }\n \n updateContentForHighlightedState() {\n \n \n }\n \n updateContentForSelectedState() {\n \n \n }\n \n updateContentForSelectedAndHighlightedState() {\n \n this.updateContentForSelectedState()\n \n }\n \n \n override set enabled(enabled: boolean) {\n super.enabled = enabled\n this.updateContentForCurrentEnabledState()\n }\n \n override get enabled() {\n return super.enabled\n }\n \n override updateContentForCurrentEnabledState() {\n \n if (this.enabled) {\n this.alpha = 1\n }\n else {\n this.alpha = 0.5\n }\n \n this.userInteractionEnabled = this.enabled\n \n }\n \n \n override addStyleClass(styleClassName: string) {\n \n super.addStyleClass(styleClassName)\n \n if (this.styleClassName != styleClassName) {\n \n this.updateContentForCurrentState.call(this)\n \n }\n \n }\n \n \n override didReceiveBroadcastEvent(event: UIViewBroadcastEvent) {\n \n super.didReceiveBroadcastEvent(event)\n \n if (event.name == UIView.broadcastEventName.PageDidScroll || event.name ==\n UIView.broadcastEventName.AddedToViewTree) {\n \n this.hovered = NO\n \n this.highlighted = NO\n \n this.updateContentForCurrentState()\n \n }\n \n \n }\n \n \n toggleSelectedState() {\n \n \n this.selected = !this.selected\n \n \n }\n \n set isToggleable(isToggleable: boolean) {\n \n this._isToggleable = isToggleable\n \n }\n \n get isToggleable() {\n \n return this._isToggleable\n \n }\n \n \n override layoutSubviews() {\n \n super.layoutSubviews()\n \n const bounds = this.bounds\n \n \n }\n \n \n override sendControlEventForKey(eventKey: string, nativeEvent: Event) {\n \n if (eventKey == UIView.controlEvent.PointerUpInside && !this.highlighted) {\n \n // Do not send the event in this case\n //super.sendControlEventForKey(eventKey, nativeEvent);\n \n const asd = 1\n \n }\n else {\n \n super.sendControlEventForKey(eventKey, nativeEvent)\n \n }\n \n }\n \n \n static getEventCoordinatesInDocument(touchOrMouseEvent: any) {\n // http://www.quirksmode.org/js/events_properties.html\n var posx = 0\n var posy = 0\n var e = touchOrMouseEvent\n if (!e) {\n e = window.event\n }\n if (e.pageX || e.pageY) {\n posx = e.pageX\n posy = e.pageY\n }\n else if (e.clientX || e.clientY) {\n posx = e.clientX + document.body.scrollLeft\n + document.documentElement.scrollLeft\n posy = e.clientY + document.body.scrollTop\n + document.documentElement.scrollTop\n }\n // posx and posy contain the mouse position relative to the document\n \n const coordinates = { \"x\": posx, \"y\": posy }\n \n return coordinates\n \n }\n \n \n static getElementPositionInDocument(el: { tagName: string; offsetLeft: number; scrollLeft: number; clientLeft: number; offsetTop: number; scrollTop: number; clientTop: number; offsetParent: any }) {\n //https://www.kirupa.com/html5/getting_mouse_click_position.htm\n var xPosition = 0\n var yPosition = 0\n \n while (el) {\n if (el.tagName == \"BODY\") {\n \n // Coordinates in document are coordinates in body, therefore subtracting the scroll position of the body is not needed\n \n // // deal with browser quirks with body/window/document and page scroll\n // var xScrollPos = el.scrollLeft || document.documentElement.scrollLeft;\n // var yScrollPos = el.scrollTop || document.documentElement.scrollTop;\n //\n // xPosition += (el.offsetLeft - xScrollPos + el.clientLeft);\n // yPosition += (el.offsetTop - yScrollPos + el.clientTop);\n }\n else {\n xPosition += (el.offsetLeft - el.scrollLeft + el.clientLeft)\n yPosition += (el.offsetTop - el.scrollTop + el.clientTop)\n }\n \n el = el.offsetParent\n }\n return {\n x: xPosition,\n y: yPosition\n }\n }\n \n static convertCoordinatesFromDocumentToElement(x: number, y: number, element: any) {\n const elementPositionInDocument = this.getElementPositionInDocument(element)\n const coordinatesInElement = { \"x\": x - elementPositionInDocument.x, \"y\": y - elementPositionInDocument.y }\n return coordinatesInElement\n }\n \n static getEventCoordinatesInElement(touchOrMouseEvent: any, element: any) {\n const coordinatesInDocument = this.getEventCoordinatesInDocument(touchOrMouseEvent)\n const coordinatesInElement = this.convertCoordinatesFromDocumentToElement(\n coordinatesInDocument.x,\n coordinatesInDocument.y,\n element\n )\n return coordinatesInElement\n }\n \n \n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAwB;AACxB,sBAAiC;AACjC,oBAA6C;AAGtC,MAAM,qBAAqB,qBAAO;AAAA,EAarC,YAAY,WAAoB,aAAsB;AAElD,UAAM,WAAW,qBAAK,WAAW;AAbrC,qBAAqB;AACrB,wBAAwB;AAKxB,yBAAyB;AAYrB,SAAK,mBAAmB;AAGxB,UAAM,aAAa,MAAM;AACrB,WAAK,UAAU;AAAA,IACnB;AACA,SAAK,yBAAyB,qBAAO,aAAa,cAAc,UAAU;AAE1E,UAAM,gBAAgB,MAAM;AAExB,WAAK,U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,UAAM,wBAAwB,KAAK,8BAA8B,iBAAiB;AAClF,UAAM,uBAAuB,KAAK;AAAA,MAC9B,sBAAsB;AAAA,MACtB,sBAAsB;AAAA,MACtB;AAAA,IACJ;AACA,WAAO;AAAA,EACX;AAGJ;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../scripts/UIButton.ts"],
4
- "sourcesContent": ["import { UIBaseButton } from \"./UIBaseButton\"\nimport { UIColor } from \"./UIColor\"\nimport { UIImageView } from \"./UIImageView\"\nimport { IS, IS_NOT, IS_NOT_NIL, nil, NO, YES } from \"./UIObject\"\nimport { UIRectangle } from \"./UIRectangle\"\nimport { UITextView } from \"./UITextView\"\n\n\nexport interface UIButtonColorSpecifier {\n \n titleLabel: UIButtonElementColorSpecifier;\n background: UIButtonElementColorSpecifier;\n \n}\n\n\nexport interface UIButtonElementColorSpecifier {\n \n normal: UIColor;\n hovered?: UIColor;\n highlighted: UIColor;\n focused?: UIColor;\n selected: UIColor;\n selectedAndHighlighted?: UIColor;\n \n}\n\n\nexport class UIButton extends UIBaseButton {\n \n _contentPadding = 0\n _titleLabel?: UITextView\n _imageView: UIImageView\n \n usesAutomaticTitleFontSize = NO\n minAutomaticFontSize: number = nil\n maxAutomaticFontSize: number = 25\n \n colors: UIButtonColorSpecifier = {\n \n titleLabel: {\n \n normal: UIColor.whiteColor,\n highlighted: UIColor.whiteColor,\n selected: UIColor.whiteColor\n \n },\n \n background: {\n \n normal: UIColor.blueColor,\n highlighted: UIColor.greenColor,\n selected: UIColor.redColor\n \n }\n \n }\n \n \n constructor(elementID?: string, elementType?: string, titleType = UITextView.type.span) {\n \n super(elementID, elementType)\n \n // Instance variables\n \n this._imageView = new UIImageView(this.elementID + \"ImageView\")\n this._imageView.hidden = YES\n this.addSubview(this.imageView)\n \n this.imageView.fillMode = UIImageView.fillMode.aspectFitIfLarger\n \n \n if (IS_NOT_NIL(titleType)) {\n \n this._titleLabel = new UITextView(this.elementID + \"TitleLabel\", titleType)\n this.titleLabel.style.whiteSpace = \"nowrap\"\n this.addSubview(this.titleLabel)\n \n this.titleLabel.userInteractionEnabled = NO\n \n }\n \n this.contentPadding = 10\n \n this.imageView.userInteractionEnabled = NO\n this.titleLabel.textAlignment = UITextView.textAlignment.center\n this.titleLabel.nativeSelectionEnabled = NO\n \n }\n \n \n get contentPadding() {\n return this._contentPadding.integerValue\n }\n \n set contentPadding(contentPadding) {\n this._contentPadding = contentPadding\n this.setNeedsLayout()\n }\n \n \n public set hovered(hovered: boolean) {\n this._hovered = hovered\n this.updateContentForCurrentState()\n }\n \n public get hovered(): boolean {\n return this._hovered ?? NO\n }\n \n public set highlighted(highlighted: boolean) {\n this._highlighted = highlighted\n this.updateContentForCurrentState()\n }\n \n public get highlighted(): boolean {\n return this._highlighted\n }\n \n public set focused(focused: boolean) {\n this._focused = focused\n if (focused) {\n this.focus()\n }\n else {\n this.blur()\n }\n this.updateContentForCurrentState()\n }\n \n public get focused(): boolean {\n return this._focused ?? NO\n }\n \n public set selected(selected: boolean) {\n this._selected = selected\n this.updateContentForCurrentState()\n }\n \n public get selected(): boolean {\n return this._selected\n }\n \n \n updateContentForCurrentState() {\n \n let updateFunction: Function = this.updateContentForNormalState\n if (this.selected && this.highlighted) {\n updateFunction = this.updateContentForSelectedAndHighlightedState\n }\n else if (this.selected) {\n updateFunction = this.updateContentForSelectedState\n }\n else if (this.focused) {\n updateFunction = this.updateContentForFocusedState\n }\n else if (this.highlighted) {\n updateFunction = this.updateContentForHighlightedState\n }\n else if (this.hovered) {\n updateFunction = this.updateContentForHoveredState\n }\n \n if (!IS(updateFunction)) {\n this.titleLabel.textColor = UIColor.nilColor\n this.backgroundColor = UIColor.nilColor\n }\n else {\n updateFunction.call(this)\n }\n \n this.updateContentForCurrentEnabledState()\n \n }\n \n updateContentForNormalState() {\n \n this.backgroundColor = this.colors.background.normal\n this.titleLabel.textColor = this.colors.titleLabel.normal\n \n }\n \n updateContentForHoveredState() {\n \n this.updateContentForNormalState()\n \n if (this.colors.background.hovered) {\n this.backgroundColor = this.colors.background.hovered\n }\n \n if (this.colors.titleLabel.hovered) {\n this.titleLabel.textColor = this.colors.titleLabel.hovered\n }\n \n }\n \n updateContentForFocusedState() {\n \n this.updateContentForHoveredState()\n \n if (this.colors.background.focused) {\n this.backgroundColor = this.colors.background.focused\n }\n \n if (this.colors.titleLabel.focused) {\n this.titleLabel.textColor = this.colors.titleLabel.focused\n }\n \n }\n \n updateContentForHighlightedState() {\n \n this.backgroundColor = this.colors.background.highlighted\n this.titleLabel.textColor = this.colors.titleLabel.highlighted\n \n }\n \n updateContentForSelectedState() {\n \n this.backgroundColor = this.colors.background.selected\n this.titleLabel.textColor = this.colors.titleLabel.selected\n \n }\n \n updateContentForSelectedAndHighlightedState() {\n \n this.updateContentForSelectedState()\n \n if (this.colors.background.selectedAndHighlighted) {\n this.backgroundColor = this.colors.background.selectedAndHighlighted\n }\n \n if (this.colors.titleLabel.selectedAndHighlighted) {\n this.titleLabel.textColor = this.colors.titleLabel.selectedAndHighlighted\n }\n \n }\n \n \n set enabled(enabled: boolean) {\n \n // @ts-ignore\n super.enabled = enabled\n \n this.updateContentForCurrentState()\n \n }\n \n get enabled() {\n \n // @ts-ignore\n return super.enabled\n \n }\n \n updateContentForCurrentEnabledState() {\n \n if (this.enabled) {\n this.alpha = 1\n }\n else {\n this.alpha = 0.5\n }\n \n this.userInteractionEnabled = this.enabled\n \n }\n \n \n addStyleClass(styleClassName: string) {\n \n super.addStyleClass(styleClassName)\n \n if (this.styleClassName != styleClassName) {\n \n this.updateContentForCurrentState.call(this)\n \n }\n \n }\n \n \n get titleLabel(): UITextView {\n return this._titleLabel ?? nil\n }\n \n get imageView() {\n \n return this._imageView\n \n }\n \n \n layoutSubviews() {\n \n super.layoutSubviews()\n \n let bounds = this.bounds\n \n this.hoverText = this.titleLabel.text\n \n // Image only if text is not present\n if (IS_NOT(this.imageView.hidden) && !IS(this.titleLabel.text)) {\n \n this.imageView.frame = bounds\n \n }\n \n // Text only if image is not present\n if (IS(this.imageView.hidden) && IS(this.titleLabel.text)) {\n \n this.titleLabel.style.left = this.contentPadding + \"px\"\n this.titleLabel.style.right = this.contentPadding + \"px\"\n // this.titleLabel.style.marginLeft = \"\"\n // this.titleLabel.style.right = this.contentPadding\n this.titleLabel.style.top = \"50%\"\n this.titleLabel.style.transform = \"translateY(-50%)\"\n this.titleLabel.frame = new UIRectangle(nil, nil, nil, nil)\n \n if (this.usesAutomaticTitleFontSize) {\n \n const hidden = this.titleLabel.hidden\n \n this.titleLabel.hidden = YES\n \n this.titleLabel.fontSize = 15\n \n this.titleLabel.fontSize = UITextView.automaticallyCalculatedFontSize(\n new UIRectangle(\n 0,\n 0,\n this.bounds.height,\n this.titleLabel.viewHTMLElement.offsetWidth\n ),\n this.titleLabel.intrinsicContentSize(),\n this.titleLabel.fontSize,\n this.minAutomaticFontSize,\n this.maxAutomaticFontSize\n )\n \n this.titleLabel.hidden = hidden\n \n }\n \n \n }\n \n // Image and text both present\n if (IS_NOT(this.imageView.hidden) && IS(this.titleLabel.text)) {\n \n //const imageShareOfWidth = 0.25\n \n bounds = bounds.rectangleWithInset(this.contentPadding)\n \n const imageFrame = bounds.copy()\n imageFrame.width = bounds.height - this.contentPadding * 0.5\n this.imageView.frame = imageFrame\n \n this.titleLabel.style.left = imageFrame.max.x + this.contentPadding + \"px\"\n this.titleLabel.style.right = this.contentPadding + \"px\"\n this.titleLabel.style.top = \"50%\"\n this.titleLabel.style.transform = \"translateY(-50%)\"\n \n if (this.usesAutomaticTitleFontSize) {\n \n const hidden = this.titleLabel.hidden\n \n this.titleLabel.hidden = YES\n \n this.titleLabel.fontSize = 15\n \n this.titleLabel.fontSize = UITextView.automaticallyCalculatedFontSize(\n new UIRectangle(\n 0,\n 0,\n this.bounds.height,\n this.titleLabel.viewHTMLElement.offsetWidth\n ),\n this.titleLabel.intrinsicContentSize(),\n this.titleLabel.fontSize,\n this.minAutomaticFontSize,\n this.maxAutomaticFontSize\n )\n \n this.titleLabel.hidden = hidden\n \n }\n \n }\n \n this.applyClassesAndStyles()\n \n }\n \n initViewStyleSelectors() {\n \n this.initStyleSelector(\".\" + this.styleClassName, \"background-color: lightblue;\")\n \n // var selectorWithoutImage = \".\" + this.styleClassName + \" .\" + this.imageView.styleClassName + \" + .\" + this.titleLabel.styleClassName;\n \n // this.initStyleSelector(\n // selectorWithoutImage,\n // \"left: \" + this.contentPadding + \";\" +\n // \"right: \" + this.contentPadding + \";\" +\n // \"top: 50%;\" +\n // \"transform: translateY(-50%);\");\n \n }\n \n \n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\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,0BAA6B;AAC7B,qBAAwB;AACxB,yBAA4B;AAC5B,sBAAqD;AACrD,yBAA4B;AAC5B,wBAA2B;AAuBpB,MAAM,iBAAiB,iCAAa;AAAA,EA+BvC,YAAY,WAAoB,aAAsB,YAAY,6BAAW,KAAK,MAAM;AAEpF,UAAM,WAAW,WAAW;AA/BhC,2BAAkB;AAIlB,sCAA6B;AAC7B,gCAA+B;AAC/B,gCAA+B;AAE/B,kBAAiC;AAAA,MAE7B,YAAY;AAAA,QAER,QAAQ,uBAAQ;AAAA,QAChB,aAAa,uBAAQ;AAAA,QACrB,UAAU,uBAAQ;AAAA,MAEtB;AAAA,MAEA,YAAY;AAAA,QAER,QAAQ,uBAAQ;AAAA,QAChB,aAAa,uBAAQ;AAAA,QACrB,UAAU,uBAAQ;AAAA,MAEtB;AAAA,IAEJ;AASI,SAAK,aAAa,IAAI,+BAAY,KAAK,YAAY,W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UACpC;AAAA,UACA,KAAK,WAAW,qBAAqB;AAAA,UACrC,KAAK,WAAW;AAAA,UAChB,KAAK;AAAA,UACL,KAAK;AAAA,QACT;AAEA,aAAK,WAAW,SAAS;AAAA,MAE7B;AAAA,IAEJ;AAEA,SAAK,sBAAsB;AAAA,EAE/B;AAAA,EAEA,yBAAyB;AAErB,SAAK,kBAAkB,MAAM,KAAK,gBAAgB,8BAA8B;AAAA,EAWpF;AAGJ;",
4
+ "sourcesContent": ["import { UIBaseButton } from \"./UIBaseButton\"\nimport { UIColor } from \"./UIColor\"\nimport { UIImageView } from \"./UIImageView\"\nimport { IS, IS_NOT, IS_NOT_NIL, nil, NO, YES } from \"./UIObject\"\nimport { UIRectangle } from \"./UIRectangle\"\nimport { UITextView } from \"./UITextView\"\n\n\nexport interface UIButtonColorSpecifier {\n \n titleLabel: UIButtonElementColorSpecifier;\n background: UIButtonElementColorSpecifier;\n \n}\n\n\nexport interface UIButtonElementColorSpecifier {\n \n normal: UIColor;\n hovered?: UIColor;\n highlighted: UIColor;\n focused?: UIColor;\n selected: UIColor;\n selectedAndHighlighted?: UIColor;\n \n}\n\n\nexport class UIButton extends UIBaseButton {\n \n _contentPadding = 0\n _titleLabel?: UITextView\n _imageView: UIImageView\n \n usesAutomaticTitleFontSize = NO\n minAutomaticFontSize: number = nil\n maxAutomaticFontSize: number = 25\n \n colors: UIButtonColorSpecifier = {\n \n titleLabel: {\n \n normal: UIColor.whiteColor,\n highlighted: UIColor.whiteColor,\n selected: UIColor.whiteColor\n \n },\n \n background: {\n \n normal: UIColor.blueColor,\n highlighted: UIColor.greenColor,\n selected: UIColor.redColor\n \n }\n \n }\n \n \n constructor(elementID?: string, elementType?: string, titleType = UITextView.type.span) {\n \n super(elementID, elementType)\n \n // Instance variables\n \n this._imageView = new UIImageView(this.elementID + \"ImageView\")\n this._imageView.hidden = YES\n this.addSubview(this.imageView)\n \n this.imageView.fillMode = UIImageView.fillMode.aspectFitIfLarger\n \n \n if (IS_NOT_NIL(titleType)) {\n \n this._titleLabel = new UITextView(this.elementID + \"TitleLabel\", titleType)\n this.titleLabel.style.whiteSpace = \"nowrap\"\n this.addSubview(this.titleLabel)\n \n this.titleLabel.userInteractionEnabled = NO\n \n }\n \n this.contentPadding = 10\n \n this.imageView.userInteractionEnabled = NO\n this.titleLabel.textAlignment = UITextView.textAlignment.center\n this.titleLabel.nativeSelectionEnabled = NO\n \n }\n \n \n get contentPadding() {\n return this._contentPadding.integerValue\n }\n \n set contentPadding(contentPadding) {\n this._contentPadding = contentPadding\n this.setNeedsLayout()\n }\n \n \n public override set hovered(hovered: boolean) {\n this._hovered = hovered\n this.updateContentForCurrentState()\n }\n \n public override get hovered(): boolean {\n return this._hovered ?? NO\n }\n \n public override set highlighted(highlighted: boolean) {\n this._highlighted = highlighted\n this.updateContentForCurrentState()\n }\n \n public override get highlighted(): boolean {\n return this._highlighted\n }\n \n public override set focused(focused: boolean) {\n this._focused = focused\n if (focused) {\n this.focus()\n }\n else {\n this.blur()\n }\n this.updateContentForCurrentState()\n }\n \n public override get focused(): boolean {\n return this._focused ?? NO\n }\n \n public override set selected(selected: boolean) {\n this._selected = selected\n this.updateContentForCurrentState()\n }\n \n public override get selected(): boolean {\n return this._selected\n }\n \n \n override updateContentForCurrentState() {\n \n let updateFunction: Function = this.updateContentForNormalState\n if (this.selected && this.highlighted) {\n updateFunction = this.updateContentForSelectedAndHighlightedState\n }\n else if (this.selected) {\n updateFunction = this.updateContentForSelectedState\n }\n else if (this.focused) {\n updateFunction = this.updateContentForFocusedState\n }\n else if (this.highlighted) {\n updateFunction = this.updateContentForHighlightedState\n }\n else if (this.hovered) {\n updateFunction = this.updateContentForHoveredState\n }\n \n if (!IS(updateFunction)) {\n this.titleLabel.textColor = UIColor.nilColor\n this.backgroundColor = UIColor.nilColor\n }\n else {\n updateFunction.call(this)\n }\n \n this.updateContentForCurrentEnabledState()\n \n }\n \n override updateContentForNormalState() {\n \n this.backgroundColor = this.colors.background.normal\n this.titleLabel.textColor = this.colors.titleLabel.normal\n \n }\n \n override updateContentForHoveredState() {\n \n this.updateContentForNormalState()\n \n if (this.colors.background.hovered) {\n this.backgroundColor = this.colors.background.hovered\n }\n \n if (this.colors.titleLabel.hovered) {\n this.titleLabel.textColor = this.colors.titleLabel.hovered\n }\n \n }\n \n override updateContentForFocusedState() {\n \n this.updateContentForHoveredState()\n \n if (this.colors.background.focused) {\n this.backgroundColor = this.colors.background.focused\n }\n \n if (this.colors.titleLabel.focused) {\n this.titleLabel.textColor = this.colors.titleLabel.focused\n }\n \n }\n \n override updateContentForHighlightedState() {\n \n this.backgroundColor = this.colors.background.highlighted\n this.titleLabel.textColor = this.colors.titleLabel.highlighted\n \n }\n \n override updateContentForSelectedState() {\n \n this.backgroundColor = this.colors.background.selected\n this.titleLabel.textColor = this.colors.titleLabel.selected\n \n }\n \n override updateContentForSelectedAndHighlightedState() {\n \n this.updateContentForSelectedState()\n \n if (this.colors.background.selectedAndHighlighted) {\n this.backgroundColor = this.colors.background.selectedAndHighlighted\n }\n \n if (this.colors.titleLabel.selectedAndHighlighted) {\n this.titleLabel.textColor = this.colors.titleLabel.selectedAndHighlighted\n }\n \n }\n \n \n override set enabled(enabled: boolean) {\n \n // @ts-ignore\n super.enabled = enabled\n \n this.updateContentForCurrentState()\n \n }\n \n override get enabled() {\n \n // @ts-ignore\n return super.enabled\n \n }\n \n override updateContentForCurrentEnabledState() {\n \n if (this.enabled) {\n this.alpha = 1\n }\n else {\n this.alpha = 0.5\n }\n \n this.userInteractionEnabled = this.enabled\n \n }\n \n \n override addStyleClass(styleClassName: string) {\n \n super.addStyleClass(styleClassName)\n \n if (this.styleClassName != styleClassName) {\n \n this.updateContentForCurrentState.call(this)\n \n }\n \n }\n \n \n get titleLabel(): UITextView {\n return this._titleLabel ?? nil\n }\n \n get imageView() {\n \n return this._imageView\n \n }\n \n \n override layoutSubviews() {\n \n super.layoutSubviews()\n \n let bounds = this.bounds\n \n this.hoverText = this.titleLabel.text\n \n // Image only if text is not present\n if (IS_NOT(this.imageView.hidden) && !IS(this.titleLabel.text)) {\n \n this.imageView.frame = bounds\n \n }\n \n // Text only if image is not present\n if (IS(this.imageView.hidden) && IS(this.titleLabel.text)) {\n \n this.titleLabel.style.left = this.contentPadding + \"px\"\n this.titleLabel.style.right = this.contentPadding + \"px\"\n // this.titleLabel.style.marginLeft = \"\"\n // this.titleLabel.style.right = this.contentPadding\n this.titleLabel.style.top = \"50%\"\n this.titleLabel.style.transform = \"translateY(-50%)\"\n this.titleLabel.frame = new UIRectangle(nil, nil, nil, nil)\n \n if (this.usesAutomaticTitleFontSize) {\n \n const hidden = this.titleLabel.hidden\n \n this.titleLabel.hidden = YES\n \n this.titleLabel.fontSize = 15\n \n this.titleLabel.fontSize = UITextView.automaticallyCalculatedFontSize(\n new UIRectangle(\n 0,\n 0,\n this.bounds.height,\n this.titleLabel.viewHTMLElement.offsetWidth\n ),\n this.titleLabel.intrinsicContentSize(),\n this.titleLabel.fontSize,\n this.minAutomaticFontSize,\n this.maxAutomaticFontSize\n )\n \n this.titleLabel.hidden = hidden\n \n }\n \n \n }\n \n // Image and text both present\n if (IS_NOT(this.imageView.hidden) && IS(this.titleLabel.text)) {\n \n //const imageShareOfWidth = 0.25\n \n bounds = bounds.rectangleWithInset(this.contentPadding)\n \n const imageFrame = bounds.copy()\n imageFrame.width = bounds.height - this.contentPadding * 0.5\n this.imageView.frame = imageFrame\n \n this.titleLabel.style.left = imageFrame.max.x + this.contentPadding + \"px\"\n this.titleLabel.style.right = this.contentPadding + \"px\"\n this.titleLabel.style.top = \"50%\"\n this.titleLabel.style.transform = \"translateY(-50%)\"\n \n if (this.usesAutomaticTitleFontSize) {\n \n const hidden = this.titleLabel.hidden\n \n this.titleLabel.hidden = YES\n \n this.titleLabel.fontSize = 15\n \n this.titleLabel.fontSize = UITextView.automaticallyCalculatedFontSize(\n new UIRectangle(\n 0,\n 0,\n this.bounds.height,\n this.titleLabel.viewHTMLElement.offsetWidth\n ),\n this.titleLabel.intrinsicContentSize(),\n this.titleLabel.fontSize,\n this.minAutomaticFontSize,\n this.maxAutomaticFontSize\n )\n \n this.titleLabel.hidden = hidden\n \n }\n \n }\n \n this.applyClassesAndStyles()\n \n }\n \n override initViewStyleSelectors() {\n \n this.initStyleSelector(\".\" + this.styleClassName, \"background-color: lightblue;\")\n \n // var selectorWithoutImage = \".\" + this.styleClassName + \" .\" + this.imageView.styleClassName + \" + .\" + this.titleLabel.styleClassName;\n \n // this.initStyleSelector(\n // selectorWithoutImage,\n // \"left: \" + this.contentPadding + \";\" +\n // \"right: \" + this.contentPadding + \";\" +\n // \"top: 50%;\" +\n // \"transform: translateY(-50%);\");\n \n }\n \n \n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\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,0BAA6B;AAC7B,qBAAwB;AACxB,yBAA4B;AAC5B,sBAAqD;AACrD,yBAA4B;AAC5B,wBAA2B;AAuBpB,MAAM,iBAAiB,iCAAa;AAAA,EA+BvC,YAAY,WAAoB,aAAsB,YAAY,6BAAW,KAAK,MAAM;AAEpF,UAAM,WAAW,WAAW;AA/BhC,2BAAkB;AAIlB,sCAA6B;AAC7B,gCAA+B;AAC/B,gCAA+B;AAE/B,kBAAiC;AAAA,MAE7B,YAAY;AAAA,QAER,QAAQ,uBAAQ;AAAA,QAChB,aAAa,uBAAQ;AAAA,QACrB,UAAU,uBAAQ;AAAA,MAEtB;AAAA,MAEA,YAAY;AAAA,QAER,QAAQ,uBAAQ;AAAA,QAChB,aAAa,uBAAQ;AAAA,QACrB,UAAU,uBAAQ;AAAA,MAEtB;A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AAA,YACA,KAAK,OAAO;AAAA,YACZ,KAAK,WAAW,gBAAgB;AAAA,UACpC;AAAA,UACA,KAAK,WAAW,qBAAqB;AAAA,UACrC,KAAK,WAAW;AAAA,UAChB,KAAK;AAAA,UACL,KAAK;AAAA,QACT;AAEA,aAAK,WAAW,SAAS;AAAA,MAE7B;AAAA,IAEJ;AAEA,SAAK,sBAAsB;AAAA,EAE/B;AAAA,EAES,yBAAyB;AAE9B,SAAK,kBAAkB,MAAM,KAAK,gBAAgB,8BAA8B;AAAA,EAWpF;AAGJ;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../scripts/UIColor.ts"],
4
- "sourcesContent": ["import { UIObject } from \"./UIObject\"\n\n\nexport interface UIColorDescriptor {\n \n red: number;\n green: number;\n blue: number;\n alpha?: number;\n \n}\n\n\n\n\n\nexport class UIColor extends UIObject {\n \n \n constructor(public stringValue: string) {\n \n super()\n \n }\n \n \n \n toString() {\n return this.stringValue\n }\n \n static get redColor() {\n return new UIColor(\"red\")\n }\n \n static get blueColor() {\n return new UIColor(\"blue\")\n }\n \n static get greenColor() {\n return new UIColor(\"green\")\n }\n \n static get yellowColor() {\n return new UIColor(\"yellow\")\n }\n \n static get blackColor() {\n return new UIColor(\"black\")\n }\n \n static get brownColor() {\n return new UIColor(\"brown\")\n }\n \n static get whiteColor() {\n return new UIColor(\"white\")\n }\n \n static get greyColor() {\n return new UIColor(\"grey\")\n }\n \n static get lightGreyColor() {\n return new UIColor(\"lightgrey\")\n }\n \n static get transparentColor() {\n return new UIColor(\"transparent\")\n }\n \n static get undefinedColor() {\n return new UIColor(\"\")\n }\n \n static get nilColor() {\n return new UIColor(\"\")\n }\n \n \n \n static nameToHex(name: string) {\n return {\n \"aliceblue\": \"#f0f8ff\",\n \"antiquewhite\": \"#faebd7\",\n \"aqua\": \"#00ffff\",\n \"aquamarine\": \"#7fffd4\",\n \"azure\": \"#f0ffff\",\n \"beige\": \"#f5f5dc\",\n \"bisque\": \"#ffe4c4\",\n \"black\": \"#000000\",\n \"blanchedalmond\": \"#ffebcd\",\n \"blue\": \"#0000ff\",\n \"blueviolet\": \"#8a2be2\",\n \"brown\": \"#a52a2a\",\n \"burlywood\": \"#deb887\",\n \"cadetblue\": \"#5f9ea0\",\n \"chartreuse\": \"#7fff00\",\n \"chocolate\": \"#d2691e\",\n \"coral\": \"#ff7f50\",\n \"cornflowerblue\": \"#6495ed\",\n \"cornsilk\": \"#fff8dc\",\n \"crimson\": \"#dc143c\",\n \"cyan\": \"#00ffff\",\n \"darkblue\": \"#00008b\",\n \"darkcyan\": \"#008b8b\",\n \"darkgoldenrod\": \"#b8860b\",\n \"darkgray\": \"#a9a9a9\",\n \"darkgreen\": \"#006400\",\n \"darkkhaki\": \"#bdb76b\",\n \"darkmagenta\": \"#8b008b\",\n \"darkolivegreen\": \"#556b2f\",\n \"darkorange\": \"#ff8c00\",\n \"darkorchid\": \"#9932cc\",\n \"darkred\": \"#8b0000\",\n \"darksalmon\": \"#e9967a\",\n \"darkseagreen\": \"#8fbc8f\",\n \"darkslateblue\": \"#483d8b\",\n \"darkslategray\": \"#2f4f4f\",\n \"darkturquoise\": \"#00ced1\",\n \"darkviolet\": \"#9400d3\",\n \"deeppink\": \"#ff1493\",\n \"deepskyblue\": \"#00bfff\",\n \"dimgray\": \"#696969\",\n \"dodgerblue\": \"#1e90ff\",\n \"firebrick\": \"#b22222\",\n \"floralwhite\": \"#fffaf0\",\n \"forestgreen\": \"#228b22\",\n \"fuchsia\": \"#ff00ff\",\n \"gainsboro\": \"#dcdcdc\",\n \"ghostwhite\": \"#f8f8ff\",\n \"gold\": \"#ffd700\",\n \"goldenrod\": \"#daa520\",\n \"gray\": \"#808080\",\n \"green\": \"#008000\",\n \"greenyellow\": \"#adff2f\",\n \"honeydew\": \"#f0fff0\",\n \"hotpink\": \"#ff69b4\",\n \"indianred \": \"#cd5c5c\",\n \"indigo\": \"#4b0082\",\n \"ivory\": \"#fffff0\",\n \"khaki\": \"#f0e68c\",\n \"lavender\": \"#e6e6fa\",\n \"lavenderblush\": \"#fff0f5\",\n \"lawngreen\": \"#7cfc00\",\n \"lemonchiffon\": \"#fffacd\",\n \"lightblue\": \"#add8e6\",\n \"lightcoral\": \"#f08080\",\n \"lightcyan\": \"#e0ffff\",\n \"lightgoldenrodyellow\": \"#fafad2\",\n \"lightgrey\": \"#d3d3d3\",\n \"lightgreen\": \"#90ee90\",\n \"lightpink\": \"#ffb6c1\",\n \"lightsalmon\": \"#ffa07a\",\n \"lightseagreen\": \"#20b2aa\",\n \"lightskyblue\": \"#87cefa\",\n \"lightslategray\": \"#778899\",\n \"lightsteelblue\": \"#b0c4de\",\n \"lightyellow\": \"#ffffe0\",\n \"lime\": \"#00ff00\",\n \"limegreen\": \"#32cd32\",\n \"linen\": \"#faf0e6\",\n \"magenta\": \"#ff00ff\",\n \"maroon\": \"#800000\",\n \"mediumaquamarine\": \"#66cdaa\",\n \"mediumblue\": \"#0000cd\",\n \"mediumorchid\": \"#ba55d3\",\n \"mediumpurple\": \"#9370d8\",\n \"mediumseagreen\": \"#3cb371\",\n \"mediumslateblue\": \"#7b68ee\",\n \"mediumspringgreen\": \"#00fa9a\",\n \"mediumturquoise\": \"#48d1cc\",\n \"mediumvioletred\": \"#c71585\",\n \"midnightblue\": \"#191970\",\n \"mintcream\": \"#f5fffa\",\n \"mistyrose\": \"#ffe4e1\",\n \"moccasin\": \"#ffe4b5\",\n \"navajowhite\": \"#ffdead\",\n \"navy\": \"#000080\",\n \"oldlace\": \"#fdf5e6\",\n \"olive\": \"#808000\",\n \"olivedrab\": \"#6b8e23\",\n \"orange\": \"#ffa500\",\n \"orangered\": \"#ff4500\",\n \"orchid\": \"#da70d6\",\n \"palegoldenrod\": \"#eee8aa\",\n \"palegreen\": \"#98fb98\",\n \"paleturquoise\": \"#afeeee\",\n \"palevioletred\": \"#d87093\",\n \"papayawhip\": \"#ffefd5\",\n \"peachpuff\": \"#ffdab9\",\n \"peru\": \"#cd853f\",\n \"pink\": \"#ffc0cb\",\n \"plum\": \"#dda0dd\",\n \"powderblue\": \"#b0e0e6\",\n \"purple\": \"#800080\",\n \"red\": \"#ff0000\",\n \"rosybrown\": \"#bc8f8f\",\n \"royalblue\": \"#4169e1\",\n \"saddlebrown\": \"#8b4513\",\n \"salmon\": \"#fa8072\",\n \"sandybrown\": \"#f4a460\",\n \"seagreen\": \"#2e8b57\",\n \"seashell\": \"#fff5ee\",\n \"sienna\": \"#a0522d\",\n \"silver\": \"#c0c0c0\",\n \"skyblue\": \"#87ceeb\",\n \"slateblue\": \"#6a5acd\",\n \"slategray\": \"#708090\",\n \"snow\": \"#fffafa\",\n \"springgreen\": \"#00ff7f\",\n \"steelblue\": \"#4682b4\",\n \"tan\": \"#d2b48c\",\n \"teal\": \"#008080\",\n \"thistle\": \"#d8bfd8\",\n \"tomato\": \"#ff6347\",\n \"turquoise\": \"#40e0d0\",\n \"violet\": \"#ee82ee\",\n \"wheat\": \"#f5deb3\",\n \"white\": \"#ffffff\",\n \"whitesmoke\": \"#f5f5f5\",\n \"yellow\": \"#ffff00\",\n \"yellowgreen\": \"#9acd32\"\n }[name.toLowerCase()]\n }\n \n \n \n static hexToDescriptor(c: string): UIColorDescriptor {\n if (c[0] === \"#\") {\n c = c.substr(1)\n }\n const r = parseInt(c.slice(0, 2), 16)\n const g = parseInt(c.slice(2, 4), 16)\n const b = parseInt(c.slice(4, 6), 16)\n const a = parseInt(c.slice(6, 8), 16)\n \n const result = { \"red\": r, \"green\": g, \"blue\": b, \"alpha\": a }\n \n return result\n \n //return 'rgb(' + r + ',' + g + ',' + b + ')';\n \n }\n \n static rgbToDescriptor(colorString: string) {\n \n \n if (colorString.startsWith(\"rgba(\")) {\n \n colorString = colorString.slice(5, colorString.length - 1)\n \n }\n \n if (colorString.startsWith(\"rgb(\")) {\n \n colorString = colorString.slice(4, colorString.length - 1) + \", 0\"\n \n }\n \n \n const components = colorString.split(\",\")\n \n \n \n const result = {\n \"red\": Number(components[0]),\n \"green\": Number(components[1]),\n \"blue\": Number(components[2]),\n \"alpha\": Number(components[3])\n }\n \n \n return result\n \n \n }\n \n \n \n get colorDescriptor(): UIColorDescriptor {\n \n var descriptor\n \n const colorHEXFromName = UIColor.nameToHex(this.stringValue)\n \n if (this.stringValue.startsWith(\"rgb\")) {\n \n descriptor = UIColor.rgbToDescriptor(this.stringValue)\n \n }\n else if (colorHEXFromName) {\n \n descriptor = UIColor.hexToDescriptor(colorHEXFromName)\n \n }\n else {\n \n descriptor = UIColor.hexToDescriptor(this.stringValue)\n \n }\n \n return descriptor\n \n }\n \n \n \n colorWithRed(red: number) {\n \n \n const descriptor = this.colorDescriptor\n \n const result = new UIColor(\"rgba(\" + red + \",\" + descriptor.green + \",\" + descriptor.blue + \",\" +\n descriptor.alpha + \")\")\n \n return result\n \n }\n \n colorWithGreen(green: number) {\n \n \n const descriptor = this.colorDescriptor\n \n const result = new UIColor(\"rgba(\" + descriptor.red + \",\" + green + \",\" + descriptor.blue + \",\" +\n descriptor.alpha + \")\")\n \n return result\n \n }\n \n colorWithBlue(blue: number) {\n \n \n const descriptor = this.colorDescriptor\n \n const result = new UIColor(\"rgba(\" + descriptor.red + \",\" + descriptor.green + \",\" + blue + \",\" +\n descriptor.alpha + \")\")\n \n return result\n \n }\n \n \n colorWithAlpha(alpha: number) {\n \n \n const descriptor = this.colorDescriptor\n \n const result = new UIColor(\"rgba(\" + descriptor.red + \",\" + descriptor.green + \",\" + descriptor.blue + \",\" +\n alpha + \")\")\n \n return result\n \n }\n \n \n \n static colorWithRGBA(red: number, green: number, blue: number, alpha: number = 1) {\n \n \n const result = new UIColor(\"rgba(\" + red + \",\" + green + \",\" + blue + \",\" + alpha + \")\")\n \n return result\n \n \n }\n \n static colorWithDescriptor(descriptor: UIColorDescriptor) {\n \n \n const result = new UIColor(\"rgba(\" + descriptor.red.toFixed(0) + \",\" + descriptor.green.toFixed(0) + \",\" +\n descriptor.blue.toFixed(0) + \",\" + this.defaultAlphaToOne(descriptor.alpha) + \")\")\n \n return result\n \n }\n \n \n private static defaultAlphaToOne(value = 1) {\n if (value != value) {\n value = 1\n }\n return value\n }\n \n \n \n colorByMultiplyingRGB(multiplier: number) {\n \n const descriptor = this.colorDescriptor\n \n descriptor.red = descriptor.red * multiplier\n descriptor.green = descriptor.green * multiplier\n descriptor.blue = descriptor.blue * multiplier\n \n const result = UIColor.colorWithDescriptor(descriptor)\n \n return result\n \n }\n \n \n \n \n \n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAyB;AAgBlB,MAAM,gBAAgB,yBAAS;AAAA,EAGlC,YAAmB,aAAqB;AAEpC,UAAM;AAFS;AAAA,EAInB;AAAA,EAIA,WAAW;AACP,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,WAAW,WAAW;AAClB,WAAO,IAAI,QAAQ,KAAK;AAAA,EAC5B;AAAA,EAEA,WAAW,YAAY;AACnB,WAAO,IAAI,QAAQ,MAAM;AAAA,EAC7B;AAAA,EAEA,WAAW,aAAa;AACpB,WAAO,IAAI,QAAQ,OAAO;AAAA,EAC9B;AAAA,EAEA,WAAW,cAAc;AACrB,WAAO,IAAI,QAAQ,QAAQ;AAAA,EAC/B;AAAA,EAEA,WAAW,aAAa;AACpB,WAAO,IAAI,QAAQ,OAAO;AAAA,EAC9B;AAAA,EAEA,WAAW,aAAa;AACpB,WAAO,IAAI,QAAQ,OAAO;AAAA,EAC9B;AAAA,EAEA,WAAW,aAAa;AACpB,WAAO,IAAI,QAAQ,OAAO;AAAA,EAC9B;AAAA,EAEA,WAAW,YAAY;AACnB,WAAO,IAAI,QAAQ,MAAM;AAAA,EAC7B;AAAA,EAEA,WAAW,iBAAiB;AACxB,WAAO,IAAI,QAAQ,WAAW;AAAA,EAClC;AAAA,EAEA,WAAW,mBAAmB;AAC1B,WAAO,IAAI,QAAQ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AAI,QAAQ,UAAU,WAAW,IAAI,QAAQ,CAAC,IAAI,MAAM,WAAW,MAAM,QAAQ,CAAC,IAAI,MACjG,WAAW,KAAK,QAAQ,CAAC,IAAI,MAAM,KAAK,kBAAkB,WAAW,KAAK,IAAI,GAAG;AAErF,WAAO;AAAA,EAEX;AAAA,EAGA,OAAe,kBAAkB,QAAQ,GAAG;AACxC,QAAI,SAAS,OAAO;AAChB,cAAQ;AAAA,IACZ;AACA,WAAO;AAAA,EACX;AAAA,EAIA,sBAAsB,YAAoB;AAEtC,UAAM,aAAa,KAAK;AAExB,eAAW,MAAM,WAAW,MAAM;AAClC,eAAW,QAAQ,WAAW,QAAQ;AACtC,eAAW,OAAO,WAAW,OAAO;AAEpC,UAAM,SAAS,QAAQ,oBAAoB,UAAU;AAErD,WAAO;AAAA,EAEX;AAMJ;",
4
+ "sourcesContent": ["import { UIObject } from \"./UIObject\"\n\n\nexport interface UIColorDescriptor {\n \n red: number;\n green: number;\n blue: number;\n alpha?: number;\n \n}\n\n\n\n\n\nexport class UIColor extends UIObject {\n \n \n constructor(public stringValue: string) {\n \n super()\n \n }\n \n \n \n override toString() {\n return this.stringValue\n }\n \n static get redColor() {\n return new UIColor(\"red\")\n }\n \n static get blueColor() {\n return new UIColor(\"blue\")\n }\n \n static get greenColor() {\n return new UIColor(\"green\")\n }\n \n static get yellowColor() {\n return new UIColor(\"yellow\")\n }\n \n static get blackColor() {\n return new UIColor(\"black\")\n }\n \n static get brownColor() {\n return new UIColor(\"brown\")\n }\n \n static get whiteColor() {\n return new UIColor(\"white\")\n }\n \n static get greyColor() {\n return new UIColor(\"grey\")\n }\n \n static get lightGreyColor() {\n return new UIColor(\"lightgrey\")\n }\n \n static get transparentColor() {\n return new UIColor(\"transparent\")\n }\n \n static get undefinedColor() {\n return new UIColor(\"\")\n }\n \n static get nilColor() {\n return new UIColor(\"\")\n }\n \n \n \n static nameToHex(name: string) {\n return {\n \"aliceblue\": \"#f0f8ff\",\n \"antiquewhite\": \"#faebd7\",\n \"aqua\": \"#00ffff\",\n \"aquamarine\": \"#7fffd4\",\n \"azure\": \"#f0ffff\",\n \"beige\": \"#f5f5dc\",\n \"bisque\": \"#ffe4c4\",\n \"black\": \"#000000\",\n \"blanchedalmond\": \"#ffebcd\",\n \"blue\": \"#0000ff\",\n \"blueviolet\": \"#8a2be2\",\n \"brown\": \"#a52a2a\",\n \"burlywood\": \"#deb887\",\n \"cadetblue\": \"#5f9ea0\",\n \"chartreuse\": \"#7fff00\",\n \"chocolate\": \"#d2691e\",\n \"coral\": \"#ff7f50\",\n \"cornflowerblue\": \"#6495ed\",\n \"cornsilk\": \"#fff8dc\",\n \"crimson\": \"#dc143c\",\n \"cyan\": \"#00ffff\",\n \"darkblue\": \"#00008b\",\n \"darkcyan\": \"#008b8b\",\n \"darkgoldenrod\": \"#b8860b\",\n \"darkgray\": \"#a9a9a9\",\n \"darkgreen\": \"#006400\",\n \"darkkhaki\": \"#bdb76b\",\n \"darkmagenta\": \"#8b008b\",\n \"darkolivegreen\": \"#556b2f\",\n \"darkorange\": \"#ff8c00\",\n \"darkorchid\": \"#9932cc\",\n \"darkred\": \"#8b0000\",\n \"darksalmon\": \"#e9967a\",\n \"darkseagreen\": \"#8fbc8f\",\n \"darkslateblue\": \"#483d8b\",\n \"darkslategray\": \"#2f4f4f\",\n \"darkturquoise\": \"#00ced1\",\n \"darkviolet\": \"#9400d3\",\n \"deeppink\": \"#ff1493\",\n \"deepskyblue\": \"#00bfff\",\n \"dimgray\": \"#696969\",\n \"dodgerblue\": \"#1e90ff\",\n \"firebrick\": \"#b22222\",\n \"floralwhite\": \"#fffaf0\",\n \"forestgreen\": \"#228b22\",\n \"fuchsia\": \"#ff00ff\",\n \"gainsboro\": \"#dcdcdc\",\n \"ghostwhite\": \"#f8f8ff\",\n \"gold\": \"#ffd700\",\n \"goldenrod\": \"#daa520\",\n \"gray\": \"#808080\",\n \"green\": \"#008000\",\n \"greenyellow\": \"#adff2f\",\n \"honeydew\": \"#f0fff0\",\n \"hotpink\": \"#ff69b4\",\n \"indianred \": \"#cd5c5c\",\n \"indigo\": \"#4b0082\",\n \"ivory\": \"#fffff0\",\n \"khaki\": \"#f0e68c\",\n \"lavender\": \"#e6e6fa\",\n \"lavenderblush\": \"#fff0f5\",\n \"lawngreen\": \"#7cfc00\",\n \"lemonchiffon\": \"#fffacd\",\n \"lightblue\": \"#add8e6\",\n \"lightcoral\": \"#f08080\",\n \"lightcyan\": \"#e0ffff\",\n \"lightgoldenrodyellow\": \"#fafad2\",\n \"lightgrey\": \"#d3d3d3\",\n \"lightgreen\": \"#90ee90\",\n \"lightpink\": \"#ffb6c1\",\n \"lightsalmon\": \"#ffa07a\",\n \"lightseagreen\": \"#20b2aa\",\n \"lightskyblue\": \"#87cefa\",\n \"lightslategray\": \"#778899\",\n \"lightsteelblue\": \"#b0c4de\",\n \"lightyellow\": \"#ffffe0\",\n \"lime\": \"#00ff00\",\n \"limegreen\": \"#32cd32\",\n \"linen\": \"#faf0e6\",\n \"magenta\": \"#ff00ff\",\n \"maroon\": \"#800000\",\n \"mediumaquamarine\": \"#66cdaa\",\n \"mediumblue\": \"#0000cd\",\n \"mediumorchid\": \"#ba55d3\",\n \"mediumpurple\": \"#9370d8\",\n \"mediumseagreen\": \"#3cb371\",\n \"mediumslateblue\": \"#7b68ee\",\n \"mediumspringgreen\": \"#00fa9a\",\n \"mediumturquoise\": \"#48d1cc\",\n \"mediumvioletred\": \"#c71585\",\n \"midnightblue\": \"#191970\",\n \"mintcream\": \"#f5fffa\",\n \"mistyrose\": \"#ffe4e1\",\n \"moccasin\": \"#ffe4b5\",\n \"navajowhite\": \"#ffdead\",\n \"navy\": \"#000080\",\n \"oldlace\": \"#fdf5e6\",\n \"olive\": \"#808000\",\n \"olivedrab\": \"#6b8e23\",\n \"orange\": \"#ffa500\",\n \"orangered\": \"#ff4500\",\n \"orchid\": \"#da70d6\",\n \"palegoldenrod\": \"#eee8aa\",\n \"palegreen\": \"#98fb98\",\n \"paleturquoise\": \"#afeeee\",\n \"palevioletred\": \"#d87093\",\n \"papayawhip\": \"#ffefd5\",\n \"peachpuff\": \"#ffdab9\",\n \"peru\": \"#cd853f\",\n \"pink\": \"#ffc0cb\",\n \"plum\": \"#dda0dd\",\n \"powderblue\": \"#b0e0e6\",\n \"purple\": \"#800080\",\n \"red\": \"#ff0000\",\n \"rosybrown\": \"#bc8f8f\",\n \"royalblue\": \"#4169e1\",\n \"saddlebrown\": \"#8b4513\",\n \"salmon\": \"#fa8072\",\n \"sandybrown\": \"#f4a460\",\n \"seagreen\": \"#2e8b57\",\n \"seashell\": \"#fff5ee\",\n \"sienna\": \"#a0522d\",\n \"silver\": \"#c0c0c0\",\n \"skyblue\": \"#87ceeb\",\n \"slateblue\": \"#6a5acd\",\n \"slategray\": \"#708090\",\n \"snow\": \"#fffafa\",\n \"springgreen\": \"#00ff7f\",\n \"steelblue\": \"#4682b4\",\n \"tan\": \"#d2b48c\",\n \"teal\": \"#008080\",\n \"thistle\": \"#d8bfd8\",\n \"tomato\": \"#ff6347\",\n \"turquoise\": \"#40e0d0\",\n \"violet\": \"#ee82ee\",\n \"wheat\": \"#f5deb3\",\n \"white\": \"#ffffff\",\n \"whitesmoke\": \"#f5f5f5\",\n \"yellow\": \"#ffff00\",\n \"yellowgreen\": \"#9acd32\"\n }[name.toLowerCase()]\n }\n \n \n \n static hexToDescriptor(c: string): UIColorDescriptor {\n if (c[0] === \"#\") {\n c = c.substr(1)\n }\n const r = parseInt(c.slice(0, 2), 16)\n const g = parseInt(c.slice(2, 4), 16)\n const b = parseInt(c.slice(4, 6), 16)\n const a = parseInt(c.slice(6, 8), 16)\n \n const result = { \"red\": r, \"green\": g, \"blue\": b, \"alpha\": a }\n \n return result\n \n //return 'rgb(' + r + ',' + g + ',' + b + ')';\n \n }\n \n static rgbToDescriptor(colorString: string) {\n \n \n if (colorString.startsWith(\"rgba(\")) {\n \n colorString = colorString.slice(5, colorString.length - 1)\n \n }\n \n if (colorString.startsWith(\"rgb(\")) {\n \n colorString = colorString.slice(4, colorString.length - 1) + \", 0\"\n \n }\n \n \n const components = colorString.split(\",\")\n \n \n \n const result = {\n \"red\": Number(components[0]),\n \"green\": Number(components[1]),\n \"blue\": Number(components[2]),\n \"alpha\": Number(components[3])\n }\n \n \n return result\n \n \n }\n \n \n \n get colorDescriptor(): UIColorDescriptor {\n \n var descriptor\n \n const colorHEXFromName = UIColor.nameToHex(this.stringValue)\n \n if (this.stringValue.startsWith(\"rgb\")) {\n \n descriptor = UIColor.rgbToDescriptor(this.stringValue)\n \n }\n else if (colorHEXFromName) {\n \n descriptor = UIColor.hexToDescriptor(colorHEXFromName)\n \n }\n else {\n \n descriptor = UIColor.hexToDescriptor(this.stringValue)\n \n }\n \n return descriptor\n \n }\n \n \n \n colorWithRed(red: number) {\n \n \n const descriptor = this.colorDescriptor\n \n const result = new UIColor(\"rgba(\" + red + \",\" + descriptor.green + \",\" + descriptor.blue + \",\" +\n descriptor.alpha + \")\")\n \n return result\n \n }\n \n colorWithGreen(green: number) {\n \n \n const descriptor = this.colorDescriptor\n \n const result = new UIColor(\"rgba(\" + descriptor.red + \",\" + green + \",\" + descriptor.blue + \",\" +\n descriptor.alpha + \")\")\n \n return result\n \n }\n \n colorWithBlue(blue: number) {\n \n \n const descriptor = this.colorDescriptor\n \n const result = new UIColor(\"rgba(\" + descriptor.red + \",\" + descriptor.green + \",\" + blue + \",\" +\n descriptor.alpha + \")\")\n \n return result\n \n }\n \n \n colorWithAlpha(alpha: number) {\n \n \n const descriptor = this.colorDescriptor\n \n const result = new UIColor(\"rgba(\" + descriptor.red + \",\" + descriptor.green + \",\" + descriptor.blue + \",\" +\n alpha + \")\")\n \n return result\n \n }\n \n \n \n static colorWithRGBA(red: number, green: number, blue: number, alpha: number = 1) {\n \n \n const result = new UIColor(\"rgba(\" + red + \",\" + green + \",\" + blue + \",\" + alpha + \")\")\n \n return result\n \n \n }\n \n static colorWithDescriptor(descriptor: UIColorDescriptor) {\n \n \n const result = new UIColor(\"rgba(\" + descriptor.red.toFixed(0) + \",\" + descriptor.green.toFixed(0) + \",\" +\n descriptor.blue.toFixed(0) + \",\" + this.defaultAlphaToOne(descriptor.alpha) + \")\")\n \n return result\n \n }\n \n \n private static defaultAlphaToOne(value = 1) {\n if (value != value) {\n value = 1\n }\n return value\n }\n \n \n \n colorByMultiplyingRGB(multiplier: number) {\n \n const descriptor = this.colorDescriptor\n \n descriptor.red = descriptor.red * multiplier\n descriptor.green = descriptor.green * multiplier\n descriptor.blue = descriptor.blue * multiplier\n \n const result = UIColor.colorWithDescriptor(descriptor)\n \n return result\n \n }\n \n \n \n \n \n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAyB;AAgBlB,MAAM,gBAAgB,yBAAS;AAAA,EAGlC,YAAmB,aAAqB;AAEpC,UAAM;AAFS;AAAA,EAInB;AAAA,EAIS,WAAW;AAChB,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,WAAW,WAAW;AAClB,WAAO,IAAI,QAAQ,KAAK;AAAA,EAC5B;AAAA,EAEA,WAAW,YAAY;AACnB,WAAO,IAAI,QAAQ,MAAM;AAAA,EAC7B;AAAA,EAEA,WAAW,aAAa;AACpB,WAAO,IAAI,QAAQ,OAAO;AAAA,EAC9B;AAAA,EAEA,WAAW,cAAc;AACrB,WAAO,IAAI,QAAQ,QAAQ;AAAA,EAC/B;AAAA,EAEA,WAAW,aAAa;AACpB,WAAO,IAAI,QAAQ,OAAO;AAAA,EAC9B;AAAA,EAEA,WAAW,aAAa;AACpB,WAAO,IAAI,QAAQ,OAAO;AAAA,EAC9B;AAAA,EAEA,WAAW,aAAa;AACpB,WAAO,IAAI,QAAQ,OAAO;AAAA,EAC9B;AAAA,EAEA,WAAW,YAAY;AACnB,WAAO,IAAI,QAAQ,MAAM;AAAA,EAC7B;AAAA,EAEA,WAAW,iBAAiB;AACx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AQ,GAAG;AAEvF,WAAO;AAAA,EAGX;AAAA,EAEA,OAAO,oBAAoB,YAA+B;AAGtD,UAAM,SAAS,IAAI,QAAQ,UAAU,WAAW,IAAI,QAAQ,CAAC,IAAI,MAAM,WAAW,MAAM,QAAQ,CAAC,IAAI,MACjG,WAAW,KAAK,QAAQ,CAAC,IAAI,MAAM,KAAK,kBAAkB,WAAW,KAAK,IAAI,GAAG;AAErF,WAAO;AAAA,EAEX;AAAA,EAGA,OAAe,kBAAkB,QAAQ,GAAG;AACxC,QAAI,SAAS,OAAO;AAChB,cAAQ;AAAA,IACZ;AACA,WAAO;AAAA,EACX;AAAA,EAIA,sBAAsB,YAAoB;AAEtC,UAAM,aAAa,KAAK;AAExB,eAAW,MAAM,WAAW,MAAM;AAClC,eAAW,QAAQ,WAAW,QAAQ;AACtC,eAAW,OAAO,WAAW,OAAO;AAEpC,UAAM,SAAS,QAAQ,oBAAoB,UAAU;AAErD,WAAO;AAAA,EAEX;AAMJ;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../scripts/UIDateTimeInput.ts"],
4
- "sourcesContent": ["import { nil } from \"./UIObject\"\nimport { UIView, UIViewAddControlEventTargetObject } from \"./UIView\"\n\n\nexport class UIDateTimeInput extends UIView {\n \n \n constructor(elementID: string, type: string = UIDateTimeInput.type.DateTime) {\n \n super(elementID, nil, \"input\")\n \n this.viewHTMLElement.setAttribute(\"type\", type)\n \n this.viewHTMLElement.onchange = (event) => {\n this.sendControlEventForKey(UIDateTimeInput.controlEvent.ValueChange, event)\n }\n \n }\n \n \n static controlEvent = Object.assign({}, UIView.controlEvent, {\n \n \"ValueChange\": \"ValueChange\"\n \n })\n \n \n get controlEventTargetAccumulator(): UIViewAddControlEventTargetObject<UIDateTimeInput> {\n return super.controlEventTargetAccumulator as any\n }\n \n \n static type = {\n \n \"Date\": \"date\",\n \"Time\": \"time\",\n \"DateTime\": \"datetime\"\n \n \n }\n \n \n static format = {\n \n \"European\": \"DD-MM-YYYY\",\n \"ISOComputer\": \"YYYY-MM-DD\",\n \"American\": \"MM/DD/YYYY\"\n \n }\n \n \n get date() {\n \n const result = new Date((this.viewHTMLElement as HTMLInputElement).value)\n \n return result\n \n }\n \n \n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAoB;AACpB,oBAA0D;AAGnD,MAAM,mBAAN,cAA8B,qBAAO;AAAA,EAGxC,YAAY,WAAmB,OAAe,iBAAgB,KAAK,UAAU;AAEzE,UAAM,WAAW,qBAAK,OAAO;AAE7B,SAAK,gBAAgB,aAAa,QAAQ,IAAI;AAE9C,SAAK,gBAAgB,WAAW,CAAC,UAAU;AACvC,WAAK,uBAAuB,iBAAgB,aAAa,aAAa,KAAK;AAAA,IAC/E;AAAA,EAEJ;AAAA,EAUA,IAAI,gCAAoF;AACpF,WAAO,MAAM;AAAA,EACjB;AAAA,EAsBA,IAAI,OAAO;AAEP,UAAM,SAAS,IAAI,KAAM,KAAK,gBAAqC,KAAK;AAExE,WAAO;AAAA,EAEX;AAGJ;AAxDO,IAAM,kBAAN;AAAM,gBAgBF,eAAe,OAAO,OAAO,CAAC,GAAG,qBAAO,cAAc;AAAA,EAEzD,eAAe;AAEnB,CAAC;AApBQ,gBA4BF,OAAO;AAAA,EAEV,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,YAAY;AAGhB;AAnCS,gBAsCF,SAAS;AAAA,EAEZ,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,YAAY;AAEhB;",
4
+ "sourcesContent": ["import { nil } from \"./UIObject\"\nimport { UIView, UIViewAddControlEventTargetObject } from \"./UIView\"\n\n\nexport class UIDateTimeInput extends UIView {\n \n \n constructor(elementID: string, type: string = UIDateTimeInput.type.DateTime) {\n \n super(elementID, nil, \"input\")\n \n this.viewHTMLElement.setAttribute(\"type\", type)\n \n this.viewHTMLElement.onchange = (event) => {\n this.sendControlEventForKey(UIDateTimeInput.controlEvent.ValueChange, event)\n }\n \n }\n \n \n static override controlEvent = Object.assign({}, UIView.controlEvent, {\n \n \"ValueChange\": \"ValueChange\"\n \n })\n \n \n override get controlEventTargetAccumulator(): UIViewAddControlEventTargetObject<UIDateTimeInput> {\n return super.controlEventTargetAccumulator as any\n }\n \n \n static type = {\n \n \"Date\": \"date\",\n \"Time\": \"time\",\n \"DateTime\": \"datetime\"\n \n \n }\n \n \n static format = {\n \n \"European\": \"DD-MM-YYYY\",\n \"ISOComputer\": \"YYYY-MM-DD\",\n \"American\": \"MM/DD/YYYY\"\n \n }\n \n \n get date() {\n \n const result = new Date((this.viewHTMLElement as HTMLInputElement).value)\n \n return result\n \n }\n \n \n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAoB;AACpB,oBAA0D;AAGnD,MAAM,mBAAN,cAA8B,qBAAO;AAAA,EAGxC,YAAY,WAAmB,OAAe,iBAAgB,KAAK,UAAU;AAEzE,UAAM,WAAW,qBAAK,OAAO;AAE7B,SAAK,gBAAgB,aAAa,QAAQ,IAAI;AAE9C,SAAK,gBAAgB,WAAW,CAAC,UAAU;AACvC,WAAK,uBAAuB,iBAAgB,aAAa,aAAa,KAAK;AAAA,IAC/E;AAAA,EAEJ;AAAA,EAUA,IAAa,gCAAoF;AAC7F,WAAO,MAAM;AAAA,EACjB;AAAA,EAsBA,IAAI,OAAO;AAEP,UAAM,SAAS,IAAI,KAAM,KAAK,gBAAqC,KAAK;AAExE,WAAO;AAAA,EAEX;AAGJ;AAxDO,IAAM,kBAAN;AAAM,gBAgBO,eAAe,OAAO,OAAO,CAAC,GAAG,qBAAO,cAAc;AAAA,EAElE,eAAe;AAEnB,CAAC;AApBQ,gBA4BF,OAAO;AAAA,EAEV,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,YAAY;AAGhB;AAnCS,gBAsCF,SAAS;AAAA,EAEZ,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,YAAY;AAEhB;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../scripts/UIDialogView.ts"],
4
- "sourcesContent": ["import { IS_FIREFOX } from \"./ClientCheckers\"\nimport { UIColor } from \"./UIColor\"\nimport { UICore } from \"./UICore\"\nimport { IS, nil, NO, YES } from \"./UIObject\"\nimport { UIView, UIViewBroadcastEvent } from \"./UIView\"\n\n\nexport class UIDialogView<ViewType extends UIView = UIView> extends UIView {\n \n _isAUIDialogView = YES\n _view: ViewType = nil\n _appearedAnimated?: boolean\n animationDuration: number = 0.25\n _zIndex: number = 100\n isVisible: boolean = NO\n dismissesOnTapOutside = YES\n \n constructor(elementID?: string, viewHTMLElement?: HTMLElement) {\n \n \n super(elementID, viewHTMLElement)\n \n this.addTargetForControlEvent(\n UIView.controlEvent.PointerTap,\n function (this: UIDialogView, sender: UIView, event: Event) {\n \n this.didDetectTapOutside(sender, event)\n \n }.bind(this)\n )\n \n this.backgroundColor = UIColor.colorWithRGBA(0, 10, 25).colorWithAlpha(0.75) //CBColor.primaryContentColor.colorWithAlpha(0.75)\n \n this.zIndex = this._zIndex\n \n }\n \n \n didDetectTapOutside(sender: UIView, event: Event) {\n \n if (event.target == this.viewHTMLElement && this.dismissesOnTapOutside) {\n this.dismiss(this._appearedAnimated)\n }\n \n }\n \n \n set zIndex(zIndex: number) {\n \n this._zIndex = zIndex\n this.style.zIndex = \"\" + zIndex\n \n }\n \n get zIndex() {\n \n return this._zIndex\n \n }\n \n \n set view(view: ViewType) {\n \n this._view.removeFromSuperview()\n \n this._view = view\n \n this.addSubview(view)\n \n }\n \n \n get view() {\n \n return this._view\n \n }\n \n \n willAppear(animated: boolean = NO) {\n \n if (animated) {\n \n this.style.opacity = \"0\"\n \n }\n \n this.style.height = \"\"\n \n this._frame = nil\n \n }\n \n \n animateAppearing() {\n \n this.style.opacity = \"1\"\n \n }\n \n animateDisappearing() {\n \n this.style.opacity = \"0\"\n \n }\n \n \n showInView(containerView: UIView, animated: boolean) {\n \n \n animated = (animated && !IS_FIREFOX)\n \n this._appearedAnimated = animated\n \n this.willAppear(animated)\n \n \n containerView.addSubview(this)\n \n if (animated) {\n \n this.layoutSubviews()\n \n UIView.animateViewOrViewsWithDurationDelayAndFunction(\n this,\n this.animationDuration,\n 0,\n undefined,\n () => this.animateAppearing(),\n nil\n )\n \n \n }\n else {\n \n this.setNeedsLayout()\n \n }\n \n this.isVisible = YES\n \n }\n \n \n showInRootView(animated: boolean) {\n \n this.showInView(UICore.main.rootViewController.view, animated)\n \n }\n \n \n dismiss(animated?: boolean) {\n \n if (!this.isVisible) {\n return\n }\n \n animated = (animated && !IS_FIREFOX)\n \n if (animated == undefined) {\n \n animated = this._appearedAnimated\n \n }\n \n if (animated) {\n \n UIView.animateViewOrViewsWithDurationDelayAndFunction(\n this,\n this.animationDuration,\n 0,\n undefined,\n (() => {\n \n this.animateDisappearing()\n \n }).bind(this),\n () => {\n \n if (this.isVisible == NO) {\n \n this.removeFromSuperview()\n \n }\n \n }\n )\n \n }\n else {\n \n this.removeFromSuperview()\n \n }\n \n this.isVisible = NO\n \n }\n \n \n didReceiveBroadcastEvent(event: UIViewBroadcastEvent) {\n \n super.didReceiveBroadcastEvent(event)\n \n if (event.name == UICore.broadcastEventName.WindowDidResize) {\n \n this.setNeedsLayout()\n \n }\n \n }\n \n \n layoutSubviews() {\n \n \n if (!IS(this.view)) {\n \n return\n \n }\n \n //this.frame = this.superview.bounds;\n \n this.setPosition(0, 0, 0, 0, 0, \"100%\")\n this.setPosition(0, 0, 0, 0, UIView.pageHeight, \"100%\")\n \n const bounds = this.bounds\n \n const margin = 20\n \n //this.view.centerInContainer();\n \n this.view.style.position = \"relative\"\n \n // this.view.style.maxHeight = \"\" + (bounds.height - margin * 2).integerValue + \"px\";\n // this.view.style.maxWidth = \"\" + (bounds.width - margin * 2).integerValue + \"px\";\n \n \n // var viewIntrinsicRectangle = this.view.intrinsicContentSize();\n // this.view.frame = new UIRectangle((bounds.width - viewIntrinsicRectangle.width)*0.5, )\n \n super.layoutSubviews()\n \n }\n \n \n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA2B;AAC3B,qBAAwB;AACxB,oBAAuB;AACvB,sBAAiC;AACjC,oBAA6C;AAGtC,MAAM,qBAAuD,qBAAO;AAAA,EAUvE,YAAY,WAAoB,iBAA+B;AAG3D,UAAM,WAAW,eAAe;AAXpC,4BAAmB;AACnB,iBAAkB;AAElB,6BAA4B;AAC5B,mBAAkB;AAClB,qBAAqB;AACrB,iCAAwB;AAOpB,SAAK;AAAA,MACD,qBAAO,aAAa;AAAA,MACpB,SAA8B,QAAgB,OAAc;AAExD,aAAK,oBAAoB,QAAQ,KAAK;AAAA,MAE1C,EAAE,KAAK,IAAI;AAAA,IACf;AAEA,SAAK,kBAAkB,uBAAQ,cAAc,GAAG,IAAI,EAAE,EAAE,eAAe,IAAI;AAE3E,SAAK,SAAS,KAAK;AAAA,EAEvB;AAAA,EAGA,oBAAoB,QAAgB,OAAc;AAE9C,QAAI,MAAM,UAAU,KAAK,mBAAmB,KAAK,uBAAuB;AACpE,WAAK,QAAQ,KAAK,iBAAiB;AAAA,IACvC;AAAA,EAEJ;AAAA,EAGA,IAAI,OAAO,QAAgB;AAEvB,SAAK,UAAU;AACf,SAAK,MAAM,SAAS,KAAK;AAAA,EAE7B;AAAA,EAEA,IAAI,SAAS;AAET,WAAO,KAAK;AAAA,EAEhB;AAAA,EAGA,IAAI,KAAK,MAAgB;AAErB,SAAK,MAAM,oBAAoB;AAE/B,SAAK,QAAQ;AAEb,SAAK,W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;AAED,WAAK,oBAAoB;AAAA,IAE7B;AAEA,SAAK,YAAY;AAAA,EAErB;AAAA,EAGA,yBAAyB,OAA6B;AAElD,UAAM,yBAAyB,KAAK;AAEpC,QAAI,MAAM,QAAQ,qBAAO,mBAAmB,iBAAiB;AAEzD,WAAK,eAAe;AAAA,IAExB;AAAA,EAEJ;AAAA,EAGA,iBAAiB;AAGb,QAAI,KAAC,oBAAG,KAAK,IAAI,GAAG;AAEhB;AAAA,IAEJ;AAIA,SAAK,YAAY,GAAG,GAAG,GAAG,GAAG,GAAG,MAAM;AACtC,SAAK,YAAY,GAAG,GAAG,GAAG,GAAG,qBAAO,YAAY,MAAM;AAEtD,UAAM,SAAS,KAAK;AAEpB,UAAM,SAAS;AAIf,SAAK,KAAK,MAAM,WAAW;AAS3B,UAAM,eAAe;AAAA,EAEzB;AAGJ;",
4
+ "sourcesContent": ["import { IS_FIREFOX } from \"./ClientCheckers\"\nimport { UIColor } from \"./UIColor\"\nimport { UICore } from \"./UICore\"\nimport { IS, nil, NO, YES } from \"./UIObject\"\nimport { UIView, UIViewBroadcastEvent } from \"./UIView\"\n\n\nexport class UIDialogView<ViewType extends UIView = UIView> extends UIView {\n \n _isAUIDialogView = YES\n _view: ViewType = nil\n _appearedAnimated?: boolean\n animationDuration: number = 0.25\n _zIndex: number = 100\n isVisible: boolean = NO\n dismissesOnTapOutside = YES\n \n constructor(elementID?: string, viewHTMLElement?: HTMLElement) {\n \n \n super(elementID, viewHTMLElement)\n \n this.addTargetForControlEvent(\n UIView.controlEvent.PointerTap,\n function (this: UIDialogView, sender: UIView, event: Event) {\n \n this.didDetectTapOutside(sender, event)\n \n }.bind(this)\n )\n \n this.backgroundColor = UIColor.colorWithRGBA(0, 10, 25).colorWithAlpha(0.75) //CBColor.primaryContentColor.colorWithAlpha(0.75)\n \n this.zIndex = this._zIndex\n \n }\n \n \n didDetectTapOutside(sender: UIView, event: Event) {\n \n if (event.target == this.viewHTMLElement && this.dismissesOnTapOutside) {\n this.dismiss(this._appearedAnimated)\n }\n \n }\n \n \n set zIndex(zIndex: number) {\n \n this._zIndex = zIndex\n this.style.zIndex = \"\" + zIndex\n \n }\n \n get zIndex() {\n \n return this._zIndex\n \n }\n \n \n set view(view: ViewType) {\n \n this._view.removeFromSuperview()\n \n this._view = view\n \n this.addSubview(view)\n \n }\n \n \n get view() {\n \n return this._view\n \n }\n \n \n override willAppear(animated: boolean = NO) {\n \n if (animated) {\n \n this.style.opacity = \"0\"\n \n }\n \n this.style.height = \"\"\n \n this._frame = nil\n \n }\n \n \n animateAppearing() {\n \n this.style.opacity = \"1\"\n \n }\n \n animateDisappearing() {\n \n this.style.opacity = \"0\"\n \n }\n \n \n showInView(containerView: UIView, animated: boolean) {\n \n \n animated = (animated && !IS_FIREFOX)\n \n this._appearedAnimated = animated\n \n this.willAppear(animated)\n \n \n containerView.addSubview(this)\n \n if (animated) {\n \n this.layoutSubviews()\n \n UIView.animateViewOrViewsWithDurationDelayAndFunction(\n this,\n this.animationDuration,\n 0,\n undefined,\n () => this.animateAppearing(),\n nil\n )\n \n \n }\n else {\n \n this.setNeedsLayout()\n \n }\n \n this.isVisible = YES\n \n }\n \n \n showInRootView(animated: boolean) {\n \n this.showInView(UICore.main.rootViewController.view, animated)\n \n }\n \n \n dismiss(animated?: boolean) {\n \n if (!this.isVisible) {\n return\n }\n \n animated = (animated && !IS_FIREFOX)\n \n if (animated == undefined) {\n \n animated = this._appearedAnimated\n \n }\n \n if (animated) {\n \n UIView.animateViewOrViewsWithDurationDelayAndFunction(\n this,\n this.animationDuration,\n 0,\n undefined,\n (() => {\n \n this.animateDisappearing()\n \n }).bind(this),\n () => {\n \n if (this.isVisible == NO) {\n \n this.removeFromSuperview()\n \n }\n \n }\n )\n \n }\n else {\n \n this.removeFromSuperview()\n \n }\n \n this.isVisible = NO\n \n }\n \n \n override didReceiveBroadcastEvent(event: UIViewBroadcastEvent) {\n \n super.didReceiveBroadcastEvent(event)\n \n if (event.name == UICore.broadcastEventName.WindowDidResize) {\n \n this.setNeedsLayout()\n \n }\n \n }\n \n \n override layoutSubviews() {\n \n \n if (!IS(this.view)) {\n \n return\n \n }\n \n //this.frame = this.superview.bounds;\n \n this.setPosition(0, 0, 0, 0, 0, \"100%\")\n this.setPosition(0, 0, 0, 0, UIView.pageHeight, \"100%\")\n \n const bounds = this.bounds\n \n const margin = 20\n \n //this.view.centerInContainer();\n \n this.view.style.position = \"relative\"\n \n // this.view.style.maxHeight = \"\" + (bounds.height - margin * 2).integerValue + \"px\";\n // this.view.style.maxWidth = \"\" + (bounds.width - margin * 2).integerValue + \"px\";\n \n \n // var viewIntrinsicRectangle = this.view.intrinsicContentSize();\n // this.view.frame = new UIRectangle((bounds.width - viewIntrinsicRectangle.width)*0.5, )\n \n super.layoutSubviews()\n \n }\n \n \n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA2B;AAC3B,qBAAwB;AACxB,oBAAuB;AACvB,sBAAiC;AACjC,oBAA6C;AAGtC,MAAM,qBAAuD,qBAAO;AAAA,EAUvE,YAAY,WAAoB,iBAA+B;AAG3D,UAAM,WAAW,eAAe;AAXpC,4BAAmB;AACnB,iBAAkB;AAElB,6BAA4B;AAC5B,mBAAkB;AAClB,qBAAqB;AACrB,iCAAwB;AAOpB,SAAK;AAAA,MACD,qBAAO,aAAa;AAAA,MACpB,SAA8B,QAAgB,OAAc;AAExD,aAAK,oBAAoB,QAAQ,KAAK;AAAA,MAE1C,EAAE,KAAK,IAAI;AAAA,IACf;AAEA,SAAK,kBAAkB,uBAAQ,cAAc,GAAG,IAAI,EAAE,EAAE,eAAe,IAAI;AAE3E,SAAK,SAAS,KAAK;AAAA,EAEvB;AAAA,EAGA,oBAAoB,QAAgB,OAAc;AAE9C,QAAI,MAAM,UAAU,KAAK,mBAAmB,KAAK,uBAAuB;AACpE,WAAK,Q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AEpB;AAEA,QAAI,UAAU;AAEV,2BAAO;AAAA,QACH;AAAA,QACA,KAAK;AAAA,QACL;AAAA,QACA;AAAA,SACC,MAAM;AAEH,eAAK,oBAAoB;AAAA,QAE7B,GAAG,KAAK,IAAI;AAAA,QACZ,MAAM;AAEF,cAAI,KAAK,aAAa,oBAAI;AAEtB,iBAAK,oBAAoB;AAAA,UAE7B;AAAA,QAEJ;AAAA,MACJ;AAAA,IAEJ,OACK;AAED,WAAK,oBAAoB;AAAA,IAE7B;AAEA,SAAK,YAAY;AAAA,EAErB;AAAA,EAGS,yBAAyB,OAA6B;AAE3D,UAAM,yBAAyB,KAAK;AAEpC,QAAI,MAAM,QAAQ,qBAAO,mBAAmB,iBAAiB;AAEzD,WAAK,eAAe;AAAA,IAExB;AAAA,EAEJ;AAAA,EAGS,iBAAiB;AAGtB,QAAI,KAAC,oBAAG,KAAK,IAAI,GAAG;AAEhB;AAAA,IAEJ;AAIA,SAAK,YAAY,GAAG,GAAG,GAAG,GAAG,GAAG,MAAM;AACtC,SAAK,YAAY,GAAG,GAAG,GAAG,GAAG,qBAAO,YAAY,MAAM;AAEtD,UAAM,SAAS,KAAK;AAEpB,UAAM,SAAS;AAIf,SAAK,KAAK,MAAM,WAAW;AAS3B,UAAM,eAAe;AAAA,EAEzB;AAGJ;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../scripts/UIImageView.ts"],
4
- "sourcesContent": ["import { UICore } from \"./UICore\"\nimport { IS_NOT, nil, NO, YES } from \"./UIObject\"\nimport { UIRectangle } from \"./UIRectangle\"\nimport { UIView, UIViewBroadcastEvent } from \"./UIView\"\n\n\nexport class UIImageView extends UIView {\n \n \n //actionIndicator: UIActionIndicator;\n _sourceKey?: string\n _defaultSource?: string\n \n _fillMode: any\n \n _hiddenWhenEmpty = NO\n \n \n constructor(elementID?: string, viewHTMLElement = null) {\n \n super(elementID, viewHTMLElement, \"img\")\n \n \n //this.actionIndicator = new UIActionIndicator(elementID + \"ActionIndicator\");\n \n \n }\n \n \n static fillMode = {\n \n \"stretchToFill\": \"fill\",\n \"aspectFit\": \"contain\",\n \"aspectFill\": \"cover\",\n \"center\": \"none\",\n \"aspectFitIfLarger\": \"scale-down\"\n \n }\n \n \n get viewHTMLElement() {\n \n return super.viewHTMLElement as HTMLImageElement\n \n }\n \n \n static objectURLFromDataURL(dataURL: string) {\n // @ts-ignore\n const blob = dataURLtoBlob(dataURL)\n return URL.createObjectURL(blob)\n }\n \n \n static dataURL(url: string | URL, callback: (arg0: string | ArrayBuffer | null) => void) {\n const xhr = new XMLHttpRequest()\n xhr.open(\"get\", url)\n xhr.responseType = \"blob\"\n xhr.onload = function () {\n const fr = new FileReader()\n \n fr.onload = function () {\n callback(this.result)\n }\n \n fr.readAsDataURL(xhr.response) // async call\n }\n \n xhr.send()\n }\n \n \n static dataURLWithMaxSize(URLString: string, maxSize: number, completion: (resultURLString: string) => void) {\n \n const imageView = new UIImageView()\n imageView.imageSource = URLString\n \n imageView.viewHTMLElement.onload = () => {\n \n const originalSize = imageView.intrinsicContentSize()\n \n let multiplier = maxSize / Math.max(originalSize.height, originalSize.width)\n multiplier = Math.min(1, multiplier)\n \n const result = imageView.getDataURL((originalSize.height * multiplier).integerValue, (originalSize.width *\n multiplier).integerValue)\n \n completion(result)\n \n }\n \n }\n \n \n static dataURLWithSizes(\n URLString: string,\n height: number,\n width: number,\n completion: (resultURLString: string) => void\n ) {\n \n const imageView = new UIImageView()\n imageView.imageSource = URLString\n \n imageView.viewHTMLElement.onload = () => {\n \n const result = imageView.getDataURL(height, width)\n completion(result)\n \n }\n \n }\n \n \n getDataURL(height?: number, width?: number) {\n \n const img = this.viewHTMLElement\n \n // Create an empty canvas element\n const canvas: HTMLCanvasElement = document.createElement(\"canvas\")\n canvas.width = width ?? img.naturalWidth\n canvas.height = height ?? img.naturalHeight\n \n // Copy the image contents to the canvas\n const ctx = canvas.getContext(\"2d\") as CanvasRenderingContext2D\n ctx.drawImage(img, 0, 0, width ?? img.naturalWidth, height ?? img.naturalHeight)\n \n // Get the data-URL formatted image\n // Firefox supports PNG and JPEG. You could check img.src to\n // guess the original format, but be aware the using \"image/jpg\"\n // will re-encode the image.\n return canvas.toDataURL(\"image/png\")\n \n }\n \n \n get imageSource() {\n \n return this.viewHTMLElement.src\n \n }\n \n set imageSource(sourceString: string) {\n \n if (IS_NOT(sourceString)) {\n sourceString = \"\"\n }\n \n this.viewHTMLElement.src = sourceString\n \n if (this.hiddenWhenEmpty) {\n this.hidden = IS_NOT(this.imageSource)\n }\n \n if (!sourceString || !sourceString.length) {\n \n //this.actionIndicator.stop();\n this.hidden = YES\n \n return\n \n }\n else {\n \n this.hidden = NO\n \n }\n \n // this.superview.addSubview(this.actionIndicator);\n // this.actionIndicator.frame = this.frame;\n // this.actionIndicator.start();\n // this.actionIndicator.backgroundColor = UIColor.redColor\n \n // @ts-ignore\n this.viewHTMLElement.onload = () => this.superview.setNeedsLayout()\n \n }\n \n \n setImageSource(key: string, defaultString: string) {\n \n const languageName = UICore.languageService.currentLanguageKey\n this.imageSource = UICore.languageService.stringForKey(key, languageName, defaultString, nil)\n \n }\n \n \n didReceiveBroadcastEvent(event: UIViewBroadcastEvent) {\n \n super.didReceiveBroadcastEvent(event)\n \n if (event.name == UIView.broadcastEventName.LanguageChanged || event.name ==\n UIView.broadcastEventName.AddedToViewTree) {\n \n this._setImageSourceFromKeyIfPossible()\n \n }\n \n }\n \n \n willMoveToSuperview(superview: UIView) {\n \n super.willMoveToSuperview(superview)\n \n this._setImageSourceFromKeyIfPossible()\n \n }\n \n _setImageSourceFromKeyIfPossible() {\n \n if (this._sourceKey && this._defaultSource) {\n \n this.setImageSource(this._sourceKey, this._defaultSource)\n \n }\n \n }\n \n \n get fillMode() {\n return this._fillMode\n }\n \n set fillMode(fillMode) {\n \n this._fillMode = fillMode;\n (this.style as any).objectFit = fillMode\n \n }\n \n \n get hiddenWhenEmpty() {\n return this._hiddenWhenEmpty\n }\n \n set hiddenWhenEmpty(hiddenWhenEmpty: boolean) {\n this._hiddenWhenEmpty = hiddenWhenEmpty\n if (hiddenWhenEmpty) {\n this.hidden = IS_NOT(this.imageSource)\n }\n }\n \n \n didMoveToSuperview(superview: UIView) {\n \n super.didMoveToSuperview(superview)\n \n \n }\n \n \n layoutSubviews() {\n \n super.layoutSubviews()\n \n \n }\n \n \n intrinsicContentSize() {\n \n \n return new UIRectangle(0, 0, this.viewHTMLElement.naturalHeight, this.viewHTMLElement.naturalWidth)\n \n \n }\n \n intrinsicContentSizeWithConstraints(constrainingHeight = 0, constrainingWidth = 0) {\n \n const heightRatio = constrainingHeight / this.viewHTMLElement.naturalHeight\n \n const widthRatio = constrainingWidth / this.viewHTMLElement.naturalWidth\n \n const multiplier = Math.max(heightRatio, widthRatio)\n \n return new UIRectangle(0, 0, this.viewHTMLElement.naturalHeight *\n multiplier, this.viewHTMLElement.naturalWidth * multiplier)\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,oBAAuB;AACvB,sBAAqC;AACrC,yBAA4B;AAC5B,oBAA6C;AAGtC,MAAM,eAAN,cAA0B,qBAAO;AAAA,EAYpC,YAAY,WAAoB,kBAAkB,MAAM;AAEpD,UAAM,WAAW,iBAAiB,KAAK;AAL3C,4BAAmB;AAAA,EAWnB;AAAA,EAcA,IAAI,kBAAkB;AAElB,WAAO,MAAM;AAAA,EAEjB;AAAA,EAGA,OAAO,qBAAqB,SAAiB;AAEzC,UAAM,OAAO,cAAc,OAAO;AAClC,WAAO,IAAI,gBAAgB,IAAI;AAAA,EACnC;AAAA,EAGA,OAAO,QAAQ,KAAmB,UAAuD;AACrF,UAAM,MAAM,IAAI,eAAe;AAC/B,QAAI,KAAK,OAAO,GAAG;AACnB,QAAI,eAAe;AACnB,QAAI,SAAS,WAAY;AACrB,YAAM,KAA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C;AAAA,EAGA,iBAAiB;AAEb,UAAM,eAAe;AAAA,EAGzB;AAAA,EAGA,uBAAuB;AAGnB,WAAO,IAAI,+BAAY,GAAG,GAAG,KAAK,gBAAgB,eAAe,KAAK,gBAAgB,YAAY;AAAA,EAGtG;AAAA,EAEA,oCAAoC,qBAAqB,GAAG,oBAAoB,GAAG;AAE/E,UAAM,cAAc,qBAAqB,KAAK,gBAAgB;AAE9D,UAAM,aAAa,oBAAoB,KAAK,gBAAgB;AAE5D,UAAM,aAAa,KAAK,IAAI,aAAa,UAAU;AAEnD,WAAO,IAAI,+BAAY,GAAG,GAAG,KAAK,gBAAgB,gBAC9C,YAAY,KAAK,gBAAgB,eAAe,UAAU;AAAA,EAGlE;AAGJ;AArRO,IAAM,cAAN;AAAM,YAuBF,WAAW;AAAA,EAEd,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,cAAc;AAAA,EACd,UAAU;AAAA,EACV,qBAAqB;AAEzB;",
4
+ "sourcesContent": ["import { UICore } from \"./UICore\"\nimport { IS_NOT, nil, NO, YES } from \"./UIObject\"\nimport { UIRectangle } from \"./UIRectangle\"\nimport { UIView, UIViewBroadcastEvent } from \"./UIView\"\n\n\nexport class UIImageView extends UIView {\n \n \n //actionIndicator: UIActionIndicator;\n _sourceKey?: string\n _defaultSource?: string\n \n _fillMode: any\n \n _hiddenWhenEmpty = NO\n \n \n constructor(elementID?: string, viewHTMLElement = null) {\n \n super(elementID, viewHTMLElement, \"img\")\n \n \n //this.actionIndicator = new UIActionIndicator(elementID + \"ActionIndicator\");\n \n \n }\n \n \n static fillMode = {\n \n \"stretchToFill\": \"fill\",\n \"aspectFit\": \"contain\",\n \"aspectFill\": \"cover\",\n \"center\": \"none\",\n \"aspectFitIfLarger\": \"scale-down\"\n \n }\n \n \n override get viewHTMLElement() {\n \n return super.viewHTMLElement as HTMLImageElement\n \n }\n \n \n static objectURLFromDataURL(dataURL: string) {\n // @ts-ignore\n const blob = dataURLtoBlob(dataURL)\n return URL.createObjectURL(blob)\n }\n \n \n static dataURL(url: string | URL, callback: (arg0: string | ArrayBuffer | null) => void) {\n const xhr = new XMLHttpRequest()\n xhr.open(\"get\", url)\n xhr.responseType = \"blob\"\n xhr.onload = function () {\n const fr = new FileReader()\n \n fr.onload = function () {\n callback(this.result)\n }\n \n fr.readAsDataURL(xhr.response) // async call\n }\n \n xhr.send()\n }\n \n \n static dataURLWithMaxSize(URLString: string, maxSize: number, completion: (resultURLString: string) => void) {\n \n const imageView = new UIImageView()\n imageView.imageSource = URLString\n \n imageView.viewHTMLElement.onload = () => {\n \n const originalSize = imageView.intrinsicContentSize()\n \n let multiplier = maxSize / Math.max(originalSize.height, originalSize.width)\n multiplier = Math.min(1, multiplier)\n \n const result = imageView.getDataURL((originalSize.height * multiplier).integerValue, (originalSize.width *\n multiplier).integerValue)\n \n completion(result)\n \n }\n \n }\n \n \n static dataURLWithSizes(\n URLString: string,\n height: number,\n width: number,\n completion: (resultURLString: string) => void\n ) {\n \n const imageView = new UIImageView()\n imageView.imageSource = URLString\n \n imageView.viewHTMLElement.onload = () => {\n \n const result = imageView.getDataURL(height, width)\n completion(result)\n \n }\n \n }\n \n \n getDataURL(height?: number, width?: number) {\n \n const img = this.viewHTMLElement\n \n // Create an empty canvas element\n const canvas: HTMLCanvasElement = document.createElement(\"canvas\")\n canvas.width = width ?? img.naturalWidth\n canvas.height = height ?? img.naturalHeight\n \n // Copy the image contents to the canvas\n const ctx = canvas.getContext(\"2d\") as CanvasRenderingContext2D\n ctx.drawImage(img, 0, 0, width ?? img.naturalWidth, height ?? img.naturalHeight)\n \n // Get the data-URL formatted image\n // Firefox supports PNG and JPEG. You could check img.src to\n // guess the original format, but be aware the using \"image/jpg\"\n // will re-encode the image.\n return canvas.toDataURL(\"image/png\")\n \n }\n \n \n get imageSource() {\n \n return this.viewHTMLElement.src\n \n }\n \n set imageSource(sourceString: string) {\n \n if (IS_NOT(sourceString)) {\n sourceString = \"\"\n }\n \n this.viewHTMLElement.src = sourceString\n \n if (this.hiddenWhenEmpty) {\n this.hidden = IS_NOT(this.imageSource)\n }\n \n if (!sourceString || !sourceString.length) {\n \n //this.actionIndicator.stop();\n this.hidden = YES\n \n return\n \n }\n else {\n \n this.hidden = NO\n \n }\n \n // this.superview.addSubview(this.actionIndicator);\n // this.actionIndicator.frame = this.frame;\n // this.actionIndicator.start();\n // this.actionIndicator.backgroundColor = UIColor.redColor\n \n // @ts-ignore\n this.viewHTMLElement.onload = () => this.superview.setNeedsLayout()\n \n }\n \n \n setImageSource(key: string, defaultString: string) {\n \n const languageName = UICore.languageService.currentLanguageKey\n this.imageSource = UICore.languageService.stringForKey(key, languageName, defaultString, nil)\n \n }\n \n \n override didReceiveBroadcastEvent(event: UIViewBroadcastEvent) {\n \n super.didReceiveBroadcastEvent(event)\n \n if (event.name == UIView.broadcastEventName.LanguageChanged || event.name ==\n UIView.broadcastEventName.AddedToViewTree) {\n \n this._setImageSourceFromKeyIfPossible()\n \n }\n \n }\n \n \n override willMoveToSuperview(superview: UIView) {\n \n super.willMoveToSuperview(superview)\n \n this._setImageSourceFromKeyIfPossible()\n \n }\n \n _setImageSourceFromKeyIfPossible() {\n \n if (this._sourceKey && this._defaultSource) {\n \n this.setImageSource(this._sourceKey, this._defaultSource)\n \n }\n \n }\n \n \n get fillMode() {\n return this._fillMode\n }\n \n set fillMode(fillMode) {\n \n this._fillMode = fillMode;\n (this.style as any).objectFit = fillMode\n \n }\n \n \n get hiddenWhenEmpty() {\n return this._hiddenWhenEmpty\n }\n \n set hiddenWhenEmpty(hiddenWhenEmpty: boolean) {\n this._hiddenWhenEmpty = hiddenWhenEmpty\n if (hiddenWhenEmpty) {\n this.hidden = IS_NOT(this.imageSource)\n }\n }\n \n \n override didMoveToSuperview(superview: UIView) {\n \n super.didMoveToSuperview(superview)\n \n \n }\n \n \n override layoutSubviews() {\n \n super.layoutSubviews()\n \n \n }\n \n \n override intrinsicContentSize() {\n \n \n return new UIRectangle(0, 0, this.viewHTMLElement.naturalHeight, this.viewHTMLElement.naturalWidth)\n \n \n }\n \n override intrinsicContentSizeWithConstraints(constrainingHeight = 0, constrainingWidth = 0) {\n \n const heightRatio = constrainingHeight / this.viewHTMLElement.naturalHeight\n \n const widthRatio = constrainingWidth / this.viewHTMLElement.naturalWidth\n \n const multiplier = Math.max(heightRatio, widthRatio)\n \n return new UIRectangle(0, 0, this.viewHTMLElement.naturalHeight *\n multiplier, this.viewHTMLElement.naturalWidth * multiplier)\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,oBAAuB;AACvB,sBAAqC;AACrC,yBAA4B;AAC5B,oBAA6C;AAGtC,MAAM,eAAN,cAA0B,qBAAO;AAAA,EAYpC,YAAY,WAAoB,kBAAkB,MAAM;AAEpD,UAAM,WAAW,iBAAiB,KAAK;AAL3C,4BAAmB;AAAA,EAWnB;AAAA,EAcA,IAAa,kBAAkB;AAE3B,WAAO,MAAM;AAAA,EAEjB;AAAA,EAGA,OAAO,qBAAqB,SAAiB;AAEzC,UAAM,OAAO,cAAc,OAAO;AAClC,WAAO,IAAI,gBAAgB,IAAI;AAAA,EACnC;AAAA,EAGA,OAAO,QAAQ,KAAmB,UAAuD;AACrF,UAAM,MAAM,IAAI,eAAe;AAC/B,QAAI,KAAK,OAAO,GAAG;AACnB,QAAI,eAAe;AACnB,QAAI,SAAS,WAAY;AACrB,YAAM,KAAK,IAAI,WAAW;AAE1B,SAAG,SAAS,WAAY;AACpB,iBAAS,KAAK,MAAM;AAAA,MACxB;AAEA,SAAG,cAAc,IAAI,QAAQ;AAAA,IACjC;AAEA,QAAI,KAAK;AAAA,EACb;AAAA,EAGA,OAAO,mBAAmB,WAAmB,SAAiB,YAA+C;AAEzG,UAAM,YAAY,IAAI,aAAY;AAClC,cAAU,cAAc;AAExB,cAAU,gBAAgB,SAAS,MAAM;AAErC,YAAM,eAAe,UAA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;AAE5D,UAAM,aAAa,KAAK,IAAI,aAAa,UAAU;AAEnD,WAAO,IAAI,+BAAY,GAAG,GAAG,KAAK,gBAAgB,gBAC9C,YAAY,KAAK,gBAAgB,eAAe,UAAU;AAAA,EAGlE;AAGJ;AArRO,IAAM,cAAN;AAAM,YAuBF,WAAW;AAAA,EAEd,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,cAAc;AAAA,EACd,UAAU;AAAA,EACV,qBAAqB;AAEzB;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../scripts/UILink.ts"],
4
- "sourcesContent": ["import { UIBaseButton } from \"./UIBaseButton\"\nimport { UIButtonColorSpecifier } from \"./UIButton\"\nimport { UICore } from \"./UICore\"\nimport { nil, NO } from \"./UIObject\"\nimport { UIRoute } from \"./UIRoute\"\nimport { UIViewBroadcastEvent } from \"./UIView\"\n\n\nexport class UILink extends UIBaseButton {\n \n private _colors?: UIButtonColorSpecifier | undefined\n \n constructor(elementID?: string) {\n \n super(elementID, \"a\")\n \n this.stopsPointerEventPropagation = NO\n this.pausesPointerEvents = NO\n \n this.viewHTMLElement.onclick = this.blur.bind(this)\n \n }\n \n \n get colors(): UIButtonColorSpecifier | undefined {\n return this._colors\n }\n \n set colors(value: UIButtonColorSpecifier | undefined) {\n this._colors = value\n }\n \n \n get viewHTMLElement() {\n \n // @ts-ignore\n return super.viewHTMLElement as HTMLLinkElement\n \n }\n \n set text(text: string) {\n this.viewHTMLElement.textContent = text\n }\n \n get text() {\n return this.viewHTMLElement.textContent ?? \"\"\n }\n \n \n set target(target: string) {\n this.viewHTMLElement.setAttribute(\"href\", target)\n }\n \n get target() {\n return this.viewHTMLElement.getAttribute(\"href\") ?? \"\"\n }\n \n \n set targetRouteForCurrentState(targetRouteForCurrentState: () => (UIRoute | string)) {\n this._targetRouteForCurrentState = targetRouteForCurrentState\n this.updateTarget()\n }\n \n get targetRouteForCurrentState() {\n return this._targetRouteForCurrentState\n }\n \n \n _targetRouteForCurrentState() {\n return UIRoute.currentRoute.routeByRemovingComponentsOtherThanOnesNamed([\"settings\"]) as (UIRoute | string)\n }\n \n \n didReceiveBroadcastEvent(event: UIViewBroadcastEvent) {\n \n super.didReceiveBroadcastEvent(event)\n \n if (event.name == UICore.broadcastEventName.RouteDidChange) {\n \n this.updateTarget()\n \n }\n \n }\n \n \n wasAddedToViewTree() {\n \n super.wasAddedToViewTree()\n \n this.updateTarget()\n \n \n }\n \n \n updateTarget() {\n \n const route = this.targetRouteForCurrentState()\n \n if (route instanceof UIRoute) {\n \n this.target = route.linkRepresentation\n \n return\n \n }\n \n this.target = route\n \n }\n \n \n layoutSubviews() {\n \n super.layoutSubviews()\n \n const bounds = this.bounds\n \n }\n \n \n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\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,0BAA6B;AAE7B,oBAAuB;AACvB,sBAAwB;AACxB,qBAAwB;AAIjB,MAAM,eAAe,iCAAa;AAAA,EAIrC,YAAY,WAAoB;AAE5B,UAAM,WAAW,GAAG;AAEpB,SAAK,+BAA+B;AACpC,SAAK,sBAAsB;AAE3B,SAAK,gBAAgB,UAAU,KAAK,KAAK,KAAK,IAAI;AAAA,EAEtD;AAAA,EAGA,IAAI,SAA6C;AAC7C,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,IAAI,OAAO,OAA2C;AAClD,SAAK,UAAU;AAAA,EACnB;AAAA,EAGA,IAAI,kBAAkB;AAGlB,WAAO,MAAM;AAAA,EAEjB;AAAA,EAEA,IAAI,KAAK,MAAc;AACnB,SAAK,gBAAgB,cAAc;AAAA,EACvC;AAAA,EAEA,IAAI,OAAO;AA5Cf;AA6CQ,YAAO,UAAK,gBAAgB,gBAArB,YAAoC;AAAA,EAC/C;AAAA,EAGA,IAAI,OAAO,QAAgB;AACvB,SAAK,gBAAgB,aAAa,QAAQ,MAAM;AAAA,EACpD;AAAA,EAEA,IAAI,SAAS;AArDjB;AAsDQ,YAAO,UAAK,gBAAgB,aAAa,MAAM,MAAxC,YAA6C;AAAA,EACxD;AAAA,EAGA,IAAI,2BAA2B,4BAAsD;AACjF,SAAK,8BAA8B;AACnC,SAAK,aAAa;AAAA,EACtB;AAAA,EAEA,IAAI,6BAA6B;AAC7B,WAAO,KAAK;AAAA,EAChB;AAAA,EAGA,8BAA8B;AAC1B,WAAO,uBAAQ,aAAa,4CAA4C,CAAC,UAAU,CAAC;AAAA,EACxF;AAAA,EAGA,yBAAyB,OAA6B;AAElD,UAAM,yBAAyB,KAAK;AAEpC,QAAI,MAAM,QAAQ,qBAAO,mBAAmB,gBAAgB;AAExD,WAAK,aAAa;AAAA,IAEtB;AAAA,EAEJ;AAAA,EAGA,qBAAqB;AAEjB,UAAM,mBAAmB;AAEzB,SAAK,aAAa;AAAA,EAGtB;AAAA,EAGA,eAAe;AAEX,UAAM,QAAQ,KAAK,2BAA2B;AAE9C,QAAI,iBAAiB,wBAAS;AAE1B,WAAK,SAAS,MAAM;AAEpB;AAAA,IAEJ;AAEA,SAAK,SAAS;AAAA,EAElB;AAAA,EAGA,iBAAiB;AAEb,UAAM,eAAe;AAErB,UAAM,SAAS,KAAK;AAAA,EAExB;AAGJ;",
4
+ "sourcesContent": ["import { UIBaseButton } from \"./UIBaseButton\"\nimport { UIButtonColorSpecifier } from \"./UIButton\"\nimport { UICore } from \"./UICore\"\nimport { nil, NO } from \"./UIObject\"\nimport { UIRoute } from \"./UIRoute\"\nimport { UIViewBroadcastEvent } from \"./UIView\"\n\n\nexport class UILink extends UIBaseButton {\n \n private _colors?: UIButtonColorSpecifier | undefined\n \n constructor(elementID?: string) {\n \n super(elementID, \"a\")\n \n this.stopsPointerEventPropagation = NO\n this.pausesPointerEvents = NO\n \n this.viewHTMLElement.onclick = this.blur.bind(this)\n \n }\n \n \n get colors(): UIButtonColorSpecifier | undefined {\n return this._colors\n }\n \n set colors(value: UIButtonColorSpecifier | undefined) {\n this._colors = value\n }\n \n \n override get viewHTMLElement() {\n \n // @ts-ignore\n return super.viewHTMLElement as HTMLLinkElement\n \n }\n \n set text(text: string) {\n this.viewHTMLElement.textContent = text\n }\n \n get text() {\n return this.viewHTMLElement.textContent ?? \"\"\n }\n \n \n set target(target: string) {\n this.viewHTMLElement.setAttribute(\"href\", target)\n }\n \n get target() {\n return this.viewHTMLElement.getAttribute(\"href\") ?? \"\"\n }\n \n \n set targetRouteForCurrentState(targetRouteForCurrentState: () => (UIRoute | string)) {\n this._targetRouteForCurrentState = targetRouteForCurrentState\n this.updateTarget()\n }\n \n get targetRouteForCurrentState() {\n return this._targetRouteForCurrentState\n }\n \n \n _targetRouteForCurrentState() {\n return UIRoute.currentRoute.routeByRemovingComponentsOtherThanOnesNamed([\"settings\"]) as (UIRoute | string)\n }\n \n \n override didReceiveBroadcastEvent(event: UIViewBroadcastEvent) {\n \n super.didReceiveBroadcastEvent(event)\n \n if (event.name == UICore.broadcastEventName.RouteDidChange) {\n \n this.updateTarget()\n \n }\n \n }\n \n \n override wasAddedToViewTree() {\n \n super.wasAddedToViewTree()\n \n this.updateTarget()\n \n \n }\n \n \n updateTarget() {\n \n const route = this.targetRouteForCurrentState()\n \n if (route instanceof UIRoute) {\n \n this.target = route.linkRepresentation\n \n return\n \n }\n \n this.target = route\n \n }\n \n \n override layoutSubviews() {\n \n super.layoutSubviews()\n \n const bounds = this.bounds\n \n }\n \n \n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\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,qBAAO,mBAAmB,gBAAgB;AAExD,WAAK,aAAa;AAAA,IAEtB;AAAA,EAEJ;AAAA,EAGS,qBAAqB;AAE1B,UAAM,mBAAmB;AAEzB,SAAK,aAAa;AAAA,EAGtB;AAAA,EAGA,eAAe;AAEX,UAAM,QAAQ,KAAK,2BAA2B;AAE9C,QAAI,iBAAiB,wBAAS;AAE1B,WAAK,SAAS,MAAM;AAEpB;AAAA,IAEJ;AAEA,SAAK,SAAS;AAAA,EAElB;AAAA,EAGS,iBAAiB;AAEtB,UAAM,eAAe;AAErB,UAAM,SAAS,KAAK;AAAA,EAExB;AAGJ;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../scripts/UILinkButton.ts"],
4
- "sourcesContent": ["import { UIButton, UIButtonColorSpecifier } from \"./UIButton\"\nimport { UILink } from \"./UILink\"\n\n\nexport class UILinkButton extends UILink {\n \n button: UIButton\n \n constructor(elementID?: string, elementType?: string, titleType?: string) {\n \n super(elementID)\n \n // Instance variables\n this.button = new UIButton(this.elementID + \"Button\", elementType, titleType)\n this.addSubview(this.button)\n \n this.style.position = \"absolute\"\n this.button.controlEventTargetAccumulator.EnterDown.PointerUpInside = () => window.location = this.target as any\n \n }\n \n \n get titleLabel() {\n return this.button.titleLabel\n }\n \n get imageView() {\n return this.button.imageView\n }\n \n \n set colors(colors: UIButtonColorSpecifier) {\n this.button.colors = colors\n }\n \n get colors(): UIButtonColorSpecifier {\n return this.button.colors\n }\n \n \n get viewHTMLElement() {\n return super.viewHTMLElement as HTMLLinkElement\n }\n \n \n set target(target: string) {\n this.viewHTMLElement.setAttribute(\"href\", target)\n }\n \n get target() {\n return this.viewHTMLElement.getAttribute(\"href\") ?? \"\"\n }\n \n \n layoutSubviews() {\n \n super.layoutSubviews()\n \n const bounds = this.bounds\n \n this.button.frame = bounds\n this.button.layoutSubviews()\n \n }\n \n \n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n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ier } from \"./UIButton\"\nimport { UILink } from \"./UILink\"\n\n\nexport class UILinkButton extends UILink {\n \n button: UIButton\n \n constructor(elementID?: string, elementType?: string, titleType?: string) {\n \n super(elementID)\n \n // Instance variables\n this.button = new UIButton(this.elementID + \"Button\", elementType, titleType)\n this.addSubview(this.button)\n \n this.style.position = \"absolute\"\n this.button.controlEventTargetAccumulator.EnterDown.PointerUpInside = () => window.location = this.target as any\n \n }\n \n \n get titleLabel() {\n return this.button.titleLabel\n }\n \n get imageView() {\n return this.button.imageView\n }\n \n \n override set colors(colors: UIButtonColorSpecifier) {\n this.button.colors = colors\n }\n \n override get colors(): UIButtonColorSpecifier {\n return this.button.colors\n }\n \n \n override get viewHTMLElement() {\n return super.viewHTMLElement as HTMLLinkElement\n }\n \n \n override set target(target: string) {\n this.viewHTMLElement.setAttribute(\"href\", target)\n }\n \n override get target() {\n return this.viewHTMLElement.getAttribute(\"href\") ?? \"\"\n }\n \n \n override layoutSubviews() {\n \n super.layoutSubviews()\n \n const bounds = this.bounds\n \n this.button.frame = bounds\n this.button.layoutSubviews()\n \n }\n \n \n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\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,sBAAiD;AACjD,oBAAuB;AAGhB,MAAM,qBAAqB,qBAAO;AAAA,EAIrC,YAAY,WAAoB,aAAsB,WAAoB;AAEtE,UAAM,SAAS;AAGf,SAAK,SAAS,IAAI,yBAAS,KAAK,YAAY,UAAU,aAAa,SAAS;AAC5E,SAAK,WAAW,KAAK,MAAM;AAE3B,SAAK,MAAM,WAAW;AACtB,SAAK,OAAO,8BAA8B,UAAU,kBAAkB,MAAM,OAAO,WAAW,KAAK;AAAA,EAEvG;AAAA,EAGA,IAAI,aAAa;AACb,WAAO,KAAK,OAAO;AAAA,EACvB;AAAA,EAEA,IAAI,YAAY;AACZ,WAAO,KAAK,OAAO;AAAA,EACvB;AAAA,EAGA,IAAa,OAAO,QAAgC;AAChD,SAAK,OAAO,SAAS;AAAA,EACzB;AAAA,EAEA,IAAa,SAAiC;AAC1C,WAAO,KAAK,OAAO;AAAA,EACvB;AAAA,EAGA,IAAa,kBAAkB;AAC3B,WAAO,MAAM;AAAA,EACjB;AAAA,EAGA,IAAa,OAAO,QAAgB;AAChC,SAAK,gBAAgB,aAAa,QAAQ,MAAM;AAAA,EACpD;AAAA,EAEA,IAAa,SAAS;AAjD1B;AAkDQ,YAAO,UAAK,gBAAgB,aAAa,MAAM,MAAxC,YAA6C;AAAA,EACxD;AAAA,EAGS,iBAAiB;AAEtB,UAAM,eAAe;AAErB,UAAM,SAAS,KAAK;AAEpB,SAAK,OAAO,QAAQ;AACpB,SAAK,OAAO,eAAe;AAAA,EAE/B;AAGJ;",
6
6
  "names": []
7
7
  }
@@ -309,7 +309,7 @@ class UIObject {
309
309
  break;
310
310
  }
311
311
  currentObject = currentObject[key];
312
- if (IS_NOT(currentObject)) {
312
+ if (IS_LIKE_NULL(currentObject)) {
313
313
  currentObject = nil;
314
314
  }
315
315
  }
@@ -345,6 +345,7 @@ class UIObject {
345
345
  }
346
346
  static configureWithObject(configurationTarget, object) {
347
347
  const isAnObject = (item) => item && typeof item === "object" && !Array.isArray(item) && !(item instanceof import_UICoreExtensionValueObject.UICoreExtensionValueObject);
348
+ const isAPureObject = (item) => isAnObject(item) && Object.getPrototypeOf(item) === Object.getPrototypeOf({});
348
349
  function isAClass(funcOrClass) {
349
350
  const isFunction = (functionToCheck) => functionToCheck && {}.toString.call(functionToCheck) === "[object Function]";
350
351
  const propertyNames = Object.getOwnPropertyNames(funcOrClass);
@@ -361,7 +362,7 @@ class UIObject {
361
362
  keyPath: valueKeyPath.replace(".", "")
362
363
  });
363
364
  }
364
- if (isAnObject(sourceValue) || isAClass(sourceValue)) {
365
+ if (isAPureObject(sourceValue) || isAClass(sourceValue)) {
365
366
  if (!(key in target) || target[key] instanceof Function) {
366
367
  addValueAndKeyPath(sourceValue);
367
368
  } else {