bootstrap-vue-next
Version:
Seamless integration of Vue 3, Bootstrap 5, and TypeScript for modern, type-safe UI development
28 lines (27 loc) • 1.01 kB
JavaScript
//#region src/utils/registryAccess.ts
/**
* Gets the active show/hide instance for a given ID.
* Uses getActive() which returns the most recent instance to handle UID disambiguation.
*
* @param registry - The show/hide registry ref (or null)
* @param id - The component ID to look up (or falsy value)
* @returns The active show/hide instance, undefined if not found, or null if id is falsy
*/
var getActiveShowHide = (registry, id) => {
if (!id) return null;
if (!registry) return void 0;
return registry.value.get(id)?.getActive();
};
/**
* Gets the boolean visibility state of a show/hide component.
*
* @param registry - The show/hide registry ref (or null)
* @param id - The component ID to look up
* @returns The visibility state (true if shown), or false if not found
*/
var getShowHideValue = (registry, id) => {
return getActiveShowHide(registry, id)?.value.value ?? false;
};
//#endregion
export { getShowHideValue as n, getActiveShowHide as t };
//# sourceMappingURL=registryAccess-BO4rk3Sm.mjs.map