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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gd-bs",
3
- "version": "6.2.3",
3
+ "version": "6.2.5",
4
4
  "description": "Bootstrap JavaScript, TypeScript and Web Components library.",
5
5
  "main": "build/index.js",
6
6
  "typings": "src/index.d.ts",
@@ -113,12 +113,12 @@ class _Button extends Base<IButtonProps> implements IButton {
113
113
 
114
114
  // Set the icon if it exists
115
115
  if (this.props.iconType) {
116
+ // Update the styling of the button
117
+ this.el.classList.add("btn-icon");
118
+
116
119
  if (typeof (this.props.iconType) === "function") {
117
120
  // Append the icon
118
121
  this.el.prepend((this.props.iconType as Function)(this.props.iconSize, this.props.iconSize, this.props.iconClassName));
119
-
120
- // Update the styling of the button
121
- this.el.classList.add("btn-icon");
122
122
  }
123
123
  // Else, it's an element
124
124
  else if (typeof (this.props.iconType === "object")) {
@@ -502,6 +502,16 @@ class _Dropdown extends Base<IDropdownProps> implements IDropdown {
502
502
  }
503
503
  }
504
504
 
505
+ // Sets the label of the dropdown
506
+ setLabel(value: string) {
507
+ // Get the dropdown
508
+ let ddl = this.el.querySelector(".dropdown-toggle");
509
+ if (ddl) {
510
+ // Set the inner html
511
+ ddl.innerHTML = value;
512
+ }
513
+ }
514
+
505
515
  // Enables/Disables the dark theme
506
516
  setTheme(isDark: boolean) {
507
517
  // Get the menu
@@ -83,6 +83,9 @@ export interface IDropdown {
83
83
  /** Updates the dropdown items. */
84
84
  setItems: (items: Array<IDropdownItem>) => void;
85
85
 
86
+ /** Updates the label of the dropdown. */
87
+ setLabel: (value: string) => void;
88
+
86
89
  /** Enables/Disables the dark theme. */
87
90
  setTheme: (isDark: boolean) => void;
88
91
 
@@ -144,7 +147,6 @@ export interface IDropdownProps extends IBaseProps<IDropdown> {
144
147
  onChange?: (item?: IDropdownItem | Array<IDropdownItem>, ev?: Event) => void;
145
148
  onMenuRendering?: (props: IPopoverProps) => IPopoverProps;
146
149
  required?: boolean;
147
- setLabelToValue?: boolean;
148
150
  title?: string;
149
151
  type?: number;
150
152
  value?: any;
@@ -99,7 +99,7 @@ export class FormControl implements IFormControl {
99
99
  // Creates the control
100
100
  private create() {
101
101
  // Parse the custom classes to add
102
- let className = [(this._props.className || ""), (this._props.controlClassName || "")].join(" ").trim();
102
+ let className = this._props.controlClassName || "";
103
103
 
104
104
  // Set the value
105
105
  let formValue = this._formProps.value ? this._formProps.value[this._props.name] : null;
@@ -96,6 +96,15 @@ export class FormGroup {
96
96
  elDescription = null;
97
97
  }
98
98
 
99
+ // Set the class name
100
+ if (this._props.className) {
101
+ // Set the class
102
+ this._el.className = [
103
+ this._el.className || "",
104
+ this._props.className
105
+ ].join(' ').trim();
106
+ }
107
+
99
108
  // Create the control
100
109
  this._control = new FormControl(this._props, this._formProps, elLabel);
101
110