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

60 lines (59 loc) 2.08 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 UIDateTimeInput_exports = {}; __export(UIDateTimeInput_exports, { UIDateTimeInput: () => UIDateTimeInput }); module.exports = __toCommonJS(UIDateTimeInput_exports); var import_UIView = require("./UIView"); const _UIDateTimeInput = class extends import_UIView.UIView { constructor(elementID, type = _UIDateTimeInput.type.DateTime) { super(elementID, void 0, "input"); this.viewHTMLElement.setAttribute("type", type); this.viewHTMLElement.onchange = (event) => { this.sendControlEventForKey(_UIDateTimeInput.controlEvent.ValueChange, event); }; } get controlEventTargetAccumulator() { return super.controlEventTargetAccumulator; } get date() { const result = new Date(this.viewHTMLElement.value); return result; } }; let UIDateTimeInput = _UIDateTimeInput; UIDateTimeInput.controlEvent = Object.assign({}, import_UIView.UIView.controlEvent, { "ValueChange": "ValueChange" }); UIDateTimeInput.type = { "Date": "date", "Time": "time", "DateTime": "datetime" }; UIDateTimeInput.format = { "European": "DD-MM-YYYY", "ISOComputer": "YYYY-MM-DD", "American": "MM/DD/YYYY" }; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { UIDateTimeInput }); //# sourceMappingURL=UIDateTimeInput.js.map