UNPKG

tdesign-vue-next

Version:
99 lines (95 loc) 3.09 kB
/** * tdesign v1.11.5 * (c) 2025 tdesign * @license MIT */ import _typeof from '@babel/runtime/helpers/typeof'; import { defineComponent, createVNode, mergeProps } from 'vue'; import { SearchIcon } from 'tdesign-icons-vue-next'; import { Input } from '../../input/index.js'; import { usePrefixClass } from '../../hooks/useConfig.js'; import { useGlobalIcon } from '../../hooks/useGlobalIcon.js'; import '../../input/input.js'; import '@babel/runtime/helpers/objectWithoutProperties'; import '@babel/runtime/helpers/defineProperty'; import '../../input/props.js'; import '../../hooks/useDisabled.js'; import 'lodash-es'; import '../../hooks/useReadonly.js'; import '../../_chunks/dep-7c56a7f5.js'; import '../../utils/render-tnode.js'; import '../../input/hooks/useInput.js'; import '@babel/runtime/helpers/slicedToArray'; import '../../form/consts/index.js'; import '../../hooks/useKeepAnimation.js'; import '../../config-provider/hooks/useConfig.js'; import '../../config-provider/utils/context.js'; import '../../_chunks/dep-c75b9b8e.js'; import '../../_chunks/dep-caecb55d.js'; import 'dayjs'; import '../../hooks/useVModel.js'; import '../../input/hooks/useLengthLimit.js'; import '../../_chunks/dep-92106726.js'; import '../../_chunks/dep-56c3d46e.js'; import '@babel/runtime/helpers/toConsumableArray'; import '../../input/hooks/useInputEventHandler.js'; import '../../input/hooks/useInputWidth.js'; import '../../hooks/useResizeObserver.js'; import '../../input/input-group.js'; import '../../input/input-group-props.js'; import '../../utils/withInstall.js'; 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 }; return function () { return createVNode("div", { "class": "".concat(classPrefix.value, "-transfer__search-wrapper") }, [createVNode(Input, mergeProps(inputProps, { "defaultValue": props.value, "onChange": handleChange, "placeholder": props.placeholder }), { "default": function _default() { return [createVNode(SearchIcon$1, { "slot": "suffix-icon" }, null)]; } })]); }; } }); export { Search as default }; //# sourceMappingURL=transfer-search.js.map