bfg-common 1.0.82 → 1.0.83

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.
@@ -30,11 +30,11 @@
30
30
  import type { UI_I_Localization } from '~/models/interfaces'
31
31
  import type { UI_T_ShowType } from '~/components/common/accordion/models/types'
32
32
  import type { UI_I_AccordionRecursion } from '~/components/common/accordion/models/interfaces'
33
- import type { UI_I_Navigation } from '~/components/common/content/navbar/left/models/interfaces'
33
+ import type { UI_I_ContentNavigation } from '~/components/common/content/navbar/left/models/interfaces'
34
34
  import { constructItems } from '~/components/common/content/navbar/left/utils/constructAccordion'
35
35
 
36
36
  const props = defineProps<{
37
- items: UI_I_Navigation[]
37
+ items: UI_I_ContentNavigation[] | null
38
38
  }>()
39
39
 
40
40
  const localization = computed<UI_I_Localization>(() => useLocal())
@@ -54,6 +54,8 @@ const accordionItems = ref<UI_I_AccordionRecursion[]>([])
54
54
  watch(
55
55
  () => props.items,
56
56
  (newValue) => {
57
+ if (newValue === null) return
58
+
57
59
  accordionItems.value = constructItems(newValue)
58
60
  },
59
61
  { deep: true, immediate: true }
@@ -1,5 +1,5 @@
1
- export interface UI_I_Navigation {
1
+ export interface UI_I_ContentNavigation {
2
2
  title: string
3
- children: UI_I_Navigation[]
3
+ children: UI_I_ContentNavigation[]
4
4
  _path: string
5
5
  }
@@ -1,9 +1,9 @@
1
- import type { UI_I_Navigation } from '~/components/common/content/navbar/left/models/interfaces'
1
+ import type { UI_I_ContentNavigation } from '~/components/common/content/navbar/left/models/interfaces'
2
2
  import type { UI_I_AccordionRecursion } from '~/components/common/accordion/models/interfaces'
3
3
 
4
4
  export const constructItems = (
5
- items?: UI_I_Navigation[],
6
- parent?: UI_I_Navigation
5
+ items?: UI_I_ContentNavigation[],
6
+ parent?: UI_I_ContentNavigation
7
7
  ): UI_I_AccordionRecursion[] => {
8
8
  if (!items) return []
9
9
 
@@ -13,7 +13,7 @@ export const constructItems = (
13
13
  !parent || (item.title !== parent.title && item._path !== parent._path)
14
14
  )
15
15
  })
16
- .map((item: UI_I_Navigation): UI_I_AccordionRecursion => {
16
+ .map((item: UI_I_ContentNavigation): UI_I_AccordionRecursion => {
17
17
  const children = constructItems(item.children, item)
18
18
  return {
19
19
  children,
@@ -24,11 +24,11 @@
24
24
  </template>
25
25
 
26
26
  <script setup lang="ts">
27
- import type { UI_I_NavbarItem } from '~/components/common/content/navbar/right/models/interfaces'
27
+ import type { UI_I_ContentNavbarItem } from '~/components/common/content/navbar/right/models/interfaces'
28
28
 
29
29
  const props = defineProps<{
30
30
  title: string
31
- items: UI_I_NavbarItem[]
31
+ items: UI_I_ContentNavbarItem[]
32
32
  }>()
33
33
 
34
34
  const route = useRoute()
@@ -1,4 +1,4 @@
1
- export interface UI_I_NavbarItem {
1
+ export interface UI_I_ContentNavbarItem {
2
2
  text: string
3
3
  to: string
4
4
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.0.82",
4
+ "version": "1.0.83",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",