@progress/kendo-vue-data-tools
Version:
74 lines (73 loc) • 2.11 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 { defineComponent as c, createVNode as t, h as a } from "vue";
import { getDefaultSlots as r, getTemplate as d, guid as h } from "@progress/kendo-vue-common";
import { provideLocalizationService as p } from "@progress/kendo-vue-intl";
import { selectAllRows as l, messages as u } from "../messages/main.mjs";
const b = /* @__PURE__ */ c({
props: {
field: String,
title: String,
sortable: [Boolean, Object],
selectionValue: Boolean,
render: [Object, Function, String]
},
emits: {
selectionchange: null,
headercellclick: null
},
inject: {
kendoLocalizationService: {
default: null
}
},
created() {
this.inputId = h();
},
methods: {
changeHandle(e) {
this.$emit("selectionchange", {
field: this.$props.field,
event: e
});
},
clickHandler(e) {
this.$props.sortable && this.$emit("headercellclick", e);
}
},
render() {
const e = r(this), i = this.$props.render, n = p(this).toLanguageString(l, u[l]), s = t("input", {
key: 0,
checked: this.$props.selectionValue,
id: this.inputId,
type: "checkbox",
class: "k-checkbox k-checkbox-md k-rounded-md",
"aria-label": n,
onChange: this.changeHandle
}, null), o = d.call(this, {
h: a,
template: i,
defaultRendering: s,
additionalProps: this.$props,
additionalListeners: {
click: this.clickHandler,
selectionchange: this.changeHandle
}
});
return t("span", {
class: "k-link",
onClick: this.clickHandler
}, [t("span", {
class: "k-column-title",
title: this.$props.title
}, [o]), e]);
}
});
export {
b as HeaderSelectionCell
};