UNPKG

element-plus

Version:

A Component Library for Vue 3

1 lines 2.07 kB
{"version":3,"file":"button.mjs","sources":["../../../../../../packages/components/button/src/button.ts"],"sourcesContent":["import { useFormItemProps } from '@element-plus/hooks'\nimport { buildProps, definePropType } from '@element-plus/utils/props'\nimport type { ExtractPropTypes, Component } from 'vue'\n\nexport const buttonType = [\n 'default',\n 'primary',\n 'success',\n 'warning',\n 'info',\n 'danger',\n 'text',\n '',\n] as const\nexport const buttonSize = ['', 'large', 'medium', 'small', 'mini'] as const\nexport const buttonNativeType = ['button', 'submit', 'reset'] as const\n\nexport const buttonProps = buildProps({\n ...useFormItemProps,\n type: {\n type: String,\n values: buttonType,\n default: '',\n },\n icon: {\n type: definePropType<string | Component>([String, Object]),\n default: '',\n },\n nativeType: {\n type: String,\n values: buttonNativeType,\n default: 'button',\n },\n loading: Boolean,\n plain: Boolean,\n autofocus: Boolean,\n round: Boolean,\n circle: Boolean,\n autoInsertSpace: {\n type: Boolean,\n },\n} as const)\n\nexport interface ButtonConfigContext {\n autoInsertSpace?: boolean\n}\n\nexport const buttonEmits = {\n click: (evt: MouseEvent) => evt instanceof MouseEvent,\n}\n\nexport type ButtonProps = ExtractPropTypes<typeof buttonProps>\nexport type ButtonEmits = typeof buttonEmits\n\nexport type ButtonType = ButtonProps['type']\nexport type ButtonNativeType = ButtonProps['nativeType']\n"],"names":[],"mappings":";;;;MAIa,aAAa;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;MAEW,aAAa,CAAC,IAAI,SAAS,UAAU,SAAS;MAC9C,mBAAmB,CAAC,UAAU,UAAU;MAExC,cAAc,WAAW;AAAA,KACjC;AAAA,EACH,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA;AAAA,EAEX,MAAM;AAAA,IACJ,MAAM,eAAmC,CAAC,QAAQ;AAAA,IAClD,SAAS;AAAA;AAAA,EAEX,YAAY;AAAA,IACV,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA;AAAA,EAEX,SAAS;AAAA,EACT,OAAO;AAAA,EACP,WAAW;AAAA,EACX,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,iBAAiB;AAAA,IACf,MAAM;AAAA;AAAA;MAQG,cAAc;AAAA,EACzB,OAAO,CAAC,QAAoB,eAAe;AAAA;;;;"}