bfg-common 1.5.92 → 1.5.94
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.
- package/assets/scss/common/normalize.scss +347 -347
- package/components/atoms/alert/Notification.vue +169 -169
- package/components/atoms/autocomplete/Autocomplete.vue +361 -362
- package/components/atoms/collapse/CollapseNav.vue +169 -169
- package/components/atoms/comboDropdownMenu/ComboDropdownMenu.vue +357 -357
- package/components/atoms/combobox/Combobox.vue +154 -154
- package/components/atoms/datepicker/Datepicker.vue +639 -639
- package/components/atoms/dropdown/Portlet.vue +113 -113
- package/components/atoms/dropdown/dropdown/Dropdown.vue +168 -168
- package/components/atoms/dropdown/tree/Tree.vue +137 -137
- package/components/atoms/list/SelectList.vue +63 -63
- package/components/atoms/list/dragDropList/DragDropList.vue +148 -148
- package/components/atoms/modal/Modal.vue +250 -250
- package/components/atoms/modal/bySteps/BySteps.vue +253 -253
- package/components/atoms/notificationBar/NotificationBar.vue +178 -178
- package/components/atoms/popover/Popover.vue +58 -58
- package/components/atoms/popover/lib/models/interfaces.ts +4 -4
- package/components/atoms/select/TheSelect.vue +187 -187
- package/components/atoms/stack/StackBlock.vue +185 -185
- package/components/atoms/stack/StackContent.vue +63 -63
- package/components/atoms/step/lib/models/verticalStepItem.ts +5 -5
- package/components/atoms/switch/Switch.vue +111 -111
- package/components/atoms/table/compact/Compact.vue +529 -529
- package/components/atoms/table/dataGrid/DataGrid.vue +1716 -1713
- package/components/atoms/table/dataGrid/DataGridPage.vue +195 -195
- package/components/atoms/table/info/Info.vue +2 -2
- package/components/atoms/table/simpleEvent/SimpleEvent.vue +98 -98
- package/components/atoms/table/simpleInfo/SimpleInfo.vue +73 -73
- package/components/atoms/tabs/Tabs.vue +217 -217
- package/components/atoms/wizard/Wizard.vue +341 -341
- package/components/common/accordion/Recursion.vue +222 -222
- package/components/common/adapterManager/AddAdapterModal.vue +561 -561
- package/components/common/adapterManager/ui/actions/AddAdapterButton.vue +30 -30
- package/components/common/adapterManager/ui/table/Table.vue +162 -162
- package/components/common/browse/BrowseNew.vue +237 -237
- package/components/common/browse/BrowseOld.vue +217 -217
- package/components/common/browse/blocks/TitleNew.vue +145 -145
- package/components/common/browse/blocks/TitleOld.vue +91 -91
- package/components/common/browse/blocks/contents/FilesOld.vue +72 -72
- package/components/common/chartOptionsModal/counters/timespan/form/FormNew.vue +262 -262
- package/components/common/context/Context.vue +111 -111
- package/components/common/context/recursion/RecursionOld.vue +228 -228
- package/components/common/details/DetailsItem.vue +109 -109
- package/components/common/feedback/Buttons.vue +229 -229
- package/components/common/feedback/Feedback.vue +270 -270
- package/components/common/feedback/Message.vue +519 -519
- package/components/common/graph/graphNew/GraphNew.vue +194 -194
- package/components/common/graph/lib/utils/renderGraph.ts +389 -389
- package/components/common/layout/theHeader/feedback/new/New.vue +227 -227
- package/components/common/layout/theHeader/feedback/new/additionalDetails/AdditionalDetails.vue +606 -606
- package/components/common/layout/theHeader/feedback/new/additionalDetails/Headline.vue +98 -98
- package/components/common/layout/theHeader/feedback/new/description/Description.vue +59 -59
- package/components/common/layout/theHeader/feedback/new/email/Email.vue +43 -43
- package/components/common/layout/theHeader/feedback/new/subtitle/Subtitle.vue +103 -103
- package/components/common/layout/theHeader/helpMenu/aboutNew/AboutNew.vue +112 -112
- package/components/common/layout/theHeader/helpMenu/aboutOld/AboutOld.vue +80 -80
- package/components/common/layout/theHeader/helpMenu/helpMenuOld/HelpMenuOld.vue +1 -1
- package/components/common/layout/theHeader/modals/Reconnect.vue +2 -2
- package/components/common/layout/theHeader/modals/RedirectLogin.vue +3 -3
- package/components/common/layout/theHeader/userMenu/modals/changePassword/ChangePassword.vue +1 -1
- package/components/common/layout/theHeader/userMenu/modals/changePassword/ChangePasswordNew.vue +8 -8
- package/components/common/layout/theHeader/userMenu/modals/changePassword/ChangePasswordOld.vue +3 -3
- package/components/common/layout/theHeader/userMenu/modals/preferences/PreferencesNew.vue +1 -1
- package/components/common/layout/theHeader/userMenu/modals/preferences/PreferencesOld.vue +1 -1
- package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/ChangeLanguage.vue +1 -1
- package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/ChangeLanguageNew.vue +1 -1
- package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/ChangeLanguageOld.vue +2 -5
- package/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/DefaultConsoleOld.vue +1 -1
- package/components/common/layout/theHeader/userMenu/modals/preferences/inventory/InventoryNew.vue +1 -1
- package/components/common/layout/theHeader/userMenu/userMenuNew/UserMenuNew.vue +2 -2
- package/components/common/layout/theHeader/userMenu/userMenuNew/lib/config/dropMenu.ts +1 -1
- package/components/common/layout/theHeader/userMenu/userMenuOld/UserMenuOld.vue +1 -1
- package/components/common/mainNavigationPanel/MainNavigationPanelOld.vue +2 -2
- package/components/common/modals/Rename.vue +2 -2
- package/components/common/modals/confirmByInput/ConfirmByInput.vue +2 -3
- package/components/common/modals/confirmByInput/ConfirmByInputOld.vue +3 -3
- package/components/common/modals/confirmation/ConfirmationOld.vue +1 -1
- package/components/common/modals/unsavedChanges/UnsavedChanges.vue +1 -1
- package/components/common/monitor/advanced/Advanced.vue +1 -1
- package/components/common/monitor/advanced/AdvancedNew.vue +1 -1
- package/components/common/monitor/advanced/AdvancedOld.vue +1 -1
- package/components/common/monitor/advanced/graphView/GraphViewNew.vue +1 -1
- package/components/common/monitor/advanced/graphView/GraphViewOld.vue +1 -1
- package/components/common/monitor/advanced/table/Table.vue +1 -1
- package/components/common/monitor/advanced/table/tableNew/TableNew.vue +2 -2
- package/components/common/monitor/advanced/table/tableOld/lib/config/performanceDatatable.ts +2 -2
- package/components/common/monitor/advanced/tools/ToolsOld.vue +2 -2
- package/components/common/monitor/advanced/tools/chartOptionsModal/ChartOptionsModalOld.vue +1 -1
- package/components/common/monitor/advanced/tools/chartOptionsModal/NotificationOld.vue +1 -1
- package/components/common/monitor/advanced/tools/chartOptionsModal/actions/ActionsOld.vue +1 -1
- package/components/common/monitor/advanced/tools/chartOptionsModal/actions/saveOptionsModal/SaveOptionsModal.vue +1 -1
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/CountersNew.vue +1 -1
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/tableOld/lib/config/tableConfig.ts +2 -2
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/lib/config/objectTable.ts +10 -3
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/objectNew/ObjectNew.vue +1 -1
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/objectOld/ObjectOld.vue +2 -2
- package/components/common/monitor/advanced/tools/lib/utils/countCores.ts +1 -1
- package/components/common/monitor/lib/models/interfaces.ts +1 -1
- package/components/common/monitor/overview/filters/customIntervalModal/CustomIntervalModalOld.vue +3 -3
- package/components/common/monitor/overview/filters/customIntervalModal/customIntervalModalNew/CustomIntervalModalNew.vue +4 -3
- package/components/common/monitor/resourceAllocation/lib/models/interfaces.ts +8 -8
- package/components/common/monitor/resourceAllocation/resourceAllocation.vue +2 -2
- package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/ChartOptionsModal.vue +1 -1
- package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/Notification.vue +1 -1
- package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/actions/SaveOptionsModal.vue +1 -1
- package/components/common/pages/hardwareHealth/tableView/lib/config/alertWarningTable.ts +1 -1
- package/components/common/pages/hardwareHealth/tableView/lib/config/historyTestimonyTable.ts +5 -5
- package/components/common/wizards/vm/migrate/Migrate.vue +39 -2
- package/components/common/wizards/vm/migrate/vmOrigin/VmOrigin.vue +92 -0
- package/components/common/wizards/vm/migrate/vmOrigin/lib/models/interfaces.ts +19 -0
- package/components/common/wizards/vm/migrate/vmOrigin/lib/utils/constructItems.ts +62 -0
- package/package.json +1 -1
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
:id="elementId"
|
|
4
|
-
:style="{
|
|
5
|
-
top: currentContextMenuY,
|
|
6
|
-
left: currentContextMenuX,
|
|
7
|
-
}"
|
|
8
|
-
class="context-popup"
|
|
9
|
-
>
|
|
10
|
-
<common-context-recursion
|
|
11
|
-
:action-loading="props.actionLoading"
|
|
12
|
-
:items="props.contextMenu.items"
|
|
13
|
-
@select-item="selectItem"
|
|
14
|
-
/>
|
|
15
|
-
</div>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<script setup lang="ts">
|
|
19
|
-
import type {
|
|
20
|
-
UI_I_ContextMenuItem,
|
|
21
|
-
UI_I_ContextMenu,
|
|
22
|
-
} from '~/components/common/context/lib/models/interfaces'
|
|
23
|
-
|
|
24
|
-
const props = defineProps<{
|
|
25
|
-
contextMenu: UI_I_ContextMenu
|
|
26
|
-
actionLoading: string | null
|
|
27
|
-
}>()
|
|
28
|
-
const emits = defineEmits<{
|
|
29
|
-
(event: 'select-item', value: UI_I_ContextMenuItem): void
|
|
30
|
-
(event: 'hide'): void
|
|
31
|
-
}>()
|
|
32
|
-
|
|
33
|
-
const { $store }: any = useNuxtApp()
|
|
34
|
-
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
35
|
-
|
|
36
|
-
const selectItem = (item: UI_I_ContextMenuItem): void => {
|
|
37
|
-
emits('select-item', item)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const elementId = ref<string>(`context-${useUniqueId()}`)
|
|
41
|
-
|
|
42
|
-
const currentContextMenuY = ref<string>('')
|
|
43
|
-
const currentContextMenuX = ref<string>('')
|
|
44
|
-
const setCurrentPositionsPopup = (): void => {
|
|
45
|
-
let contextMenuY = props.contextMenu.y
|
|
46
|
-
const contextMenuX = props.contextMenu.x
|
|
47
|
-
|
|
48
|
-
const contextWrap: HTMLElement | null = document.querySelector(
|
|
49
|
-
`#${elementId.value} .context-wrap`
|
|
50
|
-
)
|
|
51
|
-
const contextW = contextWrap?.offsetWidth || 0
|
|
52
|
-
const contextH = contextWrap?.offsetHeight || 0
|
|
53
|
-
|
|
54
|
-
const windowW = window.innerWidth
|
|
55
|
-
const windowH = window.innerHeight
|
|
56
|
-
|
|
57
|
-
if (contextMenuY + contextH >= windowH) {
|
|
58
|
-
currentContextMenuY.value = 'auto'
|
|
59
|
-
} else {
|
|
60
|
-
if (isNewView.value) contextMenuY += 8
|
|
61
|
-
currentContextMenuY.value = `${contextMenuY}px`
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if (contextMenuX + contextW >= windowW) {
|
|
65
|
-
let divisionW = windowW - contextW
|
|
66
|
-
if (isNewView.value) divisionW -= 16
|
|
67
|
-
currentContextMenuX.value = `${divisionW}px`
|
|
68
|
-
} else {
|
|
69
|
-
currentContextMenuX.value = `${contextMenuX}px`
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const windowMousedown = (): void => {
|
|
74
|
-
emits('hide')
|
|
75
|
-
}
|
|
76
|
-
const windowResize = (): void => {
|
|
77
|
-
emits('hide')
|
|
78
|
-
}
|
|
79
|
-
watch(
|
|
80
|
-
() => props.contextMenu.y,
|
|
81
|
-
(newValue: number) => {
|
|
82
|
-
if (!newValue) return
|
|
83
|
-
|
|
84
|
-
if (newValue < 0) {
|
|
85
|
-
window.removeEventListener('mousedown', windowMousedown)
|
|
86
|
-
window.removeEventListener('resize', windowResize)
|
|
87
|
-
} else {
|
|
88
|
-
window.addEventListener('mousedown', windowMousedown)
|
|
89
|
-
window.addEventListener('resize', windowResize)
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
setTimeout(() => {
|
|
93
|
-
setCurrentPositionsPopup()
|
|
94
|
-
}, 0)
|
|
95
|
-
}
|
|
96
|
-
)
|
|
97
|
-
</script>
|
|
98
|
-
|
|
99
|
-
<style scoped lang="scss">
|
|
100
|
-
.context-popup {
|
|
101
|
-
top: -9999px;
|
|
102
|
-
left: -9999px;
|
|
103
|
-
bottom: 0;
|
|
104
|
-
border: none;
|
|
105
|
-
box-sizing: content-box;
|
|
106
|
-
overflow: visible;
|
|
107
|
-
display: block;
|
|
108
|
-
position: fixed;
|
|
109
|
-
z-index: var(--z-popover);
|
|
110
|
-
}
|
|
111
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:id="elementId"
|
|
4
|
+
:style="{
|
|
5
|
+
top: currentContextMenuY,
|
|
6
|
+
left: currentContextMenuX,
|
|
7
|
+
}"
|
|
8
|
+
class="context-popup"
|
|
9
|
+
>
|
|
10
|
+
<common-context-recursion
|
|
11
|
+
:action-loading="props.actionLoading"
|
|
12
|
+
:items="props.contextMenu.items"
|
|
13
|
+
@select-item="selectItem"
|
|
14
|
+
/>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup lang="ts">
|
|
19
|
+
import type {
|
|
20
|
+
UI_I_ContextMenuItem,
|
|
21
|
+
UI_I_ContextMenu,
|
|
22
|
+
} from '~/components/common/context/lib/models/interfaces'
|
|
23
|
+
|
|
24
|
+
const props = defineProps<{
|
|
25
|
+
contextMenu: UI_I_ContextMenu
|
|
26
|
+
actionLoading: string | null
|
|
27
|
+
}>()
|
|
28
|
+
const emits = defineEmits<{
|
|
29
|
+
(event: 'select-item', value: UI_I_ContextMenuItem): void
|
|
30
|
+
(event: 'hide'): void
|
|
31
|
+
}>()
|
|
32
|
+
|
|
33
|
+
const { $store }: any = useNuxtApp()
|
|
34
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
35
|
+
|
|
36
|
+
const selectItem = (item: UI_I_ContextMenuItem): void => {
|
|
37
|
+
emits('select-item', item)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const elementId = ref<string>(`context-${useUniqueId()}`)
|
|
41
|
+
|
|
42
|
+
const currentContextMenuY = ref<string>('')
|
|
43
|
+
const currentContextMenuX = ref<string>('')
|
|
44
|
+
const setCurrentPositionsPopup = (): void => {
|
|
45
|
+
let contextMenuY = props.contextMenu.y
|
|
46
|
+
const contextMenuX = props.contextMenu.x
|
|
47
|
+
|
|
48
|
+
const contextWrap: HTMLElement | null = document.querySelector(
|
|
49
|
+
`#${elementId.value} .context-wrap`
|
|
50
|
+
)
|
|
51
|
+
const contextW = contextWrap?.offsetWidth || 0
|
|
52
|
+
const contextH = contextWrap?.offsetHeight || 0
|
|
53
|
+
|
|
54
|
+
const windowW = window.innerWidth
|
|
55
|
+
const windowH = window.innerHeight
|
|
56
|
+
|
|
57
|
+
if (contextMenuY + contextH >= windowH) {
|
|
58
|
+
currentContextMenuY.value = 'auto'
|
|
59
|
+
} else {
|
|
60
|
+
if (isNewView.value) contextMenuY += 8
|
|
61
|
+
currentContextMenuY.value = `${contextMenuY}px`
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (contextMenuX + contextW >= windowW) {
|
|
65
|
+
let divisionW = windowW - contextW
|
|
66
|
+
if (isNewView.value) divisionW -= 16
|
|
67
|
+
currentContextMenuX.value = `${divisionW}px`
|
|
68
|
+
} else {
|
|
69
|
+
currentContextMenuX.value = `${contextMenuX}px`
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const windowMousedown = (): void => {
|
|
74
|
+
emits('hide')
|
|
75
|
+
}
|
|
76
|
+
const windowResize = (): void => {
|
|
77
|
+
emits('hide')
|
|
78
|
+
}
|
|
79
|
+
watch(
|
|
80
|
+
() => props.contextMenu.y,
|
|
81
|
+
(newValue: number) => {
|
|
82
|
+
if (!newValue) return
|
|
83
|
+
|
|
84
|
+
if (newValue < 0) {
|
|
85
|
+
window.removeEventListener('mousedown', windowMousedown)
|
|
86
|
+
window.removeEventListener('resize', windowResize)
|
|
87
|
+
} else {
|
|
88
|
+
window.addEventListener('mousedown', windowMousedown)
|
|
89
|
+
window.addEventListener('resize', windowResize)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
setTimeout(() => {
|
|
93
|
+
setCurrentPositionsPopup()
|
|
94
|
+
}, 0)
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<style scoped lang="scss">
|
|
100
|
+
.context-popup {
|
|
101
|
+
top: -9999px;
|
|
102
|
+
left: -9999px;
|
|
103
|
+
bottom: 0;
|
|
104
|
+
border: none;
|
|
105
|
+
box-sizing: content-box;
|
|
106
|
+
overflow: visible;
|
|
107
|
+
display: block;
|
|
108
|
+
position: fixed;
|
|
109
|
+
z-index: var(--z-popover);
|
|
110
|
+
}
|
|
111
|
+
</style>
|
|
@@ -1,228 +1,228 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<ul class="context-wrap">
|
|
3
|
-
<template v-if="props.isLoading">
|
|
4
|
-
<atoms-loader-pre-loader
|
|
5
|
-
id="loader"
|
|
6
|
-
:show="true"
|
|
7
|
-
class="absolute-center context-menu__loading"
|
|
8
|
-
/>
|
|
9
|
-
</template>
|
|
10
|
-
<li
|
|
11
|
-
v-for="(item, key) in props.items"
|
|
12
|
-
v-development="item.development"
|
|
13
|
-
:key="key"
|
|
14
|
-
:class="[
|
|
15
|
-
'menu-item',
|
|
16
|
-
{ disabled: item.disabled || isLoading },
|
|
17
|
-
{ 'item-header': item.isHeader },
|
|
18
|
-
{ 'has-border-top': item.hasBorderTop },
|
|
19
|
-
]"
|
|
20
|
-
@mouseenter="emits('toggle-items', [item, true, $event])"
|
|
21
|
-
@mouseleave="emits('toggle-items', [item, false, $event])"
|
|
22
|
-
>
|
|
23
|
-
<span
|
|
24
|
-
:style="item.style"
|
|
25
|
-
:data-id="`${item.testId}-context-link`"
|
|
26
|
-
class="context-link"
|
|
27
|
-
@mousedown="emits('select-item', item)"
|
|
28
|
-
>
|
|
29
|
-
<span :class="['context-icon', item.iconClassName]" />
|
|
30
|
-
<span class="menu-item-text">{{ item.name }}</span>
|
|
31
|
-
<span v-if="item.items.length" class="arrow-icon" />
|
|
32
|
-
<span v-if="item.shortcut" class="shortcut">{{ item.shortcut }}</span>
|
|
33
|
-
</span>
|
|
34
|
-
|
|
35
|
-
<div class="context-children">
|
|
36
|
-
<common-context-recursion
|
|
37
|
-
v-show="item.isShowItems"
|
|
38
|
-
:action-loading="props.actionLoading"
|
|
39
|
-
:class="[{ 'child-show': item.isShowItems }]"
|
|
40
|
-
:items="item.items"
|
|
41
|
-
@select-item="emits('select-item', $event)"
|
|
42
|
-
/>
|
|
43
|
-
</div>
|
|
44
|
-
</li>
|
|
45
|
-
</ul>
|
|
46
|
-
</template>
|
|
47
|
-
|
|
48
|
-
<script setup lang="ts">
|
|
49
|
-
import type { UI_I_ContextMenuItem } from '~/components/common/context/lib/models/interfaces'
|
|
50
|
-
import type { I_HTMLLiElement } from '~/components/common/context/recursion/lib/models/interfaces'
|
|
51
|
-
|
|
52
|
-
const props = defineProps<{
|
|
53
|
-
items: UI_I_ContextMenuItem[]
|
|
54
|
-
actionLoading: string | null
|
|
55
|
-
isLoading: boolean
|
|
56
|
-
testId?: string
|
|
57
|
-
}>()
|
|
58
|
-
|
|
59
|
-
const emits = defineEmits<{
|
|
60
|
-
(event: 'select-item', value: UI_I_ContextMenuItem): void
|
|
61
|
-
(
|
|
62
|
-
event: 'toggle-items',
|
|
63
|
-
value: [UI_I_ContextMenuItem, boolean, I_HTMLLiElement]
|
|
64
|
-
): void
|
|
65
|
-
}>()
|
|
66
|
-
</script>
|
|
67
|
-
|
|
68
|
-
<style>
|
|
69
|
-
:root {
|
|
70
|
-
--context-menu-hover-bg-color: #e8e8e8;
|
|
71
|
-
--context-menu-border-color: #949494;
|
|
72
|
-
--context-menu-inset-border-color: #d4d5d6;
|
|
73
|
-
--context-menu-item-header-color: #eceff2;
|
|
74
|
-
--context-menu-hover-border-color: #666;
|
|
75
|
-
|
|
76
|
-
/*rtl*/
|
|
77
|
-
--context-menu-wrap-transform: none;
|
|
78
|
-
--context-menu-wrap-transform-left: translateX(-100%);
|
|
79
|
-
--context-menu-wrap-left: 0;
|
|
80
|
-
--context-menu-wrap-right: unset;
|
|
81
|
-
}
|
|
82
|
-
:root.dark-theme {
|
|
83
|
-
--context-menu-hover-bg-color: #324f61;
|
|
84
|
-
--context-menu-border-color: #495865;
|
|
85
|
-
--context-menu-inset-border-color: #485764;
|
|
86
|
-
--context-menu-item-header-color: #29414e;
|
|
87
|
-
--context-menu-hover-border-color: #fff;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
:root[dir='rtl'] {
|
|
91
|
-
--context-menu-wrap-transform: translateX(100%);
|
|
92
|
-
--context-menu-wrap-transform-left: translateX(0);
|
|
93
|
-
--context-menu-wrap-left: unset;
|
|
94
|
-
--context-menu-wrap-right: 100%;
|
|
95
|
-
}
|
|
96
|
-
</style>
|
|
97
|
-
<style scoped lang="scss">
|
|
98
|
-
.loader-wrapper {
|
|
99
|
-
width: 100%;
|
|
100
|
-
height: 100%;
|
|
101
|
-
z-index: var(--z-fixed);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.context-menu__loading {
|
|
105
|
-
:deep(.spinner) {
|
|
106
|
-
width: 45px;
|
|
107
|
-
height: 45px;
|
|
108
|
-
min-width: 45px;
|
|
109
|
-
min-height: 45px;
|
|
110
|
-
z-index: var(--z-fixed);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
.context-wrap {
|
|
114
|
-
width: auto;
|
|
115
|
-
max-width: 400px;
|
|
116
|
-
background: var(--global-bg-color);
|
|
117
|
-
border-radius: 0;
|
|
118
|
-
color: #333;
|
|
119
|
-
border: 1px solid var(--context-menu-border-color);
|
|
120
|
-
user-select: none;
|
|
121
|
-
list-style: none;
|
|
122
|
-
max-height: 100vh;
|
|
123
|
-
overflow-y: auto;
|
|
124
|
-
|
|
125
|
-
.menu-item {
|
|
126
|
-
position: relative;
|
|
127
|
-
color: #565656;
|
|
128
|
-
border-bottom: 1px solid transparent;
|
|
129
|
-
cursor: pointer;
|
|
130
|
-
padding: 5px 0 3px;
|
|
131
|
-
|
|
132
|
-
&.has-border-top {
|
|
133
|
-
border-top: 1px solid var(--context-menu-inset-border-color);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
&.item-header {
|
|
137
|
-
font-size: 11px;
|
|
138
|
-
background-color: var(--context-menu-item-header-color);
|
|
139
|
-
cursor: default;
|
|
140
|
-
}
|
|
141
|
-
&:not(.item-header):not(.disabled):hover {
|
|
142
|
-
background-color: var(--context-menu-hover-bg-color);
|
|
143
|
-
color: #454545;
|
|
144
|
-
border-bottom: 1px solid var(--context-menu-hover-border-color);
|
|
145
|
-
}
|
|
146
|
-
&.disabled {
|
|
147
|
-
opacity: 0.5;
|
|
148
|
-
user-select: none;
|
|
149
|
-
cursor: default;
|
|
150
|
-
}
|
|
151
|
-
&.left {
|
|
152
|
-
:deep(.context-children) {
|
|
153
|
-
left: var(--context-menu-wrap-left);
|
|
154
|
-
right: var(--context-menu-wrap-right);
|
|
155
|
-
|
|
156
|
-
.context-wrap {
|
|
157
|
-
transform: var(--context-menu-wrap-transform-left);
|
|
158
|
-
left: auto;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.context-link {
|
|
164
|
-
position: relative;
|
|
165
|
-
overflow: hidden;
|
|
166
|
-
text-overflow: ellipsis;
|
|
167
|
-
white-space: nowrap;
|
|
168
|
-
display: flex;
|
|
169
|
-
align-items: center;
|
|
170
|
-
user-select: none;
|
|
171
|
-
padding: 3px 20px 4px 10px;
|
|
172
|
-
|
|
173
|
-
.menu-item-text {
|
|
174
|
-
flex: 1 1 0;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.context-icon {
|
|
178
|
-
display: inline-block;
|
|
179
|
-
margin: -2px 4px 0 0;
|
|
180
|
-
vertical-align: middle;
|
|
181
|
-
width: 18px;
|
|
182
|
-
height: 18px;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
.arrow-icon {
|
|
186
|
-
position: absolute;
|
|
187
|
-
top: 50%;
|
|
188
|
-
margin-top: -8px;
|
|
189
|
-
right: 4px;
|
|
190
|
-
background-image: url('assets/img/icons/sprite.png');
|
|
191
|
-
display: inline-block;
|
|
192
|
-
width: 16px;
|
|
193
|
-
height: 16px;
|
|
194
|
-
overflow: hidden;
|
|
195
|
-
background-repeat: no-repeat;
|
|
196
|
-
font-size: 0;
|
|
197
|
-
line-height: 0;
|
|
198
|
-
text-align: center;
|
|
199
|
-
transform: rotate(90deg);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.shortcut {
|
|
203
|
-
padding-left: 10px;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
.context-children {
|
|
208
|
-
position: absolute;
|
|
209
|
-
top: 0;
|
|
210
|
-
left: 100%;
|
|
211
|
-
|
|
212
|
-
.context-wrap {
|
|
213
|
-
position: fixed;
|
|
214
|
-
transform: var(--context-menu-wrap-transform);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
.context-menu__loading {
|
|
220
|
-
:deep(.spinner) {
|
|
221
|
-
width: 45px;
|
|
222
|
-
height: 45px;
|
|
223
|
-
min-width: 45px;
|
|
224
|
-
min-height: 45px;
|
|
225
|
-
z-index: var(--z-fixed);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<ul class="context-wrap">
|
|
3
|
+
<template v-if="props.isLoading">
|
|
4
|
+
<atoms-loader-pre-loader
|
|
5
|
+
id="loader"
|
|
6
|
+
:show="true"
|
|
7
|
+
class="absolute-center context-menu__loading"
|
|
8
|
+
/>
|
|
9
|
+
</template>
|
|
10
|
+
<li
|
|
11
|
+
v-for="(item, key) in props.items"
|
|
12
|
+
v-development="item.development"
|
|
13
|
+
:key="key"
|
|
14
|
+
:class="[
|
|
15
|
+
'menu-item',
|
|
16
|
+
{ disabled: item.disabled || isLoading },
|
|
17
|
+
{ 'item-header': item.isHeader },
|
|
18
|
+
{ 'has-border-top': item.hasBorderTop },
|
|
19
|
+
]"
|
|
20
|
+
@mouseenter="emits('toggle-items', [item, true, $event])"
|
|
21
|
+
@mouseleave="emits('toggle-items', [item, false, $event])"
|
|
22
|
+
>
|
|
23
|
+
<span
|
|
24
|
+
:style="item.style"
|
|
25
|
+
:data-id="`${item.testId}-context-link`"
|
|
26
|
+
class="context-link"
|
|
27
|
+
@mousedown="emits('select-item', item)"
|
|
28
|
+
>
|
|
29
|
+
<span :class="['context-icon', item.iconClassName]" />
|
|
30
|
+
<span class="menu-item-text">{{ item.name }}</span>
|
|
31
|
+
<span v-if="item.items.length" class="arrow-icon" />
|
|
32
|
+
<span v-if="item.shortcut" class="shortcut">{{ item.shortcut }}</span>
|
|
33
|
+
</span>
|
|
34
|
+
|
|
35
|
+
<div class="context-children">
|
|
36
|
+
<common-context-recursion
|
|
37
|
+
v-show="item.isShowItems"
|
|
38
|
+
:action-loading="props.actionLoading"
|
|
39
|
+
:class="[{ 'child-show': item.isShowItems }]"
|
|
40
|
+
:items="item.items"
|
|
41
|
+
@select-item="emits('select-item', $event)"
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
</li>
|
|
45
|
+
</ul>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script setup lang="ts">
|
|
49
|
+
import type { UI_I_ContextMenuItem } from '~/components/common/context/lib/models/interfaces'
|
|
50
|
+
import type { I_HTMLLiElement } from '~/components/common/context/recursion/lib/models/interfaces'
|
|
51
|
+
|
|
52
|
+
const props = defineProps<{
|
|
53
|
+
items: UI_I_ContextMenuItem[]
|
|
54
|
+
actionLoading: string | null
|
|
55
|
+
isLoading: boolean
|
|
56
|
+
testId?: string
|
|
57
|
+
}>()
|
|
58
|
+
|
|
59
|
+
const emits = defineEmits<{
|
|
60
|
+
(event: 'select-item', value: UI_I_ContextMenuItem): void
|
|
61
|
+
(
|
|
62
|
+
event: 'toggle-items',
|
|
63
|
+
value: [UI_I_ContextMenuItem, boolean, I_HTMLLiElement]
|
|
64
|
+
): void
|
|
65
|
+
}>()
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<style>
|
|
69
|
+
:root {
|
|
70
|
+
--context-menu-hover-bg-color: #e8e8e8;
|
|
71
|
+
--context-menu-border-color: #949494;
|
|
72
|
+
--context-menu-inset-border-color: #d4d5d6;
|
|
73
|
+
--context-menu-item-header-color: #eceff2;
|
|
74
|
+
--context-menu-hover-border-color: #666;
|
|
75
|
+
|
|
76
|
+
/*rtl*/
|
|
77
|
+
--context-menu-wrap-transform: none;
|
|
78
|
+
--context-menu-wrap-transform-left: translateX(-100%);
|
|
79
|
+
--context-menu-wrap-left: 0;
|
|
80
|
+
--context-menu-wrap-right: unset;
|
|
81
|
+
}
|
|
82
|
+
:root.dark-theme {
|
|
83
|
+
--context-menu-hover-bg-color: #324f61;
|
|
84
|
+
--context-menu-border-color: #495865;
|
|
85
|
+
--context-menu-inset-border-color: #485764;
|
|
86
|
+
--context-menu-item-header-color: #29414e;
|
|
87
|
+
--context-menu-hover-border-color: #fff;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
:root[dir='rtl'] {
|
|
91
|
+
--context-menu-wrap-transform: translateX(100%);
|
|
92
|
+
--context-menu-wrap-transform-left: translateX(0);
|
|
93
|
+
--context-menu-wrap-left: unset;
|
|
94
|
+
--context-menu-wrap-right: 100%;
|
|
95
|
+
}
|
|
96
|
+
</style>
|
|
97
|
+
<style scoped lang="scss">
|
|
98
|
+
.loader-wrapper {
|
|
99
|
+
width: 100%;
|
|
100
|
+
height: 100%;
|
|
101
|
+
z-index: var(--z-fixed);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.context-menu__loading {
|
|
105
|
+
:deep(.spinner) {
|
|
106
|
+
width: 45px;
|
|
107
|
+
height: 45px;
|
|
108
|
+
min-width: 45px;
|
|
109
|
+
min-height: 45px;
|
|
110
|
+
z-index: var(--z-fixed);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
.context-wrap {
|
|
114
|
+
width: auto;
|
|
115
|
+
max-width: 400px;
|
|
116
|
+
background: var(--global-bg-color);
|
|
117
|
+
border-radius: 0;
|
|
118
|
+
color: #333;
|
|
119
|
+
border: 1px solid var(--context-menu-border-color);
|
|
120
|
+
user-select: none;
|
|
121
|
+
list-style: none;
|
|
122
|
+
max-height: 100vh;
|
|
123
|
+
overflow-y: auto;
|
|
124
|
+
|
|
125
|
+
.menu-item {
|
|
126
|
+
position: relative;
|
|
127
|
+
color: #565656;
|
|
128
|
+
border-bottom: 1px solid transparent;
|
|
129
|
+
cursor: pointer;
|
|
130
|
+
padding: 5px 0 3px;
|
|
131
|
+
|
|
132
|
+
&.has-border-top {
|
|
133
|
+
border-top: 1px solid var(--context-menu-inset-border-color);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&.item-header {
|
|
137
|
+
font-size: 11px;
|
|
138
|
+
background-color: var(--context-menu-item-header-color);
|
|
139
|
+
cursor: default;
|
|
140
|
+
}
|
|
141
|
+
&:not(.item-header):not(.disabled):hover {
|
|
142
|
+
background-color: var(--context-menu-hover-bg-color);
|
|
143
|
+
color: #454545;
|
|
144
|
+
border-bottom: 1px solid var(--context-menu-hover-border-color);
|
|
145
|
+
}
|
|
146
|
+
&.disabled {
|
|
147
|
+
opacity: 0.5;
|
|
148
|
+
user-select: none;
|
|
149
|
+
cursor: default;
|
|
150
|
+
}
|
|
151
|
+
&.left {
|
|
152
|
+
:deep(.context-children) {
|
|
153
|
+
left: var(--context-menu-wrap-left);
|
|
154
|
+
right: var(--context-menu-wrap-right);
|
|
155
|
+
|
|
156
|
+
.context-wrap {
|
|
157
|
+
transform: var(--context-menu-wrap-transform-left);
|
|
158
|
+
left: auto;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.context-link {
|
|
164
|
+
position: relative;
|
|
165
|
+
overflow: hidden;
|
|
166
|
+
text-overflow: ellipsis;
|
|
167
|
+
white-space: nowrap;
|
|
168
|
+
display: flex;
|
|
169
|
+
align-items: center;
|
|
170
|
+
user-select: none;
|
|
171
|
+
padding: 3px 20px 4px 10px;
|
|
172
|
+
|
|
173
|
+
.menu-item-text {
|
|
174
|
+
flex: 1 1 0;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.context-icon {
|
|
178
|
+
display: inline-block;
|
|
179
|
+
margin: -2px 4px 0 0;
|
|
180
|
+
vertical-align: middle;
|
|
181
|
+
width: 18px;
|
|
182
|
+
height: 18px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.arrow-icon {
|
|
186
|
+
position: absolute;
|
|
187
|
+
top: 50%;
|
|
188
|
+
margin-top: -8px;
|
|
189
|
+
right: 4px;
|
|
190
|
+
background-image: url('assets/img/icons/sprite.png');
|
|
191
|
+
display: inline-block;
|
|
192
|
+
width: 16px;
|
|
193
|
+
height: 16px;
|
|
194
|
+
overflow: hidden;
|
|
195
|
+
background-repeat: no-repeat;
|
|
196
|
+
font-size: 0;
|
|
197
|
+
line-height: 0;
|
|
198
|
+
text-align: center;
|
|
199
|
+
transform: rotate(90deg);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.shortcut {
|
|
203
|
+
padding-left: 10px;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.context-children {
|
|
208
|
+
position: absolute;
|
|
209
|
+
top: 0;
|
|
210
|
+
left: 100%;
|
|
211
|
+
|
|
212
|
+
.context-wrap {
|
|
213
|
+
position: fixed;
|
|
214
|
+
transform: var(--context-menu-wrap-transform);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
.context-menu__loading {
|
|
220
|
+
:deep(.spinner) {
|
|
221
|
+
width: 45px;
|
|
222
|
+
height: 45px;
|
|
223
|
+
min-width: 45px;
|
|
224
|
+
min-height: 45px;
|
|
225
|
+
z-index: var(--z-fixed);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
</style>
|