tdesign-vue
Version:
107 lines (103 loc) • 3.83 kB
JavaScript
/**
* tdesign v1.14.1
* (c) 2025 tdesign
* @license MIT
*/
import { h as helper } from '../../_chunks/dep-6a4dc7bb.js';
import _defineProperty from '@babel/runtime/helpers/defineProperty';
import _typeof from '@babel/runtime/helpers/typeof';
import { SearchIcon } from 'tdesign-icons-vue';
import { Input } from '../../input/index.js';
import mixins from '../../utils/mixins.js';
import { getGlobalIconMixins } from '../../config-provider/config-receiver.js';
import '../../input/input.js';
import '@babel/runtime/helpers/toConsumableArray';
import '@babel/runtime/helpers/slicedToArray';
import 'lodash-es';
import '../../_common/js/utils/helper.js';
import '@babel/runtime/helpers/objectWithoutProperties';
import '../../utils/helper.js';
import '../../utils/event.js';
import '../../input/props.js';
import '../../utils/render-tnode.js';
import '@babel/runtime/helpers/readOnlyError';
import 'vue';
import '@vue/composition-api';
import '../../_common/js/log/log.js';
import '../../config-provider/context.js';
import '../../_common/js/global-config/default-config.js';
import '../../_common/js/global-config/locale/zh_CN.js';
import '../../_chunks/dep-ba613a02.js';
import '../../_chunks/dep-fdb1b253.js';
import 'dayjs';
import '../../_common/js/global-config/t.js';
import '../../input/input-group.js';
import '../../utils/map-props.js';
import '../../utils/withInstall.js';
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var Search = mixins(getGlobalIconMixins()).extend({
name: "TTransferSearch",
model: {
prop: "searchValue",
event: "change"
},
props: {
searchValue: {
type: String,
"default": ""
},
search: {
type: [Boolean, Object]
},
placeholder: String,
classPrefix: String
},
render: function render() {
var _this = this;
var h = arguments[0];
var _this$useGlobalIcon = this.useGlobalIcon({
SearchIcon: SearchIcon
}),
SearchIcon$1 = _this$useGlobalIcon.SearchIcon;
var searchValue = this.searchValue,
search = this.search,
placeholder = this.placeholder,
classPrefix = this.classPrefix;
var inputProps = _typeof(search) === "object" ? search : {
clearable: true
};
var handleSearch = function handleSearch(value, trigger, changeCtx) {
_this.$emit("search", {
value: value,
trigger: trigger,
e: changeCtx.e
});
};
var handleChange = function handleChange(value, changeCtx) {
_this.$emit("change", value);
handleSearch(value, "input", changeCtx);
};
var handleEnter = function handleEnter(value, changeCtx) {
handleSearch(value, "enter", changeCtx);
};
return h("div", {
"class": "".concat(classPrefix, "-transfer__search-wrapper")
}, [h(Input, helper([{}, {
"props": _objectSpread({}, inputProps)
}, {
"attrs": {
"value": searchValue,
"placeholder": placeholder
},
"on": {
"change": handleChange,
"enter": handleEnter
}
}]), [h(SearchIcon$1, {
"slot": "suffix-icon"
})])]);
}
});
export { Search as default };
//# sourceMappingURL=transfer-search.js.map