UNPKG

@progress/kendo-vue-editor

Version:
70 lines (69 loc) 1.92 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 r } from "@progress/kendo-vue-buttons"; import { EditorToolsSettings as p } from "../config/toolsSettings.mjs"; import { isAligned as c, alignBlocks as d } from "@progress/kendo-editor-common"; import { provideLocalizationService as g } from "@progress/kendo-vue-intl"; import { messages as u } from "../messages/main.mjs"; import { defineComponent as f, h } from "vue"; const { alignRemove: l } = p, j = /* @__PURE__ */ f({ name: "KendoAlign", props: { view: Object, settings: { type: Object, default: function() { return { messages: {} }; } }, ...r.props }, inject: { kendoLocalizationService: { default: null } }, render() { const { view: t, settings: e, ...n } = this.$props, o = t && t.state, s = !!o && c(o, e.actions), i = g(this), a = e.messages.title, m = { ...n, selected: s, togglable: !0, title: i.toLanguageString(a, u[a]), ...e.props }; return h(r, { onClick: this.handleClick, onMousedown: this.preventDefault, onPointerdown: this.preventDefault, ...m }); }, methods: { handleClick() { const { view: t, settings: e } = this.$props, n = t && t.state, o = !!n && c(n, e.actions), s = o ? l.actions : e.actions, i = o ? l.commandName : e.commandName; return t && d(s, i)(t.state, t.dispatch); }, preventDefault(t) { t.preventDefault(); } } }); export { j as Align };