uicore-ts 1.0.576 → 1.0.578
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiledScripts/UIButton.js.map +2 -2
- package/compiledScripts/UIObject.d.ts +1 -1
- package/compiledScripts/UIObject.js +4 -0
- package/compiledScripts/UIObject.js.map +2 -2
- package/compiledScripts/UIViewController.js +1 -0
- package/compiledScripts/UIViewController.js.map +2 -2
- package/package.json +1 -1
- package/scripts/UIButton.ts +2 -93
- package/scripts/UIObject.ts +5 -1
- package/scripts/UIViewController.ts +1 -0
|
@@ -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, ValueOf, 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 = nil\n _imageView: UIImageView\n \n usesAutomaticTitleFontSize = NO\n minAutomaticFontSize?: number\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(\n elementID?: string,\n elementType?: string,\n titleType: string | ValueOf<typeof UITextView.type> = UITextView.type.span\n ) {\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 if (this.titleLabel) {\n this.titleLabel.textAlignment = UITextView.textAlignment.center\n this.titleLabel.nativeSelectionEnabled = NO\n }\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 if (this.titleLabel) {\n this.titleLabel.textColor = UIColor.nilColor\n }\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 if (this.titleLabel) {\n this.titleLabel.textColor = this.colors.titleLabel.normal\n }\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 && this.titleLabel) {\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 && this.titleLabel) {\n this.titleLabel.textColor = this.colors.titleLabel.focused\n }\n \n }\n \n override updateContentForHighlightedState() {\n \n this.backgroundColor = this.colors.background.highlighted\n if (this.titleLabel) {\n this.titleLabel.textColor = this.colors.titleLabel.highlighted\n }\n \n }\n \n override updateContentForSelectedState() {\n \n this.backgroundColor = this.colors.background.selected\n if (this.titleLabel) {\n this.titleLabel.textColor = this.colors.titleLabel.selected\n }\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 && this.titleLabel) {\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\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) && 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) && 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,sBAA8D;AAC9D,yBAA4B;AAC5B,wBAA2B;AAuBpB,MAAM,iBAAiB,iCAAa;AAAA,EA+BvC,YACI,WACA,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AAA,IAGJ;AAGA,YAAI,wBAAO,KAAK,UAAU,MAAM,OAAK,UAAK,eAAL,mBAAiB,OAAM;AAIxD,eAAS,OAAO,mBAAmB,KAAK,cAAc;AAEtD,YAAM,aAAa,OAAO,KAAK;AAC/B,iBAAW,QAAQ,OAAO,SAAS,KAAK,iBAAiB;AACzD,WAAK,UAAU,QAAQ;AAEvB,WAAK,WAAW,MAAM,OAAO,WAAW,IAAI,IAAI,KAAK,iBAAiB;AACtE,WAAK,WAAW,MAAM,QAAQ,KAAK,iBAAiB;AACpD,WAAK,WAAW,MAAM,MAAM;AAC5B,WAAK,WAAW,MAAM,YAAY;AAElC,UAAI,KAAK,4BAA4B;AAEjC,cAAM,SAAS,KAAK,WAAW;AAE/B,aAAK,WAAW,SAAS;AAEzB,aAAK,WAAW,WAAW;AAE3B,aAAK,WAAW,WAAW,6BAAW;AAAA,UAClC,IAAI;AAAA,YACA;AAAA,YACA;AAAA,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,
|
|
4
|
+
"sourcesContent": ["import { UIBaseButton } from \"./UIBaseButton\"\nimport { UIColor } from \"./UIColor\"\nimport { UIImageView } from \"./UIImageView\"\nimport { IS, IS_NOT, IS_NOT_NIL, nil, NO, ValueOf, 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 = nil\n _imageView: UIImageView\n \n usesAutomaticTitleFontSize = NO\n minAutomaticFontSize?: number\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(\n elementID?: string,\n elementType?: string,\n titleType: string | ValueOf<typeof UITextView.type> = UITextView.type.span\n ) {\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 if (this.titleLabel) {\n this.titleLabel.textAlignment = UITextView.textAlignment.center\n this.titleLabel.nativeSelectionEnabled = NO\n }\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 if (this.titleLabel) {\n this.titleLabel.textColor = UIColor.nilColor\n }\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 if (this.titleLabel) {\n this.titleLabel.textColor = this.colors.titleLabel.normal\n }\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 && this.titleLabel) {\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 && this.titleLabel) {\n this.titleLabel.textColor = this.colors.titleLabel.focused\n }\n \n }\n \n override updateContentForHighlightedState() {\n \n this.backgroundColor = this.colors.background.highlighted\n if (this.titleLabel) {\n this.titleLabel.textColor = this.colors.titleLabel.highlighted\n }\n \n }\n \n override updateContentForSelectedState() {\n \n this.backgroundColor = this.colors.background.selected\n if (this.titleLabel) {\n this.titleLabel.textColor = this.colors.titleLabel.selected\n }\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 && this.titleLabel) {\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\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) && 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) && 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 + \" + .\" +\n // 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}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|
57
57
|
}
|
|
58
58
|
export declare function LAZY_VALUE<T>(initFunction: () => T): UILazyPropertyValue<T>;
|
|
59
59
|
export type UIInitializerObject<T> = {
|
|
60
|
-
[P in keyof T]?: T[P] extends (...args: any) => any ? UIFunctionCall<T[P]> | UIFunctionExtender<T[P]> | T[P] : T[P] extends object ? UIInitializerObject<T[P]> | UILazyPropertyValue<T[P]> : Partial<T[P]>;
|
|
60
|
+
[P in keyof T]?: T[P] extends (...args: any) => any ? UIFunctionCall<T[P]> | UIFunctionCall<T[P]>[] | UIFunctionExtender<T[P]> | T[P] : T[P] extends object ? UIInitializerObject<T[P]> | UILazyPropertyValue<T[P]> : Partial<T[P]>;
|
|
61
61
|
};
|
|
62
62
|
export declare class UIObject {
|
|
63
63
|
constructor();
|
|
@@ -435,6 +435,10 @@ const _UIObject = class {
|
|
|
435
435
|
value.callFunction(getTargetFunction(YES));
|
|
436
436
|
return;
|
|
437
437
|
}
|
|
438
|
+
if (value instanceof Array && value.allMatch((element) => element instanceof UIFunctionCall)) {
|
|
439
|
+
value.map((element) => element.callFunction(getTargetFunction(YES)));
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
438
442
|
if (value instanceof UIFunctionExtender) {
|
|
439
443
|
value = value.extendedFunction(getTargetFunction());
|
|
440
444
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../scripts/UIObject.ts"],
|
|
4
|
-
"sourcesContent": ["import { UICoreExtensionValueObject } from \"./UICoreExtensionValueObject\"\nimport { UITimer } from \"./UITimer\"\n\n\nfunction NilFunction() {\n return nil\n}\n\n\n// The nil object avoids unnecessary crashes by allowing you to call any function or access any variable on it, returning nil\nexport var nil: any = new Proxy(Object.assign(NilFunction, { \"class\": null, \"className\": \"Nil\" }), {\n get(target, name) {\n if (name == Symbol.toPrimitive) {\n return function (hint: string) {\n if (hint == \"number\") {\n return 0\n }\n if (hint == \"string\") {\n return \"\"\n }\n return false\n }\n }\n if (name == \"toString\") {\n return function toString() {\n return \"\"\n }\n }\n return NilFunction()\n },\n set() {\n return NilFunction()\n }\n})\nwindow.nil = nil\n\ndeclare global {\n interface Window {\n nil: any;\n }\n}\n\n\nexport type RecursiveRequired<T> = Required<{\n [P in keyof T]: T[P] extends object | undefined ? RecursiveRequired<Required<T[P]>> : T[P];\n}>;\n\nexport function wrapInNil<T>(object?: T): Required<T> {\n let result = FIRST_OR_NIL(object)\n if (object instanceof Object && !(object instanceof Function)) {\n result = new Proxy(object as Object & T, {\n get(target, name) {\n if (name == \"wrapped_nil_target\") {\n return target\n }\n const value = Reflect.get(target, name)\n if (typeof value === \"object\") {\n return wrapInNil(value)\n }\n if (IS_NOT_LIKE_NULL(value)) {\n return value\n }\n return nil\n },\n set(target: Record<string, any> & T, name: string, value: any) {\n if (IS(target)) {\n // @ts-ignore\n target[name] = value\n }\n return YES\n }\n })\n }\n return result as any\n}\n\n\nexport const YES = true\nexport const NO = false\n\nexport function IS<T>(object: T | undefined | null | false): object is T {\n if (object && object !== nil) {\n return YES\n }\n return NO\n}\n\nexport function IS_NOT(object: any): object is undefined | null | false {\n return !IS(object)\n}\n\nexport function IS_DEFINED<T>(object: T | undefined): object is T {\n if (object != undefined) {\n return YES\n }\n return NO\n}\n\nexport function IS_UNDEFINED(object: any): object is undefined {\n return !IS_DEFINED(object)\n}\n\nexport function IS_NIL(object: any): object is typeof nil {\n if (object === nil) {\n return YES\n }\n return NO\n}\n\nexport function IS_NOT_NIL<T>(object: T | undefined | null): object is T | undefined | null {\n return !IS_NIL(object)\n}\n\n\nexport function IS_LIKE_NULL(object: any): object is undefined | null {\n return (IS_UNDEFINED(object) || IS_NIL(object) || object == null)\n}\n\nexport function IS_NOT_LIKE_NULL<T>(object: T | null | undefined): object is T {\n return !IS_LIKE_NULL(object)\n}\n\n\nexport function IS_AN_EMAIL_ADDRESS(email: string) {\n const re = /\\S+@\\S+\\.\\S+/\n return re.test(email)\n}\n\n\nexport function FIRST_OR_NIL<T>(...objects: (T | undefined | null)[]): T {\n const result = objects.find(object => IS(object))\n return result || nil\n}\n\nexport function FIRST<T>(...objects: (T | undefined | null)[]): T {\n const result = objects.find(object => IS(object))\n return result || IF(IS_DEFINED(objects.lastElement))(RETURNER(objects.lastElement))()\n}\n\n\nexport function MAKE_ID(randomPartLength = 15) {\n let result = \"\"\n const characters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\"\n for (let i = 0; i < randomPartLength; i++) {\n result = result + characters.charAt(Math.floor(Math.random() * characters.length))\n }\n result = result + Date.now()\n return result\n}\n\n\nexport function RETURNER<T>(value?: T) {\n return (..._objects: any[]) => value\n}\n\n\nexport type UIIFBlockReceiver<T> = (functionToCall: () => any) => UIIFEvaluator<T>;\nexport type UIIFEvaluatorBase<T> = () => T;\n\n\nexport interface UIIFEvaluator<T> extends UIIFEvaluatorBase<T> {\n ELSE_IF: (otherValue: any) => UIIFBlockReceiver<T>;\n ELSE: (functionToCall: () => any) => T;\n}\n\n\nexport function IF<T = any>(value: any): UIIFBlockReceiver<T> {\n \n let thenFunction = nil\n let elseFunction = nil\n \n const result: any = function (functionToCall: () => T) {\n thenFunction = functionToCall\n return result.evaluateConditions\n }\n \n result.evaluateConditions = function () {\n if (IS(value)) {\n return thenFunction()\n }\n return elseFunction()\n }\n \n result.evaluateConditions.ELSE_IF = function (otherValue: any) {\n \n const functionResult = IF(otherValue) as (UIIFBlockReceiver<T> & { evaluateConditions: UIIFEvaluator<T> })\n elseFunction = functionResult.evaluateConditions\n \n const functionResultEvaluateConditionsFunction: any = function () {\n return result.evaluateConditions()\n }\n functionResultEvaluateConditionsFunction.ELSE_IF = functionResult.evaluateConditions.ELSE_IF\n functionResultEvaluateConditionsFunction.ELSE = functionResult.evaluateConditions.ELSE\n \n functionResult.evaluateConditions = functionResultEvaluateConditionsFunction\n \n return functionResult\n \n }\n \n result.evaluateConditions.ELSE = function (functionToCall: () => T) {\n elseFunction = functionToCall\n return result.evaluateConditions()\n }\n \n return result\n}\n\n\nexport class UIFunctionCall<T extends (...args: any) => any> {\n \n isAUIFunctionCallObject = YES\n parameters: Parameters<T>[]\n \n constructor(...parameters: Parameters<T>) {\n this.parameters = parameters\n }\n \n callFunction(functionToCall: T) {\n const parameters = this.parameters\n functionToCall(...parameters)\n }\n \n}\n\n\nexport function CALL<T extends (...args: any) => any>(...objects: Parameters<T>) {\n return new UIFunctionCall<T>(...objects)\n}\n\n\nexport class UIFunctionExtender<T extends (...args: any) => any> {\n \n isAUIFunctionExtenderObject = YES\n extendingFunction: T\n \n static functionByExtendingFunction<T extends (...args: any) => any>(functionToExtend: T, extendingFunction: T) {\n return EXTEND(extendingFunction).extendedFunction(functionToExtend)\n }\n \n constructor(extendingFunction: T) {\n this.extendingFunction = extendingFunction\n }\n \n extendedFunction(functionToExtend: T): T & { extendedFunction: T } {\n const extendingFunction = this.extendingFunction\n \n function extendedFunction(this: any, ...objects: any[]) {\n const boundFunctionToExtend = functionToExtend.bind(this)\n boundFunctionToExtend(...objects)\n const boundExtendingFunction = extendingFunction.bind(this)\n boundExtendingFunction(...objects)\n }\n \n extendedFunction.extendedFunction = functionToExtend\n return extendedFunction as any\n }\n \n}\n\n\nexport function EXTEND<T extends (...args: any) => any>(extendingFunction: T) {\n return new UIFunctionExtender(extendingFunction)\n}\n\n\nexport class UILazyPropertyValue<T> {\n \n isAUILazyPropertyValueObject = YES\n initFunction: () => T\n \n constructor(initFunction: () => T) {\n this.initFunction = initFunction\n }\n \n setLazyPropertyValue(key: string, target: object) {\n \n let isValueInitialized = NO\n \n // property value\n let _value = nil\n \n const initValue = () => {\n _value = this.initFunction()\n isValueInitialized = YES\n this.initFunction = nil\n }\n \n // @ts-ignore\n if (delete target[key]) {\n \n // Create new property with getter and setter\n Object.defineProperty(target, key, {\n get: function () {\n if (IS_NOT(isValueInitialized)) {\n initValue()\n }\n return _value\n },\n set: function (newValue) {\n _value = newValue\n },\n enumerable: true,\n configurable: true\n })\n \n }\n \n }\n \n}\n\n\nexport function LAZY_VALUE<T>(initFunction: () => T) {\n return new UILazyPropertyValue(initFunction)\n}\n\n\nexport type UIInitializerObject<T> = {\n \n [P in keyof T]?:\n //T[P] extends (infer U)[] ? UIInitializerObject<U>[] :\n T[P] extends (...args: any) => any ? UIFunctionCall<T[P]> | UIFunctionExtender<T[P]> | T[P] :\n T[P] extends object ? UIInitializerObject<T[P]> | UILazyPropertyValue<T[P]> :\n Partial<T[P]>;\n \n}\n\n\nexport class UIObject {\n \n constructor() {\n \n // Do something here if needed\n \n }\n \n public get class(): any {\n return Object.getPrototypeOf(this).constructor\n }\n \n public get superclass(): any {\n return Object.getPrototypeOf(Object.getPrototypeOf(this)).constructor\n }\n \n isKindOfClass(classObject: any) {\n if (this.isMemberOfClass(classObject)) {\n return YES\n }\n for (let superclassObject = this.superclass; IS(superclassObject); superclassObject = superclassObject.superclass) {\n if (superclassObject == classObject) {\n return YES\n }\n }\n return NO\n }\n \n \n isMemberOfClass(classObject: any) {\n return (this.class == classObject)\n }\n \n \n static annotationsMap: WeakMap<any, Function[]> = new WeakMap<ClassDecoratorContext, Function[]>()\n \n static recordAnnotation(annotation: Function, target: Function) {\n if (!UIObject.annotationsMap.has(target)) {\n UIObject.annotationsMap.set(target, [])\n }\n UIObject.annotationsMap.get(target)!.push(annotation)\n }\n \n static classHasAnnotation(classObject: Function, annotation: Function) {\n return UIObject.annotationsMap.get(classObject)?.contains(annotation)\n }\n \n static annotationsOnClass(classObject: Function) {\n return UIObject.annotationsMap.get(classObject) ?? []\n }\n \n public static wrapObject<T>(object: T): UIObject & T {\n if (IS_NOT(object)) {\n return nil\n }\n \n if ((object as any) instanceof UIObject) {\n // @ts-ignore\n return object\n }\n \n return Object.assign(new UIObject(), object)\n }\n \n \n valueForKey(key: string) {\n // @ts-ignore\n return this[key]\n }\n \n valueForKeyPath<T = any>(keyPath: string, defaultValue?: T): T | undefined {\n return UIObject.valueForKeyPath(keyPath, this, defaultValue)\n }\n \n static valueForKeyPath<T = any>(keyPath: string, object: any, defaultValue?: T): T | undefined {\n \n if (IS_NOT(keyPath)) {\n return object\n }\n \n const keys = keyPath.split(\".\")\n let currentObject = object\n \n for (let i = 0; i < keys.length; i++) {\n \n const key = keys[i]\n \n if (key.substring(0, 2) == \"[]\") {\n \n // This next object will be an array and the rest of the keys need to be run for each of the elements\n currentObject = currentObject[key.substring(2)]\n \n // CurrentObject is now an array\n \n const remainingKeyPath = keys.slice(i + 1).join(\".\")\n const currentArray = currentObject as unknown as any[]\n currentObject = currentArray.map(subObject => UIObject.valueForKeyPath(remainingKeyPath, subObject))\n \n break\n \n }\n \n currentObject = currentObject?.[key]\n if (IS_LIKE_NULL(currentObject)) {\n currentObject = defaultValue\n }\n \n }\n \n return currentObject\n \n }\n \n setValueForKeyPath(keyPath: string, value: any, createPath = YES) {\n return UIObject.setValueForKeyPath(keyPath, value, this, createPath)\n }\n \n static setValueForKeyPath(keyPath: string, value: any, currentObject: any, createPath: boolean) {\n \n const keys = keyPath.split(\".\")\n let didSetValue = NO\n \n keys.forEach((key, index, array) => {\n if (index == array.length - 1 && IS_NOT_LIKE_NULL(currentObject)) {\n currentObject[key] = value\n didSetValue = YES\n return\n }\n else if (IS_NOT(currentObject)) {\n return\n }\n \n const currentObjectValue = currentObject[key]\n if (IS_LIKE_NULL(currentObjectValue) && createPath) {\n currentObject[key] = {}\n }\n currentObject = currentObject[key]\n })\n \n return didSetValue\n \n }\n \n \n configureWithObject(object: UIInitializerObject<this>) {\n \n return UIObject.configureWithObject(this, object)\n \n }\n \n configuredWithObject(object: UIInitializerObject<this>): this {\n \n this.configureWithObject(object)\n return this\n \n }\n \n \n static configureWithObject<TargetObjectType extends object, ConfigurationObjectType extends UIInitializerObject<TargetObjectType>>(\n configurationTarget: TargetObjectType,\n object: ConfigurationObjectType\n ): ConfigurationObjectType {\n \n const isAnObject = (item: any) => (item && typeof item === \"object\" && !Array.isArray(item) && !(item instanceof UICoreExtensionValueObject))\n const isAPureObject = (item: any) => isAnObject(item) && Object.getPrototypeOf(item) === Object.getPrototypeOf({})\n \n function isAClass(funcOrClass: object) {\n if (IS_NOT(funcOrClass)) {\n return NO\n }\n const isFunction = (functionToCheck: object) => (functionToCheck && {}.toString.call(functionToCheck) ===\n \"[object Function]\")\n const propertyNames = Object.getOwnPropertyNames(funcOrClass)\n return (isFunction(funcOrClass) && !propertyNames.includes(\"arguments\") &&\n propertyNames.includes(\"prototype\"))\n }\n \n const result = {} as ConfigurationObjectType\n \n let keyPathsAndValues: { value: any, keyPath: string }[] = []\n \n function prepareKeyPathsAndValues(target: Record<string, any>, source: object, keyPath = \"\") {\n \n if ((isAnObject(target) || isAClass(target)) && isAnObject(source)) {\n \n source.forEach((sourceValue, key) => {\n \n const valueKeyPath = keyPath + \".\" + key\n \n function addValueAndKeyPath(sourceValue: any) {\n keyPathsAndValues.push({\n value: sourceValue,\n keyPath: valueKeyPath.replace(\".\", \"\")\n })\n }\n \n \n if (isAPureObject(sourceValue) || isAClass(sourceValue)) {\n if (!(key in target) || target[key] instanceof Function) {\n addValueAndKeyPath(sourceValue)\n }\n else {\n prepareKeyPathsAndValues(target[key], sourceValue, valueKeyPath)\n }\n }\n else if (sourceValue instanceof UICoreExtensionValueObject) {\n addValueAndKeyPath(sourceValue.value)\n }\n else {\n addValueAndKeyPath(sourceValue)\n }\n \n })\n \n }\n \n }\n \n prepareKeyPathsAndValues(configurationTarget, object)\n \n // Sort based on key path lengths\n keyPathsAndValues = keyPathsAndValues.sort((a, b) => {\n \n const firstKeyPath = (a.keyPath as string).split(\".\").length\n const secondKeyPath = (b.keyPath as string).split(\".\").length\n \n if (firstKeyPath < secondKeyPath) {\n return -1\n }\n if (firstKeyPath > secondKeyPath) {\n return 1\n }\n return 0\n \n })\n \n keyPathsAndValues.forEach((valueAndKeyPath) => {\n \n const keyPath: string = valueAndKeyPath.keyPath\n let value = valueAndKeyPath.value\n \n const getTargetFunction = (bindThis = NO) => {\n let result = (UIObject.valueForKeyPath(keyPath, configurationTarget) as Function)\n if (bindThis) {\n const indexOfDot = keyPath.lastIndexOf(\".\")\n const thisObject = UIObject.valueForKeyPath(keyPath.substring(0, indexOfDot), configurationTarget)\n result = result.bind(thisObject)\n }\n return result\n }\n \n if (value instanceof UILazyPropertyValue) {\n const indexOfDot = keyPath.lastIndexOf(\".\")\n const thisObject = UIObject.valueForKeyPath(keyPath.substring(0, indexOfDot), configurationTarget)\n const key = keyPath.substring(indexOfDot + 1)\n value.setLazyPropertyValue(key, thisObject)\n return\n }\n \n if (value instanceof UIFunctionCall) {\n value.callFunction(getTargetFunction(YES))\n return\n }\n \n if (value instanceof UIFunctionExtender) {\n value = value.extendedFunction(getTargetFunction())\n }\n \n UIObject.setValueForKeyPath(keyPath, UIObject.valueForKeyPath(keyPath, configurationTarget), result, YES)\n UIObject.setValueForKeyPath(keyPath, value, configurationTarget, YES)\n \n })\n \n \n return result\n \n }\n \n static configuredWithObject<T extends object>(configurationTarget: T, object: UIInitializerObject<T>) {\n this.configureWithObject(configurationTarget, object)\n return configurationTarget\n }\n \n \n get methods(): MethodsOnly<Omit<this, \"methods\">> {\n const thisObject = this as object\n const result = {} as any\n thisObject.forEach((value, key) => {\n if (value instanceof Function && key != \"methods\") {\n result[key] = value.bind(thisObject)\n }\n })\n return result\n }\n \n \n performFunctionWithSelf<T>(functionToPerform: (self: this) => T): T {\n return functionToPerform(this)\n }\n \n performingFunctionWithSelf(functionToPerform: (self: this) => void): this {\n functionToPerform(this)\n return this\n }\n \n performFunctionWithDelay(delay: number, functionToCall: Function) {\n \n new UITimer(delay, NO, functionToCall)\n \n }\n \n \n}\n\n\nexport type MethodsOnly<T> =\n Pick<T, { [K in keyof T]: T[K] extends Function ? K : never }[keyof T]>;\n\nexport type ValueOf<T> = T[keyof T];\n\n\n\n\n\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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AAGD,WAAO;AAAA,EAEX;AAAA,EAEA,OAAO,qBAAuC,qBAAwB,QAAgC;AAClG,SAAK,oBAAoB,qBAAqB,MAAM;AACpD,WAAO;AAAA,EACX;AAAA,EAGA,IAAI,UAA8C;AAC9C,UAAM,aAAa;AACnB,UAAM,SAAS,CAAC;AAChB,eAAW,QAAQ,CAAC,OAAO,QAAQ;AAC/B,UAAI,iBAAiB,YAAY,OAAO,WAAW;AAC/C,eAAO,OAAO,MAAM,KAAK,UAAU;AAAA,MACvC;AAAA,IACJ,CAAC;AACD,WAAO;AAAA,EACX;AAAA,EAGA,wBAA2B,mBAAyC;AAChE,WAAO,kBAAkB,IAAI;AAAA,EACjC;AAAA,EAEA,2BAA2B,mBAA+C;AACtE,sBAAkB,IAAI;AACtB,WAAO;AAAA,EACX;AAAA,EAEA,yBAAyB,OAAe,gBAA0B;AAE9D,QAAI,uBAAQ,OAAO,IAAI,cAAc;AAAA,EAEzC;AAGJ;
|
|
4
|
+
"sourcesContent": ["import { UICoreExtensionValueObject } from \"./UICoreExtensionValueObject\"\nimport { UITimer } from \"./UITimer\"\n\n\nfunction NilFunction() {\n return nil\n}\n\n\n// The nil object avoids unnecessary crashes by allowing you to call any function or access any variable on it, returning nil\nexport var nil: any = new Proxy(Object.assign(NilFunction, { \"class\": null, \"className\": \"Nil\" }), {\n get(target, name) {\n if (name == Symbol.toPrimitive) {\n return function (hint: string) {\n if (hint == \"number\") {\n return 0\n }\n if (hint == \"string\") {\n return \"\"\n }\n return false\n }\n }\n if (name == \"toString\") {\n return function toString() {\n return \"\"\n }\n }\n return NilFunction()\n },\n set() {\n return NilFunction()\n }\n})\nwindow.nil = nil\n\ndeclare global {\n interface Window {\n nil: any;\n }\n}\n\n\nexport type RecursiveRequired<T> = Required<{\n [P in keyof T]: T[P] extends object | undefined ? RecursiveRequired<Required<T[P]>> : T[P];\n}>;\n\nexport function wrapInNil<T>(object?: T): Required<T> {\n let result = FIRST_OR_NIL(object)\n if (object instanceof Object && !(object instanceof Function)) {\n result = new Proxy(object as Object & T, {\n get(target, name) {\n if (name == \"wrapped_nil_target\") {\n return target\n }\n const value = Reflect.get(target, name)\n if (typeof value === \"object\") {\n return wrapInNil(value)\n }\n if (IS_NOT_LIKE_NULL(value)) {\n return value\n }\n return nil\n },\n set(target: Record<string, any> & T, name: string, value: any) {\n if (IS(target)) {\n // @ts-ignore\n target[name] = value\n }\n return YES\n }\n })\n }\n return result as any\n}\n\n\nexport const YES = true\nexport const NO = false\n\nexport function IS<T>(object: T | undefined | null | false): object is T {\n if (object && object !== nil) {\n return YES\n }\n return NO\n}\n\nexport function IS_NOT(object: any): object is undefined | null | false {\n return !IS(object)\n}\n\nexport function IS_DEFINED<T>(object: T | undefined): object is T {\n if (object != undefined) {\n return YES\n }\n return NO\n}\n\nexport function IS_UNDEFINED(object: any): object is undefined {\n return !IS_DEFINED(object)\n}\n\nexport function IS_NIL(object: any): object is typeof nil {\n if (object === nil) {\n return YES\n }\n return NO\n}\n\nexport function IS_NOT_NIL<T>(object: T | undefined | null): object is T | undefined | null {\n return !IS_NIL(object)\n}\n\n\nexport function IS_LIKE_NULL(object: any): object is undefined | null {\n return (IS_UNDEFINED(object) || IS_NIL(object) || object == null)\n}\n\nexport function IS_NOT_LIKE_NULL<T>(object: T | null | undefined): object is T {\n return !IS_LIKE_NULL(object)\n}\n\n\nexport function IS_AN_EMAIL_ADDRESS(email: string) {\n const re = /\\S+@\\S+\\.\\S+/\n return re.test(email)\n}\n\n\nexport function FIRST_OR_NIL<T>(...objects: (T | undefined | null)[]): T {\n const result = objects.find(object => IS(object))\n return result || nil\n}\n\nexport function FIRST<T>(...objects: (T | undefined | null)[]): T {\n const result = objects.find(object => IS(object))\n return result || IF(IS_DEFINED(objects.lastElement))(RETURNER(objects.lastElement))()\n}\n\n\nexport function MAKE_ID(randomPartLength = 15) {\n let result = \"\"\n const characters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\"\n for (let i = 0; i < randomPartLength; i++) {\n result = result + characters.charAt(Math.floor(Math.random() * characters.length))\n }\n result = result + Date.now()\n return result\n}\n\n\nexport function RETURNER<T>(value?: T) {\n return (..._objects: any[]) => value\n}\n\n\nexport type UIIFBlockReceiver<T> = (functionToCall: () => any) => UIIFEvaluator<T>;\nexport type UIIFEvaluatorBase<T> = () => T;\n\n\nexport interface UIIFEvaluator<T> extends UIIFEvaluatorBase<T> {\n ELSE_IF: (otherValue: any) => UIIFBlockReceiver<T>;\n ELSE: (functionToCall: () => any) => T;\n}\n\n\nexport function IF<T = any>(value: any): UIIFBlockReceiver<T> {\n \n let thenFunction = nil\n let elseFunction = nil\n \n const result: any = function (functionToCall: () => T) {\n thenFunction = functionToCall\n return result.evaluateConditions\n }\n \n result.evaluateConditions = function () {\n if (IS(value)) {\n return thenFunction()\n }\n return elseFunction()\n }\n \n result.evaluateConditions.ELSE_IF = function (otherValue: any) {\n \n const functionResult = IF(otherValue) as (UIIFBlockReceiver<T> & { evaluateConditions: UIIFEvaluator<T> })\n elseFunction = functionResult.evaluateConditions\n \n const functionResultEvaluateConditionsFunction: any = function () {\n return result.evaluateConditions()\n }\n functionResultEvaluateConditionsFunction.ELSE_IF = functionResult.evaluateConditions.ELSE_IF\n functionResultEvaluateConditionsFunction.ELSE = functionResult.evaluateConditions.ELSE\n \n functionResult.evaluateConditions = functionResultEvaluateConditionsFunction\n \n return functionResult\n \n }\n \n result.evaluateConditions.ELSE = function (functionToCall: () => T) {\n elseFunction = functionToCall\n return result.evaluateConditions()\n }\n \n return result\n}\n\n\nexport class UIFunctionCall<T extends (...args: any) => any> {\n \n isAUIFunctionCallObject = YES\n parameters: Parameters<T>[]\n \n constructor(...parameters: Parameters<T>) {\n this.parameters = parameters\n }\n \n callFunction(functionToCall: T) {\n const parameters = this.parameters\n functionToCall(...parameters)\n }\n \n}\n\n\nexport function CALL<T extends (...args: any) => any>(...objects: Parameters<T>) {\n return new UIFunctionCall<T>(...objects)\n}\n\n\nexport class UIFunctionExtender<T extends (...args: any) => any> {\n \n isAUIFunctionExtenderObject = YES\n extendingFunction: T\n \n static functionByExtendingFunction<T extends (...args: any) => any>(functionToExtend: T, extendingFunction: T) {\n return EXTEND(extendingFunction).extendedFunction(functionToExtend)\n }\n \n constructor(extendingFunction: T) {\n this.extendingFunction = extendingFunction\n }\n \n extendedFunction(functionToExtend: T): T & { extendedFunction: T } {\n const extendingFunction = this.extendingFunction\n \n function extendedFunction(this: any, ...objects: any[]) {\n const boundFunctionToExtend = functionToExtend.bind(this)\n boundFunctionToExtend(...objects)\n const boundExtendingFunction = extendingFunction.bind(this)\n boundExtendingFunction(...objects)\n }\n \n extendedFunction.extendedFunction = functionToExtend\n return extendedFunction as any\n }\n \n}\n\n\nexport function EXTEND<T extends (...args: any) => any>(extendingFunction: T) {\n return new UIFunctionExtender(extendingFunction)\n}\n\n\nexport class UILazyPropertyValue<T> {\n \n isAUILazyPropertyValueObject = YES\n initFunction: () => T\n \n constructor(initFunction: () => T) {\n this.initFunction = initFunction\n }\n \n setLazyPropertyValue(key: string, target: object) {\n \n let isValueInitialized = NO\n \n // property value\n let _value = nil\n \n const initValue = () => {\n _value = this.initFunction()\n isValueInitialized = YES\n this.initFunction = nil\n }\n \n // @ts-ignore\n if (delete target[key]) {\n \n // Create new property with getter and setter\n Object.defineProperty(target, key, {\n get: function () {\n if (IS_NOT(isValueInitialized)) {\n initValue()\n }\n return _value\n },\n set: function (newValue) {\n _value = newValue\n },\n enumerable: true,\n configurable: true\n })\n \n }\n \n }\n \n}\n\n\nexport function LAZY_VALUE<T>(initFunction: () => T) {\n return new UILazyPropertyValue(initFunction)\n}\n\n\nexport type UIInitializerObject<T> = {\n \n [P in keyof T]?:\n //T[P] extends (infer U)[] ? UIInitializerObject<U>[] :\n T[P] extends (...args: any) => any ? UIFunctionCall<T[P]> | UIFunctionCall<T[P]>[] | UIFunctionExtender<T[P]> | T[P] :\n T[P] extends object ? UIInitializerObject<T[P]> | UILazyPropertyValue<T[P]> :\n Partial<T[P]>;\n \n}\n\n\nexport class UIObject {\n \n constructor() {\n \n // Do something here if needed\n \n }\n \n public get class(): any {\n return Object.getPrototypeOf(this).constructor\n }\n \n public get superclass(): any {\n return Object.getPrototypeOf(Object.getPrototypeOf(this)).constructor\n }\n \n isKindOfClass(classObject: any) {\n if (this.isMemberOfClass(classObject)) {\n return YES\n }\n for (let superclassObject = this.superclass; IS(superclassObject); superclassObject = superclassObject.superclass) {\n if (superclassObject == classObject) {\n return YES\n }\n }\n return NO\n }\n \n \n isMemberOfClass(classObject: any) {\n return (this.class == classObject)\n }\n \n \n static annotationsMap: WeakMap<any, Function[]> = new WeakMap<ClassDecoratorContext, Function[]>()\n \n static recordAnnotation(annotation: Function, target: Function) {\n if (!UIObject.annotationsMap.has(target)) {\n UIObject.annotationsMap.set(target, [])\n }\n UIObject.annotationsMap.get(target)!.push(annotation)\n }\n \n static classHasAnnotation(classObject: Function, annotation: Function) {\n return UIObject.annotationsMap.get(classObject)?.contains(annotation)\n }\n \n static annotationsOnClass(classObject: Function) {\n return UIObject.annotationsMap.get(classObject) ?? []\n }\n \n public static wrapObject<T>(object: T): UIObject & T {\n if (IS_NOT(object)) {\n return nil\n }\n \n if ((object as any) instanceof UIObject) {\n // @ts-ignore\n return object\n }\n \n return Object.assign(new UIObject(), object)\n }\n \n \n valueForKey(key: string) {\n // @ts-ignore\n return this[key]\n }\n \n valueForKeyPath<T = any>(keyPath: string, defaultValue?: T): T | undefined {\n return UIObject.valueForKeyPath(keyPath, this, defaultValue)\n }\n \n static valueForKeyPath<T = any>(keyPath: string, object: any, defaultValue?: T): T | undefined {\n \n if (IS_NOT(keyPath)) {\n return object\n }\n \n const keys = keyPath.split(\".\")\n let currentObject = object\n \n for (let i = 0; i < keys.length; i++) {\n \n const key = keys[i]\n \n if (key.substring(0, 2) == \"[]\") {\n \n // This next object will be an array and the rest of the keys need to be run for each of the elements\n currentObject = currentObject[key.substring(2)]\n \n // CurrentObject is now an array\n \n const remainingKeyPath = keys.slice(i + 1).join(\".\")\n const currentArray = currentObject as unknown as any[]\n currentObject = currentArray.map(subObject => UIObject.valueForKeyPath(remainingKeyPath, subObject))\n \n break\n \n }\n \n currentObject = currentObject?.[key]\n if (IS_LIKE_NULL(currentObject)) {\n currentObject = defaultValue\n }\n \n }\n \n return currentObject\n \n }\n \n setValueForKeyPath(keyPath: string, value: any, createPath = YES) {\n return UIObject.setValueForKeyPath(keyPath, value, this, createPath)\n }\n \n static setValueForKeyPath(keyPath: string, value: any, currentObject: any, createPath: boolean) {\n \n const keys = keyPath.split(\".\")\n let didSetValue = NO\n \n keys.forEach((key, index, array) => {\n if (index == array.length - 1 && IS_NOT_LIKE_NULL(currentObject)) {\n currentObject[key] = value\n didSetValue = YES\n return\n }\n else if (IS_NOT(currentObject)) {\n return\n }\n \n const currentObjectValue = currentObject[key]\n if (IS_LIKE_NULL(currentObjectValue) && createPath) {\n currentObject[key] = {}\n }\n currentObject = currentObject[key]\n })\n \n return didSetValue\n \n }\n \n \n configureWithObject(object: UIInitializerObject<this>) {\n \n return UIObject.configureWithObject(this, object)\n \n }\n \n configuredWithObject(object: UIInitializerObject<this>): this {\n \n this.configureWithObject(object)\n return this\n \n }\n \n \n static configureWithObject<TargetObjectType extends object, ConfigurationObjectType extends UIInitializerObject<TargetObjectType>>(\n configurationTarget: TargetObjectType,\n object: ConfigurationObjectType\n ): ConfigurationObjectType {\n \n const isAnObject = (item: any) => (item && typeof item === \"object\" && !Array.isArray(item) && !(item instanceof UICoreExtensionValueObject))\n const isAPureObject = (item: any) => isAnObject(item) && Object.getPrototypeOf(item) === Object.getPrototypeOf({})\n \n function isAClass(funcOrClass: object) {\n if (IS_NOT(funcOrClass)) {\n return NO\n }\n const isFunction = (functionToCheck: object) => (functionToCheck && {}.toString.call(functionToCheck) ===\n \"[object Function]\")\n const propertyNames = Object.getOwnPropertyNames(funcOrClass)\n return (isFunction(funcOrClass) && !propertyNames.includes(\"arguments\") &&\n propertyNames.includes(\"prototype\"))\n }\n \n const result = {} as ConfigurationObjectType\n \n let keyPathsAndValues: { value: any, keyPath: string }[] = []\n \n function prepareKeyPathsAndValues(target: Record<string, any>, source: object, keyPath = \"\") {\n \n if ((isAnObject(target) || isAClass(target)) && isAnObject(source)) {\n \n source.forEach((sourceValue, key) => {\n \n const valueKeyPath = keyPath + \".\" + key\n \n function addValueAndKeyPath(sourceValue: any) {\n keyPathsAndValues.push({\n value: sourceValue,\n keyPath: valueKeyPath.replace(\".\", \"\")\n })\n }\n \n \n if (isAPureObject(sourceValue) || isAClass(sourceValue)) {\n if (!(key in target) || target[key] instanceof Function) {\n addValueAndKeyPath(sourceValue)\n }\n else {\n prepareKeyPathsAndValues(target[key], sourceValue, valueKeyPath)\n }\n }\n else if (sourceValue instanceof UICoreExtensionValueObject) {\n addValueAndKeyPath(sourceValue.value)\n }\n else {\n addValueAndKeyPath(sourceValue)\n }\n \n })\n \n }\n \n }\n \n prepareKeyPathsAndValues(configurationTarget, object)\n \n // Sort based on key path lengths\n keyPathsAndValues = keyPathsAndValues.sort((a, b) => {\n \n const firstKeyPath = (a.keyPath as string).split(\".\").length\n const secondKeyPath = (b.keyPath as string).split(\".\").length\n \n if (firstKeyPath < secondKeyPath) {\n return -1\n }\n if (firstKeyPath > secondKeyPath) {\n return 1\n }\n return 0\n \n })\n \n keyPathsAndValues.forEach((valueAndKeyPath) => {\n \n const keyPath: string = valueAndKeyPath.keyPath\n let value = valueAndKeyPath.value\n \n const getTargetFunction = (bindThis = NO) => {\n let result = (UIObject.valueForKeyPath(keyPath, configurationTarget) as Function)\n if (bindThis) {\n const indexOfDot = keyPath.lastIndexOf(\".\")\n const thisObject = UIObject.valueForKeyPath(keyPath.substring(0, indexOfDot), configurationTarget)\n result = result.bind(thisObject)\n }\n return result\n }\n \n if (value instanceof UILazyPropertyValue) {\n const indexOfDot = keyPath.lastIndexOf(\".\")\n const thisObject = UIObject.valueForKeyPath(keyPath.substring(0, indexOfDot), configurationTarget)\n const key = keyPath.substring(indexOfDot + 1)\n value.setLazyPropertyValue(key, thisObject)\n return\n }\n \n if (value instanceof UIFunctionCall) {\n value.callFunction(getTargetFunction(YES))\n return\n }\n if ((value instanceof Array && value.allMatch(element => element instanceof UIFunctionCall))) {\n value.map(element => element.callFunction(getTargetFunction(YES)))\n return\n }\n \n if (value instanceof UIFunctionExtender) {\n value = value.extendedFunction(getTargetFunction())\n }\n \n UIObject.setValueForKeyPath(keyPath, UIObject.valueForKeyPath(keyPath, configurationTarget), result, YES)\n UIObject.setValueForKeyPath(keyPath, value, configurationTarget, YES)\n \n })\n \n \n return result\n \n }\n \n static configuredWithObject<T extends object>(configurationTarget: T, object: UIInitializerObject<T>) {\n this.configureWithObject(configurationTarget, object)\n return configurationTarget\n }\n \n \n get methods(): MethodsOnly<Omit<this, \"methods\">> {\n const thisObject = this as object\n const result = {} as any\n thisObject.forEach((value, key) => {\n if (value instanceof Function && key != \"methods\") {\n result[key] = value.bind(thisObject)\n }\n })\n return result\n }\n \n \n performFunctionWithSelf<T>(functionToPerform: (self: this) => T): T {\n return functionToPerform(this)\n }\n \n performingFunctionWithSelf(functionToPerform: (self: this) => void): this {\n functionToPerform(this)\n return this\n }\n \n performFunctionWithDelay(delay: number, functionToCall: Function) {\n \n new UITimer(delay, NO, functionToCall)\n \n }\n \n \n}\n\n\nexport type MethodsOnly<T> =\n Pick<T, { [K in keyof T]: T[K] extends Function ? K : never }[keyof T]>;\n\nexport type ValueOf<T> = T[keyof T];\n\n\n\n\n\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wCAA2C;AAC3C,qBAAwB;AAG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qBAAwB,QAAgC;AAClG,SAAK,oBAAoB,qBAAqB,MAAM;AACpD,WAAO;AAAA,EACX;AAAA,EAGA,IAAI,UAA8C;AAC9C,UAAM,aAAa;AACnB,UAAM,SAAS,CAAC;AAChB,eAAW,QAAQ,CAAC,OAAO,QAAQ;AAC/B,UAAI,iBAAiB,YAAY,OAAO,WAAW;AAC/C,eAAO,OAAO,MAAM,KAAK,UAAU;AAAA,MACvC;AAAA,IACJ,CAAC;AACD,WAAO;AAAA,EACX;AAAA,EAGA,wBAA2B,mBAAyC;AAChE,WAAO,kBAAkB,IAAI;AAAA,EACjC;AAAA,EAEA,2BAA2B,mBAA+C;AACtE,sBAAkB,IAAI;AACtB,WAAO;AAAA,EACX;AAAA,EAEA,yBAAyB,OAAe,gBAA0B;AAE9D,QAAI,uBAAQ,OAAO,IAAI,cAAc;AAAA,EAEzC;AAGJ;AA5TO,IAAM,WAAN;AAAM,SAkCF,iBAA2C,oBAAI,QAA2C;",
|
|
6
6
|
"names": ["sourceValue", "result"]
|
|
7
7
|
}
|
|
@@ -143,6 +143,7 @@ class UIViewController extends import_UIObject.UIObject {
|
|
|
143
143
|
this.parentViewController = void 0;
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
+
this.childViewControllers.removeElement(controller);
|
|
146
147
|
if ((0, import_UIObject.IS)(controller.view)) {
|
|
147
148
|
controller.view.removeFromSuperview();
|
|
148
149
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../scripts/UIViewController.ts"],
|
|
4
|
-
"sourcesContent": ["import { UIDialogView } from \"./UIDialogView\"\nimport { FIRST_OR_NIL, IS, NO, UIObject, YES } from \"./UIObject\"\nimport { UIRoute } from \"./UIRoute\"\nimport { UIView, UIViewBroadcastEvent } from \"./UIView\"\n\n\nexport class UIViewController extends UIObject {\n \n \n parentViewController?: UIViewController\n childViewControllers: UIViewController[] = []\n static readonly routeComponentName: string\n static readonly ParameterIdentifierName: any\n \n constructor(public view: UIView) {\n \n super()\n \n this.view.viewController = this\n \n }\n \n \n get routeComponent() {\n return UIRoute.currentRoute.componentWithViewController(this.class)\n }\n \n handleRouteRecursively(route: UIRoute) {\n \n this.handleRoute(route)\n \n this.childViewControllers.forEach(controller => {\n \n controller.handleRouteRecursively(route)\n \n })\n \n }\n \n async handleRoute(route: UIRoute) {\n \n \n }\n \n \n async viewWillAppear() {\n \n \n }\n \n \n async viewDidAppear() {\n \n \n }\n \n \n async viewWillDisappear() {\n \n \n }\n \n async viewDidDisappear() {\n \n \n }\n \n \n updateViewConstraints() {\n \n \n }\n \n updateViewStyles() {\n \n \n }\n \n layoutViewSubviews() {\n \n \n }\n \n _triggerLayoutViewSubviews() {\n \n if (this.view.needsLayout) {\n \n this.view.layoutSubviews()\n \n this.viewDidLayoutSubviews()\n \n }\n \n }\n \n viewWillLayoutSubviews() {\n \n this.updateViewConstraints()\n this.updateViewStyles()\n \n }\n \n viewDidLayoutSubviews() {\n \n // this.childViewControllers.forEach(function (controller, index, controllers) {\n \n // controller._layoutViewSubviews();\n \n // })\n \n \n }\n \n \n viewDidReceiveBroadcastEvent(event: UIViewBroadcastEvent) {\n \n \n }\n \n \n get core() {\n return this.view.core\n }\n \n hasChildViewController(viewController: UIViewController) {\n \n // This is for performance reasons\n if (!IS(viewController)) {\n return NO\n }\n \n for (let i = 0; i < this.childViewControllers.length; i++) {\n \n const childViewController = this.childViewControllers[i]\n \n if (childViewController == viewController) {\n return YES\n }\n \n }\n \n return NO\n \n }\n \n addChildViewController(viewController: UIViewController) {\n if (!this.hasChildViewController(viewController)) {\n viewController.willMoveToParentViewController(this)\n this.childViewControllers.push(viewController)\n this.view.addSubview(viewController.view)\n viewController.didMoveToParentViewController(this)\n }\n }\n \n \n removeFromParentViewController() {\n \n this.parentViewController?.removeChildViewController(this)\n \n }\n \n willMoveToParentViewController(parentViewController: UIViewController) {\n \n }\n \n \n didMoveToParentViewController(parentViewController: UIViewController) {\n \n this.parentViewController = parentViewController\n \n }\n \n removeChildViewController(controller: UIViewController) {\n \n controller = FIRST_OR_NIL(controller)\n controller.viewWillDisappear()\n if (IS(controller.parentViewController)) {\n \n const index = this.parentViewController?.childViewControllers.indexOf(this) ?? -1\n if (index > -1) {\n this.parentViewController?.childViewControllers.splice(index, 1)\n this.view.removeFromSuperview()\n this.parentViewController = undefined\n }\n \n }\n if (IS(controller.view)) {\n controller.view.removeFromSuperview()\n }\n controller.viewDidDisappear()\n \n }\n \n \n addChildViewControllerInContainer(controller: UIViewController, containerView: UIView) {\n \n controller = FIRST_OR_NIL(controller)\n containerView = FIRST_OR_NIL(containerView)\n controller.viewWillAppear()\n this.addChildViewController(controller)\n containerView.addSubview(controller.view)\n \n controller.handleRouteRecursively(UIRoute.currentRoute)\n \n controller.didMoveToParentViewController(this)\n controller.viewDidAppear()\n \n \n }\n \n addChildViewControllerInDialogView(controller: UIViewController, dialogView: UIDialogView) {\n \n controller = FIRST_OR_NIL(controller)\n dialogView = FIRST_OR_NIL(dialogView)\n controller.viewWillAppear()\n this.addChildViewController(controller)\n dialogView.view = controller.view\n \n const originalDismissFunction = dialogView.dismiss.bind(dialogView)\n \n dialogView.dismiss = animated => {\n \n originalDismissFunction(animated)\n \n this.removeChildViewController(controller)\n \n }\n \n controller.handleRouteRecursively(UIRoute.currentRoute)\n \n controller.didMoveToParentViewController(this)\n controller.viewDidAppear()\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;AACA,sBAAoD;AACpD,qBAAwB;AAIjB,MAAM,yBAAyB,yBAAS;AAAA,EAQ3C,YAAmB,MAAc;AAE7B,UAAM;AAFS;AAJnB,gCAA2C,CAAC;AAQxC,SAAK,KAAK,iBAAiB;AAAA,EAE/B;AAAA,EAGA,IAAI,iBAAiB;AACjB,WAAO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AAK,UAAU;AAElE,eAAW,UAAU,cAAY;AAE7B,8BAAwB,QAAQ;AAEhC,WAAK,0BAA0B,UAAU;AAAA,IAE7C;AAEA,eAAW,uBAAuB,uBAAQ,YAAY;AAEtD,eAAW,8BAA8B,IAAI;AAC7C,eAAW,cAAc;AAAA,EAE7B;AAGJ;",
|
|
4
|
+
"sourcesContent": ["import { UIDialogView } from \"./UIDialogView\"\nimport { FIRST_OR_NIL, IS, NO, UIObject, YES } from \"./UIObject\"\nimport { UIRoute } from \"./UIRoute\"\nimport { UIView, UIViewBroadcastEvent } from \"./UIView\"\n\n\nexport class UIViewController extends UIObject {\n \n \n parentViewController?: UIViewController\n childViewControllers: UIViewController[] = []\n static readonly routeComponentName: string\n static readonly ParameterIdentifierName: any\n \n constructor(public view: UIView) {\n \n super()\n \n this.view.viewController = this\n \n }\n \n \n get routeComponent() {\n return UIRoute.currentRoute.componentWithViewController(this.class)\n }\n \n handleRouteRecursively(route: UIRoute) {\n \n this.handleRoute(route)\n \n this.childViewControllers.forEach(controller => {\n \n controller.handleRouteRecursively(route)\n \n })\n \n }\n \n async handleRoute(route: UIRoute) {\n \n \n }\n \n \n async viewWillAppear() {\n \n \n }\n \n \n async viewDidAppear() {\n \n \n }\n \n \n async viewWillDisappear() {\n \n \n }\n \n async viewDidDisappear() {\n \n \n }\n \n \n updateViewConstraints() {\n \n \n }\n \n updateViewStyles() {\n \n \n }\n \n layoutViewSubviews() {\n \n \n }\n \n _triggerLayoutViewSubviews() {\n \n if (this.view.needsLayout) {\n \n this.view.layoutSubviews()\n \n this.viewDidLayoutSubviews()\n \n }\n \n }\n \n viewWillLayoutSubviews() {\n \n this.updateViewConstraints()\n this.updateViewStyles()\n \n }\n \n viewDidLayoutSubviews() {\n \n // this.childViewControllers.forEach(function (controller, index, controllers) {\n \n // controller._layoutViewSubviews();\n \n // })\n \n \n }\n \n \n viewDidReceiveBroadcastEvent(event: UIViewBroadcastEvent) {\n \n \n }\n \n \n get core() {\n return this.view.core\n }\n \n hasChildViewController(viewController: UIViewController) {\n \n // This is for performance reasons\n if (!IS(viewController)) {\n return NO\n }\n \n for (let i = 0; i < this.childViewControllers.length; i++) {\n \n const childViewController = this.childViewControllers[i]\n \n if (childViewController == viewController) {\n return YES\n }\n \n }\n \n return NO\n \n }\n \n addChildViewController(viewController: UIViewController) {\n if (!this.hasChildViewController(viewController)) {\n viewController.willMoveToParentViewController(this)\n this.childViewControllers.push(viewController)\n this.view.addSubview(viewController.view)\n viewController.didMoveToParentViewController(this)\n }\n }\n \n \n removeFromParentViewController() {\n \n this.parentViewController?.removeChildViewController(this)\n \n }\n \n willMoveToParentViewController(parentViewController: UIViewController) {\n \n }\n \n \n didMoveToParentViewController(parentViewController: UIViewController) {\n \n this.parentViewController = parentViewController\n \n }\n \n removeChildViewController(controller: UIViewController) {\n \n controller = FIRST_OR_NIL(controller)\n controller.viewWillDisappear()\n if (IS(controller.parentViewController)) {\n \n const index = this.parentViewController?.childViewControllers.indexOf(this) ?? -1\n if (index > -1) {\n this.parentViewController?.childViewControllers.splice(index, 1)\n this.view.removeFromSuperview()\n this.parentViewController = undefined\n }\n \n }\n this.childViewControllers.removeElement(controller)\n if (IS(controller.view)) {\n controller.view.removeFromSuperview()\n }\n controller.viewDidDisappear()\n \n }\n \n \n addChildViewControllerInContainer(controller: UIViewController, containerView: UIView) {\n \n controller = FIRST_OR_NIL(controller)\n containerView = FIRST_OR_NIL(containerView)\n controller.viewWillAppear()\n this.addChildViewController(controller)\n containerView.addSubview(controller.view)\n \n controller.handleRouteRecursively(UIRoute.currentRoute)\n \n controller.didMoveToParentViewController(this)\n controller.viewDidAppear()\n \n \n }\n \n addChildViewControllerInDialogView(controller: UIViewController, dialogView: UIDialogView) {\n \n controller = FIRST_OR_NIL(controller)\n dialogView = FIRST_OR_NIL(dialogView)\n controller.viewWillAppear()\n this.addChildViewController(controller)\n dialogView.view = controller.view\n \n const originalDismissFunction = dialogView.dismiss.bind(dialogView)\n \n dialogView.dismiss = animated => {\n \n originalDismissFunction(animated)\n \n this.removeChildViewController(controller)\n \n }\n \n controller.handleRouteRecursively(UIRoute.currentRoute)\n \n controller.didMoveToParentViewController(this)\n controller.viewDidAppear()\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;AACA,sBAAoD;AACpD,qBAAwB;AAIjB,MAAM,yBAAyB,yBAAS;AAAA,EAQ3C,YAAmB,MAAc;AAE7B,UAAM;AAFS;AAJnB,gCAA2C,CAAC;AAQxC,SAAK,KAAK,iBAAiB;AAAA,EAE/B;AAAA,EAGA,IAAI,iBAAiB;AACjB,WAAO,uBAAQ,aAAa,4BAA4B,KAAK,KAAK;AAAA,EACtE;AAAA,EAEA,uBAAuB,OAAgB;AAEnC,SAAK,YAAY,KAAK;AAEtB,SAAK,qBAAqB,QAAQ,gBAAc;AAE5C,iBAAW,uBAAuB,KAAK;AAAA,IAE3C,CAAC;AAAA,EAEL;AAAA,EAEM,YAAY,OAAgB;AAAA;AAAA,IAGlC;AAAA;AAAA,EAGM,iBAAiB;AAAA;AAAA,IAGvB;AAAA;AAAA,EAGM,gBAAgB;AAAA;AAAA,IAGtB;AAAA;AAAA,EAGM,oBAAoB;AAAA;AAAA,IAG1B;AAAA;AAAA,EAEM,mBAAmB;AAAA;AAAA,IAGzB;AAAA;AAAA,EAGA,wBAAwB;AAAA,EAGxB;AAAA,EAEA,mBAAmB;AAAA,EAGnB;AAAA,EAEA,qBAAqB;AAAA,EAGrB;AAAA,EAEA,6BAA6B;AAEzB,QAAI,KAAK,KAAK,aAAa;AAEvB,WAAK,KAAK,eAAe;AAEzB,WAAK,sBAAsB;AAAA,IAE/B;AAAA,EAEJ;AAAA,EAEA,yBAAyB;AAErB,SAAK,sBAAsB;AAC3B,SAAK,iBAAiB;AAAA,EAE1B;AAAA,EAEA,wBA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AAK,oBAAoB;AAAA,IACxC;AACA,eAAW,iBAAiB;AAAA,EAEhC;AAAA,EAGA,kCAAkC,YAA8B,eAAuB;AAEnF,qBAAa,8BAAa,UAAU;AACpC,wBAAgB,8BAAa,aAAa;AAC1C,eAAW,eAAe;AAC1B,SAAK,uBAAuB,UAAU;AACtC,kBAAc,WAAW,WAAW,IAAI;AAExC,eAAW,uBAAuB,uBAAQ,YAAY;AAEtD,eAAW,8BAA8B,IAAI;AAC7C,eAAW,cAAc;AAAA,EAG7B;AAAA,EAEA,mCAAmC,YAA8B,YAA0B;AAEvF,qBAAa,8BAAa,UAAU;AACpC,qBAAa,8BAAa,UAAU;AACpC,eAAW,eAAe;AAC1B,SAAK,uBAAuB,UAAU;AACtC,eAAW,OAAO,WAAW;AAE7B,UAAM,0BAA0B,WAAW,QAAQ,KAAK,UAAU;AAElE,eAAW,UAAU,cAAY;AAE7B,8BAAwB,QAAQ;AAEhC,WAAK,0BAA0B,UAAU;AAAA,IAE7C;AAEA,eAAW,uBAAuB,uBAAQ,YAAY;AAEtD,eAAW,8BAA8B,IAAI;AAC7C,eAAW,cAAc;AAAA,EAE7B;AAGJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uicore-ts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.578",
|
|
4
4
|
"description": "UICore is a library to build native-like user interfaces using pure Typescript. No HTML is needed at all. Components are described as TS classes and all user interactions are handled explicitly. This library is strongly inspired by the UIKit framework that is used in IOS. In addition, UICore has tools to handle URL based routing, array sorting and filtering and adds a number of other utilities for convenience.",
|
|
5
5
|
"main": "compiledScripts/index.js",
|
|
6
6
|
"types": "compiledScripts/index.d.ts",
|
package/scripts/UIButton.ts
CHANGED
|
@@ -410,7 +410,8 @@ export class UIButton extends UIBaseButton {
|
|
|
410
410
|
|
|
411
411
|
this.initStyleSelector("." + this.styleClassName, "background-color: lightblue;")
|
|
412
412
|
|
|
413
|
-
// var selectorWithoutImage = "." + this.styleClassName + " ." + this.imageView.styleClassName + " + ." +
|
|
413
|
+
// var selectorWithoutImage = "." + this.styleClassName + " ." + this.imageView.styleClassName + " + ." +
|
|
414
|
+
// this.titleLabel.styleClassName;
|
|
414
415
|
|
|
415
416
|
// this.initStyleSelector(
|
|
416
417
|
// selectorWithoutImage,
|
|
@@ -424,95 +425,3 @@ export class UIButton extends UIBaseButton {
|
|
|
424
425
|
|
|
425
426
|
}
|
|
426
427
|
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
package/scripts/UIObject.ts
CHANGED
|
@@ -320,7 +320,7 @@ export type UIInitializerObject<T> = {
|
|
|
320
320
|
|
|
321
321
|
[P in keyof T]?:
|
|
322
322
|
//T[P] extends (infer U)[] ? UIInitializerObject<U>[] :
|
|
323
|
-
T[P] extends (...args: any) => any ? UIFunctionCall<T[P]> | UIFunctionExtender<T[P]> | T[P] :
|
|
323
|
+
T[P] extends (...args: any) => any ? UIFunctionCall<T[P]> | UIFunctionCall<T[P]>[] | UIFunctionExtender<T[P]> | T[P] :
|
|
324
324
|
T[P] extends object ? UIInitializerObject<T[P]> | UILazyPropertyValue<T[P]> :
|
|
325
325
|
Partial<T[P]>;
|
|
326
326
|
|
|
@@ -590,6 +590,10 @@ export class UIObject {
|
|
|
590
590
|
value.callFunction(getTargetFunction(YES))
|
|
591
591
|
return
|
|
592
592
|
}
|
|
593
|
+
if ((value instanceof Array && value.allMatch(element => element instanceof UIFunctionCall))) {
|
|
594
|
+
value.map(element => element.callFunction(getTargetFunction(YES)))
|
|
595
|
+
return
|
|
596
|
+
}
|
|
593
597
|
|
|
594
598
|
if (value instanceof UIFunctionExtender) {
|
|
595
599
|
value = value.extendedFunction(getTargetFunction())
|