import { buildProps, definePropType, isBoolean, isNumber, } from '@element-plus/utils' import { CHANGE_EVENT } from '@element-plus/constants' import type { ExtractPropTypes } from 'vue' import type { ZIndexProperty } from 'csstype' import type Affix from './affix.vue' export const affixProps = buildProps({ zIndex: { type: definePropType([Number, String]), default: 100, }, target: { type: String, default: '', }, offset: { type: Number, default: 0, }, position: { type: String, values: ['top', 'bottom'], default: 'top', }, } as const) export type AffixProps = ExtractPropTypes export const affixEmits = { scroll: ({ scrollTop, fixed }: { scrollTop: number; fixed: boolean }) => isNumber(scrollTop) && isBoolean(fixed), [CHANGE_EVENT]: (fixed: boolean) => isBoolean(fixed), } export type AffixEmits = typeof affixEmits export type AffixInstance = InstanceType