bfg-common 1.4.745 → 1.4.747

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 (164) hide show
  1. package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
  2. package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
  3. package/assets/img/icons/icons-sprite-light-3.svg +227 -227
  4. package/assets/img/icons/icons-sprite-light-5.svg +488 -488
  5. package/assets/localization/local_be.json +2 -1
  6. package/assets/localization/local_en.json +2 -1
  7. package/assets/localization/local_hy.json +2 -1
  8. package/assets/localization/local_kk.json +2 -1
  9. package/assets/localization/local_ru.json +2 -1
  10. package/assets/localization/local_zh.json +2 -1
  11. package/assets/scss/common/normalize.scss +361 -361
  12. package/components/atoms/TheIcon3.vue +50 -50
  13. package/components/atoms/modal/bySteps/BySteps.vue +253 -253
  14. package/components/atoms/stack/StackBlock.vue +185 -185
  15. package/components/atoms/table/dataGrid/DataGrid.vue +1696 -1696
  16. package/components/atoms/table/dataGrid/DataGridColumnSwitch.vue +222 -222
  17. package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +91 -91
  18. package/components/common/browse/BrowseNew.vue +237 -237
  19. package/components/common/browse/BrowseOld.vue +217 -217
  20. package/components/common/browse/blocks/contents/Files.vue +37 -37
  21. package/components/common/browse/blocks/contents/FilesOld.vue +72 -72
  22. package/components/common/browse/blocks/contents/filesNew/FilesNew.vue +96 -96
  23. package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
  24. package/components/common/browse/blocks/lib/models/types.ts +1 -1
  25. package/components/common/browse/lib/models/interfaces.ts +5 -5
  26. package/components/common/context/lib/models/interfaces.ts +30 -30
  27. package/components/common/context/recursion/Recursion.vue +86 -86
  28. package/components/common/context/recursion/RecursionNew.vue +226 -226
  29. package/components/common/context/recursion/RecursionOld.vue +227 -227
  30. package/components/common/diagramMain/Header.vue +211 -211
  31. package/components/common/diagramMain/adapter/AdapterItems.vue +61 -61
  32. package/components/common/diagramMain/lib/config/initial.ts +50 -50
  33. package/components/common/diagramMain/lib/models/types.ts +21 -21
  34. package/components/common/diagramMain/lib/utils/utils.ts +331 -331
  35. package/components/common/diagramMain/modals/ManagePhysicalAdaptersModal.vue +330 -330
  36. package/components/common/diagramMain/modals/editSettings/ConfirmTeamingSettingsModal.vue +40 -40
  37. package/components/common/diagramMain/modals/editSettings/EditSettings.vue +497 -497
  38. package/components/common/diagramMain/modals/editSettings/EditSettingsModal.vue +812 -812
  39. package/components/common/diagramMain/modals/editSettings/tabs/NetworkProperties.vue +214 -214
  40. package/components/common/diagramMain/modals/editSettings/tabs/Security.vue +189 -189
  41. package/components/common/diagramMain/modals/editSettings/tabs/SwitchProperties.vue +163 -163
  42. package/components/common/diagramMain/modals/editSettings/tabs/TeamingFailover.vue +175 -175
  43. package/components/common/diagramMain/modals/editSettings/tabs/TrafficShaping.vue +398 -398
  44. package/components/common/diagramMain/modals/editSettings/tabs/port/IpvFourSettings.vue +346 -346
  45. package/components/common/diagramMain/modals/editSettings/tabs/port/PortProperties.vue +205 -205
  46. package/components/common/diagramMain/modals/lib/config/diagramConfig.ts +23 -23
  47. package/components/common/diagramMain/modals/lib/config/initial.ts +180 -180
  48. package/components/common/diagramMain/modals/lib/config/vmKernelAdapter.ts +90 -90
  49. package/components/common/diagramMain/modals/lib/mappers/mappers.ts +87 -87
  50. package/components/common/diagramMain/modals/lib/utils/index.ts +24 -24
  51. package/components/common/diagramMain/modals/migrateVmkernelAdapter/lib/config/steps.ts +114 -114
  52. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/ConnectionSettings.vue +169 -169
  53. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/SelectVmkernelAdapter.vue +159 -159
  54. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +14 -14
  55. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/connectionSettings.ts +137 -137
  56. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/selectVmkernelAdapter.ts +52 -52
  57. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/validations.ts +19 -19
  58. package/components/common/diagramMain/port/Ports.vue +47 -47
  59. package/components/common/layout/theHeader/helpMenu/About.vue +82 -82
  60. package/components/common/layout/theHeader/helpMenu/aboutNew/AboutNew.vue +103 -103
  61. package/components/common/mainNavigationPanel/MainNavigationPanel.vue +150 -150
  62. package/components/common/mainNavigationPanel/MainNavigationPanelOld.vue +300 -300
  63. package/components/common/modals/confirmByInput/ConfirmByInput.vue +206 -206
  64. package/components/common/modals/unsavedChanges/UnsavedChanges.vue +56 -56
  65. package/components/common/pages/home/StatusContent.vue +49 -49
  66. package/components/common/pages/home/headline/Headline.vue +44 -44
  67. package/components/common/pages/home/headline/HeadlineNew.vue +71 -71
  68. package/components/common/pages/home/lib/models/interfaces.ts +48 -48
  69. package/components/common/pages/home/widgets/Widgets.vue +49 -49
  70. package/components/common/pages/home/widgets/WidgetsNew.vue +86 -86
  71. package/components/common/pages/home/widgets/WidgetsOld.vue +34 -34
  72. package/components/common/pages/home/widgets/hosts/Hosts.vue +27 -27
  73. package/components/common/pages/home/widgets/hosts/HostsNew.vue +100 -100
  74. package/components/common/pages/home/widgets/hosts/lib/config/items.ts +23 -23
  75. package/components/common/pages/home/widgets/services/lib/config/config.ts +108 -108
  76. package/components/common/pages/home/widgets/vms/Vms.vue +26 -26
  77. package/components/common/pages/home/widgets/vms/VmsNew.vue +101 -101
  78. package/components/common/pages/home/widgets/vms/VmsOld.vue +35 -35
  79. package/components/common/pages/home/widgets/vms/lib/config/items.ts +19 -19
  80. package/components/common/recursionTree/RecursionTree.vue +223 -223
  81. package/components/common/select/button/ButtonDropdown.vue +108 -108
  82. package/components/common/spiceConsole/Drawer.vue +370 -370
  83. package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
  84. package/components/common/split/horizontal/HorizontalNew.vue +384 -384
  85. package/components/common/split/horizontal/HorizontalOld.vue +345 -345
  86. package/components/common/split/vertical/Vertical.vue +160 -160
  87. package/components/common/vm/actions/add/Add.vue +621 -621
  88. package/components/common/vm/actions/clone/Clone.vue +639 -639
  89. package/components/common/vm/actions/clone/lib/config/steps.ts +129 -129
  90. package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +271 -271
  91. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +271 -271
  92. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareOld.vue +174 -174
  93. package/components/common/vm/actions/common/customizeHardware/virtualHardware/browseView/BrowseView.vue +219 -219
  94. package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/BusNew.vue +117 -117
  95. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDriveNew.vue +161 -161
  96. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDriveOld.vue +165 -165
  97. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/Media.vue +25 -25
  98. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/MediaNew.vue +70 -70
  99. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/MediaOld.vue +50 -50
  100. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +338 -338
  101. package/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/Limit.vue +220 -220
  102. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/mode/ModeOld.vue +56 -56
  103. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/sharing/SharingNew.vue +44 -44
  104. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +281 -281
  105. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetworkNew.vue +124 -124
  106. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/LocationOld.vue +134 -134
  107. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/New.vue +63 -63
  108. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/table/lib/config/config.ts +95 -95
  109. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +119 -119
  110. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddressNew.vue +69 -69
  111. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddressOld.vue +83 -83
  112. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIoNew.vue +66 -66
  113. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIoOld.vue +62 -62
  114. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +31 -31
  115. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIoNew.vue +84 -84
  116. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIoOld.vue +76 -76
  117. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/Note.vue +15 -15
  118. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/NoteNew.vue +42 -42
  119. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/NoteOld.vue +30 -30
  120. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGrid.vue +41 -41
  121. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGridNew.vue +81 -81
  122. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGridOld.vue +84 -84
  123. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerNew.vue +56 -56
  124. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +16 -16
  125. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/OtherNew.vue +30 -30
  126. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardNew.vue +104 -104
  127. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardOld.vue +112 -112
  128. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/totalVideoMemory/TotalVideoMemoryNew.vue +54 -54
  129. package/components/common/vm/actions/common/customizeHardware/vmoptions/Vmoptions.vue +145 -145
  130. package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsNew.vue +102 -102
  131. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsNew.vue +75 -75
  132. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +26 -26
  133. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +57 -57
  134. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/FirmwareNew.vue +42 -42
  135. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/menu/MenuNew.vue +25 -25
  136. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +171 -171
  137. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderNew.vue +50 -50
  138. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsNew.vue +141 -141
  139. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/New.vue +140 -140
  140. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/copyPaste/CopyPasteNew.vue +30 -30
  141. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/fileTransfer/FileTransferNew.vue +30 -30
  142. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/folderSharing/FolderSharingNew.vue +30 -30
  143. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +32 -32
  144. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/KeymapNew.vue +39 -39
  145. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +103 -103
  146. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/PasswordNew.vue +102 -102
  147. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/PasswordOld.vue +94 -94
  148. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +28 -28
  149. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirectionNew.vue +38 -38
  150. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirectionOld.vue +44 -44
  151. package/components/common/vm/actions/common/select/storage/Storage.vue +130 -130
  152. package/components/common/vm/actions/common/select/storage/StorageOld.vue +129 -129
  153. package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
  154. package/composables/productNameLocal.ts +30 -30
  155. package/composables/useAppVersion.ts +21 -21
  156. package/lib/models/table/interfaces.ts +1 -0
  157. package/package.json +2 -2
  158. package/plugins/date.ts +233 -233
  159. package/plugins/recursion.ts +311 -311
  160. package/public/spice-console/lib/images/bitmap.js +203 -203
  161. package/public/spice-console/network/spicechannel.js +383 -383
  162. package/store/main/mutations.ts +7 -7
  163. package/store/main/state.ts +7 -7
  164. package/store/tasks/mappers/recentTasks.ts +64 -64
@@ -1,226 +1,226 @@
1
- <template>
2
- <ul class="context-wrap relative">
3
- <template v-if="props.isLoading">
4
- <ui-loader2 class="context-loader" test-id="context-menu" />
5
- </template>
6
- <li
7
- v-for="(item, key) in props.items"
8
- :key="key"
9
- :class="[
10
- 'menu-item',
11
- { disabled: item.disabled || isLoading },
12
- { 'show-children': item.isShowItems },
13
- { 'has-divider': item.hasBorderTop },
14
- ]"
15
- @mouseenter="emits('toggle-items', [item, true, $event])"
16
- @mouseleave="emits('toggle-items', [item, false, $event])"
17
- >
18
- <span
19
- class="context-link"
20
- :style="item.style"
21
- :data-id="`${item.testId}-context-link`"
22
- @mousedown="emits('select-item', item)"
23
- >
24
- <span :class="['context-icon', item.iconClassName]" />
25
- <span class="menu-item-text">{{ item.name }}</span>
26
- <ui-icon v-if="item.items.length" name="arrow" class="arrow-icon" />
27
- <span v-if="item.shortcut" class="shortcut">{{ item.shortcut }}</span>
28
- </span>
29
-
30
- <div class="context-children">
31
- <common-context-recursion
32
- v-show="item.isShowItems"
33
- :action-loading="props.actionLoading"
34
- :items="item.items"
35
- @select-item="emits('select-item', $event)"
36
- />
37
- </div>
38
- </li>
39
- </ul>
40
- </template>
41
-
42
- <script setup lang="ts">
43
- import type { UI_I_ContextMenuItem } from '~/components/common/context/lib/models/interfaces'
44
- import type { I_HTMLLiElement } from '~/components/common/context/recursion/lib/models/interfaces'
45
-
46
- const props = defineProps<{
47
- items: UI_I_ContextMenuItem[]
48
- actionLoading: string | null
49
- isLoading: boolean
50
- testId?: string
51
- }>()
52
-
53
- const emits = defineEmits<{
54
- (event: 'select-item', value: UI_I_ContextMenuItem): void
55
- (
56
- event: 'toggle-items',
57
- value: [UI_I_ContextMenuItem, boolean, I_HTMLLiElement]
58
- ): void
59
- }>()
60
- </script>
61
-
62
- <style>
63
- :root.is-new-view {
64
- --context-menu-bg-color: #ffffff;
65
- --context-menu-item-bg-hover-color: rgba(233, 235, 237, 0.4);
66
- --context-menu-text-color: #4d5d69;
67
- --context-menu-text-disabled-color: #bdc3c7;
68
- --context-menu-text-hover-color: #182531;
69
- --context-menu-border-color: #e9ebed;
70
-
71
- /*rtl*/
72
- --context-menu-wrap-transform: none;
73
- --context-menu-wrap-transform-left: translateX(-100%);
74
- --context-menu-wrap-left: -12px;
75
- --context-menu-wrap-right: unset;
76
- }
77
- :root.is-new-view.dark-theme {
78
- --context-menu-bg-color: #334453;
79
- --context-menu-item-bg-hover-color: rgba(233, 235, 237, 0.06);
80
- --context-menu-text-color: #e9eaec;
81
- --context-menu-text-disabled-color: #bdc3c7b8;
82
- --context-menu-text-hover-color: #ffffff;
83
- --context-menu-border-color: rgba(233, 235, 237, 0.12);
84
- }
85
-
86
- :root.is-new-view[dir='rtl'] {
87
- --context-menu-wrap-transform: translateX(100%);
88
- --context-menu-wrap-transform-left: translateX(0);
89
- --context-menu-wrap-left: unset;
90
- --context-menu-wrap-right: calc(100% + 12px);
91
- }
92
- </style>
93
- <style scoped lang="scss">
94
- .context-wrap {
95
- width: auto;
96
- max-width: 400px;
97
- min-width: 212px;
98
- background: var(--context-menu-bg-color);
99
- border-radius: 8px;
100
- user-select: none;
101
- list-style: none;
102
- max-height: 100vh;
103
- box-shadow: var(--box-shadow);
104
- padding: 8px;
105
-
106
- .context-loader {
107
- position: absolute;
108
- width: 40px;
109
- top: calc(50% - 20px);
110
- left: calc(50% - 20px);
111
- }
112
-
113
- .menu-item {
114
- position: relative;
115
- color: var(--context-menu-text-color);
116
- cursor: pointer;
117
- border-radius: 4px;
118
-
119
- &.show-children::after {
120
- content: '';
121
- position: absolute;
122
- top: 0;
123
- left: 100%;
124
- width: 12px;
125
- height: 100%;
126
- }
127
-
128
- &:not(:last-child) {
129
- margin-bottom: 8px;
130
- }
131
-
132
- &:not(.disabled) > .context-link:hover {
133
- background-color: var(--context-menu-item-bg-hover-color);
134
- color: var(--context-menu-text-hover-color);
135
- }
136
-
137
- &.left {
138
- &.show-children::after {
139
- left: -12px;
140
- }
141
- :deep(.context-children) {
142
- left: var(--context-menu-wrap-left);
143
- right: var(--context-menu-wrap-right);
144
-
145
- .context-wrap {
146
- transform: var(--context-menu-wrap-transform-left);
147
- left: auto;
148
- }
149
- }
150
- }
151
-
152
- &.has-divider::before {
153
- content: '';
154
- display: block;
155
- height: 0.03rem;
156
- background-color: var(--context-menu-border-color);
157
- margin: 0 8px 8px;
158
- }
159
-
160
- .context-link {
161
- position: relative;
162
- overflow: hidden;
163
- text-overflow: ellipsis;
164
- white-space: nowrap;
165
- display: flex;
166
- align-items: center;
167
- user-select: none;
168
- border-radius: 4px;
169
- padding: 6px 8px;
170
-
171
- .menu-item-text {
172
- flex: 1 1 0;
173
- font-size: 13px;
174
- font-weight: 400;
175
- line-height: 15.73px;
176
- }
177
-
178
- .context-icon {
179
- margin-right: 8px;
180
- width: 20px;
181
- height: 20px;
182
- }
183
-
184
- .arrow-icon {
185
- position: absolute;
186
- top: 50%;
187
- margin-top: -8px;
188
- right: 4px;
189
- display: inline-block;
190
- width: 16px;
191
- height: 16px;
192
- overflow: hidden;
193
- transform: rotate(90deg);
194
- }
195
-
196
- .shortcut {
197
- color: #9da6ad;
198
- padding-left: 10px;
199
- }
200
- }
201
-
202
- &.disabled {
203
- color: var(--context-menu-text-disabled-color);
204
- user-select: none;
205
- cursor: default;
206
- .context-icon {
207
- opacity: 0.5;
208
- }
209
- .shortcut {
210
- color: var(--context-menu-text-disabled-color);
211
- }
212
- }
213
-
214
- .context-children {
215
- position: absolute;
216
- top: 0;
217
- left: calc(100% + 12px);
218
-
219
- .context-wrap {
220
- position: fixed;
221
- transform: var(--context-menu-wrap-transform);
222
- }
223
- }
224
- }
225
- }
226
- </style>
1
+ <template>
2
+ <ul class="context-wrap relative">
3
+ <template v-if="props.isLoading">
4
+ <ui-loader2 class="context-loader" test-id="context-menu" />
5
+ </template>
6
+ <li
7
+ v-for="(item, key) in props.items"
8
+ :key="key"
9
+ :class="[
10
+ 'menu-item',
11
+ { disabled: item.disabled || isLoading },
12
+ { 'show-children': item.isShowItems },
13
+ { 'has-divider': item.hasBorderTop },
14
+ ]"
15
+ @mouseenter="emits('toggle-items', [item, true, $event])"
16
+ @mouseleave="emits('toggle-items', [item, false, $event])"
17
+ >
18
+ <span
19
+ class="context-link"
20
+ :style="item.style"
21
+ :data-id="`${item.testId}-context-link`"
22
+ @mousedown="emits('select-item', item)"
23
+ >
24
+ <span :class="['context-icon', item.iconClassName]" />
25
+ <span class="menu-item-text">{{ item.name }}</span>
26
+ <ui-icon v-if="item.items.length" name="arrow" class="arrow-icon" />
27
+ <span v-if="item.shortcut" class="shortcut">{{ item.shortcut }}</span>
28
+ </span>
29
+
30
+ <div class="context-children">
31
+ <common-context-recursion
32
+ v-show="item.isShowItems"
33
+ :action-loading="props.actionLoading"
34
+ :items="item.items"
35
+ @select-item="emits('select-item', $event)"
36
+ />
37
+ </div>
38
+ </li>
39
+ </ul>
40
+ </template>
41
+
42
+ <script setup lang="ts">
43
+ import type { UI_I_ContextMenuItem } from '~/components/common/context/lib/models/interfaces'
44
+ import type { I_HTMLLiElement } from '~/components/common/context/recursion/lib/models/interfaces'
45
+
46
+ const props = defineProps<{
47
+ items: UI_I_ContextMenuItem[]
48
+ actionLoading: string | null
49
+ isLoading: boolean
50
+ testId?: string
51
+ }>()
52
+
53
+ const emits = defineEmits<{
54
+ (event: 'select-item', value: UI_I_ContextMenuItem): void
55
+ (
56
+ event: 'toggle-items',
57
+ value: [UI_I_ContextMenuItem, boolean, I_HTMLLiElement]
58
+ ): void
59
+ }>()
60
+ </script>
61
+
62
+ <style>
63
+ :root.is-new-view {
64
+ --context-menu-bg-color: #ffffff;
65
+ --context-menu-item-bg-hover-color: rgba(233, 235, 237, 0.4);
66
+ --context-menu-text-color: #4d5d69;
67
+ --context-menu-text-disabled-color: #bdc3c7;
68
+ --context-menu-text-hover-color: #182531;
69
+ --context-menu-border-color: #e9ebed;
70
+
71
+ /*rtl*/
72
+ --context-menu-wrap-transform: none;
73
+ --context-menu-wrap-transform-left: translateX(-100%);
74
+ --context-menu-wrap-left: -12px;
75
+ --context-menu-wrap-right: unset;
76
+ }
77
+ :root.is-new-view.dark-theme {
78
+ --context-menu-bg-color: #334453;
79
+ --context-menu-item-bg-hover-color: rgba(233, 235, 237, 0.06);
80
+ --context-menu-text-color: #e9eaec;
81
+ --context-menu-text-disabled-color: #bdc3c7b8;
82
+ --context-menu-text-hover-color: #ffffff;
83
+ --context-menu-border-color: rgba(233, 235, 237, 0.12);
84
+ }
85
+
86
+ :root.is-new-view[dir='rtl'] {
87
+ --context-menu-wrap-transform: translateX(100%);
88
+ --context-menu-wrap-transform-left: translateX(0);
89
+ --context-menu-wrap-left: unset;
90
+ --context-menu-wrap-right: calc(100% + 12px);
91
+ }
92
+ </style>
93
+ <style scoped lang="scss">
94
+ .context-wrap {
95
+ width: auto;
96
+ max-width: 400px;
97
+ min-width: 212px;
98
+ background: var(--context-menu-bg-color);
99
+ border-radius: 8px;
100
+ user-select: none;
101
+ list-style: none;
102
+ max-height: 100vh;
103
+ box-shadow: var(--box-shadow);
104
+ padding: 8px;
105
+
106
+ .context-loader {
107
+ position: absolute;
108
+ width: 40px;
109
+ top: calc(50% - 20px);
110
+ left: calc(50% - 20px);
111
+ }
112
+
113
+ .menu-item {
114
+ position: relative;
115
+ color: var(--context-menu-text-color);
116
+ cursor: pointer;
117
+ border-radius: 4px;
118
+
119
+ &.show-children::after {
120
+ content: '';
121
+ position: absolute;
122
+ top: 0;
123
+ left: 100%;
124
+ width: 12px;
125
+ height: 100%;
126
+ }
127
+
128
+ &:not(:last-child) {
129
+ margin-bottom: 8px;
130
+ }
131
+
132
+ &:not(.disabled) > .context-link:hover {
133
+ background-color: var(--context-menu-item-bg-hover-color);
134
+ color: var(--context-menu-text-hover-color);
135
+ }
136
+
137
+ &.left {
138
+ &.show-children::after {
139
+ left: -12px;
140
+ }
141
+ :deep(.context-children) {
142
+ left: var(--context-menu-wrap-left);
143
+ right: var(--context-menu-wrap-right);
144
+
145
+ .context-wrap {
146
+ transform: var(--context-menu-wrap-transform-left);
147
+ left: auto;
148
+ }
149
+ }
150
+ }
151
+
152
+ &.has-divider::before {
153
+ content: '';
154
+ display: block;
155
+ height: 0.03rem;
156
+ background-color: var(--context-menu-border-color);
157
+ margin: 0 8px 8px;
158
+ }
159
+
160
+ .context-link {
161
+ position: relative;
162
+ overflow: hidden;
163
+ text-overflow: ellipsis;
164
+ white-space: nowrap;
165
+ display: flex;
166
+ align-items: center;
167
+ user-select: none;
168
+ border-radius: 4px;
169
+ padding: 6px 8px;
170
+
171
+ .menu-item-text {
172
+ flex: 1 1 0;
173
+ font-size: 13px;
174
+ font-weight: 400;
175
+ line-height: 15.73px;
176
+ }
177
+
178
+ .context-icon {
179
+ margin-right: 8px;
180
+ width: 20px;
181
+ height: 20px;
182
+ }
183
+
184
+ .arrow-icon {
185
+ position: absolute;
186
+ top: 50%;
187
+ margin-top: -8px;
188
+ right: 4px;
189
+ display: inline-block;
190
+ width: 16px;
191
+ height: 16px;
192
+ overflow: hidden;
193
+ transform: rotate(90deg);
194
+ }
195
+
196
+ .shortcut {
197
+ color: #9da6ad;
198
+ padding-left: 10px;
199
+ }
200
+ }
201
+
202
+ &.disabled {
203
+ color: var(--context-menu-text-disabled-color);
204
+ user-select: none;
205
+ cursor: default;
206
+ .context-icon {
207
+ opacity: 0.5;
208
+ }
209
+ .shortcut {
210
+ color: var(--context-menu-text-disabled-color);
211
+ }
212
+ }
213
+
214
+ .context-children {
215
+ position: absolute;
216
+ top: 0;
217
+ left: calc(100% + 12px);
218
+
219
+ .context-wrap {
220
+ position: fixed;
221
+ transform: var(--context-menu-wrap-transform);
222
+ }
223
+ }
224
+ }
225
+ }
226
+ </style>