border.mjs.map 2.0 KB

1
  1. {"version":3,"file":"border.mjs","names":["computed","isRef","getCurrentInstanceName","propsFactory","makeBorderProps","border","Boolean","Number","String","useBorder","props","name","arguments","length","undefined","borderClasses","value","classes","push","split"],"sources":["../../src/composables/border.ts"],"sourcesContent":["// Utilities\nimport { computed, isRef } from 'vue'\nimport { getCurrentInstanceName, propsFactory } from '@/util'\n\n// Types\nexport interface BorderProps {\n border?: boolean | number | string\n}\n\n// Composables\nexport const makeBorderProps = propsFactory({\n border: [Boolean, Number, String],\n}, 'border')\n\nexport function useBorder (\n props: BorderProps,\n name = getCurrentInstanceName(),\n) {\n const borderClasses = computed(() => {\n const border = isRef(props) ? props.value : props.border\n const classes: string[] = []\n\n if (border === true || border === '') {\n classes.push(`${name}--border`)\n } else if (\n typeof border === 'string' ||\n border === 0\n ) {\n for (const value of String(border).split(' ')) {\n classes.push(`border-${value}`)\n }\n }\n\n return classes\n })\n\n return { borderClasses }\n}\n"],"mappings":"AAAA;AACA,SAASA,QAAQ,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAC5BC,sBAAsB,EAAEC,YAAY,6BAE7C;AAKA;AACA,OAAO,MAAMC,eAAe,GAAGD,YAAY,CAAC;EAC1CE,MAAM,EAAE,CAACC,OAAO,EAAEC,MAAM,EAAEC,MAAM;AAClC,CAAC,EAAE,QAAQ,CAAC;AAEZ,OAAO,SAASC,SAASA,CACvBC,KAAkB,EAElB;EAAA,IADAC,IAAI,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGV,sBAAsB,EAAE;EAE/B,MAAMa,aAAa,GAAGf,QAAQ,CAAC,MAAM;IACnC,MAAMK,MAAM,GAAGJ,KAAK,CAACS,KAAK,CAAC,GAAGA,KAAK,CAACM,KAAK,GAAGN,KAAK,CAACL,MAAM;IACxD,MAAMY,OAAiB,GAAG,EAAE;IAE5B,IAAIZ,MAAM,KAAK,IAAI,IAAIA,MAAM,KAAK,EAAE,EAAE;MACpCY,OAAO,CAACC,IAAI,CAAE,GAAEP,IAAK,UAAS,CAAC;IACjC,CAAC,MAAM,IACL,OAAON,MAAM,KAAK,QAAQ,IAC1BA,MAAM,KAAK,CAAC,EACZ;MACA,KAAK,MAAMW,KAAK,IAAIR,MAAM,CAACH,MAAM,CAAC,CAACc,KAAK,CAAC,GAAG,CAAC,EAAE;QAC7CF,OAAO,CAACC,IAAI,CAAE,UAASF,KAAM,EAAC,CAAC;MACjC;IACF;IAEA,OAAOC,OAAO;EAChB,CAAC,CAAC;EAEF,OAAO;IAAEF;EAAc,CAAC;AAC1B"}