@cedx/base 0.15.1 → 0.15.2

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.15.1/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.15.2/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).
@@ -15,7 +15,7 @@ export class TabActivator extends HTMLElement {
15
15
  */
16
16
  get activeTabIndex() {
17
17
  const index = Number(this.storage.getItem(this.storageKey) ?? "1");
18
- return Math.max(0, Math.min(this.tabs.length, Number.isNaN(index) ? 0 : index - 1));
18
+ return Math.max(0, Math.min(this.tabs.length - 1, Number.isNaN(index) ? 0 : index - 1));
19
19
  }
20
20
  set activeTabIndex(value) {
21
21
  this.storage.setItem(this.storageKey, (value + 1).toString());
@@ -57,7 +57,7 @@ export class TabActivator extends HTMLElement {
57
57
  */
58
58
  connectedCallback() {
59
59
  const { activeTabIndex, tabs } = this;
60
- for (let index = 0; index < tabs.length - 1; index++) {
60
+ for (let index = 0; index < tabs.length; index++) {
61
61
  const tab = tabs.item(index);
62
62
  tab.addEventListener("click", () => this.activeTabIndex = index);
63
63
  if (index == activeTabIndex)
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.15.1",
10
+ "version": "0.15.2",
11
11
  "devDependencies": {
12
12
  "@playwright/browser-chromium": "^1.55.0",
13
13
  "@types/bootstrap": "^5.2.10",
@@ -18,7 +18,7 @@ export class TabActivator extends HTMLElement {
18
18
  */
19
19
  get activeTabIndex(): number {
20
20
  const index = Number(this.storage.getItem(this.storageKey) ?? "1");
21
- return Math.max(0, Math.min(this.tabs.length, Number.isNaN(index) ? 0 : index - 1));
21
+ return Math.max(0, Math.min(this.tabs.length - 1, Number.isNaN(index) ? 0 : index - 1));
22
22
  }
23
23
  set activeTabIndex(value: number) {
24
24
  this.storage.setItem(this.storageKey, (value + 1).toString());
@@ -65,7 +65,7 @@ export class TabActivator extends HTMLElement {
65
65
  */
66
66
  connectedCallback(): void {
67
67
  const {activeTabIndex, tabs} = this;
68
- for (let index = 0; index < tabs.length - 1; index++) {
68
+ for (let index = 0; index < tabs.length; index++) {
69
69
  const tab = tabs.item(index);
70
70
  tab.addEventListener("click", () => this.activeTabIndex = index);
71
71
  if (index == activeTabIndex) Tab.getOrCreateInstance(tab).show();