bfg-common 1.4.580 → 1.4.581

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,207 +1,207 @@
1
- <template>
2
- <g data-title="adapter-block-contents">
3
- <foreignObject
4
- v-if="isShowArrow"
5
- :data-id="`${props.testId}-adapters-toggle`"
6
- data-title="adapter-toggle"
7
- :width="positions.arrowIconSize"
8
- :height="positions.arrowIconSize"
9
- :x="positions.arrowIconX"
10
- :y="arrawIconPosition"
11
- :cursor="hasAdapters && 'pointer'"
12
- @click="onToggleAdapters"
13
- >
14
- <div class="diagram-block__toggle">
15
- <ui-icon
16
- v-if="isNewView"
17
- name="arrow"
18
- width="20"
19
- height="20"
20
- :class="[
21
- 'virtual-switch__arrow-icon',
22
- {
23
- 'is-new': isNewView,
24
- open: hasAdapters ? props.adaptersWithPositions.toggle : false,
25
- 'without-adapters': !hasAdapters,
26
- },
27
- ]"
28
- />
29
- <atoms-the-icon
30
- v-else
31
- name="angle"
32
- :class="[
33
- 'virtual-switch__arrow-icon',
34
- {
35
- open: props.adaptersWithPositions.toggle,
36
- },
37
- ]"
38
- />
39
- {{ hasAdapters }}
40
- </div>
41
- </foreignObject>
42
- <text
43
- data-title="adapter-main-text"
44
- dy="14px"
45
- font-size="14"
46
- font-weight="500"
47
- :x="positions.adapterTextX"
48
- :y="props.adaptersWithPositions.titlePosition"
49
- :class="['diagram__heading', { 'is-new': isNewView }]"
50
- >
51
- {{ headerText }}
52
- </text>
53
-
54
- <foreignObject
55
- v-if="!isNewView && !hasAdapters"
56
- data-title="no-adapter-text"
57
- dy="11px"
58
- height="20"
59
- width="230"
60
- x="462"
61
- y="53"
62
- >
63
- <span
64
- data-title="no-physical-adapters"
65
- class="no-physical-adapters text-ellipsis"
66
- >
67
- {{ localization.common.noPhysicalNetworkAdapters }}
68
- </span>
69
- </foreignObject>
70
- </g>
71
- </template>
72
-
73
- <script setup lang="ts">
74
- import type { UI_I_AdaptersWithPositions } from '~/components/common/diagramMain/lib/models/interfaces'
75
- import type {
76
- UI_I_Localization,
77
- UI_I_ArbitraryObject,
78
- } from '~/lib/models/interfaces'
79
- import { adapterContentPositionsFunc } from '~/components/common/diagramMain/lib/config'
80
-
81
- const props = defineProps<{
82
- adaptersWithPositions: UI_I_AdaptersWithPositions
83
- testId?: string
84
- }>()
85
- const emits = defineEmits<{
86
- (event: 'toggle-adapters', networkId: string, portId: string): void
87
- }>()
88
-
89
- const { $store }: any = useNuxtApp()
90
-
91
- const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
92
-
93
- const positions = computed<UI_I_ArbitraryObject<number>>(() =>
94
- adapterContentPositionsFunc(isNewView.value)
95
- )
96
-
97
- const localization = computed<UI_I_Localization>(() => useLocal())
98
-
99
- const hasAdapters = computed<boolean>(
100
- () => props.adaptersWithPositions.adaptersCount > 0
101
- )
102
-
103
- const isShowArrow = computed<boolean>(() =>
104
- isNewView.value ? true : hasAdapters.value
105
- )
106
-
107
- const headerText = computed<string>(() =>
108
- isNewView.value
109
- ? `${localization.value.common.physicalAdapters} (${
110
- props.adaptersWithPositions.adaptersCount || 0
111
- })`
112
- : localization.value.common.physicalAdapters
113
- )
114
-
115
- const arrawIconPosition = computed<number>(
116
- () => props.adaptersWithPositions.titlePosition - 0.5
117
- )
118
-
119
- const onToggleAdapters = (networkId: string, portId: string): void => {
120
- emits('toggle-adapters', networkId, portId)
121
- }
122
- </script>
123
-
124
- <style scoped lang="scss">
125
- @import '~/assets/scss/common/mixins.scss';
126
-
127
- :root.dark-theme {
128
- .diagram__heading {
129
- fill: #c1cdd4;
130
- &.is-new {
131
- fill: var(--diagram-content-text);
132
- }
133
- }
134
- .no-physical-adapters {
135
- fill: #c1cdd4;
136
- }
137
- .text-ellipsis {
138
- color: #c1cdd4;
139
- }
140
- }
141
-
142
- .text-ellipsis {
143
- display: block;
144
- max-width: 230px;
145
- text-overflow: ellipsis;
146
- overflow: hidden;
147
- white-space: nowrap;
148
- font-weight: 400;
149
- font-size: 12px;
150
- color: #565656;
151
- }
152
-
153
- .virtual-switch__arrow-icon {
154
- width: 16px;
155
- height: 16px;
156
- margin-right: 4px;
157
- transform: rotate(90deg);
158
- align-self: center;
159
- fill: var(--triger-icon-color);
160
-
161
- &.is-new {
162
- width: 20px;
163
- height: 20px;
164
- fill: none;
165
- color: var(--diagram-content-second-text);
166
- }
167
-
168
- &.open:not(.without-adapters) {
169
- transform: rotate(180deg);
170
- }
171
-
172
- &.without-adapters {
173
- color: var(--diagram-content-second-disabled-text);
174
- fill: none;
175
- pointer-events: none;
176
- }
177
- }
178
- .diagram__heading {
179
- @include text($fs: 14px, $fw: 500);
180
- fill: #565656;
181
- letter-spacing: normal;
182
- line-height: 1.2rem;
183
-
184
- &.is-new {
185
- line-height: 16.94px;
186
- fill: var(--diagram-content-text);
187
- }
188
- }
189
- .no-physical-adapters {
190
- fill: #565656;
191
- font-size: 13px;
192
- font-weight: 400;
193
- line-height: normal;
194
- }
195
-
196
- :root.is-new-view {
197
- .text-ellipsis {
198
- color: var(--diagram-content-text);
199
- }
200
- }
201
-
202
- :root.is-new-view.dark-theme {
203
- .text-ellipsis {
204
- color: var(--diagram-content-text);
205
- }
206
- }
207
- </style>
1
+ <template>
2
+ <g data-title="adapter-block-contents">
3
+ <foreignObject
4
+ v-if="isShowArrow"
5
+ :data-id="`${props.testId}-adapters-toggle`"
6
+ data-title="adapter-toggle"
7
+ :width="positions.arrowIconSize"
8
+ :height="positions.arrowIconSize"
9
+ :x="positions.arrowIconX"
10
+ :y="arrawIconPosition"
11
+ :cursor="hasAdapters && 'pointer'"
12
+ @click="onToggleAdapters"
13
+ >
14
+ <div class="diagram-block__toggle">
15
+ <ui-icon
16
+ v-if="isNewView"
17
+ name="arrow"
18
+ width="20"
19
+ height="20"
20
+ :class="[
21
+ 'virtual-switch__arrow-icon',
22
+ {
23
+ 'is-new': isNewView,
24
+ open: hasAdapters ? props.adaptersWithPositions.toggle : false,
25
+ 'without-adapters': !hasAdapters,
26
+ },
27
+ ]"
28
+ />
29
+ <atoms-the-icon
30
+ v-else
31
+ name="angle"
32
+ :class="[
33
+ 'virtual-switch__arrow-icon',
34
+ {
35
+ open: props.adaptersWithPositions.toggle,
36
+ },
37
+ ]"
38
+ />
39
+ {{ hasAdapters }}
40
+ </div>
41
+ </foreignObject>
42
+ <text
43
+ data-title="adapter-main-text"
44
+ dy="14px"
45
+ font-size="14"
46
+ font-weight="500"
47
+ :x="positions.adapterTextX"
48
+ :y="props.adaptersWithPositions.titlePosition"
49
+ :class="['diagram__heading', { 'is-new': isNewView }]"
50
+ >
51
+ {{ headerText }}
52
+ </text>
53
+
54
+ <foreignObject
55
+ v-if="!isNewView && !hasAdapters"
56
+ data-title="no-adapter-text"
57
+ dy="11px"
58
+ height="20"
59
+ width="230"
60
+ x="462"
61
+ y="53"
62
+ >
63
+ <span
64
+ data-title="no-physical-adapters"
65
+ class="no-physical-adapters text-ellipsis"
66
+ >
67
+ {{ localization.common.noPhysicalNetworkAdapters }}
68
+ </span>
69
+ </foreignObject>
70
+ </g>
71
+ </template>
72
+
73
+ <script setup lang="ts">
74
+ import type { UI_I_AdaptersWithPositions } from '~/components/common/diagramMain/lib/models/interfaces'
75
+ import type {
76
+ UI_I_Localization,
77
+ UI_I_ArbitraryObject,
78
+ } from '~/lib/models/interfaces'
79
+ import { adapterContentPositionsFunc } from '~/components/common/diagramMain/lib/config'
80
+
81
+ const props = defineProps<{
82
+ adaptersWithPositions: UI_I_AdaptersWithPositions
83
+ testId?: string
84
+ }>()
85
+ const emits = defineEmits<{
86
+ (event: 'toggle-adapters', networkId: string, portId: string): void
87
+ }>()
88
+
89
+ const { $store }: any = useNuxtApp()
90
+
91
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
92
+
93
+ const positions = computed<UI_I_ArbitraryObject<number>>(() =>
94
+ adapterContentPositionsFunc(isNewView.value)
95
+ )
96
+
97
+ const localization = computed<UI_I_Localization>(() => useLocal())
98
+
99
+ const hasAdapters = computed<boolean>(
100
+ () => props.adaptersWithPositions.adaptersCount > 0
101
+ )
102
+
103
+ const isShowArrow = computed<boolean>(() =>
104
+ isNewView.value ? true : hasAdapters.value
105
+ )
106
+
107
+ const headerText = computed<string>(() =>
108
+ isNewView.value
109
+ ? `${localization.value.common.physicalAdapters} (${
110
+ props.adaptersWithPositions.adaptersCount || 0
111
+ })`
112
+ : localization.value.common.physicalAdapters
113
+ )
114
+
115
+ const arrawIconPosition = computed<number>(
116
+ () => props.adaptersWithPositions.titlePosition - 0.5
117
+ )
118
+
119
+ const onToggleAdapters = (networkId: string, portId: string): void => {
120
+ emits('toggle-adapters', networkId, portId)
121
+ }
122
+ </script>
123
+
124
+ <style scoped lang="scss">
125
+ @import '~/assets/scss/common/mixins.scss';
126
+
127
+ :root.dark-theme {
128
+ .diagram__heading {
129
+ fill: #c1cdd4;
130
+ &.is-new {
131
+ fill: var(--diagram-content-text);
132
+ }
133
+ }
134
+ .no-physical-adapters {
135
+ fill: #c1cdd4;
136
+ }
137
+ .text-ellipsis {
138
+ color: #c1cdd4;
139
+ }
140
+ }
141
+
142
+ .text-ellipsis {
143
+ display: block;
144
+ max-width: 230px;
145
+ text-overflow: ellipsis;
146
+ overflow: hidden;
147
+ white-space: nowrap;
148
+ font-weight: 400;
149
+ font-size: 12px;
150
+ color: #565656;
151
+ }
152
+
153
+ .virtual-switch__arrow-icon {
154
+ width: 16px;
155
+ height: 16px;
156
+ margin-right: 4px;
157
+ transform: rotate(90deg);
158
+ align-self: center;
159
+ fill: var(--triger-icon-color);
160
+
161
+ &.is-new {
162
+ width: 20px;
163
+ height: 20px;
164
+ fill: none;
165
+ color: var(--diagram-content-second-text);
166
+ }
167
+
168
+ &.open:not(.without-adapters) {
169
+ transform: rotate(180deg);
170
+ }
171
+
172
+ &.without-adapters {
173
+ color: var(--diagram-content-second-disabled-text);
174
+ fill: none;
175
+ pointer-events: none;
176
+ }
177
+ }
178
+ .diagram__heading {
179
+ @include text($fs: 14px, $fw: 500);
180
+ fill: #565656;
181
+ letter-spacing: normal;
182
+ line-height: 1.2rem;
183
+
184
+ &.is-new {
185
+ line-height: 16.94px;
186
+ fill: var(--diagram-content-text);
187
+ }
188
+ }
189
+ .no-physical-adapters {
190
+ fill: #565656;
191
+ font-size: 13px;
192
+ font-weight: 400;
193
+ line-height: normal;
194
+ }
195
+
196
+ :root.is-new-view {
197
+ .text-ellipsis {
198
+ color: var(--diagram-content-text);
199
+ }
200
+ }
201
+
202
+ :root.is-new-view.dark-theme {
203
+ .text-ellipsis {
204
+ color: var(--diagram-content-text);
205
+ }
206
+ }
207
+ </style>