@progress/kendo-vue-grid
Version:
83 lines (82 loc) • 2.58 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 d, inject as h, createVNode as t } from "vue";
import { GroupingIndicator as m } from "../drag/GroupingIndicator.mjs";
import { groupHeaderAriaLabel as l, messages as p, groupPanelEmpty as c } from "../messages/main.mjs";
import { provideLocalizationService as g } from "@progress/kendo-vue-intl";
const $ = /* @__PURE__ */ d({
props: {
group: Array,
resolveTitle: Function,
ariaControls: String,
onPressHandler: Function,
onDragHandler: Function,
onReleaseHandler: Function,
onGroupChange: Function
},
inject: {
kendoLocalizationService: {
default: null
}
},
methods: {
pressHandler(e, r) {
this.$emit("pressHandler", e, r);
},
dragHandler(e, r) {
this.$emit("dragHandler", e, r);
},
releaseHandler(e) {
this.$emit("releaseHandler", e);
},
onGroupRemove(e, r) {
const o = this.$props.group.slice();
o.splice(r, 1), this.$emit("groupChange", o, e);
},
onGroupSortChange(e, r, o, a) {
const i = Object.assign({}, o, {
dir: a
}), n = this.$props.group.slice();
n.splice(r, 1, i), this.$emit("groupChange", n, e);
}
},
setup() {
return {
kendoLocalizationService: h("kendoLocalizationService", {})
};
},
render() {
const e = this.$props.group || [], r = this.$props.ariaControls, o = e.map(function(i, n) {
return t(m, {
key: n,
dir: i.dir || "asc",
title: this.$props.resolveTitle(i.field),
onRemove: (s) => this.onGroupRemove(s, n),
onSortChange: (s, u) => {
this.onGroupSortChange(s, n, i, u);
},
onPress: this.pressHandler,
onDrag: this.dragHandler,
onRelease: this.releaseHandler
}, null);
}, this), a = g(this).toLanguageString(l, p[l]);
return t("div", {
class: "k-grouping-header",
role: "toolbar",
"aria-label": a,
"aria-controls": r
}, [!!o.length && t("div", {
class: "k-chip-list k-chip-list-md"
}, [o]), t("div", {
class: "k-grouping-drop-container"
}, [!o.length && g(this).toLanguageString(c, p[c])])]);
}
});
export {
$ as GroupPanel
};