/**
 * 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/dep-70c789e5.js';
import '../../_chunks/dep-5210251b.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/dep-eb467ddf.js';
import '../../_chunks/dep-cf772670.js';
import '../../_chunks/dep-47d77fc8.js';
import 'lodash/mergeWith';
import '../config-provider/context.js';
import '../../_chunks/dep-def4c2ce.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';

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
