element-plus
Version:
A Component Library for Vue 3
1 lines • 5.37 kB
Source Map (JSON)
{"version":3,"file":"step.mjs","sources":["../../../../../../packages/components/tour/src/step.ts"],"sourcesContent":["import { buildProps, definePropType, iconPropType } from '@element-plus/utils'\nimport { tourContentProps } from './content'\n\nimport type { CSSProperties, Component, ExtractPublicPropTypes } from 'vue'\nimport type { TourBtnProps, TourMask } from './types'\nimport type { TourContentProps } from './content'\n\nexport interface TourStepProps {\n /**\n * @description get the element the guide card points to. empty makes it show in center of screen\n */\n target?: string | HTMLElement | (() => HTMLElement | null) | null\n /**\n * @description the title of the tour content\n */\n title?: string\n /**\n * @description description\n */\n description?: string\n /**\n * @description whether to show a close button\n */\n showClose?: boolean\n /**\n * @description custom close icon, default is Close\n */\n closeIcon?: string | Component\n /**\n * @description whether to show the arrow\n */\n showArrow?: boolean\n /**\n * @description position of the guide card relative to the target element\n */\n placement?: TourContentProps['placement']\n /**\n * @description whether to enable masking, change mask style and fill color by pass custom props\n */\n mask?: TourMask\n /**\n * @description custom style for content\n */\n contentStyle?: CSSProperties\n /**\n * @description properties of the previous button\n */\n prevButtonProps?: TourBtnProps\n /**\n * @description properties of the Next button\n */\n nextButtonProps?: TourBtnProps\n /**\n * @description support pass custom scrollIntoView options\n */\n scrollIntoViewOptions?: boolean | ScrollIntoViewOptions\n /**\n * @description type, affects the background color and text color\n */\n type?: 'default' | 'primary'\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `TourStepProps` instead.\n */\nexport const tourStepProps = buildProps({\n /**\n * @description get the element the guide card points to. empty makes it show in center of screen\n */\n target: {\n type: definePropType<\n string | HTMLElement | (() => HTMLElement | null) | null\n >([String, Object, Function]),\n },\n /**\n * @description the title of the tour content\n */\n title: String,\n /**\n * @description description\n */\n description: String,\n /**\n * @description whether to show a close button\n */\n showClose: {\n type: Boolean,\n default: undefined,\n },\n /**\n * @description custom close icon, default is Close\n */\n closeIcon: {\n type: iconPropType,\n },\n /**\n * @description whether to show the arrow\n */\n showArrow: {\n type: Boolean,\n default: undefined,\n },\n /**\n * @description position of the guide card relative to the target element\n */\n placement: tourContentProps.placement,\n /**\n * @description whether to enable masking, change mask style and fill color by pass custom props\n */\n mask: {\n type: definePropType<TourMask>([Boolean, Object]),\n default: undefined,\n },\n /**\n * @description custom style for content\n */\n contentStyle: {\n type: definePropType<CSSProperties>([Object]),\n },\n /**\n * @description properties of the previous button\n */\n prevButtonProps: {\n type: definePropType<TourBtnProps>(Object),\n },\n /**\n * @description properties of the Next button\n */\n nextButtonProps: {\n type: definePropType<TourBtnProps>(Object),\n },\n /**\n * @description support pass custom scrollIntoView options\n */\n scrollIntoViewOptions: {\n type: definePropType<boolean | ScrollIntoViewOptions>([Boolean, Object]),\n default: undefined,\n },\n /**\n * @description type, affects the background color and text color\n */\n type: {\n type: definePropType<'default' | 'primary'>(String),\n },\n})\n\n/**\n * @deprecated Removed after 3.0.0, Use `TourStepProps` instead.\n */\nexport type TourStepPropsPublic = ExtractPublicPropTypes<typeof tourStepProps>\n\nexport const tourStepEmits = {\n close: () => true,\n}\nexport type TourStepEmits = typeof tourStepEmits\n"],"names":[],"mappings":";;;;AAiEO,MAAM,gBAAgB,UAAA,CAAW;AAAA;AAAA;AAAA;AAAA,EAItC,MAAA,EAAQ;AAAA,IACN,MAAM,cAAA,CAEJ,CAAC,MAAA,EAAQ,MAAA,EAAQ,QAAQ,CAAC;AAAA,GAC9B;AAAA;AAAA;AAAA;AAAA,EAIA,KAAA,EAAO,MAAA;AAAA;AAAA;AAAA;AAAA,EAIP,WAAA,EAAa,MAAA;AAAA;AAAA;AAAA;AAAA,EAIb,SAAA,EAAW;AAAA,IACT,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,SAAA,EAAW;AAAA,IACT,IAAA,EAAM;AAAA,GACR;AAAA;AAAA;AAAA;AAAA,EAIA,SAAA,EAAW;AAAA,IACT,IAAA,EAAM,OAAA;AAAA,IACN,OAAA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