gd-bs 6.2.4 → 6.2.6

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.
@@ -93,6 +93,9 @@ var _Button = /** @class */ (function (_super) {
93
93
  this.props.isSmall ? this.el.classList.add("btn-sm") : null;
94
94
  // Set the default type
95
95
  this.setType(this.props.type || ButtonTypes.Primary);
96
+ // Set the aria label/description
97
+ this.props.description ? this.el.setAttribute("aria-description", this.props.description) : null;
98
+ this.el.setAttribute("aria-label", this.props.label || this.props.text);
96
99
  // Set the attributes
97
100
  this.props.dismiss ? this.el.setAttribute("data-bs-dismiss", this.props.dismiss) : null;
98
101
  this.props.href ? this.el.href = this.props.href : null;
@@ -144,6 +144,7 @@ var _Dropdown = /** @class */ (function (_super) {
144
144
  if (toggle) {
145
145
  toggle.classList.add(btnType);
146
146
  toggle.disabled = this.props.isReadonly ? true : false;
147
+ toggle.setAttribute("aria-label", this.props.label || "");
147
148
  }
148
149
  // See if we are rendering the menu only
149
150
  var menu = this.el.querySelector(".dropdown-menu");
@@ -490,6 +491,15 @@ var _Dropdown = /** @class */ (function (_super) {
490
491
  }
491
492
  }
492
493
  };
494
+ // Sets the label of the dropdown
495
+ _Dropdown.prototype.setLabel = function (value) {
496
+ // Get the dropdown
497
+ var ddl = this.el.querySelector(".dropdown-toggle");
498
+ if (ddl) {
499
+ // Set the inner html
500
+ ddl.innerHTML = value;
501
+ }
502
+ };
493
503
  // Enables/Disables the dark theme
494
504
  _Dropdown.prototype.setTheme = function (isDark) {
495
505
  // 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 = [(this._props.className || ""), (this._props.controlClassName || "")].join(" ").trim();
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
@@ -94,6 +94,11 @@ var _Tooltip = /** @class */ (function (_super) {
94
94
  // Default the toggle property for the button
95
95
  var btnProps = this.props.btnProps || {};
96
96
  btnProps.type = btnProps.type || button_1.ButtonTypes.OutlineSecondary;
97
+ // See if the content is text
98
+ if (typeof (this.props.content) === "string") {
99
+ // Set the label
100
+ btnProps.description = this.props.content;
101
+ }
97
102
  // Create the button
98
103
  this._btn = (0, button_1.Button)(btnProps);
99
104
  // Update the element
@@ -19,6 +19,8 @@ var generateIcon = function (svg, height, width, className) {
19
19
  icon.classList.add(classNames[i]);
20
20
  }
21
21
  }
22
+ // Make this icon invisible to the screen reader
23
+ icon.setAttribute("aria-hidden", "true");
22
24
  // Set the height/width
23
25
  icon.setAttribute("height", (height ? height : 32).toString());
24
26
  icon.setAttribute("width", (width ? width : 32).toString());