{"version":3,"file":"affix.mjs","names":[],"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 { ExtractPublicPropTypes } from 'vue'\nimport type Affix from './affix.vue'\nimport type { ZIndexType } from '@element-plus/utils'\n\nexport interface AffixProps {\n  /**\n   * @description affix element zIndex value\n   * */\n  zIndex?: ZIndexType\n  /**\n   * @description target container. (CSS selector)\n   */\n  target?: string\n  /**\n   * @description offset distance\n   * */\n  offset?: number\n  /**\n   * @description position of affix\n   * */\n  position?: 'top' | 'bottom'\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?: string | HTMLElement\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `AffixProps` instead.\n */\nexport const affixProps = buildProps({\n  /**\n   * @description affix element zIndex value\n   * */\n  zIndex: {\n    type: definePropType<ZIndexType>([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)\n\n/**\n * @deprecated Removed after 3.0.0, Use `AffixProps` instead.\n */\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"],"mappings":";;;;;;;;;AA2CA,MAAa,aAAa,WAAW;CAInC,QAAQ;EACN,MAAM,eAA2B,CAAC,QAAQ,OAAO,CAAC;EAClD,SAAS;EACV;CAID,QAAQ;EACN,MAAM;EACN,SAAS;EACV;CAID,QAAQ;EACN,MAAM;EACN,SAAS;EACV;CAID,UAAU;EACR,MAAM;EACN,QAAQ,CAAC,OAAO,SAAS;EACzB,SAAS;EACV;CAID,YAAY;CAIZ,UAAU;EACR,MAAM,cAAc,GAAG;EACvB,SAAS;EACV;CACF,CAAU;AAOX,MAAa,aAAa;CACxB,SAAS,EAAE,WAAW,YACpB,SAAS,UAAU,IAAI,UAAU,MAAM;EACxC,gBAAgB,UAAmB,UAAU,MAAM;CACrD"}