UNPKG

zent

Version:

一套前端设计语言和基于React的实现

14 lines (13 loc) 769 B
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime"; import cx from 'classnames'; import { getLeft } from './common'; function isActive(value, left, right) { return value >= left && value <= right; } function Dots(_a) { var min = _a.min, max = _a.max, activeLeft = _a.activeLeft, activeRight = _a.activeRight, potentialValues = _a.potentialValues, disabled = _a.disabled; return (_jsx(_Fragment, { children: potentialValues.map(function (value) { return (_jsx("div", { className: cx('zent-slider-dot', { 'zent-slider-dot-active': !disabled && isActive(value, activeLeft, activeRight), }), style: { left: getLeft(value, min, max) + "%" }, "data-zv": '10.0.17' }, value)); }) }, void 0)); } export default Dots;