@progress/kendo-vue-editor
Version:
78 lines (77 loc) • 2 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 d } from "@progress/kendo-vue-buttons";
import { toggleList as g, hasNode as m } from "@progress/kendo-editor-common";
import { provideLocalizationService as v } from "@progress/kendo-vue-intl";
import { messages as y } from "../messages/main.mjs";
import { defineComponent as L, h as b } from "vue";
const z = /* @__PURE__ */ L({
name: "KendoList",
props: {
view: Object,
settings: {
type: Object,
default: function() {
return {
messages: {}
};
}
},
...d.props
},
inject: {
kendoLocalizationService: {
default: null
}
},
render() {
const {
view: t,
render: s,
settings: e,
...o
} = this.$props;
let i = !1;
const u = v(this), l = e.messages.title, n = e.types, f = e.listType;
if (t) {
const r = t.state, p = r.schema.nodes, a = m(r, p[n.orderedList]), c = m(r, p[n.bulletList]);
f === n.orderedList ? i = a && !c : i = !a && c;
}
const h = {
...o,
selected: i,
togglable: !0,
title: u.toLanguageString(l, y[l]),
...e.props
};
return b(d, {
onClick: this.handleClick,
onMousedown: this.preventDefault,
onPointerdown: this.preventDefault,
...h
});
},
methods: {
handleClick() {
const {
view: t,
settings: s
} = this.$props, e = s.types, o = s.listType;
this.view && g(t.state, t.dispatch, t, {
listType: o,
...e
}, s.commandName);
},
preventDefault(t) {
t.preventDefault();
}
}
});
export {
z as List
};