UNPKG

@progress/kendo-vue-grid

Version:
93 lines (92 loc) 2.62 kB
/** * @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 l, createVNode as s, h as d } from "vue"; import { getDefaultSlots as n, getTemplate as a } from "@progress/kendo-vue-common"; const c = /* @__PURE__ */ l({ name: "KendoGridRow", props: { rowType: String, item: Object, isAltRow: Boolean, isHidden: Boolean, isHighlighted: Boolean, onClick: Function, isInEdit: Boolean, isSelected: Boolean, selectedField: String, rowHeight: Number, ariaRowIndex: Number, absoluteRowIndex: Number, dataIndex: Number, render: [String, Function, Object], onRowclick: Function, onRowdblclick: Function }, methods: { handleClick(e) { this.$emit("rowclick", e); }, handleDoubleClick(e) { this.$emit("rowdblclick", e); } }, computed: { trClass() { const { rowType: e, isAltRow: t, isInEdit: o, isHighlighted: i, isSelected: r } = this.$props; return { "k-table-row": !0, "k-selected": r, "k-highlighted": i, "k-table-group-row": e === "groupHeader", "k-grouping-row": e === "groupHeader", "k-group-footer": e === "groupFooter", "k-master-row": e !== "groupHeader" && e !== "groupFooter", "k-table-alt-row": t, "k-edit-row": o }; } }, render() { const e = n(this), t = s("tr", { onClick: this.handleClick, onDblclick: this.handleDoubleClick, class: this.trClass, style: { height: this.$props.rowHeight ? this.$props.rowHeight + "px" : "", visibility: this.$props.isHidden ? "hidden" : "" }, role: "row", "aria-rowindex": this.$props.ariaRowIndex, "absolute-row-index": this.$props.absoluteRowIndex, "data-grid-row-index": this.$props.rowType === "data" ? this.$props.dataIndex : void 0 }, [e]); return a.call(this, { h: d, template: this.$props.render, defaultRendering: t, additionalProps: { ...this.$props, dataItem: this.$props.item.dataItem }, additionalListeners: { click: this.handleClick }, defaultSlots: e, swapDefaultSlots: !0 }); } }); export { c as GridRow };