feat: add Fieldset and SearchField infrastructure
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { computed, inject, type ComputedRef, type InjectionKey } from "vue";
|
||||
|
||||
/** Semantic disabled scope, including controls with no native disabled attribute. */
|
||||
export const disabledContextKey: InjectionKey<ComputedRef<boolean>> =
|
||||
Symbol("HeroUIVue.Disabled");
|
||||
export function useInheritedDisabled(local: () => unknown = () => false) {
|
||||
const parent = inject(disabledContextKey, undefined);
|
||||
return computed(() => Boolean(local() || parent?.value));
|
||||
}
|
||||
Reference in New Issue
Block a user