UNPKG

tdesign-vue

Version:
109 lines (105 loc) 4.08 kB
/** * tdesign v1.14.1 * (c) 2025 tdesign * @license MIT */ import _defineProperty from '@babel/runtime/helpers/defineProperty'; import { FileCopyIcon } from 'tdesign-icons-vue'; import copyText from '../utils/clipboard.js'; import { MessagePlugin } from '../message/plugin.js'; import props from './anchor-target-props.js'; import { Popup } from '../popup/index.js'; import mixins from '../utils/mixins.js'; import getConfigReceiverMixins, { getGlobalIconMixins } from '../config-provider/config-receiver.js'; import 'clipboard'; import '@babel/runtime/helpers/typeof'; import 'vue'; import '../message/messageList.js'; import '../message/const.js'; import '../message/message.js'; import '../loading/index.js'; import '../loading/directive.js'; import 'lodash-es'; import '../loading/plugin.js'; import '../loading/loading.js'; import '../loading/icon/gradient.js'; import '../_common/js/loading/circle-adapter.js'; import '../_common/js/utils/setStyle.js'; import '../_common/js/utils/helper.js'; import '@babel/runtime/helpers/toConsumableArray'; import '@babel/runtime/helpers/objectWithoutProperties'; import '@babel/runtime/helpers/slicedToArray'; import '../utils/dom.js'; import 'raf'; import '../utils/easing.js'; import '../utils/render-tnode.js'; import '@babel/runtime/helpers/readOnlyError'; import '@vue/composition-api'; import '../utils/transfer-dom.js'; import '../loading/props.js'; import '../config.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 '../utils/withInstall.js'; import '../message/props.js'; import '../message/animation.js'; import '../popup/popup.js'; import '@popperjs/core'; import '../utils/helper.js'; import '../popup/props.js'; import '../popup/container.js'; import '../utils/event.js'; import '../popup/utils.js'; import '../utils/map-props.js'; import '../popup/plugin.js'; import '../_common/js/log/log.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 _AnchorTarget = mixins(getConfigReceiverMixins("anchor"), getGlobalIconMixins()).extend({ name: "TAnchorTarget", props: _objectSpread({}, props), methods: { copyText: function copyText$1() { var a = document.createElement("a"); a.href = "#".concat(this.id); copyText(a.href); MessagePlugin.success(this.global.copySuccessText, 1e3); } }, render: function render() { var h = arguments[0]; var Tag = this.tag, children = this.$scopedSlots["default"], id = this.id; var _this$useGlobalIcon = this.useGlobalIcon({ FileCopyIcon: FileCopyIcon }), FileCopyIcon$1 = _this$useGlobalIcon.FileCopyIcon; var className = ["".concat(this.componentName, "__target")]; var iconClassName = "".concat(this.componentName, "__copy"); return h(Tag, { "attrs": { "id": id }, "class": className }, [children && children(null), h(Popup, { "attrs": { "content": this.global.copyText, "placement": "top", "showArrow": true }, "class": iconClassName }, [h(FileCopyIcon$1, { "nativeOn": { "click": this.copyText } })])]); } }); export { _AnchorTarget as default }; //# sourceMappingURL=anchor-target.js.map