element-plus
Version:
A Component Library for Vue 3
1 lines • 5.51 kB
Source Map (JSON)
{"version":3,"file":"carousel.mjs","sources":["../../../../../../packages/components/carousel/src/carousel.ts"],"sourcesContent":["import { buildProps, isNumber } from '@element-plus/utils'\n\nimport type { ExtractPublicPropTypes } from 'vue'\n\nexport interface CarouselProps {\n /**\n * @description index of the initially active slide (starting from 0)\n */\n initialIndex?: number\n /**\n * @description height of the carousel\n */\n height?: string\n /**\n * @description how indicators are triggered\n */\n trigger?: 'hover' | 'click'\n /**\n * @description whether automatically loop the slides\n */\n autoplay?: boolean\n /**\n * @description interval of the auto loop, in milliseconds\n */\n interval?: number\n /**\n * @description position of the indicators\n */\n indicatorPosition?: '' | 'none' | 'outside'\n /**\n * @description when arrows are shown\n */\n arrow?: 'always' | 'hover' | 'never'\n /**\n * @description type of the Carousel\n */\n type?: '' | 'card'\n /**\n * @description when type is card, scaled size of secondary cards\n */\n cardScale?: number\n /**\n * @description display the items in loop\n */\n loop?: boolean\n /**\n * @description display direction\n */\n direction?: 'horizontal' | 'vertical'\n /**\n * @description pause autoplay when hover\n */\n pauseOnHover?: boolean\n /**\n * @description infuse dynamism and smoothness into the carousel\n */\n motionBlur?: boolean\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `CarouselProps` instead.\n */\nexport const carouselProps = buildProps({\n /**\n * @description index of the initially active slide (starting from 0)\n */\n initialIndex: {\n type: Number,\n default: 0,\n },\n /**\n * @description height of the carousel\n */\n height: {\n type: String,\n default: '',\n },\n /**\n * @description how indicators are triggered\n */\n trigger: {\n type: String,\n values: ['hover', 'click'],\n default: 'hover',\n },\n /**\n * @description whether automatically loop the slides\n */\n autoplay: {\n type: Boolean,\n default: true,\n },\n /**\n * @description interval of the auto loop, in milliseconds\n */\n interval: {\n type: Number,\n default: 3000,\n },\n /**\n * @description position of the indicators\n */\n indicatorPosition: {\n type: String,\n values: ['', 'none', 'outside'],\n default: '',\n },\n /**\n * @description when arrows are shown\n */\n arrow: {\n type: String,\n values: ['always', 'hover', 'never'],\n default: 'hover',\n },\n /**\n * @description type of the Carousel\n */\n type: {\n type: String,\n values: ['', 'card'],\n default: '',\n },\n /**\n * @description when type is card, scaled size of secondary cards\n */\n cardScale: {\n type: Number,\n default: 0.83,\n },\n /**\n * @description display the items in loop\n */\n loop: {\n type: Boolean,\n default: true,\n },\n /**\n * @description display direction\n */\n direction: {\n type: String,\n values: ['horizontal', 'vertical'],\n default: 'horizontal',\n },\n /**\n * @description pause autoplay when hover\n */\n pauseOnHover: {\n type: Boolean,\n default: true,\n },\n /**\n * @description infuse dynamism and smoothness into the carousel\n */\n motionBlur: Boolean,\n} as const)\n\nexport const carouselEmits = {\n /**\n * @description triggers when the active slide switches\n * @param current index of the new active slide\n * @param prev index of the old active slide\n */\n change: (current: number, prev: number) => [current, prev].every(isNumber),\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `CarouselProps` instead.\n */\nexport type CarouselPropsPublic = ExtractPublicPropTypes<typeof carouselProps>\nexport type CarouselEmits = typeof carouselEmits\n"],"names":[],"mappings":";;;AA8DO,MAAM,gBAAgB,UAAA,CAAW;AAAA;AAAA;AAAA;AAAA,EAItC,YAAA,EAAc;AAAA,IACZ,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,OAAA,EAAS;AAAA,IACP,IAAA,EAAM,MAAA;AAAA,IACN,MAAA,EAAQ,CAAC,OAAA,EAAS,OAAO,CAAA;AAAA,IACzB,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,MAA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