UNPKG

@progress/kendo-vue-editor

Version:
59 lines (58 loc) 1.64 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { Button as c } from "@progress/kendo-vue-buttons"; import { provideLocalizationService as a } from "@progress/kendo-vue-intl"; import { messages as m } from "../messages/main.mjs"; import { EditorToolsSettings as u } from "../config/toolsSettings.mjs"; import { defineComponent as f, h as w } from "vue"; const { print: h } = u, P = /* @__PURE__ */ f({ name: "KendoPrint", props: { view: Object, settings: Object, ...c.props }, inject: { kendoLocalizationService: { default: null } }, render() { const { view: t, render: e, settings: o = h, ...d } = this.$props, n = t && t.dom, i = n && n.ownerDocument, r = i && i.defaultView, s = o.messages.title, l = a(this), p = { ...d, disabled: !r || r === window, title: l.toLanguageString(s, m[s]), ...o.props }; return w(c, { onClick: this.handleClick, onMousedown: this.preventDefault, onPointerdown: this.preventDefault, ...p }); }, methods: { handleClick() { const t = this.view && this.view.dom, e = t && t.ownerDocument, o = e && e.defaultView; o && o.print(); }, preventDefault(t) { t.preventDefault(); } } }); export { P as Print };