element-plus
Version:
A Component Library for Vue 3
1 lines • 3.87 kB
Source Map (JSON)
{"version":3,"file":"anchor.mjs","sources":["../../../../../../packages/components/anchor/src/anchor.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n isString,\n isUndefined,\n} from '@element-plus/utils'\n\nimport type { ExtractPublicPropTypes } from 'vue'\nimport type Anchor from './anchor.vue'\n\nexport interface AnchorProps {\n /**\n * @description scroll container\n */\n container?: string | HTMLElement | Window | null\n /**\n * @description Set the offset of the anchor scroll\n */\n offset?: number\n /**\n * @description The offset of the element starting to trigger the anchor\n */\n bound?: number\n /**\n * @description Set the scroll duration of the container when the anchor is clicked, in milliseconds\n */\n duration?: number\n /**\n * @description Whether to show the marker\n */\n marker?: boolean\n /**\n * @description Set Anchor type\n */\n type?: 'default' | 'underline'\n /**\n * @description Set Anchor direction\n */\n direction?: 'vertical' | 'horizontal'\n /**\n * @description Scroll whether link is selected at the top\n */\n selectScrollTop?: boolean\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `AnchorProps` instead.\n */\nexport const anchorProps = buildProps({\n /**\n * @description scroll container\n */\n container: {\n type: definePropType<string | HTMLElement | Window | null>([\n String,\n Object,\n ]),\n },\n /**\n * @description Set the offset of the anchor scroll\n */\n offset: {\n type: Number,\n default: 0,\n },\n /**\n * @description The offset of the element starting to trigger the anchor\n */\n bound: {\n type: Number,\n default: 15,\n },\n /**\n * @description Set the scroll duration of the container when the anchor is clicked, in milliseconds\n */\n duration: {\n type: Number,\n default: 300,\n },\n /**\n * @description Whether to show the marker\n */\n marker: {\n type: Boolean,\n default: true,\n },\n /**\n * @description Set Anchor type\n */\n type: {\n type: definePropType<'default' | 'underline'>(String),\n default: 'default',\n },\n /**\n * @description Set Anchor direction\n */\n direction: {\n type: definePropType<'vertical' | 'horizontal'>(String),\n default: 'vertical',\n },\n /**\n * @description Scroll whether link is selected at the top\n */\n selectScrollTop: Boolean,\n})\n\n/**\n * @deprecated Removed after 3.0.0, Use `AnchorProps` instead.\n */\nexport type AnchorPropsPublic = ExtractPublicPropTypes<typeof anchorProps>\nexport type AnchorInstance = InstanceType<typeof Anchor> & unknown\n\nexport const anchorEmits = {\n change: (href: string) => isString(href),\n click: (e: MouseEvent, href?: string) =>\n e instanceof MouseEvent && (isString(href) || isUndefined(href)),\n}\nexport type AnchorEmits = typeof anchorEmits\n"],"names":[],"mappings":";;;;AAgDO,MAAM,cAAc,UAAA,CAAW;AAAA;AAAA;AAAA;AAAA,EAIpC,SAAA,EAAW;AAAA,IACT,MAAM,cAAA,CAAqD;AAAA,MACzD,MAAA;AAAA,MACA;AAAA,KACD;AAAA,GACH;AAAA;AAAA;AAAA;AAAA,EAIA,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,eAAwC,MAAM,CAAA;AAAA,IACpD,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,SAAA,EAAW;AAAA,IACT,IAAA,EAAM,eAA0C,MAAM,CAAA;AAAA,IACtD,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,eAAA,EAAiB;AACnB,CAAC;AAQM,MAAM,WAAA,GAAc;AAAA,EACzB,MAAA,EAAQ,CAAC,IAAA,KAAiB,QAAA,CAAS,IAAI,CAAA;AAAA,EACvC,KAAA,EAAO,CAAC,CAAA,EAAe,IAAA,KACrB,CAAA,YAAa,eAAe,QAAA,CAAS,IAAI,CAAA,IAAK,WAAA,CAAY,IAAI,CAAA;AAClE;;;;"}