@progress/kendo-vue-editor
Version:
66 lines (65 loc) • 1.78 kB
JavaScript
/**
* @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 n } from "@progress/kendo-vue-buttons";
import { provideLocalizationService as m } from "@progress/kendo-vue-intl";
import { messages as c } from "../messages/main.mjs";
import { cleanFormatting as l } from "@progress/kendo-editor-common";
import { EditorToolsSettings as p } from "../config/toolsSettings.mjs";
import { defineComponent as d, h as u } from "vue";
const {
cleanFormatting: f
} = p, i = l(), D = /* @__PURE__ */ d({
name: "KendoCleanFormatting",
props: {
view: Object,
settings: {
type: Object,
default: function() {
return f;
}
},
...n.props
},
inject: {
kendoLocalizationService: {
default: null
}
},
render() {
const {
view: t,
render: h,
settings: e,
...s
} = this.$props, o = e.messages.title, r = m(this), a = {
...s,
disabled: !t || !i(t.state),
title: r.toLanguageString(o, c[o]),
...e.props
};
return u(n, {
onClick: this.handleClick,
onMousedown: this.preventDefault,
onPointerdown: this.preventDefault,
...a
});
},
methods: {
handleClick() {
this.view && i(this.view.state, (t) => {
t.setMeta("commandName", this.settings.commandName), this.view.dispatch(t);
});
},
preventDefault(t) {
t.preventDefault();
}
}
});
export {
D as CleanFormatting
};