"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const Event_js_1 = __importDefault(require("../../event/Event.cjs")); const HTMLElement_js_1 = __importDefault(require("../html-element/HTMLElement.cjs")); /** * HTML Dialog Element. * * Reference: * https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement. */ class HTMLDialogElement extends HTMLElement_js_1.default { constructor() { super(...arguments); this.returnValue = ''; // Events this.oncancel = null; this.onclose = null; } /** * Returns open. * * @returns Open. */ get open() { return this.hasAttributeNS(null, 'open'); } /** * Closes the dialog. * * @param [returnValue] ReturnValue. */ close(returnValue = '') { this.removeAttribute('open'); this.returnValue = returnValue; this.dispatchEvent(new Event_js_1.default('close')); } /** * Shows the modal. */ showModal() { this.setAttribute('open', ''); } /** * Shows the dialog. */ show() { this.setAttribute('open', ''); } } exports.default = HTMLDialogElement; //# sourceMappingURL=HTMLDialogElement.cjs.map