@bagelink/vue 1.6.51 → 1.6.53

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.
@@ -6,6 +6,6 @@ export interface NavLink {
6
6
  href?: string;
7
7
  localized?: string;
8
8
  children?: NavLink[];
9
- onClick?: () => void;
9
+ action?: () => void;
10
10
  }
11
11
  //# sourceMappingURL=NavLink.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NavLink.d.ts","sourceRoot":"","sources":["../../src/types/NavLink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,MAAM,WAAW,OAAO;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,QAAQ,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACpB"}
1
+ {"version":3,"file":"NavLink.d.ts","sourceRoot":"","sources":["../../src/types/NavLink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,MAAM,WAAW,OAAO;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,QAAQ,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CACnB"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "1.6.51",
4
+ "version": "1.6.53",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Bagel Studio",
@@ -1,45 +1,38 @@
1
1
  <script setup lang="ts">
2
- import type { IconType } from '@bagelink/vue'
2
+ import type { NavLink } from '@bagelink/vue'
3
3
  import { Btn, Icon, Dropdown } from '@bagelink/vue'
4
4
 
5
- export interface MenuItem {
6
- icon: IconType
7
- value: string
8
- to: string
9
- items?: MenuItem[]
10
- }
11
-
12
- defineProps<{ items: MenuItem[] }>()
5
+ defineProps<{ items: NavLink[] }>()
13
6
  </script>
14
7
 
15
8
  <template>
16
9
  <div class="flex space-between m_w-100vw overflow m_-ms-1 m_px-05 m_py-025 bglTopMenu">
17
10
  <div class="flex gap-025 m_gap-05">
18
- <template v-for="item in items" :key="item.value">
19
- <Dropdown v-if="item.items" :value="item.value" iconEnd="keyboard_arrow_down">
11
+ <template v-for="item in items" :key="item.label">
12
+ <Dropdown v-if="item.children" :value="item.label" iconEnd="keyboard_arrow_down">
20
13
  <template #trigger="{ show }">
21
14
  <Btn thin flat @click="show()">
22
15
  <Icon :name="item.icon" size="0.8" style="margin-bottom: -0.1rem" />
23
16
  <p class="-ms-025">
24
- {{ item.value }}
17
+ {{ item.label }}
25
18
  </p>
26
19
  <Icon name="keyboard_arrow_down" size="0.8" style="margin-bottom: -0.1rem" />
27
20
  </Btn>
28
21
  </template>
29
22
  <Btn
30
- v-for="subItem in item.items" :key="subItem.value" thin flat :to="subItem.to"
23
+ v-for="subItem in item.children" :key="subItem.label" thin flat :to="subItem.to"
31
24
  class="block m_px-025"
32
25
  >
33
26
  <Icon :name="subItem.icon" size="0.8" style="margin-bottom: -0.1rem" />
34
27
  <p class="-ms-025">
35
- {{ subItem.value }}
28
+ {{ subItem.label }}
36
29
  </p>
37
30
  </Btn>
38
31
  </Dropdown>
39
32
  <Btn v-else thin flat :to="item.to" class="m_px-025">
40
33
  <Icon :name="item.icon" size="0.9" style="margin-bottom: -0.1rem" />
41
34
  <p class="-ms-025">
42
- {{ item.value }}
35
+ {{ item.label }}
43
36
  </p>
44
37
  </Btn>
45
38
  </template>
@@ -60,7 +60,7 @@ onMounted(calcIsOpen)
60
60
  :key="link.label"
61
61
  class="nav-button"
62
62
  :to="link.to"
63
- @click="link.onClick?.()"
63
+ @click="link.action?.()"
64
64
  >
65
65
  <Icon :icon="link.icon" />
66
66
  <div class="tooltip">
@@ -77,7 +77,7 @@ onMounted(calcIsOpen)
77
77
  :key="link.label"
78
78
  class="nav-button"
79
79
  :to="link.to"
80
- @click="link.onClick?.()"
80
+ @click="link.action?.()"
81
81
  >
82
82
  <Icon :icon="link.icon" />
83
83
  <div class="tooltip">
@@ -4,9 +4,8 @@ import { Btn, Icon } from '@bagelink/vue'
4
4
  import { inject, computed, ref, watch } from 'vue'
5
5
  import { useRoute } from 'vue-router'
6
6
 
7
- // Extended interface for links that can have actions
7
+ // Extended interface for links with active route tracking
8
8
  interface LinkWithAction extends NavLink {
9
- action?: () => void
10
9
  activeRoutes?: string[] // נתיבים שצריכים להיות מסומנים כאקטיביים עבור הלינק הזה
11
10
  }
12
11
 
@@ -20,7 +20,7 @@ defineProps<{
20
20
  <slot name="brand" />
21
21
  <Btn
22
22
  v-for="(nav, i) in navLinks" :key="i" :to="nav.to" class="m_h-auto"
23
- @click="nav.onClick"
23
+ @click="nav.action"
24
24
  >
25
25
  <Icon :icon="nav.icon" :size="1.4" class="m-0 line-height-14" />
26
26
  <p class="m-0 pb-025 txt10 line-height-1 w60 menu-text">
@@ -47,7 +47,7 @@ const toggleMenu = useDebounceFn(() => {
47
47
  v-bind="{
48
48
  ...(nav.to && { to: nav.to }),
49
49
  ...(nav.href && { href: nav.href }),
50
- ...(nav.onClick && { onClick: nav.onClick }),
50
+ ...(nav.action && { onClick: nav.action }),
51
51
  }"
52
52
  class="nav-button px-075 me-auto w-100"
53
53
  >
@@ -7,5 +7,5 @@ export interface NavLink {
7
7
  href?: string
8
8
  localized?: string
9
9
  children?: NavLink[]
10
- onClick?: () => void
10
+ action?: () => void
11
11
  }