UNPKG

@progress/kendo-vue-grid

Version:
89 lines (88 loc) 2.57 kB
/** * @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, createVNode as l, h as n } from "vue"; import { getNestedValue as s } from "../utils/main.mjs"; import { getDefaultSlots as a, getTemplate as p } from "@progress/kendo-vue-common"; const g = /* @__PURE__ */ d({ name: "KendoGridRow", props: { rowType: String, dataItem: Object, isAltRow: Boolean, isHidden: Boolean, isHighlighted: Boolean, onClick: Function, isInEdit: Boolean, isSelected: Boolean, selectedField: String, rowHeight: Number, ariaRowIndex: 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: i, selectedField: o, isHighlighted: r } = this.$props; return { "k-table-row": !0, "k-selected": o !== void 0 && s(o, this.$props.dataItem), "k-highlighted": r, "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": i }; } }, render() { const e = a(this), t = l("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, "data-grid-row-index": this.$props.rowType === "data" ? this.$props.dataIndex : void 0 }, [e]); return p.call(this, { h: n, template: this.$props.render, defaultRendering: t, additionalProps: this.$props, additionalListeners: { click: this.handleClick }, defaultSlots: e, swapDefaultSlots: !0 }); } }); export { g as GridRow };