@xen-orchestra/web-core 0.27.0 → 0.29.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 (81) hide show
  1. package/lib/components/card/VtsCardRowKeyValue.vue +1 -0
  2. package/lib/components/cell-object/VtsCellObject.vue +1 -2
  3. package/lib/components/console/VtsActionsConsole.vue +3 -9
  4. package/lib/components/copy-button/VtsCopyButton.vue +1 -3
  5. package/lib/components/dropdown/DropdownTitle.vue +3 -3
  6. package/lib/components/icon/VtsIcon.vue +32 -76
  7. package/lib/components/input-wrapper/VtsInputWrapper.vue +2 -2
  8. package/lib/components/layout/VtsLayoutSidebar.vue +1 -2
  9. package/lib/components/menu/MenuItem.vue +4 -5
  10. package/lib/components/menu/MenuTrigger.vue +3 -3
  11. package/lib/components/object-icon/VtsObjectIcon.vue +2 -2
  12. package/lib/components/progress-bar/VtsProgressBar.vue +54 -0
  13. package/lib/components/progress-bar-group/VtsProgressBarGroup.vue +76 -0
  14. package/lib/components/resources/VtsResource.vue +3 -3
  15. package/lib/components/select/VtsSelect.vue +4 -5
  16. package/lib/components/table/ColumnTitle.vue +11 -12
  17. package/lib/components/task/VtsQuickTaskButton.vue +1 -2
  18. package/lib/components/tree/VtsTreeLoadingItem.vue +3 -3
  19. package/lib/components/ui/alarm-item/UiAlarmItem.vue +1 -2
  20. package/lib/components/ui/alert/UiAlert.vue +14 -13
  21. package/lib/components/ui/button/UiButton.vue +4 -5
  22. package/lib/components/ui/button-icon/UiButtonIcon.vue +3 -3
  23. package/lib/components/ui/checkbox/UiCheckbox.vue +2 -9
  24. package/lib/components/ui/chip/ChipIcon.vue +3 -3
  25. package/lib/components/ui/chip/ChipRemoveIcon.vue +1 -2
  26. package/lib/components/ui/chip/UiChip.vue +2 -2
  27. package/lib/components/ui/circle-progress-bar/UiCircleProgressBar.vue +7 -4
  28. package/lib/components/ui/data-ruler/UiDataRuler.vue +54 -6
  29. package/lib/components/ui/donut-chart/UiDonutChart.vue +30 -17
  30. package/lib/components/ui/dropdown/UiDropdown.vue +5 -7
  31. package/lib/components/ui/dropdown-button/UiDropdownButton.vue +4 -5
  32. package/lib/components/ui/head-bar/UiHeadBar.vue +6 -11
  33. package/lib/components/ui/info/UiInfo.vue +14 -20
  34. package/lib/components/ui/input/UiInput.vue +6 -7
  35. package/lib/components/ui/label/UiLabel.vue +3 -3
  36. package/lib/components/ui/legend/UiLegend.vue +3 -3
  37. package/lib/components/ui/legend-title/UiLegendTitle.vue +7 -3
  38. package/lib/components/ui/link/UiLink.vue +4 -5
  39. package/lib/components/ui/log-entry-viewer/UiLogEntryViewer.vue +6 -2
  40. package/lib/components/ui/object-link/UiObjectLink.vue +4 -4
  41. package/lib/components/ui/progress-bar/UiProgressBar.vue +14 -70
  42. package/lib/components/ui/query-search-bar/UiQuerySearchBar.vue +3 -4
  43. package/lib/components/ui/quick-task-item/UiQuickTaskItem.vue +3 -4
  44. package/lib/components/ui/radio-button/UiRadioButton.vue +1 -2
  45. package/lib/components/ui/table-pagination/PaginationButton.vue +2 -25
  46. package/lib/components/ui/table-pagination/UiTablePagination.vue +41 -20
  47. package/lib/components/ui/tag/UiTag.vue +3 -3
  48. package/lib/components/ui/text-area/UiTextarea.vue +2 -2
  49. package/lib/components/ui/toaster/UiToaster.vue +15 -13
  50. package/lib/components/ui/tree-item-label/UiTreeItemLabel.vue +4 -5
  51. package/lib/composables/pagination.composable.ts +5 -0
  52. package/lib/i18n.ts +4 -0
  53. package/lib/icons/fa-icons.ts +48 -2
  54. package/lib/icons/index.ts +4 -0
  55. package/lib/icons/legacy-icons.ts +10 -0
  56. package/lib/icons/object-icons.ts +1 -1
  57. package/lib/layouts/CoreLayout.vue +1 -2
  58. package/lib/locales/cs.json +29 -10
  59. package/lib/locales/de.json +70 -7
  60. package/lib/locales/en.json +23 -0
  61. package/lib/locales/es.json +3 -3
  62. package/lib/locales/fr.json +23 -0
  63. package/lib/locales/it.json +17 -5
  64. package/lib/locales/nl.json +28 -10
  65. package/lib/locales/pt_BR.json +67 -0
  66. package/lib/locales/sv.json +17 -0
  67. package/lib/packages/icon/DisplayIcon.vue +1 -0
  68. package/lib/packages/progress/README.md +62 -0
  69. package/lib/packages/progress/types.ts +19 -0
  70. package/lib/packages/progress/use-progress-group.ts +68 -0
  71. package/lib/packages/progress/use-progress.ts +22 -0
  72. package/lib/packages/threshold/README.md +30 -0
  73. package/lib/packages/threshold/type.ts +3 -0
  74. package/lib/packages/threshold/use-threshold.ts +19 -0
  75. package/lib/types/object-icon.type.ts +0 -40
  76. package/lib/utils/progress.util.ts +72 -0
  77. package/lib/utils/size.util.ts +6 -0
  78. package/package.json +1 -1
  79. package/lib/components/icon/NewVtsIcon.vue +0 -49
  80. package/lib/components/ui/complex-icon/UiComplexIcon.vue +0 -45
  81. package/lib/components/ui/object-icon/UiObjectIcon.vue +0 -251
@@ -49,6 +49,7 @@ const slots = defineSlots<{
49
49
  gap: 0.8rem;
50
50
  margin-left: auto;
51
51
  font-size: 1.6rem;
52
+ align-items: center;
52
53
  }
53
54
  }
54
55
  </style>
@@ -9,7 +9,7 @@
9
9
  </span>
10
10
  <UiButton
11
11
  v-if="isSupported && copiableId"
12
- :left-icon="faCopy"
12
+ left-icon="fa:copy"
13
13
  variant="secondary"
14
14
  size="small"
15
15
  accent="brand"
@@ -25,7 +25,6 @@
25
25
  <script lang="ts" setup>
26
26
  import UiButton from '@core/components/ui/button/UiButton.vue'
27
27
  import { vTooltip } from '@core/directives/tooltip.directive'
28
- import { faCopy } from '@fortawesome/free-solid-svg-icons'
29
28
  import { useClipboard } from '@vueuse/core'
30
29
  import { useI18n } from 'vue-i18n'
31
30
 
@@ -5,7 +5,7 @@
5
5
  accent="brand"
6
6
  variant="tertiary"
7
7
  size="medium"
8
- :left-icon="isFullscreen ? faDownLeftAndUpRightToCenter : faUpRightAndDownLeftFromCenter"
8
+ :left-icon="isFullscreen ? 'fa:down-left-and-up-right-to-center' : 'fa:up-right-and-down-left-from-center'"
9
9
  @click="toggleFullScreen"
10
10
  >
11
11
  {{ t(isFullscreen ? 'exit-fullscreen' : 'fullscreen') }}
@@ -15,7 +15,7 @@
15
15
  accent="brand"
16
16
  variant="tertiary"
17
17
  size="medium"
18
- :left-icon="faArrowUpRightFromSquare"
18
+ left-icon="fa:arrow-up-right-from-square"
19
19
  @click="openInNewTab"
20
20
  >
21
21
  {{ t('open-console-in-new-tab') }}
@@ -25,7 +25,7 @@
25
25
  accent="brand"
26
26
  variant="tertiary"
27
27
  size="medium"
28
- :left-icon="faKeyboard"
28
+ left-icon="fa:keyboard"
29
29
  @click="sendCtrlAltDel"
30
30
  >
31
31
  {{ t('send-ctrl-alt-del') }}
@@ -36,12 +36,6 @@
36
36
  import UiButton from '@core/components/ui/button/UiButton.vue'
37
37
  import UiCardTitle from '@core/components/ui/card-title/UiCardTitle.vue'
38
38
  import { useUiStore } from '@core/stores/ui.store'
39
- import {
40
- faArrowUpRightFromSquare,
41
- faDownLeftAndUpRightToCenter,
42
- faKeyboard,
43
- faUpRightAndDownLeftFromCenter,
44
- } from '@fortawesome/free-solid-svg-icons'
45
39
  import { useActiveElement, useMagicKeys, whenever } from '@vueuse/core'
46
40
  import { logicAnd } from '@vueuse/math'
47
41
  import { computed } from 'vue'
@@ -5,8 +5,6 @@
5
5
  <script setup lang="ts">
6
6
  import UiButtonIcon from '@core/components/ui/button-icon/UiButtonIcon.vue'
7
7
  import { vTooltip } from '@core/directives/tooltip.directive'
8
- import { faCopy } from '@fortawesome/free-regular-svg-icons'
9
- import { faCheckCircle } from '@fortawesome/free-solid-svg-icons'
10
8
  import { useClipboard } from '@vueuse/core'
11
9
  import { computed } from 'vue'
12
10
  import { useI18n } from 'vue-i18n'
@@ -19,5 +17,5 @@ const { t } = useI18n()
19
17
 
20
18
  const { copy, copied } = useClipboard({ source: () => value })
21
19
 
22
- const icon = computed(() => (copied.value ? faCheckCircle : faCopy))
20
+ const icon = computed(() => (copied.value ? 'fa:check-circle' : 'fa:copy'))
23
21
  </script>
@@ -4,7 +4,7 @@
4
4
  -->
5
5
  <template>
6
6
  <div class="dropdown-title">
7
- <VtsIcon :icon accent="current" />
7
+ <VtsIcon :name="icon" size="medium" />
8
8
  <div class="label c3 semi-bold">
9
9
  <slot />
10
10
  </div>
@@ -21,12 +21,12 @@
21
21
 
22
22
  <script lang="ts" setup>
23
23
  import VtsIcon from '@core/components/icon/VtsIcon.vue'
24
- import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
24
+ import type { IconName } from '@core/icons'
25
25
  import { useI18n } from 'vue-i18n'
26
26
 
27
27
  withDefaults(
28
28
  defineProps<{
29
- icon?: IconDefinition
29
+ icon?: IconName
30
30
  selected?: 'all' | 'some' | 'none'
31
31
  onToggleSelectAll?: (value: boolean) => void
32
32
  }>(),
@@ -1,100 +1,56 @@
1
- <!-- WIP -->
2
1
  <template>
3
- <UiLoader v-if="busy" class="vts-icon" />
4
- <div v-else-if="overlayIcon !== undefined && icon !== undefined" class="vts-icon stacked" :class="accent">
5
- <FontAwesomeIcon :fixed-width="fixedWidth" :icon />
6
- <FontAwesomeIcon class="overlay-icon" :fixed-width="fixedWidth" :icon="overlayIcon" />
7
- </div>
8
- <FontAwesomeIcon v-else-if="icon !== undefined" :class="accent" :fixed-width="fixedWidth" :icon class="vts-icon" />
2
+ <UiLoader v-if="busy" />
3
+ <DisplayIcon v-else-if="icon" class="vts-icon" :class="className" :icon />
9
4
  </template>
10
5
 
11
6
  <script lang="ts" setup>
12
7
  import UiLoader from '@core/components/ui/loader/UiLoader.vue'
13
- import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
14
- import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
8
+ import { type IconName, icons } from '@core/icons'
9
+ import { DisplayIcon } from '@core/packages/icon'
10
+ import { toVariants } from '@core/utils/to-variants.util.ts'
11
+ import { computed } from 'vue'
15
12
 
16
- export type IconAccent = 'current' | 'brand' | 'info' | 'success' | 'warning' | 'danger' | 'muted'
13
+ export type IconSize = 'small' | 'medium' | 'large' | 'current'
17
14
 
18
- defineProps<{
19
- accent: IconAccent
20
- icon?: IconDefinition
21
- overlayIcon?: IconDefinition
15
+ const { size, name } = defineProps<{
16
+ size: IconSize
17
+ name: IconName | undefined
22
18
  busy?: boolean
23
- fixedWidth?: boolean
24
19
  }>()
25
- </script>
26
-
27
- <style lang="postcss" scoped>
28
- .vts-icon {
29
- &.stacked {
30
- display: inline-grid;
31
- place-items: center;
32
-
33
- svg {
34
- grid-area: 1 / -1;
35
20
 
36
- &:last-child {
37
- font-size: 50%;
38
- }
39
- }
40
- }
41
-
42
- /* COLOR VARIANTS */
43
-
44
- &.current {
45
- color: currentColor;
21
+ const className = computed(() =>
22
+ toVariants({
23
+ size: size === 'current' ? undefined : size,
24
+ })
25
+ )
46
26
 
47
- .overlay-icon {
48
- color: var(--color-neutral-background-primary);
49
- }
27
+ const icon = computed(() => {
28
+ if (!name) {
29
+ return undefined
50
30
  }
51
31
 
52
- &.brand {
53
- color: var(--color-brand-item-base);
32
+ const icon = icons[name]
54
33
 
55
- .overlay-icon {
56
- color: var(--color-brand-txt-item);
57
- }
34
+ if (icon === undefined) {
35
+ console.warn(`Icon "${name}" not found.`)
58
36
  }
59
37
 
60
- &.info {
61
- color: var(--color-info-item-base);
62
-
63
- .overlay-icon {
64
- color: var(--color-info-txt-item);
65
- }
66
- }
67
-
68
- &.success {
69
- color: var(--color-success-item-base);
70
-
71
- .overlay-icon {
72
- color: var(--color-success-txt-item);
73
- }
74
- }
75
-
76
- &.warning {
77
- color: var(--color-warning-item-base);
38
+ return icon
39
+ })
40
+ </script>
78
41
 
79
- .overlay-icon {
80
- color: var(--color-warning-txt-item);
81
- }
42
+ <style lang="postcss" scoped>
43
+ .vts-icon {
44
+ &.size--small {
45
+ font-size: 1.2rem;
82
46
  }
83
47
 
84
- &.danger {
85
- color: var(--color-danger-item-base);
86
-
87
- .overlay-icon {
88
- color: var(--color-danger-txt-item);
89
- }
48
+ &.size--medium {
49
+ font-size: 1.6rem;
90
50
  }
91
51
 
92
- &.muted {
93
- color: var(--color-neutral-background-disabled);
94
-
95
- .overlay-icon {
96
- color: var(--color-neutral-txt-secondary);
97
- }
52
+ &.size--large {
53
+ font-size: 2rem;
98
54
  }
99
55
  }
100
56
  </style>
@@ -21,11 +21,11 @@
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
23
  import { useRanked } from '@core/composables/ranked.composable.ts'
24
+ import type { IconName } from '@core/icons'
24
25
  import { useMapper } from '@core/packages/mapper/use-mapper.ts'
25
26
  import type { MaybeArray } from '@core/types/utility.type'
26
27
  import { IK_INPUT_WRAPPER_CONTROLLER } from '@core/utils/injection-keys.util'
27
28
  import { toArray } from '@core/utils/to-array.utils'
28
- import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
29
29
  import { useArrayMap } from '@vueuse/core'
30
30
  import { provide, reactive, useId } from 'vue'
31
31
 
@@ -40,7 +40,7 @@ export type InputWrapperController = {
40
40
  const { message: _message } = defineProps<{
41
41
  label?: string
42
42
  learnMoreUrl?: string
43
- icon?: IconDefinition
43
+ icon?: IconName
44
44
  message?: InputWrapperMessage
45
45
  }>()
46
46
 
@@ -11,7 +11,7 @@
11
11
  }"
12
12
  accent="brand"
13
13
  size="medium"
14
- :icon="sidebar.isLocked ? faThumbTackSlash : faThumbTack"
14
+ :icon="sidebar.isLocked ? 'fa:thumb-tack-slash' : 'fa:thumb-tack'"
15
15
  @click="sidebar.toggleLock()"
16
16
  />
17
17
  </div>
@@ -38,7 +38,6 @@ 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 { faThumbTack, faThumbTackSlash } from '@fortawesome/free-solid-svg-icons'
42
41
  import { useI18n } from 'vue-i18n'
43
42
 
44
43
  const slots = defineSlots<{
@@ -15,7 +15,7 @@
15
15
  <template #trigger="{ open, isOpen }">
16
16
  <MenuTrigger :active="isOpen" :busy="isBusy" :disabled="isDisabled" :icon @click="open">
17
17
  <slot />
18
- <VtsIcon :fixed-width="false" :icon="submenuIcon" accent="current" class="submenu-icon" />
18
+ <VtsIcon :name="submenuIcon" size="medium" class="submenu-icon" />
19
19
  </MenuTrigger>
20
20
  </template>
21
21
  <slot name="submenu" />
@@ -28,13 +28,12 @@ import VtsIcon from '@core/components/icon/VtsIcon.vue'
28
28
  import MenuList from '@core/components/menu/MenuList.vue'
29
29
  import MenuTrigger from '@core/components/menu/MenuTrigger.vue'
30
30
  import { useDisabled } from '@core/composables/disabled.composable'
31
+ import type { IconName } from '@core/icons'
31
32
  import { IK_CLOSE_MENU, IK_MENU_HORIZONTAL } from '@core/utils/injection-keys.util'
32
- import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
33
- import { faAngleDown, faAngleRight } from '@fortawesome/free-solid-svg-icons'
34
33
  import { computed, inject, ref } from 'vue'
35
34
 
36
35
  const props = defineProps<{
37
- icon?: IconDefinition
36
+ icon?: IconName
38
37
  onClick?: () => any
39
38
  disabled?: boolean
40
39
  busy?: boolean
@@ -46,7 +45,7 @@ const isParentHorizontal = inject(
46
45
  )
47
46
  const isDisabled = useDisabled(() => props.disabled)
48
47
 
49
- const submenuIcon = computed(() => (isParentHorizontal.value ? faAngleDown : faAngleRight))
48
+ const submenuIcon = computed((): IconName => (isParentHorizontal.value ? 'fa:angle-down' : 'fa:angle-right'))
50
49
 
51
50
  const isHandlingClick = ref(false)
52
51
  const isBusy = computed(() => isHandlingClick.value || props.busy === true)
@@ -1,20 +1,20 @@
1
1
  <!-- v1.0 -->
2
2
  <template>
3
3
  <div :class="{ active, disabled }" class="menu-trigger">
4
- <VtsIcon :busy :icon accent="current" />
4
+ <VtsIcon :name="icon" size="medium" :busy />
5
5
  <slot />
6
6
  </div>
7
7
  </template>
8
8
 
9
9
  <script lang="ts" setup>
10
10
  import VtsIcon from '@core/components/icon/VtsIcon.vue'
11
- import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
11
+ import type { IconName } from '@core/icons'
12
12
 
13
13
  defineProps<{
14
14
  active?: boolean
15
15
  busy?: boolean
16
16
  disabled?: boolean
17
- icon?: IconDefinition
17
+ icon?: IconName
18
18
  }>()
19
19
  </script>
20
20
 
@@ -1,9 +1,9 @@
1
1
  <template>
2
- <NewVtsIcon :name="iconName" :size />
2
+ <VtsIcon :name="iconName" :size />
3
3
  </template>
4
4
 
5
5
  <script generic="TType extends ObjectIconType" lang="ts" setup>
6
- import NewVtsIcon, { type IconSize } from '@core/components/icon/NewVtsIcon.vue'
6
+ import VtsIcon, { type IconSize } from '@core/components/icon/VtsIcon.vue'
7
7
  import type { ObjectIconName } from '@core/icons'
8
8
  import { computed } from 'vue'
9
9
 
@@ -0,0 +1,54 @@
1
+ <template>
2
+ <div class="vts-progress-bar">
3
+ <UiDataRuler :max="percentageCap" :warning="threshold.payload" />
4
+ <UiProgressBar :accent="threshold.payload.accent ?? 'info'" :fill-width :legend />
5
+ </div>
6
+ </template>
7
+
8
+ <script generic="TSource" lang="ts" setup>
9
+ import UiDataRuler from '@core/components/ui/data-ruler/UiDataRuler.vue'
10
+ import UiProgressBar, { type ProgressBarAccent } from '@core/components/ui/progress-bar/UiProgressBar.vue'
11
+ import { useProgress } from '@core/packages/progress/use-progress.ts'
12
+ import type { ThresholdConfig } from '@core/packages/threshold/type.ts'
13
+ import { useThreshold } from '@core/packages/threshold/use-threshold.ts'
14
+ import { defaultProgressThresholds, useProgressToLegend } from '@core/utils/progress.util.ts'
15
+
16
+ export type ProgressBarLegendType = 'percent' | 'bytes' | 'bytes-with-total' | 'value' | 'value-with-total'
17
+
18
+ export type ProgressBarThresholdPayload = { accent?: ProgressBarAccent; tooltip?: string }
19
+
20
+ export type ProgressBarThresholdConfig = ThresholdConfig<ProgressBarThresholdPayload>
21
+
22
+ const {
23
+ current,
24
+ total,
25
+ label,
26
+ thresholds = defaultProgressThresholds(),
27
+ legendType,
28
+ } = defineProps<{
29
+ current: number
30
+ total: number
31
+ label: string
32
+ legendType?: ProgressBarLegendType
33
+ thresholds?: ProgressBarThresholdConfig
34
+ }>()
35
+
36
+ const progress = useProgress(
37
+ () => current,
38
+ () => total
39
+ )
40
+
41
+ const { percentageCap, percentage, fillWidth } = progress
42
+
43
+ const legend = useProgressToLegend(() => legendType, label, progress)
44
+
45
+ const threshold = useThreshold(percentage, () => thresholds)
46
+ </script>
47
+
48
+ <style lang="postcss" scoped>
49
+ .vts-progress-bar {
50
+ display: flex;
51
+ flex-direction: column;
52
+ gap: 1.6rem;
53
+ }
54
+ </style>
@@ -0,0 +1,76 @@
1
+ <template>
2
+ <div class="vts-progress-bar-group">
3
+ <UiDataRuler :max="highestPercentageCap" :warning="threshold.payload" />
4
+ <UiProgressBar
5
+ v-for="item of progressItems"
6
+ :key="item.source.id"
7
+ :accent="item.threshold.payload?.accent ?? 'info'"
8
+ :fill-width="item.fillWidth"
9
+ :legend="toLegend(item.source.label, item)"
10
+ />
11
+ </div>
12
+ </template>
13
+
14
+ <script generic="TSource" lang="ts" setup>
15
+ import type {
16
+ ProgressBarLegendType,
17
+ ProgressBarThresholdConfig,
18
+ } from '@core/components/progress-bar/VtsProgressBar.vue'
19
+ import UiDataRuler from '@core/components/ui/data-ruler/UiDataRuler.vue'
20
+ import UiProgressBar from '@core/components/ui/progress-bar/UiProgressBar.vue'
21
+ import { useProgressGroup } from '@core/packages/progress/use-progress-group.ts'
22
+ import { useThreshold } from '@core/packages/threshold/use-threshold.ts'
23
+ import { defaultProgressThresholds, useProgressToLegend } from '@core/utils/progress.util.ts'
24
+ import { computed } from 'vue'
25
+
26
+ export type ProgressBarGroupItem = { id: string; current: number; total: number; label: string }
27
+
28
+ const {
29
+ items,
30
+ thresholds = defaultProgressThresholds(),
31
+ sort = 'desc',
32
+ legendType,
33
+ nItems,
34
+ } = defineProps<{
35
+ items: ProgressBarGroupItem[]
36
+ legendType?: ProgressBarLegendType
37
+ thresholds?: ProgressBarThresholdConfig
38
+ sort?: 'asc' | 'desc' | 'none'
39
+ nItems?: number
40
+ }>()
41
+
42
+ const {
43
+ highestPercentageCap,
44
+ progressItems: rawProgressItems,
45
+ highestPercentage,
46
+ } = useProgressGroup(() => items, {
47
+ sort: () => (sort === 'none' ? undefined : sort),
48
+ })
49
+
50
+ const progressItems = computed(() => {
51
+ const items = rawProgressItems.value.map(item => {
52
+ return {
53
+ ...item,
54
+ threshold: useThreshold(item.percentage, thresholds).value,
55
+ }
56
+ })
57
+
58
+ if (nItems) {
59
+ return items.slice(0, nItems)
60
+ }
61
+
62
+ return items
63
+ })
64
+
65
+ const toLegend = useProgressToLegend(() => legendType)
66
+
67
+ const threshold = useThreshold(highestPercentage, () => thresholds)
68
+ </script>
69
+
70
+ <style lang="postcss" scoped>
71
+ .vts-progress-bar-group {
72
+ display: flex;
73
+ flex-direction: column;
74
+ gap: 1.6rem;
75
+ }
76
+ </style>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <li class="vts-resource">
3
- <VtsIcon accent="brand" :icon class="icon" />
3
+ <VtsIcon :name="icon" size="medium" class="icon" />
4
4
  <div class="separator" />
5
5
  <div class="label typo-h6">{{ label }}</div>
6
6
  <div class="count typo-body-regular-small">{{ count }}</div>
@@ -9,10 +9,10 @@
9
9
 
10
10
  <script lang="ts" setup>
11
11
  import VtsIcon from '@core/components/icon/VtsIcon.vue'
12
- import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
12
+ import type { IconName } from '@core/icons'
13
13
 
14
14
  defineProps<{
15
- icon: IconDefinition
15
+ icon: IconName
16
16
  label: string
17
17
  count: string | number
18
18
  }>()
@@ -8,7 +8,7 @@
8
8
  :model-value="selectedLabel"
9
9
  :placeholder
10
10
  :required="isRequired"
11
- :right-icon="faAngleDown"
11
+ right-icon="fa:angle-down"
12
12
  readonly
13
13
  />
14
14
 
@@ -22,7 +22,7 @@
22
22
  ref="searchRef"
23
23
  v-model="searchTerm"
24
24
  :placeholder="searchPlaceholder"
25
- :right-icon="faMagnifyingGlass"
25
+ right-icon="fa:magnifying-glass"
26
26
  accent="brand"
27
27
  />
28
28
  </div>
@@ -46,6 +46,7 @@ import VtsOption from '@core/components/select/VtsOption.vue'
46
46
  import UiDropdown from '@core/components/ui/dropdown/UiDropdown.vue'
47
47
  import UiDropdownList from '@core/components/ui/dropdown/UiDropdownList.vue'
48
48
  import UiInput from '@core/components/ui/input/UiInput.vue'
49
+ import type { IconName } from '@core/icons'
49
50
  import {
50
51
  type FormSelect,
51
52
  type FormSelectId,
@@ -53,8 +54,6 @@ import {
53
54
  useFormSelectController,
54
55
  } from '@core/packages/form-select'
55
56
  import { toVariants } from '@core/utils/to-variants.util.ts'
56
- import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
57
- import { faAngleDown, faMagnifyingGlass } from '@fortawesome/free-solid-svg-icons'
58
57
  import { useCurrentElement, useElementSize } from '@vueuse/core'
59
58
  import { computed, inject } from 'vue'
60
59
  import { useI18n } from 'vue-i18n'
@@ -62,7 +61,7 @@ import { useI18n } from 'vue-i18n'
62
61
  const { accent, id } = defineProps<{
63
62
  accent: 'brand' | 'warning' | 'danger'
64
63
  id: TSelectId
65
- icon?: IconDefinition
64
+ icon?: IconName
66
65
  }>()
67
66
 
68
67
  defineSlots<{
@@ -9,10 +9,10 @@
9
9
  >
10
10
  <div class="content">
11
11
  <span class="label">
12
- <VtsIcon :icon accent="current" />
12
+ <VtsIcon :name="icon" size="medium" />
13
13
  <slot />
14
14
  </span>
15
- <VtsIcon :icon="currentInteraction?.icon" accent="current" />
15
+ <VtsIcon :name="currentInteraction?.icon" size="medium" />
16
16
  </div>
17
17
  </th>
18
18
  </template>
@@ -23,7 +23,7 @@
23
23
  :disabled="interaction.disabled"
24
24
  :on-click="() => updateInteraction(interaction)"
25
25
  >
26
- <VtsIcon :icon="interaction.icon" accent="current" />
26
+ <VtsIcon :name="interaction.icon" size="medium" />
27
27
  {{ interaction.label }}
28
28
  <i v-if="currentInteraction?.id === interaction.id" class="current-interaction typo-body-regular-small">
29
29
  {{ t('core.current').toLowerCase() }}
@@ -37,8 +37,7 @@ import VtsIcon from '@core/components/icon/VtsIcon.vue'
37
37
  import MenuItem from '@core/components/menu/MenuItem.vue'
38
38
  import MenuList from '@core/components/menu/MenuList.vue'
39
39
  import { vTooltip } from '@core/directives/tooltip.directive'
40
- import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
41
- import { faArrowDown, faArrowUp, faEyeSlash, faFilter, faLayerGroup } from '@fortawesome/free-solid-svg-icons'
40
+ import type { IconName } from '@core/icons'
42
41
  import { noop } from '@vueuse/core'
43
42
  import { computed, inject } from 'vue'
44
43
  import { useI18n } from 'vue-i18n'
@@ -48,14 +47,14 @@ type InteractionId = 'sort-asc' | 'sort-desc' | 'group' | 'filter' | 'hide'
48
47
  type Interaction = {
49
48
  disabled?: boolean
50
49
  id: InteractionId
51
- icon: IconDefinition
50
+ icon: IconName
52
51
  label: string
53
52
  }
54
53
 
55
54
  const props = withDefaults(
56
55
  defineProps<{
57
56
  id?: string
58
- icon?: IconDefinition
57
+ icon?: IconName
59
58
  interactive?: boolean
60
59
  disabled?: boolean
61
60
  }>(),
@@ -68,11 +67,11 @@ const { t } = useI18n()
68
67
  const router = useRouter()
69
68
 
70
69
  const interactions = computed<Interaction[]>(() => [
71
- { id: 'sort-asc', icon: faArrowDown, label: t('core.sort.ascending'), disabled: true },
72
- { id: 'sort-desc', icon: faArrowUp, label: t('core.sort.descending'), disabled: true },
73
- { id: 'group', icon: faLayerGroup, label: t('core.group'), disabled: true },
74
- { id: 'filter', icon: faFilter, label: t('core.filter'), disabled: true },
75
- { id: 'hide', icon: faEyeSlash, label: t('core.hide'), disabled: true },
70
+ { id: 'sort-asc', icon: 'fa:arrow-down', label: t('core.sort.ascending'), disabled: true },
71
+ { id: 'sort-desc', icon: 'fa:arrow-up', label: t('core.sort.descending'), disabled: true },
72
+ { id: 'group', icon: 'fa:layer-group', label: t('core.group'), disabled: true },
73
+ { id: 'filter', icon: 'fa:filter', label: t('core.filter'), disabled: true },
74
+ { id: 'hide', icon: 'fa:eye-slash', label: t('core.hide'), disabled: true },
76
75
  ])
77
76
 
78
77
  const tableName = inject<string>('tableName')
@@ -4,7 +4,7 @@
4
4
  v-tooltip="{ content: t('tasks.quick-view'), placement: 'bottom-end' }"
5
5
  accent="brand"
6
6
  :dot="hasNewTask"
7
- :icon="faBarsProgress"
7
+ icon="fa:bars-progress"
8
8
  size="large"
9
9
  @click="isPanelOpen = true"
10
10
  />
@@ -20,7 +20,6 @@ import UiButtonIcon from '@core/components/ui/button-icon/UiButtonIcon.vue'
20
20
  import type { Task } from '@core/components/ui/quick-task-item/UiQuickTaskItem.vue'
21
21
  import UiQuickTaskPanel from '@core/components/ui/quick-task-panel/UiQuickTaskPanel.vue'
22
22
  import { vTooltip } from '@core/directives/tooltip.directive'
23
- import { faBarsProgress } from '@fortawesome/free-solid-svg-icons'
24
23
  import { unrefElement, watchArray, whenever } from '@vueuse/core'
25
24
  import placementJs from 'placement.js'
26
25
  import { computed, nextTick, ref } from 'vue'
@@ -5,7 +5,7 @@
5
5
  <template v-if="depth > 1">
6
6
  <VtsTreeLine v-for="i in depth - 1" :key="i" :right="i === depth - 1" full-height />
7
7
  </template>
8
- <VtsIcon :icon accent="current" />
8
+ <VtsIcon :name="icon" size="medium" />
9
9
  <div class="loader">&nbsp;</div>
10
10
  </div>
11
11
  </div>
@@ -15,12 +15,12 @@
15
15
  <script lang="ts" setup>
16
16
  import VtsIcon from '@core/components/icon/VtsIcon.vue'
17
17
  import VtsTreeLine from '@core/components/tree/VtsTreeLine.vue'
18
+ import type { IconName } from '@core/icons'
18
19
  import { IK_TREE_LIST_DEPTH } from '@core/utils/injection-keys.util'
19
- import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
20
20
  import { inject } from 'vue'
21
21
 
22
22
  defineProps<{
23
- icon: IconDefinition
23
+ icon: IconName
24
24
  }>()
25
25
 
26
26
  const depth = inject(IK_TREE_LIST_DEPTH, 0)