bfg-common 1.4.625 → 1.4.627

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.
@@ -1,74 +1,74 @@
1
- <template>
2
- <ui-data-table
3
- test-id="data-table-main"
4
- :data="data"
5
- :options="options"
6
- server-off
7
- class="network-table"
8
- @select-row="onSelect"
9
- >
10
- <template #icon="{ item }">
11
- <span class="flex-align-center">
12
- <span :class="['icon', item.data.icon]" />
13
-
14
- <span :data-id="item.data.testId">
15
- {{ item.text }}
16
- </span>
17
- </span>
18
- </template>
19
- </ui-data-table>
20
- </template>
21
-
22
- <script setup lang="ts">
23
- import type {
24
- UI_I_DataTable,
25
- UI_I_DataTableHeader,
26
- UI_I_DataTableBody,
27
- } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
28
- import type { UI_I_Localization } from '~/lib/models/interfaces'
29
- import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
30
- import {
31
- options,
32
- getHeaderDataFunc,
33
- getBodyDataFunc,
34
- } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/table/lib/config/config'
35
-
36
- const props = defineProps<{
37
- networksTable: UI_I_NetworkTableItem[]
38
- }>()
39
- const emits = defineEmits<{
40
- (event: 'select', value: string): void
41
- }>()
42
-
43
- const localization = computed<UI_I_Localization>(() => useLocal())
44
-
45
- const data = computed<UI_I_DataTable>(() => ({
46
- id: 'new-network-location',
47
- header: headItems.value,
48
- body: bodyItems.value,
49
- }))
50
-
51
- const headItems = computed<UI_I_DataTableHeader[]>(() =>
52
- getHeaderDataFunc(localization.value)
53
- )
54
-
55
- const bodyItems = ref<UI_I_DataTableBody[]>([])
56
- watch(
57
- () => props.networksTable,
58
- (newValue: UI_I_NetworkTableItem[]) => {
59
- if (!newValue?.length) return
60
-
61
- bodyItems.value = getBodyDataFunc(newValue)
62
- },
63
- { deep: true, immediate: true }
64
- )
65
- const onSelect = (value: UI_I_DataTableBody[]): void => {
66
- emits('select', value[0].data[0].text.toString())
67
- }
68
- </script>
69
-
70
- <style scoped lang="scss">
71
- .icon {
72
- margin-right: 4px;
73
- }
74
- </style>
1
+ <template>
2
+ <ui-data-table
3
+ test-id="data-table-main"
4
+ :data="data"
5
+ :options="options"
6
+ server-off
7
+ class="network-table"
8
+ @select-row="onSelect"
9
+ >
10
+ <template #icon="{ item }">
11
+ <span class="flex-align-center">
12
+ <span :class="['icon', item.data.icon]" />
13
+
14
+ <span :data-id="item.data.testId">
15
+ {{ item.text }}
16
+ </span>
17
+ </span>
18
+ </template>
19
+ </ui-data-table>
20
+ </template>
21
+
22
+ <script setup lang="ts">
23
+ import type {
24
+ UI_I_DataTable,
25
+ UI_I_DataTableHeader,
26
+ UI_I_DataTableBody,
27
+ } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
28
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
29
+ import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
30
+ import {
31
+ options,
32
+ getHeaderDataFunc,
33
+ getBodyDataFunc,
34
+ } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/table/lib/config/config'
35
+
36
+ const props = defineProps<{
37
+ networksTable: UI_I_NetworkTableItem[]
38
+ }>()
39
+ const emits = defineEmits<{
40
+ (event: 'select', value: string): void
41
+ }>()
42
+
43
+ const localization = computed<UI_I_Localization>(() => useLocal())
44
+
45
+ const data = computed<UI_I_DataTable>(() => ({
46
+ id: 'new-network-location',
47
+ header: headItems.value,
48
+ body: bodyItems.value,
49
+ }))
50
+
51
+ const headItems = computed<UI_I_DataTableHeader[]>(() =>
52
+ getHeaderDataFunc(localization.value)
53
+ )
54
+
55
+ const bodyItems = ref<UI_I_DataTableBody[]>([])
56
+ watch(
57
+ () => props.networksTable,
58
+ (newValue: UI_I_NetworkTableItem[]) => {
59
+ if (!newValue?.length) return
60
+
61
+ bodyItems.value = getBodyDataFunc(newValue)
62
+ },
63
+ { deep: true, immediate: true }
64
+ )
65
+ const onSelect = (value: UI_I_DataTableBody[]): void => {
66
+ emits('select', value[0].data[0].text.toString())
67
+ }
68
+ </script>
69
+
70
+ <style scoped lang="scss">
71
+ .icon {
72
+ margin-right: 4px;
73
+ }
74
+ </style>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.625",
4
+ "version": "1.4.627",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -35,7 +35,7 @@
35
35
  "@vueuse/components": "^10.1.2",
36
36
  "date-fns": "^2.29.3",
37
37
  "bfg-nuxt-3-graph": "1.0.15",
38
- "bfg-uikit": "1.0.274",
38
+ "bfg-uikit": "1.0.275",
39
39
  "html2canvas": "^1.4.1",
40
40
  "prettier-eslint": "^15.0.1"
41
41
  }