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.
- package/build/components/breadcrumb/item.js +3 -0
- package/dist/gd-bs-icons.js +1 -1
- package/dist/gd-bs-icons.min.js +1 -1
- package/dist/gd-bs.d.ts +3 -0
- package/dist/gd-bs.js +1 -1
- package/dist/gd-bs.min.js +1 -1
- package/package.json +1 -1
- package/src/components/breadcrumb/item.ts +4 -0
- package/src/components/breadcrumb/types.d.ts +3 -0
package/dist/gd-bs.d.ts
CHANGED
package/dist/gd-bs.js
CHANGED
|
@@ -752,7 +752,7 @@ eval("\n\nvar __extends = this && this.__extends || function () {\n var _extend
|
|
|
752
752
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
753
753
|
|
|
754
754
|
"use strict";
|
|
755
|
-
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.BreadcrumbItem = void 0;\n\nvar templates_1 = __webpack_require__(/*! ./templates */ \"./build/components/breadcrumb/templates.js\");\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/./build/components/breadcrumb/item.js?");
|
|
755
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.BreadcrumbItem = void 0;\n\nvar common_1 = __webpack_require__(/*! ../common */ \"./build/components/common.js\");\n\nvar templates_1 = __webpack_require__(/*! ./templates */ \"./build/components/breadcrumb/templates.js\");\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/./build/components/breadcrumb/item.js?");
|
|
756
756
|
|
|
757
757
|
/***/ }),
|
|
758
758
|
|