{"version":3,"file":"slider2.js","sources":["../../../../../../packages/components/slider/src/slider.ts"],"sourcesContent":["import { placements } from '@popperjs/core'\nimport {\n buildProps,\n definePropType,\n isArray,\n isNumber,\n} from '@element-plus/utils'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { useAriaProps, useSizeProp } from '@element-plus/hooks'\nimport type { Arrayable } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type { SliderMarkerProps } from './marker'\nimport type Slider from './slider.vue'\n\ntype SliderMarks = Record\n\nexport interface SliderInitData {\n firstValue: number\n secondValue: number\n oldValue?: Arrayable\n dragging: boolean\n sliderSize: number\n}\n\nexport const sliderProps = buildProps({\n /**\n * @description binding value\n */\n modelValue: {\n type: definePropType>([Number, Array]),\n default: 0,\n },\n id: {\n type: String,\n default: undefined,\n },\n /**\n * @description minimum value\n */\n min: {\n type: Number,\n default: 0,\n },\n /**\n * @description maximum value\n */\n max: {\n type: Number,\n default: 100,\n },\n /**\n * @description step size\n */\n step: {\n type: Number,\n default: 1,\n },\n /**\n * @description whether to display an input box, works when `range` is false\n */\n showInput: Boolean,\n /**\n * @description whether to display control buttons when `show-input` is true\n */\n showInputControls: {\n type: Boolean,\n default: true,\n },\n /**\n * @description size of the slider wrapper, will not work in vertical mode\n */\n size: useSizeProp,\n /**\n * @description size of the input box, when set `size`, the default is the value of `size`\n */\n inputSize: useSizeProp,\n /**\n * @description whether to display breakpoints\n */\n showStops: Boolean,\n /**\n * @description whether to display tooltip value\n */\n showTooltip: {\n type: Boolean,\n default: true,\n },\n /**\n * @description format to display tooltip value\n */\n formatTooltip: {\n type: definePropType<(val: number) => number | string>(Function),\n default: undefined,\n },\n /**\n * @description whether Slider is disabled\n */\n disabled: Boolean,\n /**\n * @description whether to select a range\n */\n range: Boolean,\n /**\n * @description vertical mode\n */\n vertical: Boolean,\n /**\n * @description slider height, required in vertical mode\n */\n height: String,\n /**\n * @description debounce delay when typing, in milliseconds, works when `show-input` is true\n */\n debounce: {\n type: Number,\n default: 300,\n },\n /**\n * @description when `range` is true, screen reader label for the start of the range\n */\n rangeStartLabel: {\n type: String,\n default: undefined,\n },\n /**\n * @description when `range` is true, screen reader label for the end of the range\n */\n rangeEndLabel: {\n type: String,\n default: undefined,\n },\n /**\n * @description format to display the `aria-valuenow` attribute for screen readers\n */\n formatValueText: {\n type: definePropType<(val: number) => string>(Function),\n default: undefined,\n },\n /**\n * @description custom class name for the tooltip\n */\n tooltipClass: {\n type: String,\n default: undefined,\n },\n /**\n * @description position of Tooltip\n */\n placement: {\n type: String,\n values: placements,\n default: 'top',\n },\n /**\n * @description marks, type of key must be `number` and must in closed interval `[min, max]`, each mark can custom style\n */\n marks: {\n type: definePropType(Object),\n },\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n ...useAriaProps(['ariaLabel']),\n} as const)\nexport type SliderProps = ExtractPropTypes\n\nconst isValidValue = (value: Arrayable) =>\n isNumber(value) || (isArray(value) && value.every(isNumber))\nexport const sliderEmits = {\n [UPDATE_MODEL_EVENT]: isValidValue,\n [INPUT_EVENT]: isValidValue,\n [CHANGE_EVENT]: isValidValue,\n}\nexport type SliderEmits = typeof sliderEmits\n\nexport type SliderInstance = InstanceType\n"],"names":["buildProps","definePropType","useSizeProp","placements","useAriaProps","isNumber","isArray","UPDATE_MODEL_EVENT","INPUT_EVENT","CHANGE_EVENT"],"mappings":";;;;;;;;;;;;;;;AAaY,MAAC,WAAW,GAAGA,kBAAU,CAAC;AACtC,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAEC,sBAAc,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACzC,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,GAAG,EAAE;A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