UNPKG

@progress/kendo-vue-editor

Version:
76 lines (75 loc) 2.17 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 d } from "@progress/kendo-vue-buttons"; import { isIndented as r, canOutdentAsListItem as l, liftListItem as f, indentBlocks as h } from "@progress/kendo-editor-common"; import { provideLocalizationService as v } from "@progress/kendo-vue-intl"; import { messages as g } from "../messages/main.mjs"; import { defineComponent as y, h as O } from "vue"; const C = /* @__PURE__ */ y({ name: "KendoOutdent", props: { view: Object, settings: { type: Object, default: function() { return { messages: {} }; } }, ...d.props }, inject: { kendoLocalizationService: { default: null } }, render() { const { view: t, render: o, settings: e, ...s } = this.$props, n = t && t.state, i = !!n && r(n, e.actions, s.dir); n && n.schema.nodes[e.listsTypes.listItem]; const a = !!n && l(n, { nodes: e.actions, listsTypes: e.listsTypes }), p = i || a, m = v(this), c = e.messages.title, u = { ...s, disabled: !p, title: m.toLanguageString(c, g[c]), ...e.props }; return O(d, { onClick: this.handleClick, onMousedown: this.preventDefault, onPointerdown: this.preventDefault, ...u }); }, methods: { handleClick() { const { view: t, settings: o, dir: e } = this.$props, s = t && t.state, n = !!s && r(s, o.actions, e), i = s && s.schema.nodes[o.listsTypes.listItem], a = !!s && l(s, { nodes: o.actions, listsTypes: o.listsTypes }); t && a ? f(i)(t.state, t.dispatch) : t && n && h(o.actions, o.commandName, e)(t.state, t.dispatch); }, preventDefault(t) { t.preventDefault(); } } }); export { C as Outdent };