UNPKG

md-editor-v3

Version:

Markdown editor for vue3, developed in jsx and typescript, dark theme、beautify content by prettier、render articles directly、paste or clip the picture and upload it...

154 lines (153 loc) 3.02 kB
import { defineComponent as r, createVNode as d, Fragment as c, isVNode as y } from "vue"; import { M as g } from "./chunks/index2.mjs"; import { p as a } from "./chunks/config.mjs"; import { g as i } from "./chunks/vue-tsx.mjs"; function m(e) { return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !y(e); } const h = { title: { type: String, default: "" }, modalTitle: { type: [String, Object], default: "" }, visible: { type: Boolean, default: void 0 }, width: { type: String, default: "auto" }, height: { type: String, default: "auto" }, // 展示在工具栏的内容,通常是个图标 trigger: { type: [String, Object], default: void 0 }, onClick: { type: Function, default: void 0 }, onClose: { type: Function, default: void 0 }, /** * 显示全屏按钮 */ showAdjust: { type: Boolean, default: !1 }, isFullscreen: { type: Boolean, default: !1 }, onAdjust: { type: Function, default: void 0 }, class: { type: String, default: void 0 }, style: { type: [Object, String], default: void 0 }, showMask: { type: Boolean, default: !0 }, /** * ==没有意义,仅用于规避克隆组件自动嵌入insert方法时,传入的是该组件而产生的waring */ insert: { type: Function, default: void 0 }, language: { type: String, default: void 0 }, theme: { type: String, default: void 0 }, previewTheme: { type: String, default: void 0 }, codeTheme: { type: String, default: void 0 }, disabled: { type: Boolean, default: void 0 }, showToolbarName: { type: Boolean, default: void 0 } /** * ==结束 */ }, o = /* @__PURE__ */ r({ name: "ModalToolbar", props: h, emits: ["onClick", "onClose", "onAdjust"], setup(e, t) { const u = () => { e.onClose?.(), t.emit("onClose"); }, s = (n) => { e.onAdjust?.(n), t.emit("onAdjust", n); }; return () => { const n = i({ props: e, ctx: t }, "trigger"), f = i({ props: e, ctx: t }, "modalTitle"), l = i({ props: e, ctx: t }); return d(c, null, [d("button", { class: [`${a}-toolbar-item`, e.disabled && `${a}-disabled`], title: e.title, disabled: e.disabled, onClick: () => { e.onClick?.(), t.emit("onClick"); }, type: "button" }, [n]), d(g, { style: e.style, class: e.class, width: e.width, height: e.height, title: f, visible: e.visible, showMask: e.showMask, onClose: u, showAdjust: e.showAdjust, isFullscreen: e.isFullscreen, onAdjust: s }, m(l) ? l : { default: () => [l] })]); }; } }); o.install = (e) => (e.component(o.name, o), e); export { o as default };