UNPKG

@progress/kendo-vue-grid

Version:
98 lines (97 loc) 2.78 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 n, createVNode as d, h as l } from "vue"; import { getDefaultSlots as a, getTemplate as p, uGrid as h } from "@progress/kendo-vue-common"; const w = /* @__PURE__ */ n({ name: "KendoGridRow", props: { rowType: String, isPinned: Boolean, 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], rows: Object, onRowclick: Function, onRowdblclick: Function }, methods: { handleClick(e) { this.$emit("rowclick", e); }, handleDoubleClick(e) { this.$emit("rowdblclick", e); } }, computed: { trClass() { const { rowType: e, isAltRow: i, isInEdit: o, isHighlighted: r, isSelected: t, isPinned: s } = this.$props; return h.tr({ selected: t, highlighted: r, isHeader: e === "groupHeader", isFooter: e === "groupFooter", isMaster: e !== "groupHeader" && e !== "groupFooter", isAltRow: i, isInEdit: o, isPinned: s }); } }, render() { const e = a(this), i = { 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 }, o = d("tr", i, [e]), r = this.$props.rowType || "data", t = this.$props.rows; return p.call(this, { h: l, template: this.$props.render || (t == null ? void 0 : t[r]), defaultRendering: o, additionalProps: { ...this.$props, dataItem: this.$props.item.dataItem, trProps: i, defaultSlots: e }, additionalListeners: { click: this.handleClick, dblclick: this.handleDoubleClick }, defaultSlots: e, swapDefaultSlots: !0 }); } }); export { w as GridRow };