UNPKG

element-plus

Version:

A Component Library for Vue 3

1 lines 3.17 kB
{"version":3,"file":"link.mjs","sources":["../../../../../../packages/components/link/src/link.ts"],"sourcesContent":["import { buildProps, iconPropType } from '@element-plus/utils'\n\nimport type { Component, ExtractPublicPropTypes, PropType } from 'vue'\nimport type Link from './link.vue'\n\nexport interface LinkProps {\n /**\n * @description type\n */\n type?: 'primary' | 'success' | 'warning' | 'info' | 'danger' | 'default'\n /**\n * @description when underlines should appear\n */\n underline?: boolean | 'always' | 'never' | 'hover'\n\n /**\n * @description whether the component is disabled\n */\n disabled?: boolean\n /**\n * @description same as native hyperlink's `href`\n */\n href?: string\n /**\n * @description same as native hyperlink's `target`\n */\n target?:\n | '_blank'\n | '_parent'\n | '_self'\n | '_top'\n | (string & NonNullable<unknown>)\n\n /**\n * @description icon component\n */\n icon?: string | Component\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `LinkProps` instead.\n */\nexport const linkProps = buildProps({\n /**\n * @description type\n */\n type: {\n type: String,\n values: ['primary', 'success', 'warning', 'info', 'danger', 'default'],\n default: undefined,\n },\n /**\n * @description when underlines should appear\n */\n underline: {\n type: [Boolean, String],\n values: [true, false, 'always', 'never', 'hover'],\n default: undefined,\n },\n /**\n * @description whether the component is disabled\n */\n disabled: Boolean,\n /**\n * @description same as native hyperlink's `href`\n */\n href: { type: String, default: '' },\n /**\n * @description same as native hyperlink's `target`\n */\n target: {\n type: String as PropType<'_blank' | '_parent' | '_self' | '_top' | string>,\n default: '_self',\n },\n /**\n * @description icon component\n */\n icon: {\n type: iconPropType,\n },\n} as const)\n\n/**\n * @deprecated Removed after 3.0.0, Use `LinkProps` instead.\n */\nexport type LinkPropsPublic = ExtractPublicPropTypes<typeof linkProps>\n\nexport const linkEmits = {\n click: (evt: MouseEvent) => evt instanceof MouseEvent,\n}\nexport type LinkEmits = typeof linkEmits\n\nexport type LinkInstance = InstanceType<typeof Link> & unknown\nexport interface LinkConfigContext {\n type?: LinkProps['type']\n underline?: LinkProps['underline']\n}\n"],"names":[],"mappings":";;;AA0CO,MAAM,YAAY,UAAA,CAAW;AAAA;AAAA;AAAA;AAAA,EAIlC,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,MAAA;AAAA,IACN,QAAQ,CAAC,SAAA,EAAW,WAAW,SAAA,EAAW,MAAA,EAAQ,UAAU,SAAS,CAAA;AAAA,IACrE,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,SAAA,EAAW;AAAA,IACT,IAAA,EAAM,CAAC,OAAA,EAAS,MAAM,CAAA;AAAA,IACtB,QAAQ,CAAC,IAAA,EAAM,KAAA,EAAO,QAAA,EAAU,SAAS,OAAO,CAAA;AAAA,IAChD,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,QAAA,EAAU,OAAA;AAAA;AAAA;AAAA;AAAA,EAIV,IAAA,EAAM,EAAE,IAAA,EAAM,MAAA,EAAQ,SAAS,EAAA,EAAG;AAAA;AAAA;AAAA;AAAA,EAIlC,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM;AAAA;AAEV,CAAU;AAOH,MAAM,SAAA,GAAY;AAAA,EACvB,KAAA,EAAO,CAAC,GAAA,KAAoB,GAAA,YAAe;AAC7C;;;;"}