bootstrap-vue-next
Version:
Seamless integration of Vue 3, Bootstrap 5, and TypeScript for modern, type-safe UI development
1 lines • 1.67 kB
Source Map (JSON)
{"version":3,"file":"registryAccess-CjgwYkQG.mjs","sources":["../src/utils/registryAccess.ts"],"sourcesContent":["import type {Ref} from 'vue'\nimport type {RegisterShowHideInstances, RegisterShowHideMapValue} from './keys'\n\n/**\n * Gets the active show/hide instance for a given ID.\n * Uses getActive() which returns the most recent instance to handle UID disambiguation.\n *\n * @param registry - The show/hide registry ref (or null)\n * @param id - The component ID to look up (or falsy value)\n * @returns The active show/hide instance, undefined if not found, or null if id is falsy\n */\nexport const getActiveShowHide = (\n registry: Ref<Map<string, RegisterShowHideInstances>> | null,\n id: string | undefined\n): RegisterShowHideMapValue | undefined | null => {\n if (!id) return null\n if (!registry) return undefined\n const holder = registry.value.get(id)\n return holder?.getActive()\n}\n\n/**\n * Gets the boolean visibility state of a show/hide component.\n *\n * @param registry - The show/hide registry ref (or null)\n * @param id - The component ID to look up\n * @returns The visibility state (true if shown), or false if not found\n */\nexport const getShowHideValue = (\n registry: Ref<Map<string, RegisterShowHideInstances>> | null,\n id: string\n): boolean => {\n const instance = getActiveShowHide(registry, id)\n return instance?.value.value ?? false\n}\n"],"names":[],"mappings":"AAWO,MAAM,oBAAoB,CAC/B,UACA,OACgD;AAChD,MAAI,CAAC,GAAI,QAAO;AAChB,MAAI,CAAC,SAAU,QAAO;AACtB,QAAM,SAAS,SAAS,MAAM,IAAI,EAAE;AACpC,SAAO,QAAQ,UAAA;AACjB;AASO,MAAM,mBAAmB,CAC9B,UACA,OACY;AACZ,QAAM,WAAW,kBAAkB,UAAU,EAAE;AAC/C,SAAO,UAAU,MAAM,SAAS;AAClC;"}