item_rule.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. "use strict";
  2. var __extends = (this && this.__extends) || (function () {
  3. var extendStatics = function (d, b) {
  4. extendStatics = Object.setPrototypeOf ||
  5. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  6. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  7. return extendStatics(d, b);
  8. };
  9. return function (d, b) {
  10. extendStatics(d, b);
  11. function __() { this.constructor = d; }
  12. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  13. };
  14. })();
  15. Object.defineProperty(exports, "__esModule", { value: true });
  16. exports.Rule = void 0;
  17. var abstract_entry_js_1 = require("./abstract_entry.js");
  18. var html_classes_js_1 = require("./html_classes.js");
  19. var Rule = (function (_super) {
  20. __extends(Rule, _super);
  21. function Rule(menu) {
  22. var _this = _super.call(this, menu, 'rule') || this;
  23. _this.className = html_classes_js_1.HtmlClasses['MENUITEM'];
  24. _this.role = 'separator';
  25. return _this;
  26. }
  27. Rule.fromJson = function (_factory, _a, menu) {
  28. return new this(menu);
  29. };
  30. Rule.prototype.generateHtml = function () {
  31. _super.prototype.generateHtml.call(this);
  32. var html = this.html;
  33. html.classList.add(html_classes_js_1.HtmlClasses['MENURULE']);
  34. html.setAttribute('aria-orientation', 'vertical');
  35. };
  36. Rule.prototype.addEvents = function (_element) { };
  37. Rule.prototype.toJson = function () {
  38. return { type: 'rule' };
  39. };
  40. return Rule;
  41. }(abstract_entry_js_1.AbstractEntry));
  42. exports.Rule = Rule;
  43. //# sourceMappingURL=item_rule.js.map