bfg-common 1.2.230 → 1.2.231

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.
@@ -18,6 +18,7 @@ import type { UI_I_ViewSettingsFields } from '~/components/common/tools/viewSett
18
18
 
19
19
  const props = withDefaults(
20
20
  defineProps<{
21
+ modelValue?: number | string
21
22
  tabs?: UI_I_CollapseNavItem[]
22
23
  viewSettingsFields?: UI_I_ViewSettingsFields[]
23
24
  activeDefaultTab?: number | string
@@ -28,9 +29,21 @@ const props = withDefaults(
28
29
  tabs: undefined,
29
30
  }
30
31
  )
32
+ const emits = defineEmits<{
33
+ (event: 'update:model-value', value: number | string): void
34
+ }>()
31
35
 
32
- // Selected tab id on the view settings
33
- const selectedTabViewSettings = ref<number | string>(props.activeDefaultTab)
36
+ const activeDefaultTabLocal = ref<number | string>(props.activeDefaultTab)
37
+ const selectedTabViewSettings = computed<number | string>({
38
+ get() {
39
+ return activeDefaultTabLocal.value ?? props.modelValue
40
+ },
41
+ set(newValue) {
42
+ props.modelValue
43
+ ? emits('update:model-value', newValue)
44
+ : (activeDefaultTabLocal.value = newValue)
45
+ },
46
+ })
34
47
 
35
48
  // Filtering the selected tab content
36
49
  // const viewSettingsTabContent = (tab: number): UI_I_ViewSettingsFields[] =>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.2.230",
4
+ "version": "1.2.231",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",