tera-system-ui 0.1.16 → 0.1.18

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.
@@ -17,8 +17,10 @@ export function createContext(context) {
17
17
  return currentTab;
18
18
  },
19
19
  set currentTab(value) {
20
- context.onchange(value);
21
- currentTab = value;
20
+ if (value !== currentTab) {
21
+ context.onchange(value);
22
+ currentTab = value;
23
+ }
22
24
  },
23
25
  });
24
26
  }
@@ -13,7 +13,9 @@
13
13
  let tabsList = $state()
14
14
 
15
15
  function updateIndicator() {
16
- let button = tabsList?.querySelector(`button[data-value="${context.currentTab}"]`)
16
+ if (!tabsList) return;
17
+
18
+ let button = tabsList.querySelector(`button[data-value="${context.currentTab}"]`)
17
19
 
18
20
  const rect = button.getBoundingClientRect();
19
21
  const containerRect = tabsList.getBoundingClientRect();
@@ -31,7 +33,6 @@
31
33
  let context = getCtx()
32
34
 
33
35
  $effect(() => {
34
- context.currentTab
35
36
  updateIndicator();
36
37
  })
37
38
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tera-system-ui",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "npm run customPrepublish && npm run generate-index && vite build && npm run package && npm run postpublish",