gd-bs 5.3.0 → 5.3.1

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": "5.3.0",
3
+ "version": "5.3.1",
4
4
  "description": "Bootstrap JavaScript, TypeScript and Web Components library.",
5
5
  "main": "build/index.js",
6
6
  "typings": "src/index.d.ts",
@@ -78,7 +78,7 @@ class _Modal extends Base<IModalProps> implements IModal {
78
78
  if (this.props.hideCloseButton) {
79
79
  // Remove the close button
80
80
  let closeButton = dialog.querySelector(".btn-close") as HTMLElement;
81
- closeButton ? closeButton.parentNode.removeChild(closeButton) : null;
81
+ closeButton ? closeButton.classList.add("d-none") : null;
82
82
  }
83
83
  }
84
84
 
@@ -234,6 +234,22 @@ class _Modal extends Base<IModalProps> implements IModal {
234
234
  this.el.setAttribute("data-bs-backdrop", value ? "true" : "false");
235
235
  }
236
236
 
237
+ // Updates the visibility of the close button
238
+ setCloseButtonVisibility(showFl: boolean) {
239
+ // Get the close button
240
+ let closeButton = this.el.querySelector(".btn-close") as HTMLElement;
241
+ if (closeButton) {
242
+ // See if we are showing the button
243
+ if (showFl) {
244
+ // Show the button
245
+ closeButton.classList.remove("d-none");
246
+ } else {
247
+ // Hide the button
248
+ closeButton.classList.add("d-none");
249
+ }
250
+ }
251
+ }
252
+
237
253
  // Updates the focus flag
238
254
  setFocus(value: boolean) {
239
255
  // Set the focus
@@ -92,6 +92,9 @@ export interface IModal {
92
92
  /** Updates the backdrop flag. */
93
93
  setBackdrop: (value: boolean) => void;
94
94
 
95
+ /** Updates the visibility of the close button. */
96
+ setCloseButtonVisibility: (showFl: boolean) => void;
97
+
95
98
  /** Updates the focus flag. */
96
99
  setFocus: (value: boolean) => void;
97
100