tdesign-react
Version:
TDesign Component for React
34 lines (30 loc) • 1.61 kB
JavaScript
/**
* tdesign v1.16.2
* (c) 2025 tdesign
* @license MIT
*/
import useConfig from './useConfig.js';
import 'react';
import '../config-provider/ConfigContext.js';
import '../_chunks/dep-d67deb2c.js';
import '../_chunks/dep-8abcbcbc.js';
import 'lodash-es';
import '../_chunks/dep-6b235a32.js';
import '../_chunks/dep-b9afa32b.js';
import 'dayjs';
function useInnerPopupVisible(handler) {
var _useConfig = useConfig(),
classPrefix = _useConfig.classPrefix;
var isClearIconClick = function isClearIconClick(target) {
var _target$closest, _target$closest2, _target$closest3;
if (!target || !(target instanceof Element)) return false;
return !!(target !== null && target !== void 0 && (_target$closest = target.closest) !== null && _target$closest !== void 0 && _target$closest.call(target, ".".concat(classPrefix, "-input__suffix-clear")) || target !== null && target !== void 0 && (_target$closest2 = target.closest) !== null && _target$closest2 !== void 0 && _target$closest2.call(target, ".".concat(classPrefix, "-tag-input__suffix-clear")) || target !== null && target !== void 0 && (_target$closest3 = target.closest) !== null && _target$closest3 !== void 0 && _target$closest3.call(target, ".".concat(classPrefix, "-range-input__suffix-clear")));
};
return function (visible, ctx) {
var _ctx$e;
if (isClearIconClick(ctx === null || ctx === void 0 || (_ctx$e = ctx.e) === null || _ctx$e === void 0 ? void 0 : _ctx$e.target) && visible) return;
handler(visible, ctx);
};
}
export { useInnerPopupVisible as default };
//# sourceMappingURL=useInnerPopupVisible.js.map