UNPKG

yanzhen-design-vue

Version:

114 lines (113 loc) 5.66 kB
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); const vue = require("vue"); const antDesignVue = require("ant-design-vue"); require("../../text-preview/index.cjs"); require("./rich-text.vue.cjs"); const richTextProps = require("./rich-text-props.cjs"); const useTextPreview = require("../../text-preview/src/use-text-preview.cjs"); const richText_vue_vue_type_script_setup_true_lang = require("./rich-text.vue2.cjs"); const _sfc_main = /* @__PURE__ */ vue.defineComponent({ ...{ name: richTextProps.richTextPreviewName, inheritAttrs: true }, __name: "rich-text-preview", props: richTextProps.richTextPreviewProps, emits: richTextProps.richTextPreviewEmits, setup(__props, { emit: __emit }) { const { ns } = richTextProps.richTextOptions; const props = __props; const emit = __emit; const { previewTextRef } = useTextPreview.useTextPreview(props, emit); const open = vue.ref(false); const tooltipOpen = vue.ref(false); function handleClick() { tooltipOpen.value = false; open.value = true; } return (_ctx, _cache) => { return props.value ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Tooltip), { key: 0, open: tooltipOpen.value, "onUpdate:open": _cache[1] || (_cache[1] = ($event) => tooltipOpen.value = $event), "overlay-class-name": vue.unref(ns).b("preview-tooltip") }, vue.createSlots({ default: vue.withCtx(() => [ vue.createVNode(vue.unref(antDesignVue.Button), { type: "link", class: vue.normalizeClass([vue.unref(ns).b("preview")]), onClick: handleClick }, { default: vue.withCtx(() => _cache[2] || (_cache[2] = [ vue.createElementVNode("svg", { width: "20px", height: "20px", viewBox: "0 0 20 20" }, [ vue.createElementVNode("g", { id: "页面-1", stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd" }, [ vue.createElementVNode("g", { id: "图标汇总", transform: "translate(-35.000000, -415.000000)", "fill-rule": "nonzero" }, [ vue.createElementVNode("g", { id: "富文本备份-2", transform: "translate(35.000000, 415.000000)" }, [ vue.createElementVNode("rect", { id: "矩形", fill: "#000000", opacity: "0", x: "0", y: "0", width: "20", height: "20" }), vue.createElementVNode("path", { id: "形状", d: "M13.9090909,6.18181818 L6.27272727,6.18181818 C5.9090909,6.18181818 5.54545455,6.45454545 5.54545455,6.90909092 C5.54545455,7.36363639 5.90909092,7.63636365 6.27272727,7.63636363 L9.36363637,7.63636363 L9.36363637,14.3636364 C9.36363637,14.7272727 9.72727273,15.0909091 10.0909091,15.0909091 C10.4545454,15.0909091 10.8181818,14.7272727 10.8181818,14.3636364 L10.8181818,7.63636363 L13.9090909,7.63636363 C14.2727273,7.63636363 14.6363636,7.27272727 14.6363636,6.90909092 C14.6363636,6.54545457 14.2727273,6.18181818 13.9090909,6.18181818 Z M16.4545454,1 L3.45454545,1 C2.09090908,1 0.909090918,2.18181818 0.909090918,3.54545455 L0.909090918,16.5454546 C0.909090918,17.9090909 2.0909091,19.0909091 3.45454545,19.0909091 L16.4545454,19.0909091 C17.9090909,19.0909091 19,18 19,16.5454546 L19,3.45454545 C19,2.09090908 17.9090909,1 16.4545454,1 Z M17.6363636,16.5454546 C17.6363636,17.1818182 17.1818182,17.6363636 16.5454546,17.6363636 L3.54545455,17.6363636 C2.90909092,17.6363636 2.45454545,17.1818182 2.45454545,16.5454546 L2.45454545,3.45454545 C2.45454545,2.81818182 2.9090909,2.36363637 3.54545455,2.36363637 L16.5454546,2.36363637 C17.1818182,2.36363637 17.6363636,2.81818182 17.6363636,3.45454545 L17.6363636,16.5454546 Z", fill: "#979797" }) ]) ]) ]) ], -1) ])), _: 1 }, 8, ["class"]), vue.createVNode(vue.unref(antDesignVue.Modal), { open: open.value, "onUpdate:open": _cache[0] || (_cache[0] = ($event) => open.value = $event), width: "80vh", footer: null }, { default: vue.withCtx(() => [ vue.createVNode(richText_vue_vue_type_script_setup_true_lang.default, vue.mergeProps({ style: { "height": "70vh" } }, props, { disabled: "", "show-toolbar": false }), null, 16) ]), _: 1 }, 8, ["open"]) ]), _: 2 }, [ vue.unref(previewTextRef) ? { name: "title", fn: vue.withCtx(() => [ vue.createElementVNode("div", { class: vue.normalizeClass(vue.unref(ns).b("preview-tooltip-title")), onClick: vue.withModifiers(handleClick, ["stop"]) }, vue.toDisplayString(vue.unref(previewTextRef)), 3) ]), key: "0" } : void 0 ]), 1032, ["open", "overlay-class-name"])) : vue.createCommentVNode("", true); }; } }); exports.default = _sfc_main;