UNPKG

vue-amazing-ui

Version:

An Amazing Vue3 UI Components Library, Using TypeScript.

2 lines (1 loc) 1.6 kB
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),l=require("../utils/index.cjs"),u={key:0,class:"divider-text"},c=t.defineComponent({__name:"Divider",props:{orientation:{default:"center"},orientationMargin:{default:void 0},borderWidth:{default:1},borderStyle:{default:"solid"},borderColor:{default:"rgba(5, 5, 5, 0.06)"},vertical:{type:Boolean,default:!1},height:{default:"0.9em"}},setup(e){const r=e,n=l.useSlotsExist(["default"]),o=t.computed(()=>typeof r.orientationMargin=="number"?`${r.orientationMargin}px`:r.orientationMargin),a=t.computed(()=>typeof r.height=="number"?`${r.height}px`:r.height),i=t.computed(()=>n.default);return(d,v)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["divider-wrap",[e.vertical?"divider-vertical":"divider-horizontal",{"divider-with-text":i.value,"divider-with-text-center":i.value&&e.orientation==="center","divider-with-text-left":i.value&&e.orientation==="left","divider-with-text-right":i.value&&e.orientation==="right","divider-orientation-margin-left":i.value&&e.orientation==="left"&&e.orientationMargin!==void 0,"divider-orientation-margin-right":i.value&&e.orientation==="right"&&e.orientationMargin!==void 0}]]),style:t.normalizeStyle(`--border-width: ${e.borderWidth}px; --border-style: ${e.borderStyle}; --border-color: ${e.borderColor}; --margin: ${o.value}; --line-height: ${a.value};`)},[i.value?(t.openBlock(),t.createElementBlock("span",u,[t.renderSlot(d.$slots,"default",{},void 0,!0)])):t.createCommentVNode("",!0)],6))}});exports.default=c;