@extclp/vexip-ui
Version:
A Vue 3 UI library, Highly customizability, full TypeScript, performance pretty good
1 lines • 3 kB
Source Map (JSON)
{"version":3,"file":"divider.vue2.mjs","sources":["../../../components/divider/divider.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\n\nimport { useNameHelper, useProps } from '@vexip-ui/config'\nimport { toCssSize } from '@vexip-ui/utils'\nimport { dividerProps } from './props'\n\ndefineOptions({ name: 'Divider' })\n\nconst _props = defineProps(dividerProps)\nconst props = useProps('divider', _props, {\n vertical: false,\n textPosition: {\n default: 'center',\n validator: value => ['center', 'left', 'right'].includes(value)\n },\n primary: false,\n dashed: false,\n margin: null\n})\n\nconst slots = defineSlots<{ default: () => any }>()\n\nconst nh = useNameHelper('divider')\n\nconst hasText = computed(() => !!slots.default)\nconst className = computed(() => {\n return [\n nh.b(),\n nh.bs('vars'),\n nh.bm(props.vertical ? 'vertical' : 'horizontal'),\n {\n [nh.bm('inherit')]: props.inherit,\n [nh.bm('primary')]: !props.vertical && props.primary,\n [nh.bm('dashed')]: props.dashed,\n [nh.bm('with-text')]: !props.vertical && hasText.value,\n [nh.bm(`with-text-${props.textPosition}`)]:\n !props.vertical && hasText.value && props.textPosition !== 'center'\n }\n ]\n})\nconst margin = computed(() => toCssSize(props.margin))\nconst style = computed(() => {\n if (!margin.value) return {}\n\n return props.vertical\n ? {\n marginRight: margin.value,\n marginLeft: margin.value\n }\n : {\n marginTop: margin.value,\n marginBottom: margin.value\n }\n})\n</script>\n\n<template>\n <div :class=\"className\" role=\"separator\" :style=\"style\">\n <span v-if=\"!props.vertical && hasText\" :class=\"nh.be('text')\">\n <slot></slot>\n </span>\n </div>\n</template>\n"],"names":["props","useProps","__props","value","slots","_useSlots","nh","useNameHelper","hasText","computed","className","margin","toCssSize","style"],"mappings":";;;;;;;;;AAUM,UAAAA,IAAQC,EAAS,WADRC,GAC2B;AAAA,MACxC,UAAU;AAAA,MACV,cAAc;AAAA,QACZ,SAAS;AAAA,QACT,WAAW,OAAS,CAAC,UAAU,QAAQ,OAAO,EAAE,SAASC,CAAK;AAAA,MAChE;AAAA,MACA,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,QAAQ;AAAA,IAAA,CACT,GAEKC,IAAQC,EAAA,GAERC,IAAKC,EAAc,SAAS,GAE5BC,IAAUC,EAAS,MAAM,CAAC,CAACL,EAAM,OAAO,GACxCM,IAAYD,EAAS,MAClB;AAAA,MACLH,EAAG,EAAE;AAAA,MACLA,EAAG,GAAG,MAAM;AAAA,MACZA,EAAG,GAAGN,EAAM,WAAW,aAAa,YAAY;AAAA,MAChD;AAAA,QACE,CAACM,EAAG,GAAG,SAAS,CAAC,GAAGN,EAAM;AAAA,QAC1B,CAACM,EAAG,GAAG,SAAS,CAAC,GAAG,CAACN,EAAM,YAAYA,EAAM;AAAA,QAC7C,CAACM,EAAG,GAAG,QAAQ,CAAC,GAAGN,EAAM;AAAA,QACzB,CAACM,EAAG,GAAG,WAAW,CAAC,GAAG,CAACN,EAAM,YAAYQ,EAAQ;AAAA,QACjD,CAACF,EAAG,GAAG,aAAaN,EAAM,YAAY,EAAE,CAAC,GACvC,CAACA,EAAM,YAAYQ,EAAQ,SAASR,EAAM,iBAAiB;AAAA,MAAA;AAAA,IAEjE,CACD,GACKW,IAASF,EAAS,MAAMG,EAAUZ,EAAM,MAAM,CAAC,GAC/Ca,IAAQJ,EAAS,MAChBE,EAAO,QAELX,EAAM,WACT;AAAA,MACE,aAAaW,EAAO;AAAA,MACpB,YAAYA,EAAO;AAAA,IAAA,IAErB;AAAA,MACE,WAAWA,EAAO;AAAA,MAClB,cAAcA,EAAO;AAAA,IACvB,IAVsB,CAAC,CAW5B;;;;;;;;;;;;;;;"}