{"version":3,"file":"rounded.mjs","names":["computed","isRef","getCurrentInstanceName","propsFactory","makeRoundedProps","rounded","type","Boolean","Number","String","default","undefined","tile","useRounded","props","name","arguments","length","roundedClasses","value","classes","push","split"],"sources":["../../src/composables/rounded.ts"],"sourcesContent":["// Utilities\nimport { computed, isRef } from 'vue'\nimport { getCurrentInstanceName, propsFactory } from '@/util'\n\n// Types\nimport type { Ref } from 'vue'\n\ntype RoundedValue = boolean | string | number | null | undefined\n\nexport interface RoundedProps {\n rounded?: RoundedValue\n tile?: boolean\n}\n\ntype RoundedData = {\n roundedClasses: Ref\n}\n\n// Composables\nexport const makeRoundedProps = propsFactory({\n rounded: {\n type: [Boolean, Number, String],\n default: undefined,\n },\n tile: Boolean,\n}, 'rounded')\n\nexport function useRounded (\n props: RoundedProps | Ref,\n name = getCurrentInstanceName(),\n): RoundedData {\n const roundedClasses = computed(() => {\n const rounded = isRef(props) ? props.value : props.rounded\n const tile = isRef(props) ? props.value : props.tile\n const classes: string[] = []\n\n if (rounded === true || rounded === '') {\n classes.push(`${name}--rounded`)\n } else if (\n typeof rounded === 'string' ||\n rounded === 0\n ) {\n for (const value of String(rounded).split(' ')) {\n classes.push(`rounded-${value}`)\n }\n } else if (tile || rounded === false) {\n classes.push('rounded-0')\n }\n\n return classes\n })\n\n return { roundedClasses }\n}\n"],"mappings":"AAAA;AACA,SAASA,QAAQ,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAC5BC,sBAAsB,EAAEC,YAAY,6BAE7C;AAcA;AACA,OAAO,MAAMC,gBAAgB,GAAGD,YAAY,CAAC;EAC3CE,OAAO,EAAE;IACPC,IAAI,EAAE,CAACC,OAAO,EAAEC,MAAM,EAAEC,MAAM,CAAC;IAC/BC,OAAO,EAAEC;EACX,CAAC;EACDC,IAAI,EAAEL;AACR,CAAC,EAAE,SAAS,CAAC;AAEb,OAAO,SAASM,UAAUA,CACxBC,KAAuC,EAE1B;EAAA,IADbC,IAAI,GAAAC,SAAA,CAAAC,MAA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