UNPKG

@progress/kendo-vue-editor

Version:
78 lines (77 loc) 2.05 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 { defineComponent as d, h as m, createVNode as r } from "vue"; import { canInsert as c } from "@progress/kendo-editor-common"; import { Button as a } from "@progress/kendo-vue-buttons"; import { InsertImageDialog as u } from "../dialogs/insertImage.mjs"; import { provideLocalizationService as f } from "@progress/kendo-vue-intl"; import { messages as h } from "../messages/main.mjs"; const S = /* @__PURE__ */ d({ name: "KendoInsertImage", props: { view: Object, settings: { type: Object, default: function() { return { messages: {} }; } }, dir: String, ...a.props }, inject: { kendoLocalizationService: { default: null } }, data() { return { openedDialog: !1 }; }, render() { const { view: e, settings: t, ...l } = this.$props, o = e && e.state, n = o ? o.schema.nodes[t.node] : void 0, g = f(this), { insertImage: i } = t.messages, s = { ...l, key: "insertImage", disabled: !n || !o || !c(o, n), title: g.toLanguageString(i, h[i]), ...t.props }, p = [m(a, { onClick: this.toggleDialog, onMousedown: this.preventDefault, onPointerdown: this.preventDefault, ...s }), this.openedDialog && e && r(u, { key: "insertImageDialog", view: e, settings: t, dir: s.dir, onClose: this.toggleDialog }, null) || null]; return r("span", null, [p]); }, methods: { toggleDialog() { this.openedDialog = !this.openedDialog; }, preventDefault(e) { e.preventDefault(); } } }); export { S as InsertImage };