{"version":3,"file":"scrollbar.mjs","names":[],"sources":["../../../../../../packages/components/scrollbar/src/scrollbar.ts"],"sourcesContent":["import { buildProps, definePropType, isNumber } from '@element-plus/utils'\nimport { useAriaProps } from '@element-plus/hooks'\n\nimport type { ExtractPublicPropTypes, StyleValue } from 'vue'\nimport type Scrollbar from './scrollbar.vue'\n\nexport interface ScrollbarProps {\n  /**\n   * @description trigger distance(px)\n   * @default 0\n   */\n  distance?: number\n  /**\n   * @description height of scrollbar\n   * @default ''\n   */\n  height?: number | string\n  /**\n   * @description max height of scrollbar\n   * @default ''\n   */\n  maxHeight?: number | string\n  /**\n   * @description whether to use the native scrollbar\n   */\n  native?: boolean\n  /**\n   * @description style of wrap\n   * @default ''\n   */\n  wrapStyle?: StyleValue\n  /**\n   * @description class of wrap\n   * @default ''\n   */\n  wrapClass?: string | string[]\n  /**\n   * @description class of view\n   * @default ''\n   */\n  viewClass?: string | string[]\n  /**\n   * @description style of view\n   * @default ''\n   */\n  viewStyle?: StyleValue\n  /**\n   * @description do not respond to container size changes, if the container size does not change, it is better to set it to optimize performance\n   */\n  noresize?: boolean\n  /**\n   * @description element tag of the view\n   * @default 'div'\n   */\n  tag?: keyof HTMLElementTagNameMap | (string & {})\n  /**\n   * @description always show\n   */\n  always?: boolean\n  /**\n   * @description minimum size of scrollbar\n   * @default 20\n   */\n  minSize?: number\n  /**\n   * @description Wrap tabindex\n   * @default undefined\n   */\n  tabindex?: number | string\n  /**\n   * @description id of view\n   */\n  id?: string\n  /**\n   * @description role of view\n   */\n  role?: string\n  /**\n   * @description native `aria-label` attribute\n   */\n  ariaLabel?: string\n  /**\n   * @description native `aria-orientation` attribute\n   */\n  ariaOrientation?: 'horizontal' | 'vertical' | 'undefined'\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `ScrollbarProps` instead.\n */\nexport const scrollbarProps = buildProps({\n  /**\n   * @description trigger distance(px)\n   */\n  distance: {\n    type: Number,\n    default: 0,\n  },\n  /**\n   * @description height of scrollbar\n   */\n  height: {\n    type: [String, Number],\n    default: '',\n  },\n  /**\n   * @description max height of scrollbar\n   */\n  maxHeight: {\n    type: [String, Number],\n    default: '',\n  },\n  /**\n   * @description whether to use the native scrollbar\n   */\n  native: Boolean,\n  /**\n   * @description style of wrap\n   */\n  wrapStyle: {\n    type: definePropType<StyleValue>([String, Object, Array]),\n    default: '',\n  },\n  /**\n   * @description class of wrap\n   */\n  wrapClass: {\n    type: [String, Array],\n    default: '',\n  },\n  /**\n   * @description class of view\n   */\n  viewClass: {\n    type: [String, Array],\n    default: '',\n  },\n  /**\n   * @description style of view\n   */\n  viewStyle: {\n    type: [String, Array, Object],\n    default: '',\n  },\n  /**\n   * @description do not respond to container size changes, if the container size does not change, it is better to set it to optimize performance\n   */\n  noresize: Boolean, // 如果 container 尺寸不会发生变化，最好设置它可以优化性能\n  /**\n   * @description element tag of the view\n   */\n  tag: {\n    type: String,\n    default: 'div',\n  },\n  /**\n   * @description always show\n   */\n  always: Boolean,\n  /**\n   * @description minimum size of scrollbar\n   */\n  minSize: {\n    type: Number,\n    default: 20,\n  },\n  /**\n   * @description Wrap tabindex\n   */\n  tabindex: {\n    type: [String, Number],\n    default: undefined,\n  },\n  /**\n   * @description id of view\n   */\n  id: String,\n  /**\n   * @description role of view\n   */\n  role: String,\n  ...useAriaProps(['ariaLabel', 'ariaOrientation']),\n} as const)\n\n/**\n * @deprecated Removed after 3.0.0, Use `ScrollbarProps` instead.\n */\nexport type ScrollbarPropsPublic = ExtractPublicPropTypes<typeof scrollbarProps>\n\nexport const scrollbarEmits = {\n  'end-reached': (direction: ScrollbarDirection) =>\n    ['left', 'right', 'top', 'bottom'].includes(direction),\n  scroll: ({\n    scrollTop,\n    scrollLeft,\n  }: {\n    scrollTop: number\n    scrollLeft: number\n  }) => [scrollTop, scrollLeft].every(isNumber),\n}\nexport type ScrollbarEmits = typeof scrollbarEmits\nexport type ScrollbarDirection = 'top' | 'bottom' | 'left' | 'right'\n\nexport type ScrollbarInstance = InstanceType<typeof Scrollbar> & unknown\n"],"mappings":";;;;;;;;AA0FA,MAAa,iBAAiB,WAAW;CAIvC,UAAU;EACR,MAAM;EACN,SAAS;EACV;CAID,QAAQ;EACN,MAAM,CAAC,QAAQ,OAAO;EACtB,SAAS;EACV;CAID,WAAW;EACT,MAAM,CAAC,QAAQ,OAAO;EACtB,SAAS;EACV;CAID,QAAQ;CAIR,WAAW;EACT,MAAM,eAA2B;GAAC;GAAQ;GAAQ;GAAM,CAAC;EACzD,SAAS;EACV;CAID,WAAW;EACT,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;EACV;CAID,WAAW;EACT,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;EACV;CAID,WAAW;EACT,MAAM;GAAC;GAAQ;GAAO;GAAO;EAC7B,SAAS;EACV;CAID,UAAU;CAIV,KAAK;EACH,MAAM;EACN,SAAS;EACV;CAID,QAAQ;CAIR,SAAS;EACP,MAAM;EACN,SAAS;EACV;CAID,UAAU;EACR,MAAM,CAAC,QAAQ,OAAO;EACtB,SAAS;EACV;CAID,IAAI;CAIJ,MAAM;CACN,GAAG,aAAa,CAAC,aAAa,kBAAkB,CAAC;CAClD,CAAU;AAOX,MAAa,iBAAiB;CAC5B,gBAAgB,cACd;EAAC;EAAQ;EAAS;EAAO;EAAS,CAAC,SAAS,UAAU;CACxD,SAAS,EACP,WACA,iBAII,CAAC,WAAW,WAAW,CAAC,MAAM,SAAS;CAC9C"}