gd-bs 6.2.4 → 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.4",
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",
@@ -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