@progress/kendo-vue-editor
Version:
72 lines (71 loc) • 1.81 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 { ColorPicker as a } from "@progress/kendo-vue-inputs";
import { applyInlineStyle as l } from "@progress/kendo-editor-common";
import { provideLocalizationService as c } from "@progress/kendo-vue-intl";
import { messages as s } from "../messages/main.mjs";
import { defineComponent as p, h as m } from "vue";
const C = /* @__PURE__ */ p({
name: "KendoApplyColor",
props: {
view: Object,
color: String,
colorPickerProps: Object,
commandName: String,
dir: String,
ariaLabel: String
},
inject: {
kendoLocalizationService: {
default: null
}
},
render() {
const {
colorPickerProps: t,
dir: o,
ariaLabel: r
} = this.$props, e = t.title, i = c(this), n = {
...t,
dir: o,
showButtons: !1,
showClearButton: !1,
showPreview: !1,
title: e && i.toLanguageString(e, s[e]),
ariaLabel: r
};
return m(a, {
onChange: this.onChange,
onActivecolorclick: this.onChange,
...n
});
},
methods: {
onChange(t) {
const {
view: o,
color: r,
colorPickerProps: e,
commandName: i
} = this.$props;
if (o) {
l({
style: r,
value: t.value
}, i)(o.state, o.dispatch);
const {
view: n = "palette"
} = e;
n === "palette" && o.focus();
}
}
}
});
export {
C as ApplyColor
};