diff --git a/@xen-orchestra/lite/src/components/RouterTab.vue b/@xen-orchestra/lite/src/components/RouterTab.vue index ba35972099c..95a3615fe59 100644 --- a/@xen-orchestra/lite/src/components/RouterTab.vue +++ b/@xen-orchestra/lite/src/components/RouterTab.vue @@ -13,17 +13,13 @@ diff --git a/@xen-orchestra/lite/src/components/form/FormCheckbox.vue b/@xen-orchestra/lite/src/components/form/FormCheckbox.vue index 313c2a1739a..efd033995d7 100644 --- a/@xen-orchestra/lite/src/components/form/FormCheckbox.vue +++ b/@xen-orchestra/lite/src/components/form/FormCheckbox.vue @@ -16,23 +16,19 @@ -``` - -In the example above, if the `color` prop is not set, the component will use the color context (i.e., if its parent uses a `success` color context, `MyComponent` will be styled with the `success` colors defined in `_context.pcss`). - -If the `color` prop is set, the component will use the prop value to update the context for itself and its descendants. diff --git a/@xen-orchestra/web-core/lib/components/menu/MenuItem.vue b/@xen-orchestra/web-core/lib/components/menu/MenuItem.vue index fd9fb27d288..33de9c364e0 100644 --- a/@xen-orchestra/web-core/lib/components/menu/MenuItem.vue +++ b/@xen-orchestra/web-core/lib/components/menu/MenuItem.vue @@ -27,28 +27,24 @@ import VtsIcon from '@core/components/icon/VtsIcon.vue' import MenuList from '@core/components/menu/MenuList.vue' import MenuTrigger from '@core/components/menu/MenuTrigger.vue' -import { useContext } from '@core/composables/context.composable' -import { DisabledContext } from '@core/context' +import { useDisabled } from '@core/composables/disabled.composable' import { IK_CLOSE_MENU, IK_MENU_HORIZONTAL } from '@core/utils/injection-keys.util' import type { IconDefinition } from '@fortawesome/fontawesome-common-types' import { faAngleDown, faAngleRight } from '@fortawesome/free-solid-svg-icons' import { computed, inject, ref } from 'vue' -const props = withDefaults( - defineProps<{ - icon?: IconDefinition - onClick?: () => any - disabled?: boolean - busy?: boolean - }>(), - { disabled: undefined } -) +const props = defineProps<{ + icon?: IconDefinition + onClick?: () => any + disabled?: boolean + busy?: boolean +}>() const isParentHorizontal = inject( IK_MENU_HORIZONTAL, computed(() => false) ) -const isDisabled = useContext(DisabledContext, () => props.disabled) +const isDisabled = useDisabled(() => props.disabled) const submenuIcon = computed(() => (isParentHorizontal.value ? faAngleDown : faAngleRight)) diff --git a/@xen-orchestra/web-core/lib/components/menu/MenuList.vue b/@xen-orchestra/web-core/lib/components/menu/MenuList.vue index e3e28ee3f87..c2190a6b7e6 100644 --- a/@xen-orchestra/web-core/lib/components/menu/MenuList.vue +++ b/@xen-orchestra/web-core/lib/components/menu/MenuList.vue @@ -9,8 +9,7 @@