版博士V2.0程序
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

54 строки
1.4 KiB

  1. "use strict";
  2. var __importDefault = (this && this.__importDefault) || function (mod) {
  3. return (mod && mod.__esModule) ? mod : { "default": mod };
  4. };
  5. Object.defineProperty(exports, "__esModule", { value: true });
  6. const Event_1 = __importDefault(require("../../event/Event"));
  7. const HTMLElement_1 = __importDefault(require("../html-element/HTMLElement"));
  8. /**
  9. * HTML Dialog Element.
  10. *
  11. * Reference:
  12. * https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement.
  13. */
  14. class HTMLDialogElement extends HTMLElement_1.default {
  15. constructor() {
  16. super(...arguments);
  17. this.returnValue = '';
  18. // Events
  19. this.oncancel = null;
  20. this.onclose = null;
  21. }
  22. /**
  23. * Returns open.
  24. *
  25. * @returns Open.
  26. */
  27. get open() {
  28. return this.hasAttributeNS(null, 'open');
  29. }
  30. /**
  31. * Closes the dialog.
  32. *
  33. * @param [returnValue] ReturnValue.
  34. */
  35. close(returnValue = '') {
  36. this.removeAttributeNS(null, 'open');
  37. this.returnValue = returnValue;
  38. this.dispatchEvent(new Event_1.default('close'));
  39. }
  40. /**
  41. * Shows the modal.
  42. */
  43. showModal() {
  44. this.setAttributeNS(null, 'open', '');
  45. }
  46. /**
  47. * Shows the dialog.
  48. */
  49. show() {
  50. this.setAttributeNS(null, 'open', '');
  51. }
  52. }
  53. exports.default = HTMLDialogElement;
  54. //# sourceMappingURL=HTMLDialogElement.js.map