UNPKG

zent

Version:

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

14 lines (13 loc) 823 B
import { __assign } from "tslib"; import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { memo, useCallback } from 'react'; import Icon from '../icon'; function SelectTag(_a) { var item = _a.item, onRemove = _a.onRemove, renderValue = _a.renderValue; var onClick = useCallback(function (e) { e.stopPropagation(); onRemove(item); }, [onRemove, item]); return (_jsxs("div", __assign({ className: "zent-select-v2-tag", "data-zv": '10.0.17' }, { children: [renderValue ? (renderValue(item)) : (_jsx("span", __assign({ title: item.text, className: "zent-select-v2-tag-text", "data-zv": '10.0.17' }, { children: item.text }), void 0)), _jsx(Icon, { type: "close", className: "zent-select-v2-tag-close", onClick: onClick }, void 0)] }), void 0)); } export default memo(SelectTag);