@progress/kendo-vue-grid
Version:
82 lines (81 loc) • 2.46 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2026 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import { defineComponent as n, createVNode as t, ref as o } from "vue";
import { Draggable as r, setRef as a, Icon as i, getRef as c } from "@progress/kendo-vue-common";
import { sortAscSmallIcon as l, sortDescSmallIcon as h, xCircleIcon as p } from "@progress/kendo-svg-icons";
const f = /* @__PURE__ */ n({
props: {
title: String,
dir: String,
onRemove: Function,
onSortChange: Function,
onPress: Function,
onDrag: Function,
onRelease: Function
},
mounted() {
this.element = c(this, "indicatorContainer"), this.element && (this.draggable = this.$refs.draggable);
},
methods: {
press(e) {
this.element && this.$emit("press", e, this.element);
},
drag(e) {
this.element && this.$emit("drag", e, this.element);
},
release(e) {
this.element && this.$emit("release", e, this.element);
},
sortChange(e) {
e.preventDefault();
const s = this.$props.dir === "asc" ? "desc" : "asc";
this.$emit("sortChange", e, s);
},
groupRemove(e) {
e.preventDefault(), this.$emit("remove", e);
}
},
setup() {
return {
indicatorContainerRef: o(null)
};
},
render() {
return t(r, {
onPress: this.press,
onDrag: this.drag,
onRelease: this.release,
ref: "draggable"
}, {
default: () => [t("div", {
class: "k-chip k-chip-md k-chip-solid k-chip-solid-base k-rounded-md",
ref: a(this, "indicatorContainer")
}, [t(i, {
name: "sort-" + this.$props.dir + "-small",
class: "k-chip-icon",
icon: this.$props.dir === "asc" ? l : h
}, null), t("span", {
class: "k-chip-content",
tabindex: -1,
onClick: this.sortChange
}, [this.$props.title]), t("span", {
class: "k-chip-actions"
}, [t("span", {
class: "k-chip-action k-chip-remove-action",
tabindex: -1,
onClick: this.groupRemove
}, [t(i, {
name: "x-circle",
icon: p
}, null)])])])]
});
}
});
export {
f as GroupingIndicator
};