{"version":3,"file":"carousel2.mjs","sources":["../../../../../../packages/components/carousel/src/carousel.vue"],"sourcesContent":["<template>\n  <div\n    ref=\"root\"\n    :class=\"carouselClasses\"\n    @mouseenter.stop=\"handleMouseEnter\"\n    @mouseleave.stop=\"handleMouseLeave\"\n  >\n    <div :class=\"ns.e('container')\" :style=\"{ height: height }\">\n      <transition v-if=\"arrowDisplay\" name=\"carousel-arrow-left\">\n        <button\n          v-show=\"\n            (arrow === 'always' || hover) && (props.loop || activeIndex > 0)\n          \"\n          type=\"button\"\n          :class=\"[ns.e('arrow'), ns.em('arrow', 'left')]\"\n          @mouseenter=\"handleButtonEnter('left')\"\n          @mouseleave=\"handleButtonLeave\"\n          @click.stop=\"throttledArrowClick(activeIndex - 1)\"\n        >\n          <ElIcon>\n            <ArrowLeft />\n          </ElIcon>\n        </button>\n      </transition>\n      <transition v-if=\"arrowDisplay\" name=\"carousel-arrow-right\">\n        <button\n          v-show=\"\n            (arrow === 'always' || hover) &&\n            (props.loop || activeIndex < items.length - 1)\n          \"\n          type=\"button\"\n          :class=\"[ns.e('arrow'), ns.em('arrow', 'right')]\"\n          @mouseenter=\"handleButtonEnter('right')\"\n          @mouseleave=\"handleButtonLeave\"\n          @click.stop=\"throttledArrowClick(activeIndex + 1)\"\n        >\n          <ElIcon>\n            <ArrowRight />\n          </ElIcon>\n        </button>\n      </transition>\n      <slot />\n    </div>\n    <ul v-if=\"indicatorPosition !== 'none'\" :class=\"indicatorsClasses\">\n      <li\n        v-for=\"(item, index) in items\"\n        :key=\"index\"\n        :class=\"[\n          ns.e('indicator'),\n          ns.em('indicator', direction),\n          ns.is('active', index === activeIndex),\n        ]\"\n        @mouseenter=\"throttledIndicatorHover(index)\"\n        @click.stop=\"handleIndicatorClick(index)\"\n      >\n        <button :class=\"ns.e('button')\">\n          <span v-if=\"hasLabel\">{{ item.props.label }}</span>\n        </button>\n      </li>\n    </ul>\n  </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, unref } from 'vue'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { ArrowLeft, ArrowRight } from '@element-plus/icons-vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { carouselEmits, carouselProps } from './carousel'\nimport { useCarousel } from './use-carousel'\n\nconst COMPONENT_NAME = 'ElCarousel'\ndefineOptions({\n  name: COMPONENT_NAME,\n})\n\nconst props = defineProps(carouselProps)\nconst emit = defineEmits(carouselEmits)\nconst {\n  root,\n  activeIndex,\n  arrowDisplay,\n  hasLabel,\n  hover,\n  isCardType,\n  items,\n  handleButtonEnter,\n  handleButtonLeave,\n  handleIndicatorClick,\n  handleMouseEnter,\n  handleMouseLeave,\n  setActiveItem,\n  prev,\n  next,\n  throttledArrowClick,\n  throttledIndicatorHover,\n} = useCarousel(props, emit, COMPONENT_NAME)\nconst ns = useNamespace('carousel')\n\nconst carouselClasses = computed(() => {\n  const classes = [ns.b(), ns.m(props.direction)]\n  if (unref(isCardType)) {\n    classes.push(ns.m('card'))\n  }\n  return classes\n})\n\nconst indicatorsClasses = computed(() => {\n  const classes = [ns.e('indicators'), ns.em('indicators', props.direction)]\n  if (unref(hasLabel)) {\n    classes.push(ns.em('indicators', 'labels'))\n  }\n  if (props.indicatorPosition === 'outside' || unref(isCardType)) {\n    classes.push(ns.em('indicators', 'outside'))\n  }\n  return classes\n})\n\ndefineExpose({\n  /** @description manually switch slide */\n  setActiveItem,\n  /** @description switch to the previous slide */\n  prev,\n  /** @description switch to the next slide */\n  next,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;mCAwEc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;;AAIA,IAAM,MAAA;AAAA,MACJ,IAAA;AAAA,MACA,WAAA;AAAA,MACA,YAAA;AAAA,MACA,QAAA;AAAA,MACA,KAAA;AAAA,MACA,UAAA;AAAA,MACA,KAAA;AAAA,MACA,iBAAA;AAAA,MACA,iBAAA;AAAA,MACA,oBAAA;AAAA,MACA,gBAAA;AAAA,MACA,gBAA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