{"version":3,"file":"dimensions.mjs","names":["computed","convertToUnit","propsFactory","makeDimensionProps","height","Number","String","maxHeight","maxWidth","minHeight","minWidth","width","useDimension","props","dimensionStyles"],"sources":["../../src/composables/dimensions.ts"],"sourcesContent":["// Utilities\nimport { computed } from 'vue'\nimport { convertToUnit, propsFactory } from '@/util'\n\n// Types\nexport interface DimensionProps {\n height?: number | string\n maxHeight?: number | string\n maxWidth?: number | string\n minHeight?: number | string\n minWidth?: number | string\n width?: number | string\n}\n\n// Composables\nexport const makeDimensionProps = propsFactory({\n height: [Number, String],\n maxHeight: [Number, String],\n maxWidth: [Number, String],\n minHeight: [Number, String],\n minWidth: [Number, String],\n width: [Number, String],\n}, 'dimension')\n\nexport function useDimension (props: DimensionProps) {\n const dimensionStyles = computed(() => ({\n height: convertToUnit(props.height),\n maxHeight: convertToUnit(props.maxHeight),\n maxWidth: convertToUnit(props.maxWidth),\n minHeight: convertToUnit(props.minHeight),\n minWidth: convertToUnit(props.minWidth),\n width: convertToUnit(props.width),\n }))\n\n return { dimensionStyles }\n}\n"],"mappings":"AAAA;AACA,SAASA,QAAQ,QAAQ,KAAK;AAAA,SACrBC,aAAa,EAAEC,YAAY,6BAEpC;AAUA;AACA,OAAO,MAAMC,kBAAkB,GAAGD,YAAY,CAAC;EAC7CE,MAAM,EAAE,CAACC,MAAM,EAAEC,MAAM,CAAC;EACxBC,SAAS,EAAE,CAACF,MAAM,EAAEC,MAAM,CAAC;EAC3BE,QAAQ,EAAE,CAACH,MAAM,EAAEC,MAAM,CAAC;EAC1BG,SAAS,EAAE,CAACJ,MAAM,EAAEC,MAAM,CAAC;EAC3BI,QAAQ,EAAE,CAACL,MAAM,EAAEC,MAAM,CAAC;EAC1BK,KAAK,EAAE,CAACN,MAAM,EAAEC,MAAM;AACxB,CAAC,EAAE,WAAW,CAAC;AAEf,OAAO,SAASM,YAAYA,CAAEC,KAAqB,EAAE;EACnD,MAAMC,eAAe,GAAGd,QAAQ,CAAC,OAAO;IACtCI,MAAM,EAAEH,aAAa,CAACY,KAAK,CAACT,MAAM,CAAC;IACnCG,SAAS,EAAEN,aAAa,CAACY,KAAK,CAACN,SAAS,CAAC;IACzCC,QAAQ,EAAEP,aAAa,CAACY,KAAK,CAACL,QAAQ,CAAC;IACvCC,SAAS,EAAER,aAAa,CAACY,KAAK,CAACJ,SAAS,CAAC;IACzCC,QAAQ,EAAET,aAAa,CAACY,KAAK,CAACH,QAAQ,CAAC;IACvCC,KAAK,EAAEV,aAAa,CAACY,KAAK,CAACF,KAAK;EAClC,CAAC,CAAC,CAAC;EAEH,OAAO;IAAEG;EAAgB,CAAC;AAC5B"}