{"version":3,"file":"position.mjs","names":["computed","getCurrentInstanceName","propsFactory","positionValues","makePositionProps","position","type","String","validator","v","includes","usePosition","props","name","arguments","length","undefined","positionClasses"],"sources":["../../src/composables/position.ts"],"sourcesContent":["// Utilities\nimport { computed } from 'vue'\nimport { getCurrentInstanceName, propsFactory } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\n\nconst positionValues = ['static', 'relative', 'fixed', 'absolute', 'sticky'] as const\n\ntype Position = typeof positionValues[number]\n\nexport interface PositionProps {\n position: Position | undefined\n}\n\n// Composables\nexport const makePositionProps = propsFactory({\n position: {\n type: String as PropType,\n validator: /* istanbul ignore next */ (v: any) => positionValues.includes(v),\n },\n}, 'position')\n\nexport function usePosition (\n props: PositionProps,\n name = getCurrentInstanceName(),\n) {\n const positionClasses = computed(() => {\n return props.position ? `${name}--${props.position}` : undefined\n })\n\n return { positionClasses }\n}\n"],"mappings":"AAAA;AACA,SAASA,QAAQ,QAAQ,KAAK;AAAA,SACrBC,sBAAsB,EAAEC,YAAY,6BAE7C;AAGA,MAAMC,cAAc,GAAG,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAU;AAQrF;AACA,OAAO,MAAMC,iBAAiB,GAAGF,YAAY,CAAC;EAC5CG,QAAQ,EAAE;IACRC,IAAI,EAAEC,MAA4B;IAClCC,SAAS,EAAE,0BAA4BC,CAAM,IAAKN,cAAc,CAACO,QAAQ,CAACD,CAAC;EAC7E;AACF,CAAC,EAAE,UAAU,CAAC;AAEd,OAAO,SAASE,WAAWA,CACzBC,KAAoB,EAEpB;EAAA,IADAC,IAAI,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGb,sBAAsB,EAAE;EAE/B,MAAMgB,eAAe,GAAGjB,QAAQ,CAAC,MAAM;IACrC,OAAOY,KAAK,CAACP,QAAQ,GAAI,GAAEQ,IAAK,KAAID,KAAK,CAACP,QAAS,EAAC,GAAGW,SAAS;EAClE,CAAC,CAAC;EAEF,OAAO;IAAEC;EAAgB,CAAC;AAC5B"}