{"version":3,"file":"scrollbar.mjs","sources":["../../../../../../../packages/components/scrollbar/src/scrollbar.ts"],"sourcesContent":["import { buildProps, definePropType, isNumber } from '@hd-front-end/utils'\nimport { useAriaProps } from '@hd-front-end/hooks'\n\nimport type {\n  ExtractPropTypes,\n  StyleValue,\n  __ExtractPublicPropTypes,\n} from 'vue'\nimport type Scrollbar from './scrollbar.vue'\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)\nexport type ScrollbarProps = ExtractPropTypes<typeof scrollbarProps>\nexport type ScrollbarPropsPublic = __ExtractPublicPropTypes<\n  typeof scrollbarProps\n>\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"],"names":[],"mappings":";;;;AAUO,MAAM,iBAAiB,UAAW,CAAA;AAAA,EAIvC,QAAU,EAAA;AAAA,IACR,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,CAAA;AAAA,GACX;AAAA,EAIA,MAAQ,EAAA;AAAA,IACN,IAAA,EAAM,CAAC,MAAA,EAAQ,MAAM,CAAA;AAAA,IACrB,OAAS,EAAA,EAAA;AAAA,GACX;AAAA,EAIA,SAAW,EAAA;AAAA,IACT,IAAA,EAAM,CAAC,MAAA,EAAQ,MAAM,CAAA;AAAA,IACrB,OAAS,EAAA,EAAA;AAAA,GACX;AAAA,EAIA,MAAQ,EAAA,OAAA;AAAA,EAIR,SAAW,EAAA;AAAA,IACT,MAAM,cAA2B,CAAA,CAAC,MAAQ,EAAA,MAAA,EAAQ,KAAK,CAAC,CAAA;AAAA,IACxD,OAAS,EAAA,EAAA;AAAA,GACX;AAAA,EAIA,SAAW,EAAA;AAAA,IACT,IAAA,EAAM,CAAC,MAAA,EAAQ,KAAK,CAAA;AAAA,IACpB,OAAS,EAAA,EAAA;AAAA,GACX;AAAA,EAIA,SAAW,EAAA;AAAA,IACT,IAAA,EAAM,CAAC,MAAA,EAAQ,KAAK,CAAA;AAAA,IACpB,OAAS,EAAA,EAAA;AAAA,GACX;AAAA,EAIA,SAAW,EAAA;AAAA,IACT,IAAM,EAAA,CAAC,MAAQ,EAAA,KA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