UNPKG

element-plus

Version:

A Component Library for Vue 3

1 lines 3.25 kB
{"version":3,"file":"description-item.mjs","names":[],"sources":["../../../../../../packages/components/descriptions/src/description-item.ts"],"sourcesContent":["import { defineComponent } from 'vue'\nimport { columnAlignment } from '@element-plus/constants'\nimport { buildProps } from '@element-plus/utils'\nimport { COMPONENT_NAME } from './constants'\n\nimport type { ExtractPropTypes, ExtractPublicPropTypes, Slot, VNode } from 'vue'\n\nexport const descriptionItemProps = buildProps({\n /**\n * @description label text\n */\n label: {\n type: String,\n default: '',\n },\n /**\n * @description colspan of column\n */\n span: {\n type: Number,\n default: 1,\n },\n /**\n * @description the number of rows a cell should span\n */\n rowspan: {\n type: Number,\n default: 1,\n },\n /**\n * @description column width, the width of the same column in different rows is set by the max value (If no `border`, width contains label and content)\n */\n width: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description column minimum width, columns with `width` has a fixed width, while columns with `min-width` has a width that is distributed in proportion (If no`border`, width contains label and content)\n */\n minWidth: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description column label width, if not set, it will be the same as the width of the column. Higher priority than the `label-width` of `Descriptions`\n */\n labelWidth: {\n type: [String, Number],\n },\n /**\n * @description column content alignment (If no `border`, effective for both label and content)\n */\n align: {\n type: String,\n values: columnAlignment,\n default: 'left',\n },\n /**\n * @description column label alignment, if omitted, the value of the above `align` attribute will be applied (If no `border`, please use `align` attribute)\n */\n labelAlign: {\n type: String,\n values: columnAlignment,\n },\n /**\n * @description column content custom class name\n */\n className: {\n type: String,\n default: '',\n },\n /**\n * @description column label custom class name\n */\n labelClassName: {\n type: String,\n default: '',\n },\n})\n\nconst DescriptionItem = defineComponent({\n name: COMPONENT_NAME,\n props: descriptionItemProps,\n})\n\nexport default DescriptionItem\n\nexport type DescriptionItemProps = ExtractPropTypes<typeof descriptionItemProps>\nexport type DescriptionItemPropsPublic = ExtractPublicPropTypes<\n typeof descriptionItemProps\n>\nexport type DescriptionItemVNode = VNode & {\n children: { [name: string]: Slot } | null\n props: Partial<DescriptionItemProps> | null\n}\n"],"mappings":";;;;;;AAOA,MAAa,uBAAuB,WAAW;CAI7C,OAAO;EACL,MAAM;EACN,SAAS;EACV;CAID,MAAM;EACJ,MAAM;EACN,SAAS;EACV;CAID,SAAS;EACP,MAAM;EACN,SAAS;EACV;CAID,OAAO;EACL,MAAM,CAAC,QAAQ,OAAO;EACtB,SAAS;EACV;CAID,UAAU;EACR,MAAM,CAAC,QAAQ,OAAO;EACtB,SAAS;EACV;CAID,YAAY,EACV,MAAM,CAAC,QAAQ,OAAO,EACvB;CAID,OAAO;EACL,MAAM;EACN,QAAQ;EACR,SAAS;EACV;CAID,YAAY;EACV,MAAM;EACN,QAAQ;EACT;CAID,WAAW;EACT,MAAM;EACN,SAAS;EACV;CAID,gBAAgB;EACd,MAAM;EACN,SAAS;EACV;CACF,CAAC;AAEF,MAAM,kBAAkB,gBAAgB;CACtC,MAAM;CACN,OAAO;CACR,CAAC"}