bfg-common 1.3.437 → 1.3.438

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,373 +1,316 @@
1
- <template>
2
- <div
3
- :class="['main-navigation-panel', { pinned: menuPined }]"
4
- @mouseenter="mainMenuHovered = true"
5
- @mouseleave="mainMenuHovered = false"
6
- >
7
- <div
8
- v-show="showMenu"
9
- :class="['nav-context', { collapsed: menuCollapsed }]"
10
- >
11
- <div class="category-wrap">
12
- <div class="clr-vertical-nav">
13
- <button
14
- v-if="menuPined"
15
- id="nav-trigger"
16
- data-id="navigation-panel-trigger"
17
- class="nav-trigger"
18
- @click="collapseMenu"
19
- >
20
- <span class="nav-trigger-icon">
21
- <atoms-the-icon name="doubleArrows" />
22
- </span>
23
- </button>
24
- <div class="nav-content">
25
- <template v-for="(item, key) in navigationItems" :key="key">
26
- <nuxt-link
27
- v-for="(item2, key2) in item"
28
- :id="`nav-item-${key}-${key2}`"
29
- :key="item2.id"
30
- :data-id="item2.testId"
31
- class="nav-link"
32
- active-class="active"
33
- :to="item2.to"
34
- :title="item2.title"
35
- @click="hideMainMenu"
36
- >
37
- <span class="nav-text">
38
- <span
39
- :class="['clr-flex-shrink-0 category-icon', item2.iconName]"
40
- />
41
- <span class="category-text" :title="item2.title">{{
42
- item2.title
43
- }}</span>
44
- </span>
45
- </nuxt-link>
46
- <div
47
- v-show="key !== navigationItems.length - 1"
48
- class="nav-divider"
49
- />
50
- </template>
51
- </div>
52
- </div>
53
- </div>
54
-
55
- <div v-show="!menuCollapsed" class="pin-wrap">
56
- <div class="clr-checkbox-wrapper">
57
- <input
58
- id="pin-menu-control"
59
- v-model="menuPined"
60
- data-id="navigation-panel-pin-menu-control"
61
- type="checkbox"
62
- :disabled="props.disabledPin"
63
- @change="changeMenuPin"
64
- />
65
- <label for="pin-menu-control">{{ localization.pinMenu }}</label>
66
- </div>
67
- </div>
68
- </div>
69
- </div>
70
- </template>
71
-
72
- <script setup lang="ts">
73
- import { UI_I_Localization } from '~/lib/models/interfaces'
74
- import { UI_I_NavigationItem } from '~/components/common/mainNavigationPanel/lib/models/interfaces'
75
- import { UI_T_ParentStatus } from '~/components/common/mainNavigationPanel/lib/models/types'
76
-
77
- const props = defineProps<{
78
- mainMenuStatus: boolean
79
- navigationItems: UI_I_NavigationItem[][]
80
- parentStatus: UI_T_ParentStatus
81
- disabledPin: boolean
82
- }>()
83
- const emits = defineEmits<{
84
- (event: 'toggle', value: boolean): void
85
- }>()
86
-
87
- // const { $store } = useNuxtApp()
88
-
89
- const localization = computed<UI_I_Localization>(() => useLocal())
90
- const route = useRoute()
91
-
92
- const showMenu = computed<boolean>(
93
- () => props.mainMenuStatus || menuPined.value
94
- )
95
-
96
- const menuPined = ref<boolean>(false)
97
- const changeMenuPin = (): void => {
98
- useLocalStorage('menuPined', menuPined.value)
99
- }
100
- const setMenuPined = (): void => {
101
- menuPined.value = props.disabledPin ? false : useLocalStorage('menuPined')
102
- }
103
- watch(
104
- () => props.disabledPin,
105
- () => {
106
- setMenuPined()
107
- },
108
- { immediate: true }
109
- )
110
-
111
- const menuCollapsed = ref<boolean>(false)
112
- const collapseMenu = (): void => {
113
- menuCollapsed.value = !menuCollapsed.value
114
- useLocalStorage('menuCollapsed', menuCollapsed.value)
115
- }
116
-
117
- const mainMenuHovered = ref<boolean>(false)
118
-
119
- const clickWindow = (event: Event): void => {
120
- const target = event.target as any
121
- if (
122
- menuPined.value ||
123
- mainMenuHovered.value ||
124
- target.className.baseVal?.includes('menu-icon') ||
125
- target.className.baseVal?.includes('clr-i-outline')
126
- ) {
127
- return
128
- }
129
-
130
- emits('toggle', false)
131
- }
132
-
133
- const mountedReady = ref<boolean>(false)
134
- onMounted(() => {
135
- mountedReady.value = true
136
- window.addEventListener('click', clickWindow)
137
- })
138
-
139
- onUnmounted(() => {
140
- window.removeEventListener('click', clickWindow)
141
- })
142
-
143
- watch(
144
- [mountedReady, () => route.fullPath, () => props.parentStatus],
145
- ([mountedReadyNewValue, routeNewValue, parentStatusNewValue]: [
146
- boolean,
147
- any,
148
- UI_T_ParentStatus
149
- ]): void => {
150
- if (parentStatusNewValue === 1) return
151
-
152
- const name = location.pathname.split('/')[1]
153
-
154
- if (!mountedReadyNewValue || name === 'auth') return
155
-
156
- setSidebarOptions()
157
- useLocalStorage('navigationHistoryRoute', routeNewValue)
158
- },
159
- { immediate: true, deep: true }
160
- )
161
-
162
- const setSidebarOptions = (): void => {
163
- setMenuPined()
164
- menuCollapsed.value = useLocalStorage('menuCollapsed')
165
-
166
- if (menuPined.value) {
167
- emits('toggle', true)
168
- }
169
- }
170
-
171
- const hideMainMenu = (): void => {
172
- if (menuPined.value) return
173
- emits('toggle', false)
174
- }
175
- </script>
176
-
177
- <style scoped lang="scss">
178
- .main-navigation-panel {
179
- display: flex;
180
- flex: 1 1 auto;
181
- &.pinned {
182
- .nav-context {
183
- position: relative;
184
- }
185
- }
186
- .nav-context {
187
- position: absolute;
188
- z-index: 1001;
189
- height: 100%;
190
- display: flex;
191
- flex-direction: column;
192
- background-color: var(--vertical-nav-bg-color);
193
- border-right: 0.05rem solid var(--vertical-border-color);
194
- &.collapsed {
195
- .category-wrap .clr-vertical-nav {
196
- width: 48px;
197
- .nav-trigger {
198
- svg {
199
- transform: rotate(90deg);
200
- }
201
- }
202
- .nav-content {
203
- overflow-y: hidden;
204
-
205
- &:hover {
206
- overflow-y: auto;
207
- }
208
- .nav-link {
209
- display: flex;
210
- padding: 2px 0.6rem 2px 0.7rem;
211
- width: fit-content;
212
- .category-text {
213
- opacity: 0;
214
- }
215
- }
216
- }
217
- }
218
- }
219
- .nav-trigger {
220
- margin-top: 0;
221
- outline: none;
222
- .nav-trigger-icon {
223
- height: 16px;
224
- svg {
225
- fill: var(--arrows-icon);
226
- width: 16px;
227
- height: 16px;
228
- transform: rotate(-90deg);
229
- }
230
- }
231
- }
232
- .category-wrap {
233
- overflow: hidden;
234
- flex: 1 1 auto;
235
- .clr-vertical-nav {
236
- padding-top: 0;
237
- background: none;
238
- width: 100%;
239
- height: 100%;
240
- overflow-y: auto;
241
- }
242
- .nav-content {
243
- padding: 0 12px 12px;
244
- height: 100%;
245
-
246
- .nav-link {
247
- padding: 8px 12px;
248
- font-weight: 400;
249
- height: auto;
250
- line-height: 21px;
251
- flex-basis: auto;
252
- border-radius: 8px;
253
-
254
- &.active {
255
- //background-color: var(--row-selected-bg-color);
256
- background-color: #213444;
257
- border-bottom: 1px solid transparent;
258
- .nav-text {
259
- .category-icon {
260
- &.icon-lifecycle-manager {
261
- background-image: url('assets/img/icons/icon-life-m-light.svg');
262
-
263
- html.dark-theme & {
264
- background-image: url('assets/img/icons/icon-life-m-dark.svg');
265
- }
266
- }
267
- &.icon-realize-operations {
268
- background-image: url('assets/img/icons/icon-ro-light.svg');
269
- html.dark-theme & {
270
- background-image: url('assets/img/icons/icon-ro-dark.svg');
271
- }
272
- }
273
- }
274
- .category-text {
275
- color: var(--vertical-nav-active-item-color);
276
- }
277
- }
278
- }
279
-
280
- &:hover:not(.active) {
281
- background-color: #D3D6DA;
282
- //background-color: var(--row-hover-bg-color);
283
- }
284
- .nav-text {
285
- display: flex;
286
- align-items: center;
287
-
288
- .category-icon {
289
- margin-right: 12px;
290
- min-width: 16px;
291
- display: inline-block;
292
-
293
- &.icon-hybrid-cloud-services {
294
- background: url('assets/img/icons/icon-hcs.svg');
295
- width: 16px;
296
- height: 16px;
297
- min-height: 16px;
298
- }
299
- &.icon-realize-operations,
300
- &.icon-cloud-provider-services,
301
- &.icon-lifecycle-manager {
302
- background-size: contain;
303
- background-repeat: no-repeat;
304
- width: 18px;
305
- height: 18px;
306
- display: inline-block;
307
- vertical-align: text-bottom;
308
- }
309
- &.icon-lifecycle-manager {
310
- background-image: url('assets/img/icons/icon-life-m-light.svg');
311
- html.dark-theme & {
312
- background-image: url('assets/img/icons/icon-life-m-dark.svg');
313
- }
314
- }
315
- &.icon-cloud-provider-services {
316
- background-image: url('assets/img/icons/icon-cps.png');
317
- html.dark-theme & {
318
- background-image: url('assets/img/icons/icon-cps-dark-mode.png');
319
- }
320
- }
321
- &.icon-realize-operations {
322
- background-image: url('assets/img/icons/icon-ro-light.svg');
323
- html.dark-theme & {
324
- background-image: url('assets/img/icons/icon-ro-dark.svg');
325
- }
326
- }
327
- }
328
- .category-text {
329
- white-space: nowrap;
330
- overflow: hidden;
331
- text-overflow: ellipsis;
332
- font-size: 13px;
333
- }
334
- }
335
- }
336
-
337
- .nav-divider {
338
- border: 1px solid #D3D6DA;
339
- margin: 12px 0;
340
- }
341
- }
342
- }
343
- .pin-wrap {
344
- padding: 6px 4px 5px 12px;
345
- border-top: 0.05rem solid var(--vertical-nav-divider-border-color);
346
- label {
347
- font-size: 13px;
348
- }
349
- input[disabled] + label {
350
- cursor: not-allowed;
351
- opacity: 0.5;
352
- }
353
- }
354
- }
355
- }
356
- </style>
357
-
358
- <style>
359
- :root {
360
- --vertical-nav-bg-color: rgba(232, 232, 232, 0.85);
361
- --vertical-nav-item-color: #565656;
362
- --vertical-nav-active-item-color: #fff;
363
- --vertical-nav-divider-border-color: #ccc;
364
- --vertical-border-color: tranparent;
365
- }
366
- :root.dark-theme {
367
- --vertical-nav-bg-color: #17242b;
368
- --vertical-nav-item-color: #e9ecef;
369
- --vertical-nav-active-item-color: #000;
370
- --vertical-nav-divider-border-color: #495865;
371
- --vertical-border-color: #495865;
372
- }
373
- </style>
1
+ <template>
2
+ <div
3
+ :class="['main-navigation-panel', { pinned: menuPined }]"
4
+ @mouseenter="mainMenuHovered = true"
5
+ @mouseleave="mainMenuHovered = false"
6
+ >
7
+ <div
8
+ v-show="showMenu"
9
+ :class="['nav-context', { collapsed: menuCollapsed }]"
10
+ >
11
+ <div class="tools">
12
+ <div v-show="!menuCollapsed" class="pin-wrap">
13
+ <input
14
+ id="pin-menu-control"
15
+ v-model="menuPined"
16
+ data-id="navigation-panel-pin-menu-control"
17
+ type="checkbox"
18
+ :disabled="props.disabledPin"
19
+ @change="changeMenuPin"
20
+ />
21
+ <label for="pin-menu-control" class="pointer flex-align-center">
22
+ <ui-icon-icon3
23
+ :name="menuPined ? 'unpin' : 'pin'"
24
+ width="12px"
25
+ height="12px"
26
+ />
27
+ <span v-if="!menuPined">{{ localization.pinMenu }}</span>
28
+ <span v-else>{{ localization.unpinMenu }}</span>
29
+ </label>
30
+ </div>
31
+
32
+ <button
33
+ v-if="menuPined"
34
+ id="nav-trigger"
35
+ data-id="navigation-panel-trigger"
36
+ class="nav-trigger"
37
+ @click="collapseMenu"
38
+ >
39
+ <span class="nav-trigger-icon flex">
40
+ <ui-icon-icon3 name="doubleArrow" width="16px" height="16px" />
41
+ </span>
42
+ </button>
43
+ </div>
44
+
45
+ <div class="nav-content">
46
+ <template v-for="(item, key) in props.navigationItems" :key="key">
47
+ <nuxt-link
48
+ v-for="(item2, key2) in item"
49
+ :id="`nav-item-${key}-${key2}`"
50
+ :key="item2.id"
51
+ :data-id="item2.testId"
52
+ class="nav-link"
53
+ active-class="active"
54
+ :to="item2.to"
55
+ :title="item2.title"
56
+ @click="hideMainMenu"
57
+ >
58
+ <ui-icon-icon3 :name="item2.iconName" width="20px" height="20px" />
59
+ <span class="nav-text">{{ item2.title }}</span>
60
+ </nuxt-link>
61
+ <div
62
+ v-show="key !== props.navigationItems.length - 1"
63
+ class="nav-divider"
64
+ />
65
+ </template>
66
+ </div>
67
+ </div>
68
+ </div>
69
+ </template>
70
+
71
+ <script setup lang="ts">
72
+ import { UI_I_Localization } from '~/lib/models/interfaces'
73
+ import { UI_I_NavigationItem } from '~/components/common/mainNavigationPanel/lib/models/interfaces'
74
+ import { UI_T_ParentStatus } from '~/components/common/mainNavigationPanel/lib/models/types'
75
+
76
+ const props = defineProps<{
77
+ mainMenuStatus: boolean
78
+ navigationItems: UI_I_NavigationItem[][]
79
+ parentStatus: UI_T_ParentStatus
80
+ disabledPin: boolean
81
+ }>()
82
+ const emits = defineEmits<{
83
+ (event: 'toggle', value: boolean): void
84
+ }>()
85
+
86
+ // const { $store } = useNuxtApp()
87
+
88
+ const localization = computed<UI_I_Localization>(() => useLocal())
89
+ const route = useRoute()
90
+
91
+ const showMenu = computed<boolean>(
92
+ () => props.mainMenuStatus || menuPined.value
93
+ )
94
+
95
+ const menuPined = ref<boolean>(false)
96
+ const changeMenuPin = (): void => {
97
+ useLocalStorage('menuPined', menuPined.value)
98
+ }
99
+ const setMenuPined = (): void => {
100
+ menuPined.value = props.disabledPin ? false : useLocalStorage('menuPined')
101
+ }
102
+ watch(
103
+ () => props.disabledPin,
104
+ () => {
105
+ setMenuPined()
106
+ },
107
+ { immediate: true }
108
+ )
109
+
110
+ const menuCollapsed = ref<boolean>(false)
111
+ const collapseMenu = (): void => {
112
+ menuCollapsed.value = !menuCollapsed.value
113
+ useLocalStorage('menuCollapsed', menuCollapsed.value)
114
+ }
115
+
116
+ const mainMenuHovered = ref<boolean>(false)
117
+
118
+ const clickWindow = (event: Event): void => {
119
+ const target = event.target as any
120
+ if (
121
+ menuPined.value ||
122
+ mainMenuHovered.value ||
123
+ target.className.baseVal?.includes('menu-icon') ||
124
+ target.className.baseVal?.includes('clr-i-outline')
125
+ ) {
126
+ return
127
+ }
128
+
129
+ emits('toggle', false)
130
+ }
131
+
132
+ const mountedReady = ref<boolean>(false)
133
+ onMounted(() => {
134
+ mountedReady.value = true
135
+ window.addEventListener('click', clickWindow)
136
+ })
137
+
138
+ onUnmounted(() => {
139
+ window.removeEventListener('click', clickWindow)
140
+ })
141
+
142
+ watch(
143
+ [mountedReady, (): any => route.fullPath, (): any => props.parentStatus],
144
+ ([newValue1, newValue2, newValue3]: [
145
+ boolean,
146
+ any,
147
+ UI_T_ParentStatus
148
+ ]): void => {
149
+ if (newValue3 === 1) return
150
+
151
+ const name = location.pathname.split('/')[1]
152
+
153
+ if (!newValue1 || name === 'auth') return
154
+
155
+ setSidebarOptions()
156
+ useLocalStorage('navigationHistoryRoute', newValue2)
157
+ },
158
+ { immediate: true, deep: true }
159
+ )
160
+
161
+ const setSidebarOptions = (): void => {
162
+ setMenuPined()
163
+ menuCollapsed.value = useLocalStorage('menuCollapsed')
164
+
165
+ if (menuPined.value) {
166
+ emits('toggle', true)
167
+ }
168
+ }
169
+
170
+ const hideMainMenu = (): void => {
171
+ if (menuPined.value) return
172
+ emits('toggle', false)
173
+ }
174
+ </script>
175
+
176
+ <style scoped lang="scss">
177
+ .main-navigation-panel {
178
+ display: flex;
179
+ flex: 1 1 auto;
180
+
181
+ &.pinned {
182
+ .nav-context {
183
+ position: relative;
184
+ }
185
+ }
186
+ &:not(.pinned) {
187
+ .nav-context {
188
+ backdrop-filter: blur(12px);
189
+ box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.08);
190
+ background: #e9ebedf5;
191
+ }
192
+ }
193
+
194
+ .nav-context {
195
+ position: absolute;
196
+ z-index: 1001;
197
+ height: 100%;
198
+ display: flex;
199
+ flex-direction: column;
200
+ background-color: var(--vertical-nav-bg-color);
201
+
202
+ &.collapsed {
203
+ .tools {
204
+ justify-content: center;
205
+
206
+ button {
207
+ transform: rotate(180deg);
208
+ }
209
+ }
210
+
211
+ .nav-link {
212
+ .nav-text {
213
+ display: none;
214
+ }
215
+ }
216
+ }
217
+
218
+ .tools {
219
+ display: flex;
220
+ align-items: center;
221
+ justify-content: space-between;
222
+ padding: 12px;
223
+
224
+ .pin-wrap {
225
+ padding: 4px;
226
+ border-radius: 4px;
227
+
228
+ &:hover {
229
+ background-color: var(--vertical-nav-hover-bg-color);
230
+ }
231
+
232
+ input {
233
+ display: none;
234
+ }
235
+ label {
236
+ color: var(--vertical-nav-item-color);
237
+ font-size: 12px;
238
+ font-weight: 500;
239
+
240
+ span {
241
+ margin-left: 6px;
242
+ }
243
+ }
244
+ }
245
+
246
+ #nav-trigger {
247
+ padding: 4px;
248
+ margin: 0;
249
+ border-radius: 4px;
250
+ border: none;
251
+ background-color: transparent;
252
+ cursor: pointer;
253
+ color: var(--vertical-nav-item-color);
254
+
255
+ &:hover {
256
+ background-color: var(--vertical-nav-hover-bg-color);
257
+ }
258
+ }
259
+ }
260
+
261
+ .nav-content {
262
+ padding: 0 12px;
263
+
264
+ .nav-link {
265
+ display: flex;
266
+ align-items: center;
267
+ padding: 10px 12px;
268
+ border-radius: 8px;
269
+ color: var(--vertical-nav-item-color);
270
+ font-size: 12px;
271
+ font-weight: 500;
272
+ white-space: nowrap;
273
+ text-decoration: none;
274
+
275
+ &.active {
276
+ background-color: var(--vertical-active-nav-bg-color);
277
+ color: #ffffff;
278
+ }
279
+
280
+ &:not(.active):hover {
281
+ background-color: var(--vertical-nav-hover-bg-color);
282
+ }
283
+
284
+ .nav-text {
285
+ margin-left: 12px;
286
+ }
287
+ }
288
+ .nav-link + .nav-link {
289
+ margin-top: 4px;
290
+ }
291
+
292
+ .nav-divider {
293
+ width: 100%;
294
+ height: 1px;
295
+ background-color: #d3d6da;
296
+ margin: 12px 0;
297
+ }
298
+ }
299
+ }
300
+ }
301
+ </style>
302
+
303
+ <style>
304
+ :root {
305
+ --vertical-nav-bg-color: rgba(233, 235, 237, 0.96);
306
+ --vertical-nav-item-color: #4d5d69;
307
+ --vertical-nav-hover-bg-color: #d3d6da;
308
+ --vertical-active-nav-bg-color: #213444;
309
+ }
310
+ :root.dark-theme {
311
+ --vertical-nav-bg-color: rgba(33, 52, 68, 0.96);
312
+ --vertical-nav-item-color: #ffffff;
313
+ --vertical-nav-hover-bg-color: #485865;
314
+ --vertical-active-nav-bg-color: #213444;
315
+ }
316
+ </style>