UNPKG

@progress/kendo-vue-grid

Version:
95 lines (94 loc) 2.51 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 a, ref as o, createVNode as e } from "vue"; import { isRtl as p } from "../utils/main.mjs"; import { kendoThemeMaps as n, getRef as s, setRef as l } from "@progress/kendo-vue-common"; const f = /* @__PURE__ */ a({ name: "Footer", props: { staticHeaders: Boolean, row: Object, columnResize: Object, cols: Array, size: String }, data() { return { scrollbarWidth: 0, rtl: !1, tableWidth: null }; }, computed: { tableClass() { const { size: t } = this.$props; return { "k-table": !0, "k-grid-footer-table": !0, [`k-table-${n.sizeMap[t] || t}`]: t }; }, divStyle() { const t = this.$data.scrollbarWidth + "px", r = this.rtl ? 0 : t, i = this.rtl ? t : 0; return { padding: `0 ${r} 0 ${i}` }; }, tableStyl() { return this.tableWidth ? { width: this.tableWidth } : null; } }, mounted() { this.rtl = p(this.$el), this.$props.columnResize.colGroupFooter = s(this, "colGroupHeader"), this._footerWrap = s(this, "footerWrap"); }, methods: { setScrollLeft(t) { this._footerWrap && (this._footerWrap.scrollLeft = t); }, setWidth(t) { this.$data.tableWidth = t + "px"; } }, setup() { const t = o(null); return { colGroupHeaderRef: o(null), footerWrapRef: t }; }, render() { return this.$props.staticHeaders ? e("div", { class: "k-grid-footer", style: this.divStyle, role: "presentation" }, [e("div", { class: "k-grid-footer-wrap", ref: l(this, "footerWrap"), role: "presentation" }, [e("table", { class: this.tableClass, style: this.tableStyle, role: "presentation" }, [e("colgroup", { ref: l(this, "colGroupHeader") }, [this.$props.cols]), e("tfoot", { class: "k-table-tfoot", role: "rowgroup" }, [this.$props.row])])])]) : e("tfoot", { class: "k-table-tfoot k-grid-footer", role: "rowgroup" }, [this.$props.row]); } }); export { f as Footer };