@progress/kendo-vue-editor
Version:
9 lines (8 loc) • 1.72 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
*-------------------------------------------------------------------------------------------
*/
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@progress/kendo-vue-buttons"),i=require("@progress/kendo-editor-common"),h=require("@progress/kendo-vue-intl"),f=require("../messages/main.js"),l=require("vue"),v=l.defineComponent({name:"KendoOutdent",props:{view:Object,settings:{type:Object,default:function(){return{messages:{}}}},...r.Button.props},inject:{kendoLocalizationService:{default:null}},render(){const{view:t,render:o,settings:e,...s}=this.$props,n=t&&t.state,c=!!n&&i.isIndented(n,e.actions,s.dir);n&&n.schema.nodes[e.listsTypes.listItem];const d=!!n&&i.canOutdentAsListItem(n,{nodes:e.actions,listsTypes:e.listsTypes}),u=c||d,p=h.provideLocalizationService(this),a=e.messages.title,m={...s,disabled:!u,title:p.toLanguageString(a,f.messages[a]),...e.props};return l.h(r.Button,{onClick:this.handleClick,onMousedown:this.preventDefault,onPointerdown:this.preventDefault,...m})},methods:{handleClick(){const{view:t,settings:o,dir:e}=this.$props,s=t&&t.state,n=!!s&&i.isIndented(s,o.actions,e),c=s&&s.schema.nodes[o.listsTypes.listItem],d=!!s&&i.canOutdentAsListItem(s,{nodes:o.actions,listsTypes:o.listsTypes});t&&d?i.liftListItem(c)(t.state,t.dispatch):t&&n&&i.indentBlocks(o.actions,o.commandName,e)(t.state,t.dispatch)},preventDefault(t){t.preventDefault()}}});exports.Outdent=v;