UNPKG

@progress/kendo-vue-grid

Version:
99 lines (98 loc) 3.37 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 d, mergeProps as P, ref as v } from "vue"; import { Grid as b } from "./Grid.mjs"; import { GridStateProvider as y } from "./GridState.mjs"; import { gridProps as G } from "./common.mjs"; import { getDefaultSlots as V, getListeners as f, templateRendering as n, mapTree as $ } from "@progress/kendo-vue-common"; const I = /* @__PURE__ */ L({ name: "KendoVueGrid", props: G, setup(l, { expose: r }) { const o = v(null); r({ get element() { var e; return ((e = o.value) == null ? void 0 : e.element) || null; }, get props() { return l; }, get columns() { var e; return ((e = o.value) == null ? void 0 : e.columns) || []; }, scrollIntoView: (e) => { var s; (s = o.value) == null || s.scrollIntoView(e); }, fitColumns: (e) => { var s; (s = o.value) == null || s.fitColumns(e); }, exportAsPdf: () => { var e; (e = o.value) == null || e.exportAsPdf(); } }); }, computed: { columnsWithTemplates() { const l = f.call(this); return $(this.$props.columns || [], "children", (r) => { const o = { ...r }, e = n.call(this, o.cell, l), s = n.call(this, o.headerCell, l), i = n.call(this, o.filterCell, l), p = n.call(this, o.footerCell, l), m = n.call(this, o.columnMenu, l); return { ...o, cell: e, headerCell: s, filterCell: i, footerCell: p, columnMenu: m }; }); } }, render() { const l = V(this) || [], r = f.call(this), o = l.filter((t) => { var a, c; return t.tag && t.tag.toLowerCase().indexOf("toolbar") !== -1 || t.componentOptions && ((a = t.componentOptions.tag) == null ? void 0 : a.toLowerCase().indexOf("toolbar")) !== -1 || ((c = t == null ? void 0 : t.type) == null ? void 0 : c.name.toLowerCase().indexOf("toolbar")) !== -1; }), e = l.filter((t) => { var a, c; return t.tag && t.tag.toLowerCase().indexOf("records") !== -1 || t.componentOptions && ((a = t.componentOptions.tag) == null ? void 0 : a.toLowerCase().indexOf("records")) !== -1 || ((c = t == null ? void 0 : t.type) == null ? void 0 : c.name.toLowerCase().indexOf("records")) !== -1; }), { cellRender: s, detail: i, columns: p, rowRender: m, pager: g, loader: C, ...u } = this.$props, R = n.call(this, i, r), w = n.call(this, s, r), T = n.call(this, m, r), h = n.call(this, g, r), O = n.call(this, C, r), x = this.columnsWithTemplates; return d(y, u, { default: () => [d(b, P(u, r, { class: this.$attrs.class, style: this.$attrs.style, columns: x, cellRender: w, rowRender: T, pager: h, loader: O, detail: R, toolbar: o, noRecords: e }), null)] }); } }); export { I as RootGrid };