UNPKG

tdesign-vue-next

Version:
102 lines (98 loc) 3.24 kB
/** * tdesign v1.20.3 * (c) 2026 tdesign * @license MIT */ import { defineComponent, createVNode, mergeProps } from 'vue'; import { _ as _typeof } from '../../_chunks/dep-d84a2ec7.mjs'; import { SearchIcon } from 'tdesign-icons-vue-next'; import { Input } from '../../input/index.mjs'; import { u as usePrefixClass, i as useGlobalIcon, p as useEventForward } from '../../_chunks/dep-5975d369.mjs'; import '../../input/input.mjs'; import '../../_chunks/dep-b9c8a688.mjs'; import '../../_chunks/dep-07d8f2aa.mjs'; import '../../input/props.mjs'; import '../../input/hooks/index.mjs'; import '../../input/hooks/useInput.mjs'; import '../../_chunks/dep-ff183185.mjs'; import '../../_chunks/dep-390963eb.mjs'; import '../../form/constants/index.mjs'; import 'lodash-es'; import '../../_chunks/dep-adf8ce39.mjs'; import '../../_chunks/dep-12b4e978.mjs'; import '../../_chunks/dep-0841ee8f.mjs'; import '../../config-provider/hooks/useConfig.mjs'; import '../../config-provider/utils/context.mjs'; import '../../_chunks/dep-cf105282.mjs'; import '../../_chunks/dep-dcbc09c5.mjs'; import '../../_chunks/dep-9fc6972b.mjs'; import '../../_chunks/dep-a1cbfaae.mjs'; import '../../_chunks/dep-3f53eff0.mjs'; import '../../_chunks/dep-4c65e11b.mjs'; import '../../_chunks/dep-46776e3b.mjs'; import '../../_chunks/dep-8aebe545.mjs'; import '../../input/hooks/useLengthLimit.mjs'; import '../../_chunks/dep-ad9e539e.mjs'; import '../../_chunks/dep-92b8be55.mjs'; import '../../input/hooks/useInputEventHandler.mjs'; import '../../input/hooks/useInputWidth.mjs'; import '../../input/input-group.mjs'; import '../../input/input-group-props.mjs'; import './style/css.mjs'; var Search = defineComponent({ name: "TTransferSearch", props: { value: { type: String, "default": "" }, search: { type: [Boolean, Object], "default": false }, placeholder: { type: String, "default": "" }, onChange: Function }, setup: function setup(props) { var classPrefix = usePrefixClass(); var _useGlobalIcon = useGlobalIcon({ SearchIcon: SearchIcon }), SearchIcon$1 = _useGlobalIcon.SearchIcon; var handleChange = function handleChange(value, changeCtx) { var _props$onChange; var e = changeCtx.e, trigger = changeCtx.trigger; (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, { value: value, e: e, trigger: trigger }); }; var inputProps = _typeof(props.search) === "object" ? props.search : { clearable: true }; var inputEvents = useEventForward(inputProps, { onChange: handleChange }); return function () { return createVNode("div", { "class": "".concat(classPrefix.value, "-transfer__search-wrapper") }, [createVNode(Input, mergeProps({ "defaultValue": props.value, "placeholder": props.placeholder }, inputEvents.value), { "default": function _default() { return [createVNode(SearchIcon$1, { "slot": "suffix-icon" }, null)]; } })]); }; } }); export { Search as default }; //# sourceMappingURL=transfer-search.mjs.map