/**
 * ldesign v0.2.14
 * (c) 2022/11/2 16:16 built by swimly
 * @license MIT
 */

import { FileCopyIcon } from '@ldesign/icons-vue';
import copyText from '../../utils/clipboard.js';
import { MessagePlugin } from '../message/plugin.js';
import { Popup } from '../popup/index.js';
import mixins from '../../utils/mixins.js';
import getConfigReceiverMixins, { getGlobalIconMixins } from '../config-provider/config-receiver.js';
import { AnchorTargetProps } from './props.js';
import 'clipboard';
import 'vue';
import '../../utils/dom.js';
import 'raf';
import 'lodash/isString';
import '../../chunks/index.js';
import '../../chunks/log.js';
import '../../chunks/_commonjsHelpers-2e6815bd.js';
import '../../utils/easing.js';
import '../message/list.js';
import '../message/const.js';
import '../message/message.js';
import '../loading/index.js';
import '../../utils/with-install.js';
import 'lodash';
import '../../config.js';
import '../loading/loading.js';
import '../../utils/render-node.js';
import '../../utils/transfer-dom.js';
import '../loading/props.js';
import '../loading/icon/gradient.js';
import '../../chunks/defineProperty-838e4192.js';
import '../../chunks/set-style.js';
import '../../chunks/helper2.js';
import 'lodash/mergeWith';
import '../config-provider/context.js';
import '../../chunks/zh_CN.js';
import '../config-provider/type.js';
import '../loading/style/css.js';
import '../loading/type.js';
import '../loading/plugin.js';
import '../message/animation.js';
import '../message/props.js';
import '../../utils/map-props.js';
import '../popup/popup.js';
import '@popperjs/core';
import '../../utils/helper.js';
import 'lodash/camelCase';
import '../popup/props.js';
import '../popup/container.js';
import '../popup/style/css.js';
import '../popup/type.js';

var _AnchorTarget = mixins(getConfigReceiverMixins("anchor"), getGlobalIconMixins()).extend({
  name: "LAnchorTarget",
  props: {
    ...AnchorTargetProps
  },
  components: {
    LPopup: Popup
  },
  methods: {
    copyText() {
      const a = document.createElement("a");
      a.href = `#${this.id}`;
      copyText(a.href);
      MessagePlugin.success(this.global.copySuccessText, 1e3);
    }
  },
  render() {
    const h = arguments[0];
    const {
      tag: Tag,
      $scopedSlots: {
        default: children
      },
      id
    } = this;
    const {
      FileCopyIcon: FileCopyIcon$1
    } = this.useGlobalIcon({
      FileCopyIcon: FileCopyIcon
    });
    const className = [`${this.componentName}__target`];
    const iconClassName = `${this.componentName}__copy`;
    return h(Tag, {
      "attrs": {
        "id": id
      },
      "class": className
    }, [children && children(null), h("l-popup", {
      "attrs": {
        "content": this.global.copyText,
        "placement": "top",
        "showArrow": true
      },
      "class": iconClassName
    }, [h(FileCopyIcon$1, {
      "nativeOn": {
        "click": this.copyText
      }
    })])]);
  }
});

export { _AnchorTarget as default };
//# sourceMappingURL=target.js.map
