@progress/kendo-vue-pdf
Version:
46 lines (45 loc) • 1.63 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
const a = "k-first", g = "k-grid-header", h = "k-grid-footer", i = (e, t) => {
const n = t.length;
for (let o = 0; o < n; o++)
e.appendChild(t[o].cloneNode(!0));
}, C = (e) => {
const t = document.createElement("div");
return t.className = "k-grid k-grid-md", t.appendChild(e), t;
}, d = (e) => {
const t = e.length, n = e[0].cloneNode(!0), o = n.rows.length;
if (t > 1)
for (let l = 0; l < o; l++)
for (let s = 1; s < t; s++)
i(n.rows[l], e[s].rows[l].cells);
return n;
}, f = (e, t) => {
if (t.length > 1 && e.rows.length > 1)
for (let n = 1; n < e.rows.length; n++) {
const o = t[0].rows[n].cells.length, l = e.rows[n].cells[o];
String(l.className).indexOf(a) === -1 && (l.className += ` ${a}`);
}
}, m = (e, t, n, o) => {
const l = document.createElement("table"), s = e[0].cloneNode(!0);
for (let c = 1; c < e.length; c++)
i(s, e[c].querySelectorAll("col"));
const r = d(t), p = d(n);
if (r.className = g, f(r, t), l.appendChild(s), l.appendChild(r), l.appendChild(p), o.length) {
const c = d(o);
c.className = h, l.appendChild(c);
}
return C(l);
};
export {
i as appendNodes,
m as createTable,
d as createTableElement,
f as setFirstCellClass,
C as wrapTable
};