bfg-common 1.3.467 → 1.3.468

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.
Files changed (109) hide show
  1. package/assets/scss/common/normalize.scss +340 -340
  2. package/components/atoms/TheIcon2.vue +1353 -1353
  3. package/components/atoms/loader/Loader.vue +30 -30
  4. package/components/atoms/loader/PreLoader.vue +38 -38
  5. package/components/atoms/switch/Switch.vue +111 -111
  6. package/components/atoms/table/compact/Compact.vue +526 -526
  7. package/components/common/adapterManager/ui/table/Header.vue +93 -93
  8. package/components/common/adapterManager/ui/table/Table.vue +162 -162
  9. package/components/common/context/Context.vue +99 -99
  10. package/components/common/layout/theHeader/LanguageSwitch.vue +102 -0
  11. package/components/common/layout/theHeader/TheHeader.vue +91 -0
  12. package/components/common/layout/theHeader/TheHeaderNew.vue +229 -0
  13. package/components/common/layout/theHeader/TheHeaderOld.vue +241 -0
  14. package/components/common/layout/theHeader/feedback/Feedback.vue +104 -0
  15. package/components/common/layout/theHeader/feedback/FeedbackNew.vue +63 -0
  16. package/components/common/layout/theHeader/feedback/FeedbackOld.vue +73 -0
  17. package/components/common/layout/theHeader/helpMenu/About.vue +110 -0
  18. package/components/common/layout/theHeader/helpMenu/HelpMenu.vue +45 -0
  19. package/components/common/layout/theHeader/helpMenu/helpMenuNew/HelpMenuNew.vue +112 -0
  20. package/components/common/layout/theHeader/helpMenu/helpMenuNew/lib/config/dropMenu.ts +25 -0
  21. package/components/common/layout/theHeader/helpMenu/helpMenuOld/HelpMenuOld.vue +69 -0
  22. package/components/common/layout/theHeader/helpMenu/helpMenuOld/lib/config/dropMenu.ts +22 -0
  23. package/components/common/layout/theHeader/helpMenu/helpMenuOld/lib/models/types.ts +1 -0
  24. package/components/common/layout/theHeader/lib/models/types.ts +5 -0
  25. package/components/common/layout/theHeader/modals/Reconnect.vue +98 -0
  26. package/components/common/layout/theHeader/modals/RedirectLogin.vue +60 -0
  27. package/components/common/layout/theHeader/userMenu/UserMenu.vue +95 -0
  28. package/components/common/layout/theHeader/userMenu/lib/models/interfaces.ts +32 -0
  29. package/components/common/layout/theHeader/userMenu/modals/changePassword/ChangePassword.vue +210 -0
  30. package/components/common/layout/theHeader/userMenu/modals/changePassword/lib/config/form.ts +31 -0
  31. package/components/common/layout/theHeader/userMenu/modals/changePassword/lib/models/interfaces.ts +12 -0
  32. package/components/common/layout/theHeader/userMenu/modals/preferences/Inventory.vue +43 -0
  33. package/components/common/layout/theHeader/userMenu/modals/preferences/Preferences.vue +119 -0
  34. package/components/common/layout/theHeader/userMenu/modals/preferences/View.vue +113 -0
  35. package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/ChangeLanguage.vue +148 -0
  36. package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/config/lang.ts +10 -0
  37. package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/config/radioOptions.ts +22 -0
  38. package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/models/enums.ts +9 -0
  39. package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/models/interfaces.ts +11 -0
  40. package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/models/types.ts +1 -0
  41. package/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/DefaultConsole.vue +66 -0
  42. package/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/lib/config/consoleOptions.ts +30 -0
  43. package/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/lib/models/interfaces.ts +5 -0
  44. package/components/common/layout/theHeader/userMenu/modals/preferences/lib/config/preferencesTabs.ts +68 -0
  45. package/components/common/layout/theHeader/userMenu/modals/preferences/lib/models/types.ts +1 -0
  46. package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/TimeFormat.vue +67 -0
  47. package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/config/formatOptions.ts +27 -0
  48. package/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/models/types.ts +1 -0
  49. package/components/common/layout/theHeader/userMenu/userMenuNew/UserMenuNew.vue +114 -0
  50. package/components/common/layout/theHeader/userMenu/userMenuNew/lib/config/dropMenu.ts +28 -0
  51. package/components/common/layout/theHeader/userMenu/userMenuOld/UserMenuOld.vue +36 -0
  52. package/components/common/layout/theHeader/userMenu/userMenuOld/lib/config/dropMenu.ts +36 -0
  53. package/components/common/layout/theHeader/userMenu/userMenuOld/lib/models/types.ts +5 -0
  54. package/components/common/lib/config/states.ts +160 -160
  55. package/components/common/mainNavigationPanel/MainNavigationPanel.vue +142 -142
  56. package/components/common/mainNavigationPanel/MainNavigationPanelNew.vue +248 -248
  57. package/components/common/mainNavigationPanel/MainNavigationPanelOld.vue +288 -288
  58. package/components/common/readyToComplete/ReadyToComplete.vue +15 -15
  59. package/components/common/resource/progressBlock/ProgressBlock.vue +142 -142
  60. package/components/common/split/horizontal/Horizontal.vue +70 -70
  61. package/components/common/vm/actions/clone/Clone.vue +511 -511
  62. package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +273 -273
  63. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +697 -697
  64. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +400 -400
  65. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +329 -329
  66. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +305 -305
  67. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +168 -168
  68. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +82 -82
  69. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +32 -32
  70. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCard.vue +182 -182
  71. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptions.vue +114 -114
  72. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +192 -192
  73. package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/Tools.vue +72 -72
  74. package/components/common/vm/actions/common/select/computeResource/ComputeResource.vue +164 -164
  75. package/components/common/vm/actions/common/select/name/Name.vue +235 -235
  76. package/components/common/vm/actions/common/select/storage/Storage.vue +198 -198
  77. package/components/common/vm/actions/editSettings/EditSettings.vue +316 -316
  78. package/components/common/weekSelect/lib/config/options.ts +10 -10
  79. package/components/common/wizards/datastore/add/Add.vue +436 -436
  80. package/components/common/wizards/datastore/add/lib/config/stepItems.ts +191 -191
  81. package/components/common/wizards/datastore/add/lib/models/interfaces.ts +38 -38
  82. package/components/common/wizards/datastore/add/lib/utils.ts +70 -70
  83. package/components/common/wizards/datastore/add/local/createName/CreateName.vue +160 -160
  84. package/components/common/wizards/datastore/add/nfs/Nfs.vue +112 -112
  85. package/components/common/wizards/datastore/add/nfs/accessibility/Accessibility.vue +104 -104
  86. package/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/compatibleTable.ts +62 -62
  87. package/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/hostsTableItems.ts +53 -53
  88. package/components/common/wizards/datastore/add/readyComplete/ReadyComplete.vue +86 -86
  89. package/components/common/wizards/datastore/add/readyComplete/lib/config/propertiesDetails.ts +184 -184
  90. package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/DeviceSelection.vue +459 -459
  91. package/components/common/wizards/datastore/add/types/Types.vue +80 -80
  92. package/components/common/wizards/datastore/add/types/lib/config/typeOptions.ts +49 -49
  93. package/composables/useAppVersion.ts +22 -22
  94. package/composables/useEnvLanguage.ts +20 -20
  95. package/lib/utils/sendTask.ts +73 -73
  96. package/minify.js +146 -146
  97. package/package.json +2 -1
  98. package/plugins/spice-console/spice.console.ts +147 -147
  99. package/public/spice-console/application/codec.js +263 -263
  100. package/public/spice-console/lib/rasterEngine.js +907 -907
  101. package/public/spice-console/network/spicechannel.js +375 -375
  102. package/store/main/lib/interfaces.ts +9 -9
  103. package/store/tasks/actions.ts +133 -133
  104. package/store/tasks/getters.ts +25 -25
  105. package/store/tasks/lib/models/interfaces.ts +18 -18
  106. package/store/tasks/mutations.ts +58 -58
  107. package/store/tasks/state.ts +16 -16
  108. /package/components/{layout → common/layout}/theHeader/lib/models/enums.ts +0 -0
  109. /package/components/{layout → common/layout}/theHeader/lib/utils/localization.ts +0 -0
@@ -0,0 +1,22 @@
1
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import type { UI_I_RadioItemLang } from '~/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/lib/models/interfaces'
3
+
4
+ export const radioOptionsFunc = (
5
+ localization: UI_I_Localization
6
+ ): UI_I_RadioItemLang[] => {
7
+ return [
8
+ {
9
+ id: 1,
10
+ label: localization.browserDefault,
11
+ value: 'BROWSER',
12
+ testId: 'browser-type',
13
+ },
14
+ {
15
+ id: 2,
16
+ label: localization.specifyLanguage,
17
+ value: 'LANG',
18
+ selectLang: true,
19
+ testId: 'specify-language-type',
20
+ },
21
+ ]
22
+ }
@@ -0,0 +1,9 @@
1
+ export enum UI_E_DetectSelectedRadio {
2
+ 'BROWSER' = 'BROWSER',
3
+ 'en_US' = 'LANG',
4
+ 'ru_RU' = 'LANG',
5
+ 'hy_AM' = 'LANG',
6
+ 'zh_CHS' = 'LANG',
7
+ 'kk_KZ' = 'LANG',
8
+ 'be_BY' = 'LANG',
9
+ }
@@ -0,0 +1,11 @@
1
+ import type { UI_I_RadioItem } from '~/components/common/layout/theHeader/userMenu/lib/models/interfaces'
2
+
3
+ export interface UI_I_RadioItemLang extends UI_I_RadioItem {
4
+ selectLang?: boolean
5
+ }
6
+
7
+ export interface UI_I_LanguageItem {
8
+ text: string
9
+ value: string
10
+ lang: string
11
+ }
@@ -0,0 +1 @@
1
+ export type UI_T_SelectedRadio = 'BROWSER' | 'LANG'
@@ -0,0 +1,66 @@
1
+ <template>
2
+ <form class="compact change-default-console ng-valid ng-dirty ng-touched">
3
+ <div class="description">
4
+ {{ localization.defaultConsoleDesc }}
5
+ </div>
6
+
7
+ <div
8
+ v-for="(item, key) in consoleOptions"
9
+ :key="key"
10
+ :class="['radio', item.disabled && 'disabled']"
11
+ >
12
+ <input
13
+ :id="item.label"
14
+ v-model="consoleValue"
15
+ :data-id="item.testId"
16
+ type="radio"
17
+ :value="item.value"
18
+ :disabled="item.disabled"
19
+ @change="onChange"
20
+ />
21
+ <label :for="item.label">
22
+ {{ item.label }}
23
+ </label>
24
+ </div>
25
+ </form>
26
+ </template>
27
+
28
+ <script setup lang="ts">
29
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
30
+ import type { UI_I_RadioItemConsole } from '~/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/lib/models/interfaces'
31
+ import type { UI_T_Project } from '~/lib/models/types'
32
+ import { consoleOptionsFunc } from '~/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/lib/config/consoleOptions'
33
+
34
+ const props = defineProps<{
35
+ remoteConsole: string
36
+ project: UI_T_Project
37
+ }>()
38
+
39
+ const localization = computed<UI_I_Localization>(() => useLocal())
40
+ const { $store }: any = useNuxtApp()
41
+
42
+ const consoleValue = ref<string>(props.remoteConsole)
43
+ const consoleOptions = readonly<UI_I_RadioItemConsole[]>(
44
+ consoleOptionsFunc(localization.value)
45
+ )
46
+
47
+ const onChange = (): void => {
48
+ if (props.project === 'sphere')
49
+ $store.dispatch('profile/A_PREFERENCES_FOR_CHANGING', {
50
+ remote_console: consoleValue.value,
51
+ })
52
+ else if (props.project === 'procurator')
53
+ $store.commit('profile/M_UPDATE_USER_PREFERENCE', {
54
+ remote_console: consoleValue.value,
55
+ })
56
+ }
57
+ </script>
58
+
59
+ <style lang="scss" scoped>
60
+ .radio {
61
+ margin-bottom: 5px;
62
+ &:nth-child(2) {
63
+ margin-top: 10px;
64
+ }
65
+ }
66
+ </style>
@@ -0,0 +1,30 @@
1
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import type { UI_I_RadioItemConsole } from '~/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/lib/models/interfaces'
3
+
4
+ export const consoleOptionsFunc = (
5
+ localization: UI_I_Localization
6
+ ): UI_I_RadioItemConsole[] => {
7
+ const config = useRuntimeConfig()
8
+
9
+ const remoteConsole = localization.remoteConsoleVmrc.replaceAll(
10
+ '{trademark}',
11
+ String(config.public[`TRADEMARK_${useEnvLanguage()}`])
12
+ )
13
+
14
+ return [
15
+ {
16
+ id: 1,
17
+ label: localization.webConsole,
18
+ value: 'spice',
19
+ disabled: false,
20
+ testId: 'web-type',
21
+ },
22
+ {
23
+ id: 2,
24
+ label: remoteConsole,
25
+ value: 'VMRC',
26
+ disabled: true,
27
+ testId: 'vmrc-type',
28
+ },
29
+ ]
30
+ }
@@ -0,0 +1,5 @@
1
+ import type { UI_I_RadioItem } from '~/components/common/layout/theHeader/userMenu/lib/models/interfaces'
2
+
3
+ export interface UI_I_RadioItemConsole extends UI_I_RadioItem {
4
+ disabled: boolean
5
+ }
@@ -0,0 +1,68 @@
1
+ import type { UI_T_Project } from '~/lib/models/types'
2
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
3
+ import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
4
+
5
+ export const preferencesTabs = (
6
+ localization: UI_I_Localization,
7
+ project: UI_T_Project
8
+ ): UI_I_CollapseNavItem[] => {
9
+ let result: UI_I_CollapseNavItem[] = []
10
+
11
+ if (project === 'sphere') {
12
+ result = [
13
+ {
14
+ text: `${localization.timeFormat}`,
15
+ value: 'time-tab',
16
+ disabled: false,
17
+ testId: 'user-preferences-time-format',
18
+ },
19
+ {
20
+ text: `${localization.language}`,
21
+ value: 'language-tab',
22
+ disabled: false,
23
+ testId: 'user-preferences-language',
24
+ },
25
+ {
26
+ text: `${localization.defaultConsole}`,
27
+ value: 'console-tab',
28
+ disabled: false,
29
+ testId: 'user-preferences-default-console',
30
+ },
31
+ {
32
+ text: `${localization.inventory}`,
33
+ value: 'inventory-tab',
34
+ disabled: false,
35
+ testId: 'user-preferences-inventory',
36
+ },
37
+ {
38
+ text: `${localization.view}`,
39
+ value: 'view-tab',
40
+ disabled: false,
41
+ testId: 'user-preferences-view',
42
+ },
43
+ ]
44
+ } else if (project === 'procurator') {
45
+ result = [
46
+ {
47
+ text: `${localization.timeFormat}`,
48
+ value: 'time-tab',
49
+ disabled: false,
50
+ testId: 'time-format',
51
+ },
52
+ {
53
+ text: `${localization.language}`,
54
+ value: 'language-tab',
55
+ disabled: false,
56
+ testId: 'language',
57
+ },
58
+ {
59
+ text: `${localization.view}`,
60
+ value: 'view-tab',
61
+ disabled: false,
62
+ testId: 'view',
63
+ },
64
+ ]
65
+ }
66
+
67
+ return result
68
+ }
@@ -0,0 +1 @@
1
+ export type UI_T_UserPreferenceTab = 'time-tab' | 'language-tab' | 'console-tab' | 'inventory-tab'
@@ -0,0 +1,67 @@
1
+ <template>
2
+ <form id="time-format-form" class="compact ng-valid ng-dirty ng-touched">
3
+ <div class="description">
4
+ {{ description }}
5
+ </div>
6
+
7
+ <div v-for="(item, key) in formatOptions" :key="key" class="radio">
8
+ <input
9
+ :id="item.value"
10
+ v-model="timeItem"
11
+ :data-id="item.testId"
12
+ type="radio"
13
+ :value="item.value"
14
+ @change="onChange"
15
+ />
16
+ <label :for="item.value">
17
+ {{ item.label }}
18
+ </label>
19
+ </div>
20
+ </form>
21
+ </template>
22
+
23
+ <script setup lang="ts">
24
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
25
+ import type { UI_I_RadioItem } from '~/components/common/layout/theHeader/userMenu/lib/models/interfaces'
26
+ import type { UI_T_TimeValue } from '~/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/models/types'
27
+ import { formatOptionsFunc } from '~/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/config/formatOptions'
28
+
29
+ const props = defineProps<{
30
+ timeFormat: UI_T_TimeValue
31
+ }>()
32
+ const emits = defineEmits<{
33
+ (event: 'update', value: UI_T_TimeValue): void
34
+ }>()
35
+ const localization = computed<UI_I_Localization>(() => useLocal())
36
+
37
+ const config = useRuntimeConfig()
38
+ const description = computed<string>(() =>
39
+ localization.value.timeFormatDesc.replaceAll(
40
+ '{trademark}',
41
+ String(config.public[`TRADEMARK_${useEnvLanguage()}`])
42
+ )
43
+ )
44
+
45
+ const formatOptions = readonly<UI_I_RadioItem[]>(
46
+ formatOptionsFunc(localization.value)
47
+ )
48
+
49
+ const timeItem = ref<UI_T_TimeValue>(props.timeFormat)
50
+
51
+ const onChange = (): void => {
52
+ emits('update', timeItem.value)
53
+ }
54
+ </script>
55
+
56
+ <style lang="scss" scoped>
57
+ .radio {
58
+ margin-bottom: 5px;
59
+ &:nth-child(2) {
60
+ margin-top: 10px;
61
+ }
62
+ }
63
+ input[type='radio']:focus:checked + label::before,
64
+ input[type='radio']:focus + label::before {
65
+ box-shadow: inset 0 0 0 0.25rem #0094d2;
66
+ }
67
+ </style>
@@ -0,0 +1,27 @@
1
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import type { UI_I_RadioItem } from '~/components/common/layout/theHeader/userMenu/lib/models/interfaces'
3
+
4
+ export const formatOptionsFunc = (
5
+ localization: UI_I_Localization
6
+ ): UI_I_RadioItem[] => {
7
+ return [
8
+ {
9
+ id: 1,
10
+ label: localization.languageDefault,
11
+ value: 'DEFAULT',
12
+ testId: 'default-type',
13
+ },
14
+ {
15
+ id: 2,
16
+ label: localization.hourFormat12,
17
+ value: '12H',
18
+ testId: '12h-type',
19
+ },
20
+ {
21
+ id: 3,
22
+ label: localization.hourFormat24,
23
+ value: '24H',
24
+ testId: '24h-type',
25
+ },
26
+ ]
27
+ }
@@ -0,0 +1 @@
1
+ export type UI_T_TimeValue = '12H' | '24H' | 'DEFAULT'
@@ -0,0 +1,114 @@
1
+ <template>
2
+ <div class="user-menu-content">
3
+ <button
4
+ id="user-menu-dropdown-toggle"
5
+ data-id="user-menu-dropdown-toggle"
6
+ class="user-menu-dropdown-toggle"
7
+ @click="isShowDropdown = !isShowDropdown"
8
+ >
9
+ <span class="user-icon-container">
10
+ <ui-icon-icon3 name="user-icon" width="24" height="24" />
11
+ </span>
12
+ <span class="title">{{ props.hostname }}</span>
13
+ <span class="arrow-icon-container">
14
+ <ui-icon name="arrow2" width="16" height="8" />
15
+ </span>
16
+ </button>
17
+ </div>
18
+ <ui-dropdown
19
+ test-id="user-menu-dropdown"
20
+ :show="isShowDropdown"
21
+ :items="dropdownItems"
22
+ width="max-content"
23
+ elem-id="user-menu-dropdown-toggle"
24
+ @select="onSelectDropdown"
25
+ @hide="onHideDropdown"
26
+ >
27
+ <template #row="{ item }">
28
+ <a
29
+ :id="item.testId"
30
+ :data-id="item.testId"
31
+ :class="['w-full flex items-center dropdown-item', item.iconName]"
32
+ >
33
+ <span v-if="item.iconName === 'lock'" class="flex ui-item-text">
34
+ <ui-icon-icon3 :name="item.iconName" width="18" height="18" />
35
+ </span>
36
+ <span v-if="item.iconName === 'info'" class="flex ui-item-text">
37
+ <ui-icon :name="item.iconName" width="18" height="18" />
38
+ </span>
39
+ <span v-if="item.iconName === 'logout'" class="flex ui-item-text">
40
+ <ui-icon :name="item.iconName" width="18" height="18" />
41
+ </span>
42
+ <p class="ui-item-text truncate text-sm font-medium mt-0 mb-0 ml-2">
43
+ {{ item.text }}
44
+ </p>
45
+ </a>
46
+ </template>
47
+ </ui-dropdown>
48
+ </template>
49
+
50
+ <script setup lang="ts">
51
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
52
+ import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
53
+ import { userMenuFunc } from '~/components/common/layout/theHeader/userMenu/userMenuNew/lib/config/dropMenu'
54
+
55
+ const props = defineProps<{
56
+ hostname: string
57
+ }>()
58
+
59
+ const emits = defineEmits<{
60
+ (event: 'select-dropdown', value: string): void
61
+ }>()
62
+
63
+ const localization = computed<UI_I_Localization>(() => useLocal())
64
+
65
+ const isShowDropdown = ref<boolean>(false)
66
+
67
+ const dropdownItems = computed<UI_I_Dropdown[]>(() =>
68
+ userMenuFunc(localization.value)
69
+ )
70
+
71
+ const onHideDropdown = (): void => {
72
+ isShowDropdown.value = false
73
+ }
74
+
75
+ const onSelectDropdown = (value: string): void => {
76
+ emits('select-dropdown', value)
77
+ onHideDropdown()
78
+ }
79
+ </script>
80
+
81
+ <style lang="scss">
82
+ .user-menu-content {
83
+ .user-menu-dropdown-toggle {
84
+ border: unset;
85
+ padding: 0;
86
+ outline: unset;
87
+ background: transparent;
88
+ cursor: pointer;
89
+ display: flex;
90
+ align-items: center;
91
+ grid-gap: 10px;
92
+ color: #d3d6da;
93
+
94
+ &:hover {
95
+ color: #ffffff;
96
+ }
97
+
98
+ .arrow-icon-container {
99
+ display: flex;
100
+ transform: rotate(90deg);
101
+ }
102
+ }
103
+ }
104
+
105
+ #dropdown-user-menu-dropdown {
106
+ margin-top: 17px;
107
+
108
+ .ui-dropdown-menu-item:has(.logout) {
109
+ .ui-item-text {
110
+ color: #ea3223;
111
+ }
112
+ }
113
+ }
114
+ </style>
@@ -0,0 +1,28 @@
1
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
3
+
4
+ export const userMenuFunc = (
5
+ localization: UI_I_Localization
6
+ ): UI_I_Dropdown[] => {
7
+ return [
8
+ {
9
+ text: localization.changePassword,
10
+ value: 'changePassword',
11
+ testId: 'user-menu-change-password',
12
+ iconName: 'lock',
13
+ },
14
+ {
15
+ text: localization.preferences,
16
+ value: 'preferences',
17
+ testId: 'user-menu-preferences',
18
+ divider: true,
19
+ iconName: 'info',
20
+ },
21
+ {
22
+ text: localization.logout,
23
+ value: 'logout',
24
+ testId: 'user-menu-logout',
25
+ iconName: 'logout',
26
+ },
27
+ ]
28
+ }
@@ -0,0 +1,36 @@
1
+ <template>
2
+ <div class="tid-control-bar-user-menu user-menu">
3
+ <atoms-dropdown
4
+ test-id="user-menu-host-name-drop-down"
5
+ :title="props.hostname"
6
+ :drop-menu="accountMenu"
7
+ @select="clickMenuItem"
8
+ />
9
+ </div>
10
+ </template>
11
+
12
+ <script setup lang="ts">
13
+ import type { UI_I_DropMenu } from '~/components/atoms/dropdown/dropdown/lib/models/interfaces'
14
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
15
+ import type { T_ActionTypeUserMenu } from '~/components/common/layout/theHeader/userMenu/userMenuOld/lib/models/types'
16
+ import { accountMenuFunc } from '~/components/common/layout/theHeader/userMenu/userMenuOld/lib/config/dropMenu'
17
+
18
+ const props = defineProps<{
19
+ hostname: string
20
+ }>()
21
+
22
+ const emits = defineEmits<{
23
+ (event: 'select-dropdown', value: string): void
24
+ }>()
25
+
26
+ const localization = computed<UI_I_Localization>(() => useLocal())
27
+ const accountMenu = computed<UI_I_DropMenu<T_ActionTypeUserMenu>[]>(() =>
28
+ accountMenuFunc(localization.value)
29
+ )
30
+
31
+ const clickMenuItem = (item: UI_I_DropMenu<T_ActionTypeUserMenu>): void => {
32
+ item.action && emits('select-dropdown', item.action)
33
+ }
34
+ </script>
35
+
36
+ <style lang="scss" scoped></style>
@@ -0,0 +1,36 @@
1
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import type { UI_I_DropMenu } from '~/components/atoms/dropdown/dropdown/lib/models/interfaces'
3
+ import type { T_ActionTypeUserMenu } from '~/components/common/layout/theHeader/userMenu/userMenuOld/lib/models/types'
4
+
5
+ export const accountMenuFunc = (
6
+ localization: UI_I_Localization
7
+ ): UI_I_DropMenu<T_ActionTypeUserMenu>[] => {
8
+ return [
9
+ {
10
+ text: localization.changePassword,
11
+ action: 'changePassword',
12
+ closeAfterClick: true,
13
+ testId: 'user-menu-change-password',
14
+ },
15
+ {
16
+ text: localization.preferences,
17
+ action: 'preferences',
18
+ closeAfterClick: true,
19
+ testId: 'user-menu-preferences',
20
+ },
21
+ {
22
+ text: localization.switchTheme,
23
+ action: 'themeMode',
24
+ disabled: false,
25
+ divider: true,
26
+ closeAfterClick: true,
27
+ testId: 'user-menu-switch-theme',
28
+ },
29
+ {
30
+ text: localization.logout,
31
+ action: 'logout',
32
+ closeAfterClick: true,
33
+ testId: 'user-menu-logout',
34
+ },
35
+ ]
36
+ }
@@ -0,0 +1,5 @@
1
+ export type T_ActionTypeUserMenu =
2
+ | 'changePassword'
3
+ | 'logout'
4
+ | 'themeMode'
5
+ | 'preferences'