gd-bs 5.3.3 → 5.3.4
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/buttonGroup/index.js +17 -8
- 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/buttonGroup/index.ts +20 -9
- package/src/components/buttonGroup/types.d.ts +3 -0
package/dist/gd-bs.d.ts
CHANGED
|
@@ -473,6 +473,9 @@ declare module 'gd-bs/components/buttonGroup/types' {
|
|
|
473
473
|
/** The element. */
|
|
474
474
|
el: Element;
|
|
475
475
|
|
|
476
|
+
/** Adds a button to the group. */
|
|
477
|
+
add: (props: IButtonProps, btnTemplate?: string) => void;
|
|
478
|
+
|
|
476
479
|
/** The buttons. */
|
|
477
480
|
buttons: Array<IButton>;
|
|
478
481
|
|
package/dist/gd-bs.js
CHANGED
|
@@ -774,7 +774,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));
|
|
|
774
774
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
775
775
|
|
|
776
776
|
"use strict";
|
|
777
|
-
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.ButtonGroup = void 0;\n\nvar base_1 = __webpack_require__(/*! ../base */ \"./build/components/base.js\");\n\nvar button_1 = __webpack_require__(/*! ../button */ \"./build/components/button/index.js\");\n\nvar templates_1 = __webpack_require__(/*! ./templates */ \"./build/components/buttonGroup/templates.js\");\n/**\r\n * Button Group\r\n * @property props - The button group properties.\r\n */\n\n\nvar _ButtonGroup =\n/** @class */\nfunction (_super) {\n __extends(_ButtonGroup, _super); // Constructor\n\n\n function _ButtonGroup(props, template, btnTemplate) {\n if (template === void 0) {\n template = templates_1.HTML;\n }\n\n var _this = _super.call(this, template, props) || this;\n\n _this._buttons = null; // Configure the button group\n\n _this.configure(btnTemplate); // Configure the parent\n\n\n _this.configureParent();\n\n return _this;\n } // Configure the button group\n\n\n _ButtonGroup.prototype.configure = function (btnTemplate) {\n // Set the attributes\n this.props.id ? this.el.id = this.props.id : null;\n this.props.label ? this.el.setAttribute(\"aria-label\", this.props.label) : null; // Set the class names\n\n this.el.classList.add(this.props.isVertical ? \"btn-group-vertical\" : \"btn-group\");\n this.props.isLarge ? this.el.classList.add(\"btn-group-lg\") : null;\n this.props.isSmall ? this.el.classList.add(\"btn-group-sm\") : null; // Render the buttons\n\n this.renderButtons(btnTemplate);\n }; // Render the buttons\n\n\n _ButtonGroup.prototype.renderButtons = function (btnTemplate) {\n // Clear the buttons\n this._buttons = []; // Parse the buttons\n\n var buttons = this.props.buttons || [];\n\n for (var i = 0; i < buttons.length; i++) {\n
|
|
777
|
+
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.ButtonGroup = void 0;\n\nvar base_1 = __webpack_require__(/*! ../base */ \"./build/components/base.js\");\n\nvar button_1 = __webpack_require__(/*! ../button */ \"./build/components/button/index.js\");\n\nvar templates_1 = __webpack_require__(/*! ./templates */ \"./build/components/buttonGroup/templates.js\");\n/**\r\n * Button Group\r\n * @property props - The button group properties.\r\n */\n\n\nvar _ButtonGroup =\n/** @class */\nfunction (_super) {\n __extends(_ButtonGroup, _super); // Constructor\n\n\n function _ButtonGroup(props, template, btnTemplate) {\n if (template === void 0) {\n template = templates_1.HTML;\n }\n\n var _this = _super.call(this, template, props) || this;\n\n _this._buttons = null; // Configure the button group\n\n _this.configure(btnTemplate); // Configure the parent\n\n\n _this.configureParent();\n\n return _this;\n } // Configure the button group\n\n\n _ButtonGroup.prototype.configure = function (btnTemplate) {\n // Set the attributes\n this.props.id ? this.el.id = this.props.id : null;\n this.props.label ? this.el.setAttribute(\"aria-label\", this.props.label) : null; // Set the class names\n\n this.el.classList.add(this.props.isVertical ? \"btn-group-vertical\" : \"btn-group\");\n this.props.isLarge ? this.el.classList.add(\"btn-group-lg\") : null;\n this.props.isSmall ? this.el.classList.add(\"btn-group-sm\") : null; // Render the buttons\n\n this.renderButtons(btnTemplate);\n }; // Render the buttons\n\n\n _ButtonGroup.prototype.renderButtons = function (btnTemplate) {\n // Clear the buttons\n this._buttons = []; // Parse the buttons\n\n var buttons = this.props.buttons || [];\n\n for (var i = 0; i < buttons.length; i++) {\n // Render the button\n this.renderButton(buttons[i], btnTemplate);\n }\n }; // Renders a button\n\n\n _ButtonGroup.prototype.renderButton = function (props, template) {\n // Set the property\n props.type = props.type || this.props.buttonType; // Create the button\n\n var button = button_1.Button(props, template);\n\n this._buttons.push(button); // Append the button to the group\n\n\n this.el.appendChild(button.el);\n };\n\n Object.defineProperty(_ButtonGroup.prototype, \"buttons\", {\n /**\r\n * Public Interface\r\n */\n // Reference to the buttons\n get: function get() {\n return this._buttons;\n },\n enumerable: false,\n configurable: true\n }); // Adds a button to the group\n\n _ButtonGroup.prototype.add = function (props, btnTemplate) {\n // Render the button\n this.renderButton(props, btnTemplate);\n };\n\n return _ButtonGroup;\n}(base_1.Base);\n\nexports.ButtonGroup = function (props, template, btnTemplate) {\n return new _ButtonGroup(props, template, btnTemplate);\n};\n\n//# sourceURL=webpack://gd-bs/./build/components/buttonGroup/index.js?");
|
|
778
778
|
|
|
779
779
|
/***/ }),
|
|
780
780
|
|