@wikimedia/codex
Version:
Codex Design System for Wikimedia
15 lines (14 loc) • 542 B
TypeScript
import { Ref, ComputedRef } from 'vue';
/**
* Provides a computed ref describing whether the component is disabled.
*
* This is based on two sources:
* 1. The `disabled` prop or attribute of the component itself
* 2. A provided `disabled` value, if there is one
*
* If either of these is true, the component should be disabled.
*
* @param disabledProp The disabled prop or attribute ref
* @return A computed ref with a boolean value
*/
export default function useComputedDisabled(disabledProp: Ref<boolean>): ComputedRef<boolean>;