UNPKG

element-plus

Version:

A Component Library for Vue 3

1 lines 2.63 kB
{"version":3,"file":"affix.mjs","sources":["../../../../../../packages/components/affix/src/affix.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n isBoolean,\n isNumber,\n} from '@element-plus/utils'\nimport { CHANGE_EVENT } from '@element-plus/constants'\nimport { teleportProps } from '@element-plus/components/teleport'\n\nimport type {\n CSSProperties,\n ExtractPropTypes,\n ExtractPublicPropTypes,\n} from 'vue'\nimport type Affix from './affix.vue'\n\nexport const affixProps = buildProps({\n /**\n * @description affix element zIndex value\n * */\n zIndex: {\n type: definePropType<CSSProperties['z-index']>([Number, String]),\n default: 100,\n },\n /**\n * @description target container. (CSS selector)\n */\n target: {\n type: String,\n default: '',\n },\n /**\n * @description offset distance\n * */\n offset: {\n type: Number,\n default: 0,\n },\n /**\n * @description position of affix\n * */\n position: {\n type: String,\n values: ['top', 'bottom'],\n default: 'top',\n },\n /**\n * @description whether affix element is teleported, if `true` it will be teleported to where `append-to` sets\n * */\n teleported: Boolean,\n /**\n * @description which element the affix element appends to\n * */\n appendTo: {\n type: teleportProps.to.type,\n default: 'body',\n },\n} as const)\nexport type AffixProps = ExtractPropTypes<typeof affixProps>\nexport type AffixPropsPublic = ExtractPublicPropTypes<typeof affixProps>\n\nexport const affixEmits = {\n scroll: ({ scrollTop, fixed }: { scrollTop: number; fixed: boolean }) =>\n isNumber(scrollTop) && isBoolean(fixed),\n [CHANGE_EVENT]: (fixed: boolean) => isBoolean(fixed),\n}\nexport type AffixEmits = typeof affixEmits\n\nexport type AffixInstance = InstanceType<typeof Affix> & unknown\n"],"names":[],"mappings":";;;;;AAgBO,MAAM,aAAa,UAAW,CAAA;AAAA,EAInC,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,cAAA,CAAyC,CAAC,MAAA,EAAQ,MAAM,CAAC,CAAA;AAAA,IAC/D,OAAS,EAAA,GAAA;AAAA,GACX;AAAA,EAIA,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,EAAA;AAAA,GACX;AAAA,EAIA,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,CAAA;AAAA,GACX;AAAA,EAIA,QAAU,EAAA;AAAA,IACR,IAAM,EAAA,MAAA;AAAA,IACN,MAAA,EAAQ,CAAC,KAAA,EAAO,QAAQ,CAAA;AAAA,IACxB,OAAS,EAAA,KAAA;AAAA,GACX;AAAA,EAIA,UAAY,EAAA,OAAA;AAAA,EAIZ,QAAU,EAAA;AAAA,IACR,IAAA,EAAM,cAAc,EAAG,CAAA,IAAA;AAAA,IACvB,OAAS,EAAA,MAAA;AAAA,GACX;AACF,CAAU,EAAA;AAIH,MAAM,UAAa,GAAA;AAAA,EACxB,MAAA,EAAQ,CAAC,EAAE,SAAW,EAAA,KAAA,OACpB,QAAS,CAAA,SAAS,CAAK,IAAA,SAAA,CAAU,KAAK,CAAA;AAAA,EACxC,CAAC,YAAA,GAAe,CAAC,KAAA,KAAmB,UAAU,KAAK,CAAA;AACrD;;;;"}