gd-bs 5.2.8 → 5.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BreadcrumbItem = void 0;
4
+ var common_1 = require("../common");
4
5
  var templates_1 = require("./templates");
5
6
  /**
6
7
  * Breadcrumb Item
@@ -25,6 +26,8 @@ var BreadcrumbItem = /** @class */ (function () {
25
26
  }
26
27
  // Configure the item
27
28
  BreadcrumbItem.prototype.configure = function () {
29
+ // Set the class names
30
+ common_1.setClassNames(this._el, this._props.className);
28
31
  // See if this item is active
29
32
  if (this._props.isActive) {
30
33
  // Add the class name
@@ -742,7 +742,7 @@ eval("\n\nvar __extends = this && this.__extends || function () {\n var _extend
742
742
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
743
743
 
744
744
  "use strict";
745
- eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.BreadcrumbItem = void 0;\n\nvar templates_1 = __webpack_require__(/*! ./templates */ \"./src/components/breadcrumb/templates.ts\");\n/**\r\n * Breadcrumb Item\r\n */\n\n\nvar BreadcrumbItem =\n/** @class */\nfunction () {\n // Constructor\n function BreadcrumbItem(props, template) {\n if (template === void 0) {\n template = props.href && !props.isActive ? templates_1.HTMLLink : templates_1.HTMLItem;\n }\n\n this._el = null;\n this._elLink = null;\n this._props = null; // Save the properties\n\n this._props = props; // Create the item\n\n var elItem = document.createElement(\"div\");\n elItem.innerHTML = template;\n this._el = elItem.firstChild; // Configure the item\n\n this.configure(); // Configure the events\n\n this.configureEvents();\n } // Configure the item\n\n\n BreadcrumbItem.prototype.configure = function () {\n // See if this item is active\n if (this._props.isActive) {\n // Add the class name\n this._el.classList.add(\"active\"); // Set the attribute\n\n\n this._el.setAttribute(\"aria-current\", \"page\");\n } // See if this is a link\n\n\n this._elLink = this.el.querySelector(\"a\");\n\n if (this._elLink) {\n // Configure the link\n this._elLink.href = this._props.href;\n this._elLink.innerHTML = this._props.text == null ? \"\" : this._props.text;\n } else {\n // Configure the item\n this._el.innerHTML = this._props.text == null ? \"\" : this._props.text;\n }\n }; // Configure the events\n\n\n BreadcrumbItem.prototype.configureEvents = function () {\n var _this = this; // See if there is a click event\n\n\n if (this._props.onClick) {\n // Add the click event\n (this._elLink || this._el).addEventListener(\"click\", function (ev) {\n // Call the click event\n _this._props.onClick(_this._props, ev);\n });\n }\n };\n\n Object.defineProperty(BreadcrumbItem.prototype, \"el\", {\n /**\r\n * Public Properties\r\n */\n // The component HTML element\n get: function get() {\n return this._el;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BreadcrumbItem.prototype, \"props\", {\n // The componen properties\n get: function get() {\n return this._props;\n },\n enumerable: false,\n configurable: true\n });\n return BreadcrumbItem;\n}();\n\nexports.BreadcrumbItem = BreadcrumbItem;\n\n//# sourceURL=webpack://gd-bs/./src/components/breadcrumb/item.ts?");
745
+ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.BreadcrumbItem = void 0;\n\nvar common_1 = __webpack_require__(/*! ../common */ \"./src/components/common.ts\");\n\nvar templates_1 = __webpack_require__(/*! ./templates */ \"./src/components/breadcrumb/templates.ts\");\n/**\r\n * Breadcrumb Item\r\n */\n\n\nvar BreadcrumbItem =\n/** @class */\nfunction () {\n // Constructor\n function BreadcrumbItem(props, template) {\n if (template === void 0) {\n template = props.href && !props.isActive ? templates_1.HTMLLink : templates_1.HTMLItem;\n }\n\n this._el = null;\n this._elLink = null;\n this._props = null; // Save the properties\n\n this._props = props; // Create the item\n\n var elItem = document.createElement(\"div\");\n elItem.innerHTML = template;\n this._el = elItem.firstChild; // Configure the item\n\n this.configure(); // Configure the events\n\n this.configureEvents();\n } // Configure the item\n\n\n BreadcrumbItem.prototype.configure = function () {\n // Set the class names\n common_1.setClassNames(this._el, this._props.className); // See if this item is active\n\n if (this._props.isActive) {\n // Add the class name\n this._el.classList.add(\"active\"); // Set the attribute\n\n\n this._el.setAttribute(\"aria-current\", \"page\");\n } // See if this is a link\n\n\n this._elLink = this.el.querySelector(\"a\");\n\n if (this._elLink) {\n // Configure the link\n this._elLink.href = this._props.href;\n this._elLink.innerHTML = this._props.text == null ? \"\" : this._props.text;\n } else {\n // Configure the item\n this._el.innerHTML = this._props.text == null ? \"\" : this._props.text;\n }\n }; // Configure the events\n\n\n BreadcrumbItem.prototype.configureEvents = function () {\n var _this = this; // See if there is a click event\n\n\n if (this._props.onClick) {\n // Add the click event\n (this._elLink || this._el).addEventListener(\"click\", function (ev) {\n // Call the click event\n _this._props.onClick(_this._props, ev);\n });\n }\n };\n\n Object.defineProperty(BreadcrumbItem.prototype, \"el\", {\n /**\r\n * Public Properties\r\n */\n // The component HTML element\n get: function get() {\n return this._el;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BreadcrumbItem.prototype, \"props\", {\n // The componen properties\n get: function get() {\n return this._props;\n },\n enumerable: false,\n configurable: true\n });\n return BreadcrumbItem;\n}();\n\nexports.BreadcrumbItem = BreadcrumbItem;\n\n//# sourceURL=webpack://gd-bs/./src/components/breadcrumb/item.ts?");
746
746
 
747
747
  /***/ }),
748
748