bfg-common 1.6.40 → 1.6.41

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,223 +1,234 @@
1
- <template>
2
- <div class="diagram-header">
3
- <div class="diagram-header-left">
4
- <atoms-the-icon
5
- :class="[
6
- 'diagram-header__arrow-icon',
7
- {
8
- open: props.isShowDiagram,
9
- },
10
- ]"
11
- :data-id="`${props.testId}-toggle-icon`"
12
- name="angle"
13
- @click="emits('toggle-diagram')"
14
- />
15
- <a>
16
- <span>
17
- {{ localization.common.standardSwitch }}:
18
- {{ props.diagramName }}
19
- </span>
20
- </a>
21
- </div>
22
- <div v-if="props.isShowDiagram" class="diagram-header__btn-container">
23
- <span class="vertical-separator"></span>
24
- <button
25
- id="add-networking-button"
26
- v-permission="
27
- 'Networks.CreateSysx Networks.CreatePortGroup Networks.UpdateSwitch Networks.CreateSwitch'
28
- "
29
- :data-id="`${props.testId}-add-networking-button`"
30
- type="button"
31
- @click="onShowModal('add-networking', props.diagramName)"
32
- >
33
- {{ localization.common.addNetworking }}
34
- </button>
35
- <button
36
- id="switch-edit-button"
37
- v-permission="'Networks.UpdateSwitch'"
38
- :data-id="`${props.testId}-edit-button`"
39
- type="button"
40
- @click="onShowModal('switch-edit')"
41
- >
42
- {{ localization.common.edit }}
43
- </button>
44
- <button
45
- id="switch-manage-physical-adapters-button"
46
- v-permission="'Networks.UpdateSwitch'"
47
- :data-id="`${props.testId}-manage-physical-adapters-button`"
48
- type="button"
49
- @click="onShowModal('switch-manage-physical-adapters')"
50
- >
51
- {{ localization.common.managePhysicalAdapters }}
52
- </button>
53
- <div class="diagram-main-actions-dots">
54
- <atoms-collapse-nav
55
- :close-after-click="true"
56
- :items="switchMainNavigation"
57
- :test-id="`${props.testId}-actions`"
58
- popup-class="diagram-main-actions__popup"
59
- @change="onShowModal"
60
- />
61
- </div>
62
- </div>
63
- </div>
64
- <hr class="horizontal-separator" />
65
- </template>
66
-
67
- <script setup lang="ts">
68
- import type { UI_I_Localization } from '~/lib/models/interfaces'
69
- import type {
70
- UI_I_NavigationItem,
71
- UI_I_ModalsInitialData,
72
- } from '~/components/common/diagramMain/lib/models/interfaces'
73
- import type { UI_T_Project } from '~/lib/models/types'
74
- import { switchMainNavigationFunc } from '~/components/common/diagramMain/modals/lib/config'
75
-
76
- const props = withDefaults(
77
- defineProps<{
78
- isShowDiagram: boolean
79
- diagramName: string
80
- testId: string
81
- project?: UI_T_Project
82
- }>(),
83
- {
84
- project: undefined,
85
- }
86
- )
87
-
88
- const emits = defineEmits<{
89
- (event: 'toggle-diagram'): void
90
- (
91
- event: 'show-modal',
92
- modalName: string,
93
- properties?: UI_I_ModalsInitialData
94
- ): void
95
- }>()
96
-
97
- const localization = computed<UI_I_Localization>(() => useLocal())
98
-
99
- const switchMainNavigation = computed<UI_I_NavigationItem[]>(() =>
100
- switchMainNavigationFunc(localization.value, props.testId)
101
- )
102
-
103
- const onShowModal = (modalName: string, diagramName?: string) => {
104
- diagramName
105
- ? emits('show-modal', modalName, { switch_name: diagramName })
106
- : emits('show-modal', modalName)
107
- }
108
- </script>
109
-
110
- <style scoped lang="scss">
111
- :root.dark-theme {
112
- .diagram-header {
113
- &-left {
114
- a {
115
- span {
116
- color: #79c6e6;
117
-
118
- &:hover {
119
- color: #49afd9;
120
- }
121
- }
122
- }
123
- }
124
-
125
- &__btn-container {
126
- button {
127
- color: #89cbdf;
128
-
129
- &:hover {
130
- color: #57c8ea;
131
- }
132
- }
133
- }
134
- }
135
- }
136
-
137
- .diagram-header {
138
- display: flex;
139
- justify-self: flex-start;
140
- width: 100%;
141
- padding: 24px 16px 0;
142
-
143
- a {
144
- color: #0072a3;
145
- cursor: pointer;
146
- font-weight: 700;
147
- user-select: none;
148
- line-height: 20px;
149
- span {
150
- font-weight: 700;
151
- }
152
- }
153
-
154
- &-left {
155
- display: flex;
156
- flex-wrap: nowrap;
157
- color: #49afd9;
158
- }
159
-
160
- &__arrow-icon {
161
- width: 16px;
162
- height: 16px;
163
- margin-right: 4px;
164
- transform: rotate(90deg);
165
- align-self: center;
166
- fill: var(--triger-icon-color);
167
- cursor: pointer;
168
- &.open {
169
- transform: rotate(180deg);
170
- }
171
- }
172
-
173
- &__btn-container {
174
- display: flex;
175
-
176
- button {
177
- font-size: 11px;
178
- height: 24px;
179
- border: none;
180
- background: none;
181
- margin-right: 0;
182
- cursor: pointer;
183
- display: inline-block;
184
- white-space: nowrap;
185
- text-align: center;
186
- text-transform: uppercase;
187
- color: #49afd9;
188
- line-height: 20px;
189
- max-height: 16.8px;
190
- padding: 0 14px;
191
- font-weight: 500;
192
- letter-spacing: 1px;
193
-
194
- &:hover {
195
- color: #004d8a;
196
- }
197
- }
198
- }
199
- }
200
-
201
- .diagram-main-actions-dots {
202
- position: relative;
203
- transform: translate(62px, -11px);
204
- }
205
-
206
- .horizontal-separator {
207
- margin: 5px 10px 10px;
208
- border-left: 0;
209
- border-right: 0;
210
- border-color: #ddd;
211
- box-sizing: content-box;
212
- height: 0;
213
- overflow: visible;
214
- border-top: 0px solid #eee;
215
- width: 100%;
216
- }
217
-
218
- .vertical-separator {
219
- border: 1px solid #ddd;
220
- border-left: none;
221
- margin: 0 3px 0 14px;
222
- }
223
- </style>
1
+ <template>
2
+ <div class="diagram-header">
3
+ <div class="diagram-header-left">
4
+ <atoms-the-icon
5
+ :class="[
6
+ 'diagram-header__arrow-icon',
7
+ {
8
+ open: props.isShowDiagram,
9
+ },
10
+ ]"
11
+ :data-id="`${props.testId}-toggle-icon`"
12
+ name="angle"
13
+ @click="emits('toggle-diagram')"
14
+ />
15
+ <a>
16
+ <span>
17
+ {{ localization.common.standardSwitch }}:
18
+ {{ props.diagramName }}
19
+ </span>
20
+ </a>
21
+ </div>
22
+ <div v-if="props.isShowDiagram" class="diagram-header__btn-container">
23
+ <span class="vertical-separator"></span>
24
+ <button
25
+ id="add-networking-button"
26
+ v-permission="
27
+ 'Networks.CreateSysx Networks.CreatePortGroup Networks.UpdateSwitch Networks.CreateSwitch'
28
+ "
29
+ :data-id="`${props.testId}-add-networking-button`"
30
+ type="button"
31
+ @click="onShowModal('add-networking', props.diagramName)"
32
+ >
33
+ {{ localization.common.addNetworking }}
34
+ </button>
35
+ <button
36
+ id="switch-edit-button"
37
+ v-permission="'Networks.UpdateSwitch'"
38
+ :data-id="`${props.testId}-edit-button`"
39
+ type="button"
40
+ @click="onShowModal('switch-edit')"
41
+ >
42
+ {{ localization.common.edit }}
43
+ </button>
44
+ <button
45
+ id="switch-manage-physical-adapters-button"
46
+ v-permission="'Networks.UpdateSwitch'"
47
+ :data-id="`${props.testId}-manage-physical-adapters-button`"
48
+ type="button"
49
+ @click="onShowModal('switch-manage-physical-adapters')"
50
+ >
51
+ {{ localization.common.managePhysicalAdapters }}
52
+ </button>
53
+ <div class="diagram-main-actions-dots">
54
+ <atoms-collapse-nav
55
+ :close-after-click="true"
56
+ :items="switchMainNavigation"
57
+ :test-id="`${props.testId}-actions`"
58
+ popup-class="diagram-main-actions__popup"
59
+ @change="onShowModal"
60
+ />
61
+ </div>
62
+ </div>
63
+ </div>
64
+ <hr class="horizontal-separator" />
65
+ </template>
66
+
67
+ <script setup lang="ts">
68
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
69
+ import type {
70
+ UI_I_NavigationItem,
71
+ UI_I_ModalsInitialData,
72
+ } from '~/components/common/diagramMain/lib/models/interfaces'
73
+ import type { UI_T_Project } from '~/lib/models/types'
74
+ import { switchMainNavigationFunc } from '~/components/common/diagramMain/modals/lib/config'
75
+
76
+ const props = withDefaults(
77
+ defineProps<{
78
+ isShowDiagram: boolean
79
+ diagramName: string
80
+ testId: string
81
+ project?: UI_T_Project
82
+ }>(),
83
+ {
84
+ project: undefined,
85
+ }
86
+ )
87
+
88
+ const emits = defineEmits<{
89
+ (event: 'toggle-diagram'): void
90
+ (
91
+ event: 'show-modal',
92
+ modalName: string,
93
+ properties?: UI_I_ModalsInitialData
94
+ ): void
95
+ }>()
96
+
97
+ const localization = computed<UI_I_Localization>(() => useLocal())
98
+
99
+ const switchMainNavigation = computed<UI_I_NavigationItem[]>(() =>
100
+ switchMainNavigationFunc(localization.value, props.testId)
101
+ )
102
+
103
+ const onShowModal = (modalName: string, diagramName?: string) => {
104
+ diagramName
105
+ ? emits('show-modal', modalName, { switch_name: diagramName })
106
+ : emits('show-modal', modalName)
107
+ }
108
+ </script>
109
+
110
+ <style scoped lang="scss">
111
+ :root.dark-theme {
112
+ .diagram-header {
113
+ &-left {
114
+ a {
115
+ span {
116
+ color: #79c6e6;
117
+
118
+ &:hover {
119
+ color: #49afd9;
120
+ }
121
+ }
122
+ }
123
+ }
124
+
125
+ &__btn-container {
126
+ button {
127
+ color: #89cbdf;
128
+
129
+ &:hover {
130
+ color: #57c8ea;
131
+ }
132
+ }
133
+ }
134
+ }
135
+ }
136
+
137
+ .diagram-header {
138
+ display: flex;
139
+ justify-self: flex-start;
140
+ width: 100%;
141
+ padding: 24px 16px 0;
142
+ overflow-x: auto;
143
+ overflow-y: hidden;
144
+ scrollbar-width: none;
145
+ -ms-overflow-style: none;
146
+
147
+ &::-webkit-scrollbar {
148
+ display: none;
149
+ }
150
+
151
+ a {
152
+ color: #0072a3;
153
+ cursor: pointer;
154
+ font-weight: 700;
155
+ user-select: none;
156
+ line-height: 20px;
157
+ span {
158
+ font-weight: 700;
159
+ white-space: nowrap;
160
+ }
161
+ }
162
+
163
+ &-left {
164
+ display: flex;
165
+ flex-wrap: nowrap;
166
+ color: #49afd9;
167
+ }
168
+
169
+ &__arrow-icon {
170
+ width: 16px;
171
+ min-width: 16px;
172
+ height: 16px;
173
+ min-height: 16px;
174
+ margin-right: 4px;
175
+ transform: rotate(90deg);
176
+ align-self: center;
177
+ fill: var(--triger-icon-color);
178
+ cursor: pointer;
179
+ &.open {
180
+ transform: rotate(180deg);
181
+ }
182
+ }
183
+
184
+ &__btn-container {
185
+ display: flex;
186
+
187
+ button {
188
+ font-size: 11px;
189
+ height: 24px;
190
+ border: none;
191
+ background: none;
192
+ margin-right: 0;
193
+ cursor: pointer;
194
+ display: inline-block;
195
+ white-space: nowrap;
196
+ text-align: center;
197
+ text-transform: uppercase;
198
+ color: #49afd9;
199
+ line-height: 20px;
200
+ max-height: 16.8px;
201
+ padding: 0 14px;
202
+ font-weight: 500;
203
+ letter-spacing: 1px;
204
+
205
+ &:hover {
206
+ color: #004d8a;
207
+ }
208
+ }
209
+ }
210
+ }
211
+
212
+ .diagram-main-actions-dots {
213
+ position: relative;
214
+ transform: translate(62px, -11px);
215
+ }
216
+
217
+ .horizontal-separator {
218
+ margin: 5px 10px 10px;
219
+ border-left: 0;
220
+ border-right: 0;
221
+ border-color: #ddd;
222
+ box-sizing: content-box;
223
+ height: 0;
224
+ overflow: visible;
225
+ border-top: 0px solid #eee;
226
+ width: 100%;
227
+ }
228
+
229
+ .vertical-separator {
230
+ border: 1px solid #ddd;
231
+ border-left: none;
232
+ margin: 0 3px 0 14px;
233
+ }
234
+ </style>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.6.40",
4
+ "version": "1.6.41",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -18,7 +18,7 @@
18
18
  "@vueuse/core": "10.1.2",
19
19
  "@vueuse/nuxt": "10.1.2",
20
20
  "bfg-nuxt-3-graph": "1.0.27",
21
- "bfg-uikit": "1.1.28",
21
+ "bfg-uikit": "1.1.29",
22
22
  "eslint-config-prettier": "^8.5.0",
23
23
  "eslint-plugin-myrules": "file:./eslint",
24
24
  "nuxt": "3.11.2",