gd-bs 6.2.3 → 6.2.5
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/button/index.js +2 -2
- package/build/components/dropdown/index.js +9 -0
- package/build/components/form/control.js +1 -1
- package/build/components/form/group.js +8 -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 -1
- package/dist/gd-bs.js +1 -1
- package/dist/gd-bs.min.js +1 -1
- package/package.json +1 -1
- package/src/components/button/index.ts +3 -3
- package/src/components/dropdown/index.ts +10 -0
- package/src/components/dropdown/types.d.ts +3 -1
- package/src/components/form/control.ts +1 -1
- package/src/components/form/group.ts +9 -0
|
@@ -120,11 +120,11 @@ var _Button = /** @class */ (function (_super) {
|
|
|
120
120
|
this.setText(this.props.text);
|
|
121
121
|
// Set the icon if it exists
|
|
122
122
|
if (this.props.iconType) {
|
|
123
|
+
// Update the styling of the button
|
|
124
|
+
this.el.classList.add("btn-icon");
|
|
123
125
|
if (typeof (this.props.iconType) === "function") {
|
|
124
126
|
// Append the icon
|
|
125
127
|
this.el.prepend(this.props.iconType(this.props.iconSize, this.props.iconSize, this.props.iconClassName));
|
|
126
|
-
// Update the styling of the button
|
|
127
|
-
this.el.classList.add("btn-icon");
|
|
128
128
|
}
|
|
129
129
|
// Else, it's an element
|
|
130
130
|
else if (typeof (this.props.iconType === "object")) {
|
|
@@ -490,6 +490,15 @@ var _Dropdown = /** @class */ (function (_super) {
|
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
};
|
|
493
|
+
// Sets the label of the dropdown
|
|
494
|
+
_Dropdown.prototype.setLabel = function (value) {
|
|
495
|
+
// Get the dropdown
|
|
496
|
+
var ddl = this.el.querySelector(".dropdown-toggle");
|
|
497
|
+
if (ddl) {
|
|
498
|
+
// Set the inner html
|
|
499
|
+
ddl.innerHTML = value;
|
|
500
|
+
}
|
|
501
|
+
};
|
|
493
502
|
// Enables/Disables the dark theme
|
|
494
503
|
_Dropdown.prototype.setTheme = function (isDark) {
|
|
495
504
|
// Get the menu
|
|
@@ -95,7 +95,7 @@ var FormControl = /** @class */ (function () {
|
|
|
95
95
|
FormControl.prototype.create = function () {
|
|
96
96
|
var _this = this;
|
|
97
97
|
// Parse the custom classes to add
|
|
98
|
-
var className =
|
|
98
|
+
var className = this._props.controlClassName || "";
|
|
99
99
|
// Set the value
|
|
100
100
|
var formValue = this._formProps.value ? this._formProps.value[this._props.name] : null;
|
|
101
101
|
var value = typeof (this._props.value) === "undefined" ? formValue : this._props.value;
|
|
@@ -91,6 +91,14 @@ var FormGroup = /** @class */ (function () {
|
|
|
91
91
|
this._el.removeChild(elDescription);
|
|
92
92
|
elDescription = null;
|
|
93
93
|
}
|
|
94
|
+
// Set the class name
|
|
95
|
+
if (this._props.className) {
|
|
96
|
+
// Set the class
|
|
97
|
+
this._el.className = [
|
|
98
|
+
this._el.className || "",
|
|
99
|
+
this._props.className
|
|
100
|
+
].join(' ').trim();
|
|
101
|
+
}
|
|
94
102
|
// Create the control
|
|
95
103
|
this._control = new control_1.FormControl(this._props, this._formProps, elLabel);
|
|
96
104
|
// Wait for the control to be created
|