@xen-orchestra/web-core 0.20.1 → 0.22.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 (116) hide show
  1. package/lib/assets/css/_typography.pcss +6 -0
  2. package/lib/assets/no-selection-old.svg +70 -0
  3. package/lib/assets/no-selection.svg +85 -70
  4. package/lib/components/backup-state/VtsBackupState.vue +20 -17
  5. package/lib/components/card/VtsCardRowKeyValue.vue +4 -0
  6. package/lib/components/cell-object/VtsCellObject.vue +4 -1
  7. package/lib/components/console/VtsActionsConsole.vue +7 -4
  8. package/lib/components/console/VtsClipboardConsole.vue +9 -6
  9. package/lib/components/copy-button/VtsCopyButton.vue +9 -15
  10. package/lib/components/dropdown/DropdownTitle.vue +5 -2
  11. package/lib/components/icon/NewVtsIcon.vue +49 -0
  12. package/lib/components/input-group/VtsInputGroup.vue +41 -0
  13. package/lib/components/input-wrapper/VtsInputWrapper.vue +2 -2
  14. package/lib/components/layout/VtsLayoutSidebar.vue +6 -3
  15. package/lib/components/linear-chart/VtsLinearChart.vue +4 -0
  16. package/lib/components/object-icon/VtsObjectIcon.vue +22 -0
  17. package/lib/components/quick-info-card/VtsQuickInfoCard.vue +4 -1
  18. package/lib/components/select/VtsOption.vue +10 -6
  19. package/lib/components/select/VtsSelect.vue +74 -50
  20. package/lib/components/state-hero/VtsAllDoneHero.vue +4 -1
  21. package/lib/components/state-hero/VtsAllGoodHero.vue +4 -1
  22. package/lib/components/state-hero/VtsComingSoonHero.vue +4 -1
  23. package/lib/components/state-hero/VtsErrorNoDataHero.vue +4 -1
  24. package/lib/components/state-hero/VtsLoadingHero.vue +4 -1
  25. package/lib/components/state-hero/VtsNoDataHero.vue +4 -1
  26. package/lib/components/state-hero/VtsNoSelectionHero.vue +4 -1
  27. package/lib/components/state-hero/VtsObjectNotFoundHero.vue +4 -1
  28. package/lib/components/state-hero/VtsOfflineHero.vue +4 -1
  29. package/lib/components/state-hero/VtsPageNotFoundHero.vue +4 -1
  30. package/lib/components/table/ColumnTitle.vue +2 -2
  31. package/lib/components/task/VtsQuickTaskButton.vue +4 -1
  32. package/lib/components/task/VtsQuickTaskList.vue +5 -2
  33. package/lib/components/task/VtsQuickTaskTabBar.vue +8 -5
  34. package/lib/components/ui/card-numbers/UiCardNumbers.vue +4 -1
  35. package/lib/components/ui/character-limit/UiCharacterLimit.vue +4 -1
  36. package/lib/components/ui/input/UiInput.vue +2 -2
  37. package/lib/components/ui/label/UiLabel.vue +4 -1
  38. package/lib/components/ui/panel/UiPanel.vue +16 -3
  39. package/lib/components/ui/progress-bar/UiProgressBar.vue +5 -2
  40. package/lib/components/ui/query-search-bar/UiQuerySearchBar.vue +9 -6
  41. package/lib/components/ui/quick-task-item/UiQuickTaskItem.vue +6 -3
  42. package/lib/components/ui/quoteCode/UiQuoteCode.vue +104 -0
  43. package/lib/components/ui/stacked-bar/StackedBarSegment.vue +4 -1
  44. package/lib/components/ui/table-pagination/UiTablePagination.vue +6 -3
  45. package/lib/components/ui/text-area/UiTextarea.vue +4 -1
  46. package/lib/components/ui/top-bottom-table/UiTopBottomTable.vue +6 -3
  47. package/lib/components/ui/tree-item-label/UiTreeItemLabel.vue +4 -1
  48. package/lib/composables/local-time-ago.composable.ts +53 -0
  49. package/lib/composables/locale-time-ago.composable.ts +53 -0
  50. package/lib/icons/fa-icons.ts +164 -0
  51. package/lib/icons/index.ts +15 -0
  52. package/lib/icons/legacy-icons.ts +80 -0
  53. package/lib/icons/object-icons.ts +187 -0
  54. package/lib/layouts/CoreLayout.vue +7 -3
  55. package/lib/locales/cs.json +0 -1
  56. package/lib/locales/de.json +1 -1
  57. package/lib/locales/en.json +40 -4
  58. package/lib/locales/es.json +1 -1
  59. package/lib/locales/fr.json +39 -3
  60. package/lib/locales/it.json +1 -1
  61. package/lib/locales/nl.json +1 -1
  62. package/lib/locales/ru.json +1 -1
  63. package/lib/locales/sv.json +1 -2
  64. package/lib/packages/collection/README.md +23 -18
  65. package/lib/packages/collection/create-collection.ts +22 -21
  66. package/lib/packages/collection/create-item.ts +21 -20
  67. package/lib/packages/collection/create-use-subset.ts +23 -0
  68. package/lib/packages/collection/guess-item-id.ts +26 -16
  69. package/lib/packages/collection/index.ts +4 -0
  70. package/lib/packages/collection/types.ts +65 -37
  71. package/lib/packages/collection/use-collection.ts +68 -18
  72. package/lib/packages/collection/use-flag-registry.ts +38 -17
  73. package/lib/packages/form-select/guess-label.ts +45 -0
  74. package/lib/packages/form-select/guess-value.ts +23 -0
  75. package/lib/packages/form-select/index.ts +6 -0
  76. package/lib/packages/form-select/normalize-search-term.ts +11 -0
  77. package/lib/packages/form-select/types.ts +90 -42
  78. package/lib/packages/form-select/use-form-option-controller.ts +7 -3
  79. package/lib/packages/form-select/use-form-select-controller.ts +38 -27
  80. package/lib/packages/form-select/use-form-select-keyboard-navigation.ts +1 -1
  81. package/lib/packages/form-select/use-form-select.ts +308 -130
  82. package/lib/packages/icon/DisplayIcon.vue +25 -0
  83. package/lib/packages/icon/DisplayIconAny.vue +16 -0
  84. package/lib/packages/icon/DisplayIconSingle.vue +35 -0
  85. package/lib/packages/icon/DisplayIconStack.vue +34 -0
  86. package/lib/packages/icon/README.md +286 -0
  87. package/lib/packages/icon/create-icon-bindings.ts +27 -0
  88. package/lib/packages/icon/define-icon-pack.ts +23 -0
  89. package/lib/packages/icon/define-icon-single.ts +17 -0
  90. package/lib/packages/icon/define-icon-stack.ts +20 -0
  91. package/lib/packages/icon/define-icon.ts +40 -0
  92. package/lib/packages/icon/generate-icon-variants.ts +17 -0
  93. package/lib/packages/icon/index.ts +8 -0
  94. package/lib/packages/icon/is-icon-stack.ts +5 -0
  95. package/lib/packages/icon/merge-icons.ts +25 -0
  96. package/lib/packages/icon/merge-transforms.ts +12 -0
  97. package/lib/packages/icon/normalize-icon.ts +25 -0
  98. package/lib/packages/icon/to-tuple.ts +7 -0
  99. package/lib/packages/icon/types.ts +72 -0
  100. package/lib/packages/job/README.md +2 -2
  101. package/lib/packages/mapper/README.md +166 -0
  102. package/lib/packages/mapper/convert-to-map.ts +5 -0
  103. package/lib/packages/mapper/create-mapper.ts +30 -0
  104. package/lib/packages/mapper/index.ts +4 -0
  105. package/lib/packages/mapper/types.ts +1 -0
  106. package/lib/packages/mapper/use-mapper.ts +31 -0
  107. package/lib/stores/sidebar.store.ts +1 -1
  108. package/lib/types/chart.ts +2 -2
  109. package/lib/types/utility.type.ts +9 -0
  110. package/lib/utils/object.util.ts +16 -0
  111. package/lib/utils/size.util.ts +14 -3
  112. package/package.json +2 -1
  113. package/lib/assets/zoom.svg +0 -85
  114. package/lib/components/backup-item/VtsBackupItem.vue +0 -47
  115. package/lib/composables/mapper.composable.md +0 -74
  116. package/lib/composables/mapper.composable.ts +0 -18
@@ -0,0 +1,41 @@
1
+ <template>
2
+ <div class="vts-input-group">
3
+ <slot />
4
+ </div>
5
+ </template>
6
+
7
+ <style lang="postcss" scoped>
8
+ .vts-input-group {
9
+ display: flex;
10
+ align-items: center;
11
+
12
+ :slotted(> .ui-input),
13
+ :slotted(> .vts-select) {
14
+ &:hover {
15
+ z-index: 1;
16
+ }
17
+
18
+ &:focus-within {
19
+ z-index: 2;
20
+ }
21
+
22
+ &:not(:first-child) {
23
+ margin-left: -1px;
24
+
25
+ &,
26
+ .ui-input {
27
+ border-start-start-radius: 0;
28
+ border-end-start-radius: 0;
29
+ }
30
+ }
31
+
32
+ &:not(:last-child) {
33
+ &,
34
+ .ui-input {
35
+ border-start-end-radius: 0;
36
+ border-end-end-radius: 0;
37
+ }
38
+ }
39
+ }
40
+ }
41
+ </style>
@@ -20,8 +20,8 @@
20
20
  <script lang="ts" setup>
21
21
  import UiInfo, { type InfoAccent } from '@core/components/ui/info/UiInfo.vue'
22
22
  import UiLabel, { type LabelAccent } from '@core/components/ui/label/UiLabel.vue'
23
- import { useMapper } from '@core/composables/mapper.composable'
24
23
  import { useRanked } from '@core/composables/ranked.composable.ts'
24
+ import { useMapper } from '@core/packages/mapper/use-mapper.ts'
25
25
  import type { MaybeArray } from '@core/types/utility.type'
26
26
  import { IK_INPUT_WRAPPER_CONTROLLER } from '@core/utils/injection-keys.util'
27
27
  import { toArray } from '@core/utils/to-array.utils'
@@ -70,7 +70,7 @@ const labelAccent = useMapper<InfoAccent, LabelAccent>(
70
70
  danger: 'danger',
71
71
  muted: 'neutral',
72
72
  },
73
- 'neutral'
73
+ 'info'
74
74
  )
75
75
 
76
76
  const wrapperController = reactive({
@@ -6,12 +6,12 @@
6
6
  <div v-if="!ui.isMobile" class="lock">
7
7
  <UiButtonIcon
8
8
  v-tooltip="{
9
- content: sidebar.isLocked ? $t('core.sidebar.unlock') : $t('core.sidebar.lock'),
9
+ content: sidebar.isLocked ? t('core.sidebar.unlock') : t('core.sidebar.lock'),
10
10
  placement: 'right',
11
11
  }"
12
12
  accent="brand"
13
13
  size="medium"
14
- :icon="sidebar.isLocked ? faLock : faLockOpen"
14
+ :icon="sidebar.isLocked ? faThumbTackSlash : faThumbTack"
15
15
  @click="sidebar.toggleLock()"
16
16
  />
17
17
  </div>
@@ -38,7 +38,8 @@ import UiButtonIcon from '@core/components/ui/button-icon/UiButtonIcon.vue'
38
38
  import { vTooltip } from '@core/directives/tooltip.directive'
39
39
  import { useSidebarStore } from '@core/stores/sidebar.store'
40
40
  import { useUiStore } from '@core/stores/ui.store'
41
- import { faLock, faLockOpen } from '@fortawesome/free-solid-svg-icons'
41
+ import { faThumbTack, faThumbTackSlash } from '@fortawesome/free-solid-svg-icons'
42
+ import { useI18n } from 'vue-i18n'
42
43
 
43
44
  const slots = defineSlots<{
44
45
  default(): any
@@ -46,6 +47,8 @@ const slots = defineSlots<{
46
47
  footer?(): any
47
48
  }>()
48
49
 
50
+ const { t } = useI18n()
51
+
49
52
  const sidebar = useSidebarStore()
50
53
  const ui = useUiStore()
51
54
  </script>
@@ -29,6 +29,10 @@ const valueFormatter = computed<ValueFormatter>(() => {
29
29
  const formatter = _valueFormatter
30
30
 
31
31
  return value => {
32
+ if (value === null) {
33
+ return ''
34
+ }
35
+
32
36
  if (formatter === undefined) {
33
37
  return value.toString()
34
38
  }
@@ -0,0 +1,22 @@
1
+ <template>
2
+ <NewVtsIcon :name="iconName" :size />
3
+ </template>
4
+
5
+ <script generic="TType extends ObjectIconType" lang="ts" setup>
6
+ import NewVtsIcon, { type IconSize } from '@core/components/icon/NewVtsIcon.vue'
7
+ import type { ObjectIconName } from '@core/icons'
8
+ import { computed } from 'vue'
9
+
10
+ export type ObjectIconType = ObjectIconName extends `object:${infer TType}:${string}` ? TType : never
11
+
12
+ export type ObjectIconState<TType extends ObjectIconType> =
13
+ Extract<ObjectIconName, `object:${TType}:${string}`> extends `object:${TType}:${infer TState}` ? TState : never
14
+
15
+ const { type, state } = defineProps<{
16
+ type: TType
17
+ state: ObjectIconState<TType>
18
+ size: IconSize
19
+ }>()
20
+
21
+ const iconName = computed(() => `object:${type}:${state}` as ObjectIconName)
22
+ </script>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <UiCard class="vts-quick-info-card">
3
- <UiCardTitle>{{ $t('quick-info') }}</UiCardTitle>
3
+ <UiCardTitle>{{ t('quick-info') }}</UiCardTitle>
4
4
  <VtsLoadingHero v-if="loading" type="card" />
5
5
  <div v-else class="info-container">
6
6
  <slot />
@@ -12,10 +12,13 @@
12
12
  import VtsLoadingHero from '@core/components/state-hero/VtsLoadingHero.vue'
13
13
  import UiCard from '@core/components/ui/card/UiCard.vue'
14
14
  import UiCardTitle from '@core/components/ui/card-title/UiCardTitle.vue'
15
+ import { useI18n } from 'vue-i18n'
15
16
 
16
17
  defineProps<{
17
18
  loading: boolean
18
19
  }>()
20
+
21
+ const { t } = useI18n()
19
22
  </script>
20
23
 
21
24
  <style lang="postcss" scoped>
@@ -1,24 +1,28 @@
1
1
  <template>
2
2
  <UiDropdown
3
3
  ref="elementRef"
4
- :checkbox="option.properties.multiple"
4
+ :accent
5
+ :checkbox="isMultiple"
5
6
  :disabled="option.properties.disabled"
6
7
  :hover="option.flags.active"
7
8
  :selected="option.flags.selected"
8
- accent="normal"
9
9
  >
10
10
  <slot>{{ option.properties.label }}</slot>
11
11
  </UiDropdown>
12
12
  </template>
13
13
 
14
- <script generic="TOption extends FormOption" lang="ts" setup>
15
- import UiDropdown from '@core/components/ui/dropdown/UiDropdown.vue'
16
- import type { FormOption } from '@core/packages/form-select/types.ts'
17
- import { useFormOptionController } from '@core/packages/form-select/use-form-option-controller.ts'
14
+ <script generic="TOption extends FormOption<{ accent?: DropdownAccent }>" lang="ts" setup>
15
+ import UiDropdown, { type DropdownAccent } from '@core/components/ui/dropdown/UiDropdown.vue'
16
+ import { type FormOption, IK_FORM_SELECT_CONTROLLER, useFormOptionController } from '@core/packages/form-select'
17
+ import { computed, inject } from 'vue'
18
18
 
19
19
  const { option } = defineProps<{
20
20
  option: TOption
21
21
  }>()
22
22
 
23
+ const accent = computed(() => option.properties.accent ?? 'normal')
24
+
23
25
  const { elementRef } = useFormOptionController(() => option)
26
+
27
+ const { isMultiple } = inject(IK_FORM_SELECT_CONTROLLER)!
24
28
  </script>
@@ -1,78 +1,101 @@
1
1
  <template>
2
2
  <div :class="className" class="vts-select">
3
- <VtsBackdrop v-if="isOpen" />
4
-
5
3
  <UiInput
6
4
  ref="triggerRef"
7
5
  :accent
6
+ :disabled="isDisabled"
7
+ :icon
8
8
  :model-value="selectedLabel"
9
9
  :placeholder
10
- :required
10
+ :required="isRequired"
11
11
  :right-icon="faAngleDown"
12
12
  readonly
13
13
  />
14
14
 
15
- <UiDropdownList v-if="isOpen" ref="dropdownRef" :style="floatingStyles" class="dropdown-list">
16
- <template v-if="searchTerm !== undefined" #before>
17
- <div class="search-container">
18
- <UiInput
19
- ref="searchRef"
20
- v-model="searchTerm"
21
- :placeholder="searchPlaceholder"
22
- :right-icon="faMagnifyingGlass"
23
- accent="brand"
24
- />
25
- </div>
26
- </template>
27
- <UiDropdown v-if="loading || options.length === 0" accent="normal" disabled>
28
- {{ loading ? t('loading-in-progress') : t('no-results') }}
29
- </UiDropdown>
30
- <template v-for="option of options" :key="option.id">
31
- <slot :option>
32
- <VtsOption :option />
33
- </slot>
34
- </template>
35
- </UiDropdownList>
15
+ <Teleport v-if="isOpen" to="body">
16
+ <VtsBackdrop />
17
+
18
+ <UiDropdownList ref="dropdownRef" :style="floatingStyles" class="dropdown-list">
19
+ <template v-if="isSearchable" #before>
20
+ <div class="search-container">
21
+ <UiInput
22
+ ref="searchRef"
23
+ v-model="searchTerm"
24
+ :placeholder="searchPlaceholder"
25
+ :right-icon="faMagnifyingGlass"
26
+ accent="brand"
27
+ />
28
+ </div>
29
+ </template>
30
+ <UiDropdown v-if="isLoading || options.length === 0" accent="normal" disabled>
31
+ {{ isLoading ? t('loading-in-progress') : t('no-results') }}
32
+ </UiDropdown>
33
+ <template v-for="option of options" :key="option.id">
34
+ <slot :option="option as FormSelectIdToOption<TSelectId>">
35
+ <VtsOption :option />
36
+ </slot>
37
+ </template>
38
+ </UiDropdownList>
39
+ </Teleport>
36
40
  </div>
37
41
  </template>
38
42
 
39
- <script generic="TOption extends FormOption" lang="ts" setup>
43
+ <script generic="TSelectId extends FormSelectId" lang="ts" setup>
40
44
  import VtsBackdrop from '@core/components/backdrop/VtsBackdrop.vue'
41
45
  import VtsOption from '@core/components/select/VtsOption.vue'
42
46
  import UiDropdown from '@core/components/ui/dropdown/UiDropdown.vue'
43
47
  import UiDropdownList from '@core/components/ui/dropdown/UiDropdownList.vue'
44
48
  import UiInput from '@core/components/ui/input/UiInput.vue'
45
- import type { FormOption } from '@core/packages/form-select/types.ts'
46
- import { useFormSelectController } from '@core/packages/form-select/use-form-select-controller.ts'
49
+ import {
50
+ type FormSelect,
51
+ type FormSelectId,
52
+ type FormSelectIdToOption,
53
+ useFormSelectController,
54
+ } from '@core/packages/form-select'
47
55
  import { toVariants } from '@core/utils/to-variants.util.ts'
56
+ import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
48
57
  import { faAngleDown, faMagnifyingGlass } from '@fortawesome/free-solid-svg-icons'
49
- import { computed } from 'vue'
58
+ import { useCurrentElement, useElementSize } from '@vueuse/core'
59
+ import { computed, inject } from 'vue'
50
60
  import { useI18n } from 'vue-i18n'
51
61
 
52
- const { accent, options, selectedLabel } = defineProps<{
62
+ const { accent, id } = defineProps<{
53
63
  accent: 'brand' | 'warning' | 'danger'
54
- options: TOption[]
55
- selectedLabel: string
56
- required?: boolean
57
- placeholder?: string
58
- searchPlaceholder?: string
59
- loading?: boolean
64
+ id: TSelectId
65
+ icon?: IconDefinition
60
66
  }>()
61
67
 
62
- const searchTerm = defineModel<string>('search')
63
-
64
68
  defineSlots<{
65
- default(props: { option: TOption }): any
69
+ default(props: { option: FormSelectIdToOption<TSelectId> }): any
66
70
  }>()
67
71
 
68
72
  const { t } = useI18n()
69
73
 
70
- const { triggerRef, dropdownRef, searchRef, isOpen, floatingStyles } = useFormSelectController({
71
- options: () => options,
74
+ const select = inject(id)
75
+
76
+ if (!select) {
77
+ throw new Error(`No select configuration has been found for this ID`)
78
+ }
79
+
80
+ const {
81
+ options,
72
82
  searchTerm,
73
- })
83
+ selectedLabel,
84
+ isSearchable,
85
+ isDisabled,
86
+ isRequired,
87
+ placeholder,
88
+ searchPlaceholder,
89
+ isLoading,
90
+ } = select as FormSelect
91
+
92
+ const { triggerRef, dropdownRef, searchRef, isOpen, floatingStyles } = useFormSelectController(select as FormSelect)
74
93
 
75
94
  const className = computed(() => toVariants({ accent }))
95
+
96
+ const { width } = useElementSize(useCurrentElement())
97
+
98
+ const minWidth = computed(() => `${width.value}px`)
76
99
  </script>
77
100
 
78
101
  <style lang="postcss" scoped>
@@ -80,17 +103,18 @@ const className = computed(() => toVariants({ accent }))
80
103
  .ui-input:deep(input) {
81
104
  cursor: default;
82
105
  }
106
+ }
83
107
 
84
- .dropdown-list {
85
- min-width: 40rem;
86
- max-height: 36.2rem; /* 8 Dropdown items */
87
- overflow: auto;
88
- z-index: 1020;
108
+ /* Teleported */
109
+ .dropdown-list {
110
+ min-width: v-bind(minWidth);
111
+ max-height: 36.2rem; /* 8 Dropdown items */
112
+ overflow: auto;
113
+ z-index: 1020;
89
114
 
90
- .search-container {
91
- background-color: var(--color-neutral-background-primary);
92
- padding: 0.4rem;
93
- }
115
+ .search-container {
116
+ background-color: var(--color-neutral-background-primary);
117
+ padding: 0.4rem;
94
118
  }
95
119
  }
96
120
  </style>
@@ -1,13 +1,16 @@
1
1
  <template>
2
2
  <VtsStateHero :type class="vts-all-done-hero" image="all-done">
3
- {{ $t('all-done') }}
3
+ {{ t('all-done') }}
4
4
  </VtsStateHero>
5
5
  </template>
6
6
 
7
7
  <script lang="ts" setup>
8
8
  import VtsStateHero, { type StateHeroType } from '@core/components/state-hero/VtsStateHero.vue'
9
+ import { useI18n } from 'vue-i18n'
9
10
 
10
11
  defineProps<{
11
12
  type: StateHeroType
12
13
  }>()
14
+
15
+ const { t } = useI18n()
13
16
  </script>
@@ -1,13 +1,16 @@
1
1
  <template>
2
2
  <VtsStateHero :type class="vts-all-good-hero" image="all-good">
3
- {{ $t('all-good') }}
3
+ {{ t('all-good') }}
4
4
  </VtsStateHero>
5
5
  </template>
6
6
 
7
7
  <script lang="ts" setup>
8
8
  import VtsStateHero, { type StateHeroType } from '@core/components/state-hero/VtsStateHero.vue'
9
+ import { useI18n } from 'vue-i18n'
9
10
 
10
11
  defineProps<{
11
12
  type: StateHeroType
12
13
  }>()
14
+
15
+ const { t } = useI18n()
13
16
  </script>
@@ -1,13 +1,16 @@
1
1
  <template>
2
2
  <VtsStateHero :type class="vts-coming-soon-hero" image="under-construction">
3
- {{ $t('coming-soon') }}
3
+ {{ t('coming-soon') }}
4
4
  </VtsStateHero>
5
5
  </template>
6
6
 
7
7
  <script lang="ts" setup>
8
8
  import VtsStateHero, { type StateHeroType } from '@core/components/state-hero/VtsStateHero.vue'
9
+ import { useI18n } from 'vue-i18n'
9
10
 
10
11
  defineProps<{
11
12
  type: StateHeroType
12
13
  }>()
14
+
15
+ const { t } = useI18n()
13
16
  </script>
@@ -1,11 +1,14 @@
1
1
  <template>
2
- <VtsStateHero class="vts-error-hero" image="error" :type>{{ $t('error-no-data') }}</VtsStateHero>
2
+ <VtsStateHero class="vts-error-hero" image="error" :type>{{ t('error-no-data') }}</VtsStateHero>
3
3
  </template>
4
4
 
5
5
  <script lang="ts" setup>
6
6
  import VtsStateHero, { type StateHeroType } from '@core/components/state-hero/VtsStateHero.vue'
7
+ import { useI18n } from 'vue-i18n'
7
8
 
8
9
  defineProps<{
9
10
  type: StateHeroType
10
11
  }>()
12
+
13
+ const { t } = useI18n()
11
14
  </script>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="vts-loading-hero">
3
3
  <VtsStateHero :type busy>
4
- {{ $t('loading-in-progress') }}
4
+ {{ t('loading-in-progress') }}
5
5
  </VtsStateHero>
6
6
  <div v-if="slots.title || slots.text" class="content">
7
7
  <div v-if="slots.title" class="title" :class="className">
@@ -17,6 +17,7 @@
17
17
  <script lang="ts" setup>
18
18
  import VtsStateHero, { type StateHeroType } from '@core/components/state-hero/VtsStateHero.vue'
19
19
  import { computed } from 'vue'
20
+ import { useI18n } from 'vue-i18n'
20
21
 
21
22
  const { type } = defineProps<{
22
23
  type: StateHeroType
@@ -27,6 +28,8 @@ const slots = defineSlots<{
27
28
  text?(): any
28
29
  }>()
29
30
 
31
+ const { t } = useI18n()
32
+
30
33
  const className = computed(() => (type === 'page' ? 'typo-h1' : 'typo-h2'))
31
34
  </script>
32
35
 
@@ -1,11 +1,14 @@
1
1
  <template>
2
- <VtsStateHero class="vts-no-data-hero" image="no-data" :type>{{ $t('no-data') }}</VtsStateHero>
2
+ <VtsStateHero class="vts-no-data-hero" image="no-data" :type>{{ t('no-data') }}</VtsStateHero>
3
3
  </template>
4
4
 
5
5
  <script lang="ts" setup>
6
6
  import VtsStateHero, { type StateHeroType } from '@core/components/state-hero/VtsStateHero.vue'
7
+ import { useI18n } from 'vue-i18n'
7
8
 
8
9
  defineProps<{
9
10
  type: StateHeroType
10
11
  }>()
12
+
13
+ const { t } = useI18n()
11
14
  </script>
@@ -1,13 +1,16 @@
1
1
  <template>
2
2
  <VtsStateHero :type class="vts-no-selection-hero" image="no-selection">
3
- {{ $t('select-to-see-details') }}
3
+ {{ t('select-to-see-details') }}
4
4
  </VtsStateHero>
5
5
  </template>
6
6
 
7
7
  <script lang="ts" setup>
8
8
  import VtsStateHero, { type StateHeroType } from '@core/components/state-hero/VtsStateHero.vue'
9
+ import { useI18n } from 'vue-i18n'
9
10
 
10
11
  defineProps<{
11
12
  type: StateHeroType
12
13
  }>()
14
+
15
+ const { t } = useI18n()
13
16
  </script>
@@ -1,14 +1,17 @@
1
1
  <template>
2
2
  <VtsStateHero class="vts-object-not-found-hero" image="no-result" :type>
3
- {{ $t('object-not-found', { id }) }}
3
+ {{ t('object-not-found', { id }) }}
4
4
  </VtsStateHero>
5
5
  </template>
6
6
 
7
7
  <script lang="ts" setup>
8
8
  import VtsStateHero, { type StateHeroType } from '@core/components/state-hero/VtsStateHero.vue'
9
+ import { useI18n } from 'vue-i18n'
9
10
 
10
11
  defineProps<{
11
12
  id: string
12
13
  type: StateHeroType
13
14
  }>()
15
+
16
+ const { t } = useI18n()
14
17
  </script>
@@ -1,13 +1,16 @@
1
1
  <template>
2
2
  <VtsStateHero :type class="vts-offline-hero" image="offline">
3
- {{ $t('offline') }}
3
+ {{ t('offline') }}
4
4
  </VtsStateHero>
5
5
  </template>
6
6
 
7
7
  <script lang="ts" setup>
8
8
  import VtsStateHero, { type StateHeroType } from '@core/components/state-hero/VtsStateHero.vue'
9
+ import { useI18n } from 'vue-i18n'
9
10
 
10
11
  defineProps<{
11
12
  type: StateHeroType
12
13
  }>()
14
+
15
+ const { t } = useI18n()
13
16
  </script>
@@ -1,16 +1,19 @@
1
1
  <template>
2
2
  <VtsStateHero class="vts-page-not-found-hero" image="not-found" :type>
3
3
  <span class="numeric">404</span><br />
4
- {{ $t('page-not-found') }}
4
+ {{ t('page-not-found') }}
5
5
  </VtsStateHero>
6
6
  </template>
7
7
 
8
8
  <script lang="ts" setup>
9
9
  import VtsStateHero, { type StateHeroType } from '@core/components/state-hero/VtsStateHero.vue'
10
+ import { useI18n } from 'vue-i18n'
10
11
 
11
12
  defineProps<{
12
13
  type: StateHeroType
13
14
  }>()
15
+
16
+ const { t } = useI18n()
14
17
  </script>
15
18
 
16
19
  <style lang="postcss" scoped>
@@ -19,14 +19,14 @@
19
19
  <MenuItem
20
20
  v-for="interaction in interactions"
21
21
  :key="interaction.id"
22
- v-tooltip="$t('coming-soon')"
22
+ v-tooltip="t('coming-soon')"
23
23
  :disabled="interaction.disabled"
24
24
  :on-click="() => updateInteraction(interaction)"
25
25
  >
26
26
  <VtsIcon :icon="interaction.icon" accent="current" />
27
27
  {{ interaction.label }}
28
28
  <i v-if="currentInteraction?.id === interaction.id" class="current-interaction typo-body-regular-small">
29
- {{ $t('core.current').toLowerCase() }}
29
+ {{ t('core.current').toLowerCase() }}
30
30
  </i>
31
31
  </MenuItem>
32
32
  </MenuList>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <UiButtonIcon
3
3
  ref="buttonRef"
4
- v-tooltip="{ content: $t('tasks.quick-view'), placement: 'bottom-end' }"
4
+ v-tooltip="{ content: t('tasks.quick-view'), placement: 'bottom-end' }"
5
5
  accent="brand"
6
6
  :dot="hasNewTask"
7
7
  :icon="faBarsProgress"
@@ -24,12 +24,15 @@ import { faBarsProgress } from '@fortawesome/free-solid-svg-icons'
24
24
  import { unrefElement, watchArray, whenever } from '@vueuse/core'
25
25
  import placementJs from 'placement.js'
26
26
  import { computed, nextTick, ref } from 'vue'
27
+ import { useI18n } from 'vue-i18n'
27
28
 
28
29
  const props = defineProps<{
29
30
  tasks: Task[]
30
31
  loading?: boolean
31
32
  }>()
32
33
 
34
+ const { t } = useI18n()
35
+
33
36
  const ids = computed(() => props.tasks.map(task => task.id))
34
37
 
35
38
  const isPanelOpen = ref(false)
@@ -3,11 +3,11 @@
3
3
  <li v-if="loading">
4
4
  <div class="loading">
5
5
  <UiLoader />
6
- <div>{{ $t('loading-in-progress') }}</div>
6
+ <div>{{ t('loading-in-progress') }}</div>
7
7
  </div>
8
8
  </li>
9
9
  <template v-else>
10
- <li v-if="tasks.length === 0" class="typo-body-bold">{{ $t('tasks.no-tasks') }}</li>
10
+ <li v-if="tasks.length === 0" class="typo-body-bold">{{ t('tasks.no-tasks') }}</li>
11
11
  <UiQuickTaskItem v-for="task of tasks" :key="task.id" :task />
12
12
  </template>
13
13
  </ul>
@@ -16,12 +16,15 @@
16
16
  <script lang="ts" setup>
17
17
  import UiLoader from '@core/components/ui/loader/UiLoader.vue'
18
18
  import UiQuickTaskItem, { type Task } from '@core/components/ui/quick-task-item/UiQuickTaskItem.vue'
19
+ import { useI18n } from 'vue-i18n'
19
20
 
20
21
  defineProps<{
21
22
  tasks: Task[]
22
23
  sublist?: boolean
23
24
  loading?: boolean
24
25
  }>()
26
+
27
+ const { t } = useI18n()
25
28
  </script>
26
29
 
27
30
  <style lang="postcss" scoped>