bfg-common 1.5.488 → 1.5.489

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,106 +1,106 @@
1
- <template>
2
- <ui-popup
3
- :v-if="props.show"
4
- :title="title"
5
- :message="text"
6
- :texts="buttons"
7
- icon-name="info-status"
8
- size="sm"
9
- @hide="onHideModal"
10
- @submit="onRemove"
11
- />
12
- </template>
13
-
14
- <script setup lang="ts">
15
- import type { UI_T_Project } from '~/lib/models/types'
16
- import type { UI_I_ModalTexts } from '~/node_modules/bfg-uikit/components/ui/modal/models/interfaces'
17
- import type { UI_I_Localization } from '~/lib/models/interfaces'
18
-
19
- // Props from up
20
- const props = withDefaults(
21
- defineProps<{
22
- show: boolean
23
- modalName: string
24
- viewName: string
25
- title: string
26
- type: string
27
- id?: string
28
- isShowLoader?: boolean
29
- label?: string
30
- switchName?: string
31
- hostName?: string
32
- networkType: string
33
- project: UI_T_Project
34
- }>(),
35
- {
36
- id: '',
37
- isShowLoader: false,
38
- label: '',
39
- switchName: '',
40
- hostName: '',
41
- }
42
- )
43
-
44
- // Modal hiding
45
- const emits = defineEmits<{
46
- (event: 'hide'): void
47
- (event: 'remove', id: string, type: string): void
48
- }>()
49
-
50
- // UI_I_Localization
51
- const localization = computed<UI_I_Localization>(() => useLocal())
52
-
53
- const title = computed<string>(() => {
54
- switch (props.type) {
55
- case 'network':
56
- return localization.value.common.confirmNetworkRemoval
57
- case 'port':
58
- return localization.value.common.confirmPortRemoval
59
- case 'switch':
60
- return localization.value.common.confirmSwitchRemoval
61
- default:
62
- return ''
63
- }
64
- })
65
-
66
- const text = computed<string>(() => {
67
- switch (props.type) {
68
- case 'network':
69
- return localization.value.common.confirmNetworkRemovalMessage
70
- .replace('{networkName}', props.label)
71
- .replace('{switchName}', props.switchName)
72
- case 'port':
73
- return localization.value.common.confirmPortRemovalMessage
74
- .replace('{portName}', props.id)
75
- .replace('{switchName}', props.switchName)
76
- case 'switch':
77
- return localization.value.common.confirmSwitchRemovalMessage
78
- .replace('{switchName}', props.switchName)
79
- .replace('{hostName}', props.hostName)
80
- default:
81
- return ''
82
- }
83
- })
84
-
85
- const buttons = computed<UI_I_ModalTexts>(() => ({
86
- button1: localization.value.common.cancel,
87
- button2: localization.value.common.confirm,
88
- }))
89
-
90
- const isSphereProject = computed<boolean>(() => props.project === 'sphere')
91
-
92
- const onRemove = (): void => {
93
- const type = isSphereProject.value
94
- ? props.networkType
95
- ? `${props.type}${props.networkType}`
96
- : props.type
97
- : props.type
98
-
99
- emits('remove', props.id, type)
100
- }
101
- const onHideModal = (): void => {
102
- emits('hide')
103
- }
104
- </script>
105
-
106
- <style scoped lang="scss"></style>
1
+ <template>
2
+ <ui-popup
3
+ :v-if="props.show"
4
+ :title="title"
5
+ :message="text"
6
+ :texts="buttons"
7
+ icon-name="info-status"
8
+ size="sm"
9
+ @hide="onHideModal"
10
+ @submit="onRemove"
11
+ />
12
+ </template>
13
+
14
+ <script setup lang="ts">
15
+ import type { UI_T_Project } from '~/lib/models/types'
16
+ import type { UI_I_ModalTexts } from '~/node_modules/bfg-uikit/components/ui/modal/models/interfaces'
17
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
18
+
19
+ // Props from up
20
+ const props = withDefaults(
21
+ defineProps<{
22
+ show: boolean
23
+ modalName: string
24
+ viewName: string
25
+ title: string
26
+ type: string
27
+ id?: string
28
+ isShowLoader?: boolean
29
+ label?: string
30
+ switchName?: string
31
+ hostName?: string
32
+ networkType: string
33
+ project: UI_T_Project
34
+ }>(),
35
+ {
36
+ id: '',
37
+ isShowLoader: false,
38
+ label: '',
39
+ switchName: '',
40
+ hostName: '',
41
+ }
42
+ )
43
+
44
+ // Modal hiding
45
+ const emits = defineEmits<{
46
+ (event: 'hide'): void
47
+ (event: 'remove', id: string, type: string): void
48
+ }>()
49
+
50
+ // UI_I_Localization
51
+ const localization = computed<UI_I_Localization>(() => useLocal())
52
+
53
+ const title = computed<string>(() => {
54
+ switch (props.type) {
55
+ case 'network':
56
+ return localization.value.common.confirmNetworkRemoval
57
+ case 'port':
58
+ return localization.value.common.confirmPortRemoval
59
+ case 'switch':
60
+ return localization.value.common.confirmSwitchRemoval
61
+ default:
62
+ return ''
63
+ }
64
+ })
65
+
66
+ const text = computed<string>(() => {
67
+ switch (props.type) {
68
+ case 'network':
69
+ return localization.value.common.confirmNetworkRemovalMessage
70
+ .replace('{networkName}', props.label)
71
+ .replace('{switchName}', props.switchName)
72
+ case 'port':
73
+ return localization.value.common.confirmPortRemovalMessage
74
+ .replace('{portName}', props.id)
75
+ .replace('{switchName}', props.switchName)
76
+ case 'switch':
77
+ return localization.value.common.confirmSwitchRemovalMessage
78
+ .replace('{switchName}', props.switchName)
79
+ .replace('{hostName}', props.hostName)
80
+ default:
81
+ return ''
82
+ }
83
+ })
84
+
85
+ const buttons = computed<UI_I_ModalTexts>(() => ({
86
+ button1: localization.value.common.cancel,
87
+ button2: localization.value.common.confirm,
88
+ }))
89
+
90
+ const isSphereProject = computed<boolean>(() => props.project === 'sphere')
91
+
92
+ const onRemove = (): void => {
93
+ const type = isSphereProject.value
94
+ ? props.networkType
95
+ ? `${props.type}${props.networkType}`
96
+ : props.type
97
+ : props.type
98
+
99
+ emits('remove', props.id, type)
100
+ }
101
+ const onHideModal = (): void => {
102
+ emits('hide')
103
+ }
104
+ </script>
105
+
106
+ <style scoped lang="scss"></style>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.488",
4
+ "version": "1.5.489",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",