element-plus
Version:
A Component Library for Vue 3
1 lines • 2.41 kB
Source Map (JSON)
{"version":3,"file":"row.mjs","sources":["../../../../../../packages/components/row/src/row.ts"],"sourcesContent":["import { defineComponent, computed, h, provide } from 'vue'\nimport { buildProps } from '@element-plus/utils/props'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const rowProps = buildProps({\n tag: {\n type: String,\n default: 'div',\n },\n gutter: {\n type: Number,\n default: 0,\n },\n justify: {\n type: String,\n values: ['start', 'center', 'end', 'space-around', 'space-between'],\n default: 'start',\n },\n align: {\n type: String,\n values: ['top', 'middle', 'bottom'],\n default: 'top',\n },\n} as const)\nexport type RowProps = ExtractPropTypes<typeof rowProps>\n\nexport default defineComponent({\n name: 'ElRow',\n props: rowProps,\n\n setup(props, { slots }) {\n const gutter = computed(() => props.gutter)\n provide('ElRow', {\n gutter,\n })\n\n const style = computed(() => {\n const ret = {\n marginLeft: '',\n marginRight: '',\n }\n if (props.gutter) {\n ret.marginLeft = `-${props.gutter / 2}px`\n ret.marginRight = ret.marginLeft\n }\n return ret\n })\n\n return () =>\n h(\n props.tag,\n {\n class: [\n 'el-row',\n props.justify !== 'start' ? `is-justify-${props.justify}` : '',\n props.align !== 'top' ? `is-align-${props.align}` : '',\n ],\n style: style.value,\n },\n slots.default?.()\n )\n },\n})\n"],"names":[],"mappings":";;;MAIa,WAAW,WAAW;AAAA,EACjC,KAAK;AAAA,IACH,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,SAAS;AAAA,IACP,MAAM;AAAA,IACN,QAAQ,CAAC,SAAS,UAAU,OAAO,gBAAgB;AAAA,IACnD,SAAS;AAAA;AAAA,EAEX,OAAO;AAAA,IACL,MAAM;AAAA,IACN,QAAQ,CAAC,OAAO,UAAU;AAAA,IAC1B,SAAS;AAAA;AAAA;AAKb,UAAe,gBAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,OAAO;AAAA,EAEP,MAAM,OAAO,EAAE,SAAS;AACtB,UAAM,SAAS,SAAS,MAAM,MAAM;AACpC,YAAQ,SAAS;AAAA,MACf;AAAA;AAGF,UAAM,QAAQ,SAAS,MAAM;AAC3B,YAAM,MAAM;AAAA,QACV,YAAY;AAAA,QACZ,aAAa;AAAA;AAEf,UAAI,MAAM,QAAQ;AAChB,YAAI,aAAa,IAAI,MAAM,SAAS;AACpC,YAAI,cAAc,IAAI;AAAA;AAExB,aAAO;AAAA;AAGT,WAAO,MAAG;AAhDd;AAiDM,eACE,MAAM,KACN;AAAA,QACE,OAAO;AAAA,UACL;AAAA,UACA,MAAM,YAAY,UAAU,cAAc,MAAM,YAAY;AAAA,UAC5D,MAAM,UAAU,QAAQ,YAAY,MAAM,UAAU;AAAA;AAAA,QAEtD,OAAO,MAAM;AAAA,SAEf,YAAM,YAAN;AAAA;AAAA;AAAA;;;;"}