UNPKG

uicore-ts

Version:

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 tha

68 lines (67 loc) 2.24 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var UILinkButton_exports = {}; __export(UILinkButton_exports, { UILinkButton: () => UILinkButton }); module.exports = __toCommonJS(UILinkButton_exports); var import_UIButton = require("./UIButton"); var import_UILink = require("./UILink"); class UILinkButton extends import_UILink.UILink { constructor(elementID, elementType, titleType) { super(elementID); this.button = new import_UIButton.UIButton(this.elementID + "Button", elementType, titleType); this.addSubview(this.button); this.style.position = "absolute"; this.button.controlEventTargetAccumulator.EnterDown.PointerUpInside = () => window.location = this.target; } get titleLabel() { return this.button.titleLabel; } get imageView() { return this.button.imageView; } set colors(colors) { this.button.colors = colors; } get colors() { return this.button.colors; } get viewHTMLElement() { return super.viewHTMLElement; } set target(target) { this.viewHTMLElement.setAttribute("href", target); } get target() { var _a; return (_a = this.viewHTMLElement.getAttribute("href")) != null ? _a : ""; } layoutSubviews() { super.layoutSubviews(); const bounds = this.bounds; this.button.frame = bounds; this.button.layoutSubviews(); } } // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { UILinkButton }); //# sourceMappingURL=UILinkButton.js.map