1 |
- {"version":3,"file":"rounded.mjs","names":["computed","isRef","getCurrentInstanceName","propsFactory","makeRoundedProps","rounded","type","Boolean","Number","String","default","undefined","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<string[]>\n}\n\n// Composables\nexport const makeRoundedProps = propsFactory({\n rounded: {\n type: [Boolean, Number, String],\n default: undefined,\n },\n}, 'rounded')\n\nexport function useRounded (\n props: RoundedProps | Ref<RoundedValue>,\n name = getCurrentInstanceName(),\n): RoundedData {\n const roundedClasses = computed(() => {\n const rounded = isRef(props) ? props.value : props.rounded\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 }\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;AACF,CAAC,EAAE,SAAS,CAAC;AAEb,OAAO,SAASC,UAAUA,CACxBC,KAAuC,EAE1B;EAAA,IADbC,IAAI,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAJ,SAAA,GAAAI,SAAA,MAAGb,sBAAsB,EAAE;EAE/B,MAAMe,cAAc,GAAGjB,QAAQ,CAAC,MAAM;IACpC,MAAMK,OAAO,GAAGJ,KAAK,CAACY,KAAK,CAAC,GAAGA,KAAK,CAACK,KAAK,GAAGL,KAAK,CAACR,OAAO;IAC1D,MAAMc,OAAiB,GAAG,EAAE;IAE5B,IAAId,OAAO,KAAK,IAAI,IAAIA,OAAO,KAAK,EAAE,EAAE;MACtCc,OAAO,CAACC,IAAI,CAAE,GAAEN,IAAK,WAAU,CAAC;IAClC,CAAC,MAAM,IACL,OAAOT,OAAO,KAAK,QAAQ,IAC3BA,OAAO,KAAK,CAAC,EACb;MACA,KAAK,MAAMa,KAAK,IAAIT,MAAM,CAACJ,OAAO,CAAC,CAACgB,KAAK,CAAC,GAAG,CAAC,EAAE;QAC9CF,OAAO,CAACC,IAAI,CAAE,WAAUF,KAAM,EAAC,CAAC;MAClC;IACF;IAEA,OAAOC,OAAO;EAChB,CAAC,CAAC;EAEF,OAAO;IAAEF;EAAe,CAAC;AAC3B"}
|