@xen-orchestra/web-core 0.56.0 → 0.58.0

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 (80) hide show
  1. package/lib/assets/css/base.pcss +5 -0
  2. package/lib/components/copy-all-menu-item/VtsCopyAllMenuItem.vue +48 -0
  3. package/lib/components/copy-button/VtsCopyButton.vue +2 -2
  4. package/lib/components/input-wrapper/VtsInputWrapper.vue +2 -2
  5. package/lib/components/layout/VtsLayoutSidebar.vue +116 -43
  6. package/lib/components/menu/MenuItem.vue +9 -1
  7. package/lib/components/menu/MenuList.vue +4 -2
  8. package/lib/components/menu/VtsActionsMenu.vue +24 -24
  9. package/lib/components/modal/VtsActionModal.vue +44 -9
  10. package/lib/components/modal/VtsBlockedModal.vue +1 -1
  11. package/lib/components/modal/VtsDeleteModal.vue +1 -1
  12. package/lib/components/overlay/VtsOverlayButton.vue +35 -0
  13. package/lib/components/overlay/VtsOverlayCancelButton.vue +16 -0
  14. package/lib/components/overlay/VtsOverlayConfirmButton.vue +25 -0
  15. package/lib/components/overlay/VtsOverlayList.vue +82 -0
  16. package/lib/components/progress-bar/VtsProgressBar.vue +5 -3
  17. package/lib/components/select/VtsSelect.vue +0 -3
  18. package/lib/components/space-card/VtsSpaceCard.vue +1 -1
  19. package/lib/components/table/cells/VtsProgressBarCell.vue +1 -1
  20. package/lib/components/table/cells/VtsUserNameCell.vue +29 -0
  21. package/lib/components/task/VtsQuickTaskButton.vue +1 -1
  22. package/lib/components/task/VtsQuickTaskList.vue +1 -1
  23. package/lib/components/tree/VtsTreeItem.vue +4 -4
  24. package/lib/components/ui/head-bar/UiHeadBar.vue +1 -1
  25. package/lib/components/ui/input/UiInput.vue +53 -9
  26. package/lib/components/ui/query-search-bar/UiQuerySearchBar.vue +1 -15
  27. package/lib/components/ui/quick-task-item/UiQuickTaskItem.vue +1 -1
  28. package/lib/components/ui/quick-task-panel/UiQuickTaskPanel.vue +1 -1
  29. package/lib/components/ui/task-item/UiTaskItem.vue +14 -6
  30. package/lib/components/ui/task-list/UiTaskList.vue +1 -1
  31. package/lib/components/ui/text-area/UiTextarea.vue +12 -14
  32. package/lib/components/ui/tree-item-label/UiTreeItemLabel.vue +34 -14
  33. package/lib/components/vif-connection-toggle-modal/VtsVifConnectionToggleModal.vue +43 -0
  34. package/lib/composables/copy.composable.ts +6 -0
  35. package/lib/composables/table/multi-select.composable.md +33 -0
  36. package/lib/layouts/CoreLayout.vue +74 -62
  37. package/lib/locales/cs.json +50 -2
  38. package/lib/locales/de.json +3 -0
  39. package/lib/locales/en.json +63 -2
  40. package/lib/locales/fr.json +63 -2
  41. package/lib/locales/ko.json +2 -0
  42. package/lib/locales/nl.json +132 -1
  43. package/lib/locales/pt.json +1 -1
  44. package/lib/locales/sk.json +50 -2
  45. package/lib/packages/form-validation/custom-rules/ip-addresses.rule.ts +15 -0
  46. package/lib/packages/form-validation/custom-rules/ip.regex.ts +26 -0
  47. package/lib/packages/form-validation/custom-rules/ipv4-or-cidr.rule.ts +2 -3
  48. package/lib/packages/form-validation/index.ts +2 -0
  49. package/lib/packages/hide-permanently/README.md +60 -0
  50. package/lib/packages/hide-permanently/types.ts +3 -0
  51. package/lib/packages/hide-permanently/use-hide-permanently.ts +15 -0
  52. package/lib/packages/overlay/OverlayComponent.vue +18 -0
  53. package/lib/packages/overlay/README.md +300 -0
  54. package/lib/packages/overlay/create-event-handler.ts +73 -0
  55. package/lib/packages/overlay/injection-keys.ts +3 -0
  56. package/lib/packages/overlay/is-thenable.ts +3 -0
  57. package/lib/packages/overlay/symbols.ts +5 -0
  58. package/lib/packages/overlay/types.ts +95 -0
  59. package/lib/packages/overlay/use-overlay-escape.ts +34 -0
  60. package/lib/packages/overlay/use-overlay-store.ts +38 -0
  61. package/lib/packages/overlay/use-overlay-trigger.ts +33 -0
  62. package/lib/packages/overlay/use-overlay.ts +114 -0
  63. package/lib/packages/progress/use-progress.ts +12 -2
  64. package/lib/packages/remote-resource/define-remote-resource.ts +55 -26
  65. package/lib/packages/remote-resource/sse.store.ts +4 -4
  66. package/lib/packages/sidebar/index.ts +2 -0
  67. package/lib/packages/sidebar/sidebar.store.ts +55 -0
  68. package/lib/packages/sidebar/types.ts +21 -0
  69. package/lib/packages/sidebar/use-sidebar-resize.ts +47 -0
  70. package/lib/packages/sidebar/use-sidebar-responsive-expand.ts +19 -0
  71. package/lib/tables/column-definitions/user-name-column.ts +10 -0
  72. package/lib/tables/column-sets/server-columns.ts +2 -2
  73. package/lib/tables/column-sets/user-columns.ts +16 -0
  74. package/lib/types/object.type.ts +9 -1
  75. package/lib/types/task.type.ts +5 -12
  76. package/lib/utils/injection-keys.util.ts +3 -1
  77. package/lib/utils/ip-address.utils.ts +7 -0
  78. package/lib/utils/sr.utils.ts +4 -0
  79. package/package.json +2 -1
  80. package/lib/stores/sidebar.store.ts +0 -79
@@ -1,79 +0,0 @@
1
- import { useUiStore } from '@core/stores/ui.store'
2
- import { ifElse } from '@core/utils/if-else.utils'
3
- import { useLocalStorage, useRafFn, useStyleTag, useToggle } from '@vueuse/core'
4
- import { defineStore } from 'pinia'
5
- import { computed, ref, watch } from 'vue'
6
-
7
- export const useSidebarStore = defineStore('layout', () => {
8
- const uiStore = useUiStore()
9
- const isExpanded = useLocalStorage('sidebar.expanded', true)
10
- const isLocked = useLocalStorage('sidebar.locked', true)
11
- const width = useLocalStorage('sidebar.width', 350)
12
- const toggleExpand = useToggle(isExpanded)
13
- const toggleLock = useToggle(isLocked)
14
- const isResizing = ref(false)
15
- let desktopState = false
16
-
17
- let initialX: number
18
- let initialWidth: number
19
- let clientX: number
20
-
21
- function startResize(event: MouseEvent) {
22
- clientX = event.clientX
23
- initialX = clientX
24
- initialWidth = width.value
25
- isResizing.value = true
26
- document.addEventListener('mousemove', handleMouseMove)
27
- document.addEventListener('mouseup', handleMouseUp)
28
- }
29
-
30
- function handleMouseMove(event: MouseEvent) {
31
- clientX = event.clientX
32
- }
33
-
34
- function handleMouseUp() {
35
- isResizing.value = false
36
- document.removeEventListener('mousemove', handleMouseMove)
37
- document.removeEventListener('mouseup', handleMouseUp)
38
- }
39
-
40
- const cssWidth = computed(() => (uiStore.isSmall ? '100%' : `${width.value}px`))
41
-
42
- const cssOffset = computed(() => (isExpanded.value ? 0 : `-${cssWidth.value}`))
43
-
44
- const { load, unload } = useStyleTag('body { cursor: col-resize !important; }', { immediate: false })
45
-
46
- const { pause, resume } = useRafFn(
47
- () => (width.value = Math.min(500, Math.max(200, initialWidth + clientX - initialX))),
48
- { immediate: false }
49
- )
50
-
51
- ifElse(isResizing, [load, resume], [pause, unload])
52
-
53
- watch(
54
- () => ({
55
- isSmall: uiStore.isSmall,
56
- isLarge: uiStore.isLarge,
57
- }),
58
- ({ isSmall, isLarge }) => {
59
- if (isSmall) {
60
- desktopState = isExpanded.value
61
- } else {
62
- isExpanded.value = isLarge ? true : desktopState
63
- }
64
- },
65
- { immediate: true }
66
- )
67
-
68
- return {
69
- isExpanded,
70
- isLocked,
71
- width,
72
- toggleExpand,
73
- toggleLock,
74
- startResize,
75
- isResizing,
76
- cssWidth,
77
- cssOffset,
78
- }
79
- })