gd-bs 5.0.6 → 5.1.0

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.
@@ -88,6 +88,30 @@ var _ListBox = /** @class */ (function (_super) {
88
88
  // Configures the events
89
89
  _ListBox.prototype.configureEvents = function () {
90
90
  var _this = this;
91
+ // Execute the load event
92
+ var returnVal = this.props.onLoadData ? this.props.onLoadData() : null;
93
+ if (returnVal) {
94
+ // See if a promise was returned
95
+ if (typeof (returnVal.then) === "function") {
96
+ // Wait for the promise to complete
97
+ returnVal.then(function (items) {
98
+ // Set the options
99
+ _this.setOptions(items);
100
+ // Set the value if it's been defined
101
+ if (_this.props.value != undefined) {
102
+ _this.setValue(_this.props.value);
103
+ }
104
+ });
105
+ }
106
+ else {
107
+ // Set the options
108
+ this.setOptions(returnVal);
109
+ // Set the value if it's been defined
110
+ if (this.props.value != undefined) {
111
+ this.setValue(this.props.value);
112
+ }
113
+ }
114
+ }
91
115
  // Set the change event on the search box
92
116
  this._elSearchBox.addEventListener("input", function (ev) {
93
117
  var value = _this._elSearchBox.value;
@@ -170,7 +194,9 @@ var _ListBox = /** @class */ (function (_super) {
170
194
  /**
171
195
  * Public Interface
172
196
  */
197
+ // Gets the selected items
173
198
  _ListBox.prototype.getValue = function () { return this._selectedItems; };
199
+ // Sets the options
174
200
  _ListBox.prototype.setOptions = function (items) {
175
201
  if (items === void 0) { items = []; }
176
202
  var elDatalist = this.el.querySelector("datalist");
@@ -93,21 +93,21 @@ var _Nav = /** @class */ (function (_super) {
93
93
  // Configure the events
94
94
  this.configureEvents(link);
95
95
  // Add the tab content
96
- tabs.appendChild(link.elTab);
96
+ tabs.appendChild(link.elTabContent);
97
97
  // See if the fade option is enabled
98
98
  if (this.props.fadeTabs) {
99
99
  // Set the class name
100
- link.elTab.classList.add("fade");
100
+ link.elTabContent.classList.add("fade");
101
101
  // See if the tab is active
102
102
  if (link.props.isActive) {
103
103
  // Set the class name
104
- link.elTab.classList.add("show");
104
+ link.elTabContent.classList.add("show");
105
105
  }
106
106
  }
107
107
  }
108
108
  // Call the render events
109
- this.props.onLinkRendered ? this.props.onLinkRendered(link.el, links[i]) : null;
110
- this.props.onTabRendered ? this.props.onTabRendered(link.elTab, links[i]) : null;
109
+ this.props.onLinkRendered ? this.props.onLinkRendered(link.elTab, links[i]) : null;
110
+ this.props.onTabRendered ? this.props.onTabRendered(link.elTabContent, links[i]) : null;
111
111
  }
112
112
  }
113
113
  };
@@ -140,7 +140,7 @@ var _Nav = /** @class */ (function (_super) {
140
140
  for (var i = 0; i < this._links.length; i++) {
141
141
  var link = this._links[i];
142
142
  // See if this is the target tab
143
- if (tabId === i + 1 || link.elTab.getAttribute("data-title") == tabId) {
143
+ if (tabId === i + 1 || link.elTabContent.getAttribute("data-title") == tabId) {
144
144
  // Toggle it if it's not active
145
145
  link.isActive ? null : link.toggle(this.props.fadeTabs);
146
146
  }
@@ -1160,7 +1160,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));
1160
1160
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1161
1161
 
1162
1162
  "use strict";
1163
- eval("\n\nvar __extends = this && this.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n };\n\n return function (d, b) {\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.ListBox = void 0;\n\nvar base_1 = __webpack_require__(/*! ../base */ \"./src/components/base.ts\");\n\nvar templates_1 = __webpack_require__(/*! ./templates */ \"./src/components/listBox/templates.ts\");\n/**\r\n * List Box\r\n * @property props - The list box properties.\r\n */\n\n\nvar _ListBox = function (_super) {\n __extends(_ListBox, _super); // Constructor\n\n\n function _ListBox(props, template) {\n if (template === void 0) {\n template = templates_1.HTML;\n }\n\n var _this = _super.call(this, template, props) || this;\n\n _this._elLabel = null;\n _this._elSearchBox = null;\n _this._elDatalist = null;\n _this._elValues = null;\n _this._initFl = false;\n _this._items = null;\n _this._selectedItems = null; // Configure the list box\n\n _this.configure(); // Configure the events\n\n\n _this.configureEvents(); // Configure the parent\n\n\n _this.configureParent(); // Set the flag\n\n\n _this._initFl = true;\n return _this;\n } // Configures the list box\n\n\n _ListBox.prototype.configure = function () {\n this._elLabel = this.el.querySelector(\"label\");\n this._elSearchBox = this.el.querySelector(\"input\");\n this._elDatalist = this.el.querySelector(\"datalist\");\n this._elValues = this.el.querySelector(\"ul\"); // See if the placeholder exists\n\n if (this.props.placeholder) {\n // Update the placeholder\n this._elSearchBox ? this._elSearchBox.placeholder = this.props.placeholder : null;\n } // See if the id is set\n\n\n if (this.props.id) {\n // Update the ids\n this.el.id = this.props.id;\n this._elLabel ? this._elLabel.setAttribute(\"for\", this.props.id + \"-search\") : null;\n this._elSearchBox ? this._elSearchBox.id = this.props.id + \"-search\" : null;\n this._elSearchBox ? this._elSearchBox.setAttribute(\"list\", this.props.id + \"-list\") : null;\n this._elDatalist ? this._elDatalist.id = this.props.id + \"-list\" : null;\n } // See if the label exists\n\n\n if (this._elLabel) {\n if (this.props.label) {\n this._elLabel.innerHTML = this.props.label;\n } else {\n // Remove the label\n this.el.removeChild(this._elLabel);\n }\n } // See if this is read-only\n\n\n if (this.props.isReadonly) {\n // Disable the search box\n this._elSearchBox ? this._elSearchBox.disabled = true : null;\n } // Set the options\n\n\n this.setOptions(this.props.items); // Set the value if it's been defined\n\n if (this.props.value != undefined) {\n this.setValue(this.props.value);\n }\n }; // Configures the events\n\n\n _ListBox.prototype.configureEvents = function () {\n var _this = this; // Set the change event on the search box\n\n\n this._elSearchBox.addEventListener(\"input\", function (ev) {\n var value = _this._elSearchBox.value; // Parse the items\n\n for (var i = 0; i < _this._items.length; i++) {\n var item = _this._items[i]; // See if this is the target item\n\n if (item.text == value) {\n // See if this is a multi-select\n if (_this.props.multi) {\n var existsFl = false; // Parse the selected items\n\n for (var j = 0; j < _this._selectedItems.length; j++) {\n var selectedItem = _this._selectedItems[j]; // See if this item is already selected\n\n if (selectedItem.text == item.text) {\n // Set the flag\n existsFl = true;\n break;\n }\n } // Ensure the item wasn't already selected\n\n\n if (!existsFl) {\n // Set the value\n _this.setValue(_this._selectedItems.concat(item).sort(function (a, b) {\n if (a.text < b.text) {\n return -1;\n }\n\n if (a.text > b.text) {\n return 1;\n }\n\n return 0;\n })); // Call the change event\n\n\n _this.props.onChange ? _this.props.onChange(_this._selectedItems, ev) : null;\n }\n } else {\n // Set the value\n _this.setValue(value); // Call the change event\n\n\n _this.props.onChange ? _this.props.onChange(_this._selectedItems, ev) : null;\n } // Clear the selected value\n\n\n _this._elSearchBox.value = \"\"; // Bug - Edge (non-chromium)\n // The menu is still visible, so we fill force a \"blur\" to hide the menu after selection\n\n _this._elSearchBox.blur();\n }\n }\n });\n }; // Method to configure the item event\n\n\n _ListBox.prototype.configureItemEvent = function (elRemove, elItem, item) {\n var _this = this; // Ensure the remove element exists\n\n\n if (elRemove) {\n // Add a click event to the badge\n var badge = elItem.querySelector(\".badge\");\n\n if (badge) {\n badge.addEventListener(\"click\", function (ev) {\n // Remove the item\n _this._elValues.removeChild(elItem); // Find the selected item\n\n\n for (var i = 0; i < _this._selectedItems.length; i++) {\n var selectedItem = _this._selectedItems[i]; // See if this is the target item\n\n if (selectedItem.text == item.text) {\n // Remove this item\n _this._selectedItems.splice(i, 1); // Call the change event\n\n\n _this.props.onChange ? _this.props.onChange(_this._selectedItems, ev) : null;\n break;\n }\n }\n });\n }\n }\n };\n /**\r\n * Public Interface\r\n */\n\n\n _ListBox.prototype.getValue = function () {\n return this._selectedItems;\n };\n\n _ListBox.prototype.setOptions = function (items) {\n if (items === void 0) {\n items = [];\n }\n\n var elDatalist = this.el.querySelector(\"datalist\");\n\n if (elDatalist) {\n // Save a reference to the items\n this._items = items; // Clear the options\n\n while (elDatalist.firstChild) {\n elDatalist.removeChild(elDatalist.firstChild);\n } // Clear the value\n\n\n this._elSearchBox.value = \"\";\n this._selectedItems = []; // Parse the items\n\n for (var i = 0; i < items.length; i++) {\n var props = items[i]; // Add the option\n\n var elOption = document.createElement(\"option\");\n elOption.value = props.text;\n elDatalist.appendChild(elOption); // See if the item is selected\n\n if (props.isSelected) {\n // Add the selected item\n this._selectedItems.push(props);\n }\n } // See if items are selected\n\n\n if (this._selectedItems.length > 0) {\n // Set the value\n this.setValue(this._selectedItems);\n }\n }\n }; // Set the value\n\n\n _ListBox.prototype.setValue = function (value) {\n // Clear the items\n this._selectedItems = [];\n\n while (this._elValues.firstChild) {\n this._elValues.removeChild(this._elValues.firstChild);\n } // Parse the values\n\n\n if (value) {\n // Ensure this is an array\n var values = typeof value === \"string\" || typeof value === \"number\" ? [value] : value; // Parse the values\n\n for (var i = 0; i < values.length; i++) {\n var itemValue = values[i];\n itemValue = typeof itemValue === \"string\" || typeof itemValue === \"number\" ? itemValue : itemValue.text; // Parse the items\n\n for (var j = 0; j < this._items.length; j++) {\n var item = this._items[j]; // See if this is the target item\n\n if (item.text == itemValue || item.value == itemValue) {\n // Add the selected item\n this._selectedItems.push(item); // Create the list item\n\n\n var elItem = document.createElement(\"div\");\n elItem.innerHTML = templates_1.HTMLItem;\n elItem = elItem.firstChild;\n\n this._elValues.appendChild(elItem); // Set the text value\n\n\n var elRemove = elItem.querySelector(\"span\");\n\n if (elRemove) {\n var text = document.createTextNode(item.text);\n elItem.insertBefore(text, elRemove);\n } // See if this is read-only\n\n\n if (this.props.isReadonly) {\n // Delete the \"remove\" button\n elItem.removeChild(elRemove);\n elRemove = null;\n } // Configure the event for this item\n\n\n this.configureItemEvent(elRemove, elItem, item); // Break from the loop\n\n break;\n }\n }\n }\n } // See if a change event exists\n\n\n if (this._initFl && this.props.onChange) {\n // Execute the change event\n this.props.onChange(this.getValue());\n }\n };\n\n return _ListBox;\n}(base_1.Base);\n\nexports.ListBox = function (props, template) {\n return new _ListBox(props, template);\n};\n\n//# sourceURL=webpack://gd-bs/./src/components/listBox/index.ts?");
1163
+ eval("\n\nvar __extends = this && this.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n };\n\n return function (d, b) {\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.ListBox = void 0;\n\nvar base_1 = __webpack_require__(/*! ../base */ \"./src/components/base.ts\");\n\nvar templates_1 = __webpack_require__(/*! ./templates */ \"./src/components/listBox/templates.ts\");\n/**\r\n * List Box\r\n * @property props - The list box properties.\r\n */\n\n\nvar _ListBox = function (_super) {\n __extends(_ListBox, _super); // Constructor\n\n\n function _ListBox(props, template) {\n if (template === void 0) {\n template = templates_1.HTML;\n }\n\n var _this = _super.call(this, template, props) || this;\n\n _this._elLabel = null;\n _this._elSearchBox = null;\n _this._elDatalist = null;\n _this._elValues = null;\n _this._initFl = false;\n _this._items = null;\n _this._selectedItems = null; // Configure the list box\n\n _this.configure(); // Configure the events\n\n\n _this.configureEvents(); // Configure the parent\n\n\n _this.configureParent(); // Set the flag\n\n\n _this._initFl = true;\n return _this;\n } // Configures the list box\n\n\n _ListBox.prototype.configure = function () {\n this._elLabel = this.el.querySelector(\"label\");\n this._elSearchBox = this.el.querySelector(\"input\");\n this._elDatalist = this.el.querySelector(\"datalist\");\n this._elValues = this.el.querySelector(\"ul\"); // See if the placeholder exists\n\n if (this.props.placeholder) {\n // Update the placeholder\n this._elSearchBox ? this._elSearchBox.placeholder = this.props.placeholder : null;\n } // See if the id is set\n\n\n if (this.props.id) {\n // Update the ids\n this.el.id = this.props.id;\n this._elLabel ? this._elLabel.setAttribute(\"for\", this.props.id + \"-search\") : null;\n this._elSearchBox ? this._elSearchBox.id = this.props.id + \"-search\" : null;\n this._elSearchBox ? this._elSearchBox.setAttribute(\"list\", this.props.id + \"-list\") : null;\n this._elDatalist ? this._elDatalist.id = this.props.id + \"-list\" : null;\n } // See if the label exists\n\n\n if (this._elLabel) {\n if (this.props.label) {\n this._elLabel.innerHTML = this.props.label;\n } else {\n // Remove the label\n this.el.removeChild(this._elLabel);\n }\n } // See if this is read-only\n\n\n if (this.props.isReadonly) {\n // Disable the search box\n this._elSearchBox ? this._elSearchBox.disabled = true : null;\n } // Set the options\n\n\n this.setOptions(this.props.items); // Set the value if it's been defined\n\n if (this.props.value != undefined) {\n this.setValue(this.props.value);\n }\n }; // Configures the events\n\n\n _ListBox.prototype.configureEvents = function () {\n var _this = this; // Execute the load event\n\n\n var returnVal = this.props.onLoadData ? this.props.onLoadData() : null;\n\n if (returnVal) {\n // See if a promise was returned\n if (typeof returnVal.then === \"function\") {\n // Wait for the promise to complete\n returnVal.then(function (items) {\n // Set the options\n _this.setOptions(items); // Set the value if it's been defined\n\n\n if (_this.props.value != undefined) {\n _this.setValue(_this.props.value);\n }\n });\n } else {\n // Set the options\n this.setOptions(returnVal); // Set the value if it's been defined\n\n if (this.props.value != undefined) {\n this.setValue(this.props.value);\n }\n }\n } // Set the change event on the search box\n\n\n this._elSearchBox.addEventListener(\"input\", function (ev) {\n var value = _this._elSearchBox.value; // Parse the items\n\n for (var i = 0; i < _this._items.length; i++) {\n var item = _this._items[i]; // See if this is the target item\n\n if (item.text == value) {\n // See if this is a multi-select\n if (_this.props.multi) {\n var existsFl = false; // Parse the selected items\n\n for (var j = 0; j < _this._selectedItems.length; j++) {\n var selectedItem = _this._selectedItems[j]; // See if this item is already selected\n\n if (selectedItem.text == item.text) {\n // Set the flag\n existsFl = true;\n break;\n }\n } // Ensure the item wasn't already selected\n\n\n if (!existsFl) {\n // Set the value\n _this.setValue(_this._selectedItems.concat(item).sort(function (a, b) {\n if (a.text < b.text) {\n return -1;\n }\n\n if (a.text > b.text) {\n return 1;\n }\n\n return 0;\n })); // Call the change event\n\n\n _this.props.onChange ? _this.props.onChange(_this._selectedItems, ev) : null;\n }\n } else {\n // Set the value\n _this.setValue(value); // Call the change event\n\n\n _this.props.onChange ? _this.props.onChange(_this._selectedItems, ev) : null;\n } // Clear the selected value\n\n\n _this._elSearchBox.value = \"\"; // Bug - Edge (non-chromium)\n // The menu is still visible, so we fill force a \"blur\" to hide the menu after selection\n\n _this._elSearchBox.blur();\n }\n }\n });\n }; // Method to configure the item event\n\n\n _ListBox.prototype.configureItemEvent = function (elRemove, elItem, item) {\n var _this = this; // Ensure the remove element exists\n\n\n if (elRemove) {\n // Add a click event to the badge\n var badge = elItem.querySelector(\".badge\");\n\n if (badge) {\n badge.addEventListener(\"click\", function (ev) {\n // Remove the item\n _this._elValues.removeChild(elItem); // Find the selected item\n\n\n for (var i = 0; i < _this._selectedItems.length; i++) {\n var selectedItem = _this._selectedItems[i]; // See if this is the target item\n\n if (selectedItem.text == item.text) {\n // Remove this item\n _this._selectedItems.splice(i, 1); // Call the change event\n\n\n _this.props.onChange ? _this.props.onChange(_this._selectedItems, ev) : null;\n break;\n }\n }\n });\n }\n }\n };\n /**\r\n * Public Interface\r\n */\n // Gets the selected items\n\n\n _ListBox.prototype.getValue = function () {\n return this._selectedItems;\n }; // Sets the options\n\n\n _ListBox.prototype.setOptions = function (items) {\n if (items === void 0) {\n items = [];\n }\n\n var elDatalist = this.el.querySelector(\"datalist\");\n\n if (elDatalist) {\n // Save a reference to the items\n this._items = items; // Clear the options\n\n while (elDatalist.firstChild) {\n elDatalist.removeChild(elDatalist.firstChild);\n } // Clear the value\n\n\n this._elSearchBox.value = \"\";\n this._selectedItems = []; // Parse the items\n\n for (var i = 0; i < items.length; i++) {\n var props = items[i]; // Add the option\n\n var elOption = document.createElement(\"option\");\n elOption.value = props.text;\n elDatalist.appendChild(elOption); // See if the item is selected\n\n if (props.isSelected) {\n // Add the selected item\n this._selectedItems.push(props);\n }\n } // See if items are selected\n\n\n if (this._selectedItems.length > 0) {\n // Set the value\n this.setValue(this._selectedItems);\n }\n }\n }; // Set the value\n\n\n _ListBox.prototype.setValue = function (value) {\n // Clear the items\n this._selectedItems = [];\n\n while (this._elValues.firstChild) {\n this._elValues.removeChild(this._elValues.firstChild);\n } // Parse the values\n\n\n if (value) {\n // Ensure this is an array\n var values = typeof value === \"string\" || typeof value === \"number\" ? [value] : value; // Parse the values\n\n for (var i = 0; i < values.length; i++) {\n var itemValue = values[i];\n itemValue = typeof itemValue === \"string\" || typeof itemValue === \"number\" ? itemValue : itemValue.text; // Parse the items\n\n for (var j = 0; j < this._items.length; j++) {\n var item = this._items[j]; // See if this is the target item\n\n if (item.text == itemValue || item.value == itemValue) {\n // Add the selected item\n this._selectedItems.push(item); // Create the list item\n\n\n var elItem = document.createElement(\"div\");\n elItem.innerHTML = templates_1.HTMLItem;\n elItem = elItem.firstChild;\n\n this._elValues.appendChild(elItem); // Set the text value\n\n\n var elRemove = elItem.querySelector(\"span\");\n\n if (elRemove) {\n var text = document.createTextNode(item.text);\n elItem.insertBefore(text, elRemove);\n } // See if this is read-only\n\n\n if (this.props.isReadonly) {\n // Delete the \"remove\" button\n elItem.removeChild(elRemove);\n elRemove = null;\n } // Configure the event for this item\n\n\n this.configureItemEvent(elRemove, elItem, item); // Break from the loop\n\n break;\n }\n }\n }\n } // See if a change event exists\n\n\n if (this._initFl && this.props.onChange) {\n // Execute the change event\n this.props.onChange(this.getValue());\n }\n };\n\n return _ListBox;\n}(base_1.Base);\n\nexports.ListBox = function (props, template) {\n return new _ListBox(props, template);\n};\n\n//# sourceURL=webpack://gd-bs/./src/components/listBox/index.ts?");
1164
1164
 
1165
1165
  /***/ }),
1166
1166
 
@@ -1237,7 +1237,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));
1237
1237
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1238
1238
 
1239
1239
  "use strict";
1240
- eval("\n\nvar __extends = this && this.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n };\n\n return function (d, b) {\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.Nav = void 0;\n\nvar base_1 = __webpack_require__(/*! ../base */ \"./src/components/base.ts\");\n\nvar link_1 = __webpack_require__(/*! ./link */ \"./src/components/nav/link.ts\");\n\nvar templates_1 = __webpack_require__(/*! ./templates */ \"./src/components/nav/templates.ts\");\n/**\r\n * Navigation\r\n * @param props - The navigation properties.\r\n */\n\n\nvar _Nav = function (_super) {\n __extends(_Nav, _super); // Constructor\n\n\n function _Nav(props, template, itemTemplate) {\n if (template === void 0) {\n template = props.isTabs ? props.isVertical ? templates_1.HTMLVerticalTabs : templates_1.HTMLTabs : templates_1.HTML;\n }\n\n var _this = _super.call(this, template, props) || this;\n\n _this._links = null; // Configure the collapse\n\n _this.configure(itemTemplate); // Configure the parent\n\n\n _this.configureParent();\n\n return _this;\n } // Configure the card group\n\n\n _Nav.prototype.configure = function (itemTemplate) {\n // Update the navigation\n var nav = this.el.querySelector(\".nav\");\n\n if (nav) {\n this.props.id ? nav.id = this.props.id : null;\n this.props.enableFill ? this.el.classList.add(\"nav-fill\") : null;\n this.props.isJustified ? this.el.classList.add(\"nav-justified\") : null;\n this.props.isPills ? this.el.classList.add(\"nav-pills\") : null;\n this.props.isTabs ? this.el.classList.add(\"nav-tabs\") : null;\n this.props.isVertical ? this.el.classList.add(\"flex-column\") : null;\n } // Render the nav links\n\n\n this.renderItems(itemTemplate);\n }; // Configures the link event\n\n\n _Nav.prototype.configureEvents = function (tab) {\n var _this = this; // Add a click event\n\n\n tab.el.addEventListener(\"click\", function () {\n var prevTab = null;\n var newTab = tab; // Parse the links\n\n for (var i = 0; i < _this._links.length; i++) {\n var link = _this._links[i]; // See if it's active\n\n if (link.isActive) {\n // Set the old tab\n prevTab = link; // Toggle it\n\n link.toggle(_this.props.fadeTabs);\n }\n } // Toggle the link\n\n\n tab.toggle(_this.props.fadeTabs); // Call the click event\n\n _this.props.onClick ? _this.props.onClick(newTab, prevTab) : null;\n });\n }; // Renders the links\n\n\n _Nav.prototype.renderItems = function (itemTemplate) {\n // Clear the links\n this._links = []; // Get the nav and tab elements\n\n var nav = this.el.querySelector(\".nav\") || this.el;\n\n if (nav) {\n var tabs = this.el.querySelector(\".tab-content\"); // Parse the navigation items\n\n var links = this.props.items || [];\n\n for (var i = 0; i < links.length; i++) {\n // Create the link\n var link = new link_1.NavLink(links[i], tabs ? true : false, itemTemplate);\n nav.appendChild(link.el);\n\n this._links.push(link); // See if we are rendering tabs\n\n\n if (tabs) {\n // Configure the events\n this.configureEvents(link); // Add the tab content\n\n tabs.appendChild(link.elTab); // See if the fade option is enabled\n\n if (this.props.fadeTabs) {\n // Set the class name\n link.elTab.classList.add(\"fade\"); // See if the tab is active\n\n if (link.props.isActive) {\n // Set the class name\n link.elTab.classList.add(\"show\");\n }\n }\n } // Call the render events\n\n\n this.props.onLinkRendered ? this.props.onLinkRendered(link.el, links[i]) : null;\n this.props.onTabRendered ? this.props.onTabRendered(link.elTab, links[i]) : null;\n }\n }\n };\n\n Object.defineProperty(_Nav.prototype, \"activeTab\", {\n /**\r\n * Public Interface\r\n */\n // The active tab\n get: function get() {\n // Parse the links\n for (var i = 0; i < this._links.length; i++) {\n var link = this._links[i]; // See if it's active\n\n if (link.isActive) {\n // Return the link\n return link;\n }\n } // Active tab not found\n\n\n return null;\n },\n enumerable: false,\n configurable: true\n }); // Shows a tab\n\n _Nav.prototype.showTab = function (tabId) {\n // Ensure tabs exist\n if (this.props.isTabs) {\n // Parse the tabs\n for (var i = 0; i < this._links.length; i++) {\n var link = this._links[i]; // See if this is the target tab\n\n if (tabId === i + 1 || link.elTab.getAttribute(\"data-title\") == tabId) {\n // Toggle it if it's not active\n link.isActive ? null : link.toggle(this.props.fadeTabs);\n } // Else, see if it's active\n else if (link.isActive) {\n // Toggle it\n link.toggle(this.props.fadeTabs);\n }\n }\n }\n };\n\n return _Nav;\n}(base_1.Base);\n\nexports.Nav = function (props, template, itemTemplate) {\n return new _Nav(props, template, itemTemplate);\n};\n\n//# sourceURL=webpack://gd-bs/./src/components/nav/index.ts?");
1240
+ eval("\n\nvar __extends = this && this.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n };\n\n return function (d, b) {\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.Nav = void 0;\n\nvar base_1 = __webpack_require__(/*! ../base */ \"./src/components/base.ts\");\n\nvar link_1 = __webpack_require__(/*! ./link */ \"./src/components/nav/link.ts\");\n\nvar templates_1 = __webpack_require__(/*! ./templates */ \"./src/components/nav/templates.ts\");\n/**\r\n * Navigation\r\n * @param props - The navigation properties.\r\n */\n\n\nvar _Nav = function (_super) {\n __extends(_Nav, _super); // Constructor\n\n\n function _Nav(props, template, itemTemplate) {\n if (template === void 0) {\n template = props.isTabs ? props.isVertical ? templates_1.HTMLVerticalTabs : templates_1.HTMLTabs : templates_1.HTML;\n }\n\n var _this = _super.call(this, template, props) || this;\n\n _this._links = null; // Configure the collapse\n\n _this.configure(itemTemplate); // Configure the parent\n\n\n _this.configureParent();\n\n return _this;\n } // Configure the card group\n\n\n _Nav.prototype.configure = function (itemTemplate) {\n // Update the navigation\n var nav = this.el.querySelector(\".nav\");\n\n if (nav) {\n this.props.id ? nav.id = this.props.id : null;\n this.props.enableFill ? this.el.classList.add(\"nav-fill\") : null;\n this.props.isJustified ? this.el.classList.add(\"nav-justified\") : null;\n this.props.isPills ? this.el.classList.add(\"nav-pills\") : null;\n this.props.isTabs ? this.el.classList.add(\"nav-tabs\") : null;\n this.props.isVertical ? this.el.classList.add(\"flex-column\") : null;\n } // Render the nav links\n\n\n this.renderItems(itemTemplate);\n }; // Configures the link event\n\n\n _Nav.prototype.configureEvents = function (tab) {\n var _this = this; // Add a click event\n\n\n tab.el.addEventListener(\"click\", function () {\n var prevTab = null;\n var newTab = tab; // Parse the links\n\n for (var i = 0; i < _this._links.length; i++) {\n var link = _this._links[i]; // See if it's active\n\n if (link.isActive) {\n // Set the old tab\n prevTab = link; // Toggle it\n\n link.toggle(_this.props.fadeTabs);\n }\n } // Toggle the link\n\n\n tab.toggle(_this.props.fadeTabs); // Call the click event\n\n _this.props.onClick ? _this.props.onClick(newTab, prevTab) : null;\n });\n }; // Renders the links\n\n\n _Nav.prototype.renderItems = function (itemTemplate) {\n // Clear the links\n this._links = []; // Get the nav and tab elements\n\n var nav = this.el.querySelector(\".nav\") || this.el;\n\n if (nav) {\n var tabs = this.el.querySelector(\".tab-content\"); // Parse the navigation items\n\n var links = this.props.items || [];\n\n for (var i = 0; i < links.length; i++) {\n // Create the link\n var link = new link_1.NavLink(links[i], tabs ? true : false, itemTemplate);\n nav.appendChild(link.el);\n\n this._links.push(link); // See if we are rendering tabs\n\n\n if (tabs) {\n // Configure the events\n this.configureEvents(link); // Add the tab content\n\n tabs.appendChild(link.elTabContent); // See if the fade option is enabled\n\n if (this.props.fadeTabs) {\n // Set the class name\n link.elTabContent.classList.add(\"fade\"); // See if the tab is active\n\n if (link.props.isActive) {\n // Set the class name\n link.elTabContent.classList.add(\"show\");\n }\n }\n } // Call the render events\n\n\n this.props.onLinkRendered ? this.props.onLinkRendered(link.elTab, links[i]) : null;\n this.props.onTabRendered ? this.props.onTabRendered(link.elTabContent, links[i]) : null;\n }\n }\n };\n\n Object.defineProperty(_Nav.prototype, \"activeTab\", {\n /**\r\n * Public Interface\r\n */\n // The active tab\n get: function get() {\n // Parse the links\n for (var i = 0; i < this._links.length; i++) {\n var link = this._links[i]; // See if it's active\n\n if (link.isActive) {\n // Return the link\n return link;\n }\n } // Active tab not found\n\n\n return null;\n },\n enumerable: false,\n configurable: true\n }); // Shows a tab\n\n _Nav.prototype.showTab = function (tabId) {\n // Ensure tabs exist\n if (this.props.isTabs) {\n // Parse the tabs\n for (var i = 0; i < this._links.length; i++) {\n var link = this._links[i]; // See if this is the target tab\n\n if (tabId === i + 1 || link.elTabContent.getAttribute(\"data-title\") == tabId) {\n // Toggle it if it's not active\n link.isActive ? null : link.toggle(this.props.fadeTabs);\n } // Else, see if it's active\n else if (link.isActive) {\n // Toggle it\n link.toggle(this.props.fadeTabs);\n }\n }\n }\n };\n\n return _Nav;\n}(base_1.Base);\n\nexports.Nav = function (props, template, itemTemplate) {\n return new _Nav(props, template, itemTemplate);\n};\n\n//# sourceURL=webpack://gd-bs/./src/components/nav/index.ts?");
1241
1241
 
1242
1242
  /***/ }),
1243
1243