{"version":3,"file":"col2.js","sources":["../../../../../../packages/components/col/src/col.vue"],"sourcesContent":["<template>\n <component :is=\"tag\" :class=\"colKls\" :style=\"style\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, inject } from 'vue'\nimport { isNumber, isObject } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { rowContextKey } from '@element-plus/components/row'\nimport { colProps } from './col'\nimport type { CSSProperties } from 'vue'\n\ndefineOptions({\n name: 'ElCol',\n})\n\nconst props = defineProps(colProps)\n\nconst { gutter } = inject(rowContextKey, { gutter: computed(() => 0) })\nconst ns = useNamespace('col')\n\nconst style = computed(() => {\n const styles: CSSProperties = {}\n if (gutter.value) {\n styles.paddingLeft = styles.paddingRight = `${gutter.value / 2}px`\n }\n return styles\n})\n\nconst colKls = computed(() => {\n const classes: string[] = []\n const pos = ['span', 'offset', 'pull', 'push'] as const\n\n pos.forEach((prop) => {\n const size = props[prop]\n if (isNumber(size)) {\n if (prop === 'span') classes.push(ns.b(`${props[prop]}`))\n else if (size > 0) classes.push(ns.b(`${prop}-${props[prop]}`))\n }\n })\n\n const sizes = ['xs', 'sm', 'md', 'lg', 'xl'] as const\n sizes.forEach((size) => {\n if (isNumber(props[size])) {\n classes.push(ns.b(`${size}-${props[size]}`))\n } else if (isObject(props[size])) {\n Object.entries(props[size]).forEach(([prop, sizeProp]) => {\n classes.push(\n prop !== 'span'\n ? ns.b(`${size}-${prop}-${sizeProp}`)\n : ns.b(`${size}-${sizeProp}`)\n )\n })\n }\n })\n\n // this is for the fix\n if (gutter.value) {\n classes.push(ns.is('guttered'))\n }\n return [ns.b(), classes]\n})\n</script>\n"],"names":["inject","rowContextKey","computed","useNamespace","isNumber","isObject"],"mappings":";;;;;;;;;;;;;;;uCAcc,CAAA;AAAA,EACZ,IAAM,EAAA,OAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAIA,IAAM,MAAA,EAAE,MAAW,EAAA,GAAAA,UAAA,CAAOC,uB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