@cedx/base 0.10.0 → 0.10.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/ReadMe.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Belin.io Base
2
- ![.NET](https://badgen.net/badge/.net/%3E%3D9.0/green) ![Version](https://badgen.net/badge/project/v0.10.0/blue) ![Licence](https://badgen.net/badge/licence/MIT/blue)
2
+ ![.NET](https://badgen.net/badge/.net/%3E%3D9.0/green) ![Version](https://badgen.net/badge/project/v0.10.1/blue) ![Licence](https://badgen.net/badge/licence/MIT/blue)
3
3
 
4
4
  Base library by [Cédric Belin](https://belin.io), full stack developer,
5
5
  implemented in [C#](https://learn.microsoft.com/en-us/dotnet/csharp) and [TypeScript](https://www.typescriptlang.org).
@@ -59,13 +59,13 @@ export class KeyboardAccelerator extends HTMLElement {
59
59
  if (activeElement instanceof HTMLInputElement || activeElement instanceof HTMLTextAreaElement)
60
60
  return;
61
61
  const { modifiers } = this;
62
- if ((modifiers & KeyboardModifiers.Ctrl) != 0 && !event.ctrlKey)
62
+ if (!(modifiers & KeyboardModifiers.Ctrl) && event.ctrlKey)
63
63
  return;
64
- if ((modifiers & KeyboardModifiers.Shift) != 0 && !event.shiftKey)
64
+ if (!(modifiers & KeyboardModifiers.Shift) && event.shiftKey)
65
65
  return;
66
- if ((modifiers & KeyboardModifiers.Alt) != 0 && !event.altKey)
66
+ if (!(modifiers & KeyboardModifiers.Alt) && event.altKey)
67
67
  return;
68
- if ((modifiers & KeyboardModifiers.Meta) != 0 && !event.metaKey)
68
+ if (!(modifiers & KeyboardModifiers.Meta) && event.metaKey)
69
69
  return;
70
70
  event.preventDefault();
71
71
  this.firstElementChild.click();
@@ -17,7 +17,7 @@ export class MenuActivator extends HTMLElement {
17
17
  anchor.classList.remove("active");
18
18
  else {
19
19
  anchor.classList.add("active");
20
- anchor.closest(".nav-item.dropdown")?.querySelector(".nav-link")?.classList.add("active");
20
+ anchor.closest(".dropdown")?.querySelector('[data-bs-toggle="dropdown"]')?.classList.add("active");
21
21
  }
22
22
  }
23
23
  }
@@ -50,7 +50,7 @@ export class TabActivator extends HTMLElement {
50
50
  * The tab list.
51
51
  */
52
52
  get tabs() {
53
- return this.querySelectorAll(".nav-tabs button");
53
+ return this.querySelectorAll('[data-bs-toggle="tab"]');
54
54
  }
55
55
  /**
56
56
  * Method invoked when this component is connected.
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "name": "@cedx/base",
8
8
  "repository": "cedx/base",
9
9
  "type": "module",
10
- "version": "0.10.0",
10
+ "version": "0.10.1",
11
11
  "devDependencies": {
12
12
  "@playwright/browser-chromium": "^1.54.2",
13
13
  "@types/bootstrap": "^5.2.10",
@@ -15,7 +15,7 @@
15
15
  "@types/mocha": "^10.0.10",
16
16
  "@types/node": "^24.3.0",
17
17
  "@types/serve-handler": "^6.1.4",
18
- "chai": "^5.2.1",
18
+ "chai": "^5.3.1",
19
19
  "esbuild": "^0.25.9",
20
20
  "globals": "^16.3.0",
21
21
  "mocha": "^11.7.1",
@@ -67,10 +67,10 @@ export class KeyboardAccelerator extends HTMLElement {
67
67
  if (activeElement instanceof HTMLInputElement || activeElement instanceof HTMLTextAreaElement) return;
68
68
 
69
69
  const {modifiers} = this;
70
- if ((modifiers & KeyboardModifiers.Ctrl) != 0 && !event.ctrlKey) return;
71
- if ((modifiers & KeyboardModifiers.Shift) != 0 && !event.shiftKey) return;
72
- if ((modifiers & KeyboardModifiers.Alt) != 0 && !event.altKey) return;
73
- if ((modifiers & KeyboardModifiers.Meta) != 0 && !event.metaKey) return;
70
+ if (!(modifiers & KeyboardModifiers.Ctrl) && event.ctrlKey) return;
71
+ if (!(modifiers & KeyboardModifiers.Shift) && event.shiftKey) return;
72
+ if (!(modifiers & KeyboardModifiers.Alt) && event.altKey) return;
73
+ if (!(modifiers & KeyboardModifiers.Meta) && event.metaKey) return;
74
74
 
75
75
  event.preventDefault();
76
76
  (this.firstElementChild as HTMLElement).click();
@@ -18,7 +18,7 @@ export class MenuActivator extends HTMLElement {
18
18
  if (anchor.href != location.href) anchor.classList.remove("active");
19
19
  else {
20
20
  anchor.classList.add("active");
21
- anchor.closest(".nav-item.dropdown")?.querySelector(".nav-link")?.classList.add("active");
21
+ anchor.closest(".dropdown")?.querySelector('[data-bs-toggle="dropdown"]')?.classList.add("active");
22
22
  }
23
23
  }
24
24
  }
@@ -57,7 +57,7 @@ export class TabActivator extends HTMLElement {
57
57
  * The tab list.
58
58
  */
59
59
  get tabs(): NodeListOf<HTMLButtonElement> {
60
- return this.querySelectorAll(".nav-tabs button");
60
+ return this.querySelectorAll('[data-bs-toggle="tab"]');
61
61
  }
62
62
 
63
63
  /**