{"version":3,"file":"anchor2.mjs","sources":["../../../../../../../packages/components/anchor/src/anchor.ts"],"sourcesContent":["import {\n  buildProps,\n  definePropType,\n  isString,\n  isUndefined,\n} from '@hd-front-end/utils'\n\nimport type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\nimport type Anchor from './anchor.vue'\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\nexport type AnchorProps = ExtractPropTypes<typeof anchorProps>\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":";;;;AAUO,MAAM,cAAc,UAAW,CAAA;AAAA,EAIpC,SAAW,EAAA;AAAA,IACT,MAAM,cAAqD,CAAA;AAAA,MACzD,MAAA;AAAA,MACA,MAAA;AAAA,KACD,CAAA;AAAA,GACH;AAAA,EAIA,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,CAAA;AAAA,GACX;AAAA,EAIA,KAAO,EAAA;AAAA,IACL,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,EAAA;AAAA,GACX;AAAA,EAIA,QAAU,EAAA;AAAA,IACR,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,GAAA;AAAA,GACX;AAAA,EAIA,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,IAAA;AAAA,GACX;AAAA,EAIA,IAAM,EAAA;AAAA,IACJ,IAAA,EAAM,eAAwC,MAAM,CAAA;AAAA,IACpD,OAAS,EAAA,SAAA;AAAA,GACX;AAAA,EAIA,SAAW,EAAA;AAAA,IACT,IAAA,EAAM,eAA0C,MAAM,CAAA;AAAA,IACtD,OAAS,EAAA,UAAA;AAAA,GACX;AAAA,EAIA,eAAiB,EAAA,OAAA;AACnB,CAAC,EAAA;AAMM,MAAM,WAAc,GAAA;AAAA,EACzB,MAAQ,EAAA,CAAC,IAAiB,KAAA,QAAA,CAAS,IAAI,CAAA;AAAA,EACvC,KAAA,EAAO,CAAC,CAAA,EAAe,IACrB,KAAA,CAAA,YAAa,eAAe,QAAS,CAAA,IAAI,CAAK,IAAA,WAAA,CAAY,IAAI,CAAA,CAAA;AAClE;;;;"}