@progress/kendo-vue-layout
Version:
71 lines (70 loc) • 2.1 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
*-------------------------------------------------------------------------------------------
*/
import { templateRendering as l, getListeners as o } from "@progress/kendo-vue-common";
import { createId as m, ZERO_LEVEL_ZERO_ITEM_ID as R } from "./itemsIdsUtils.mjs";
function b(e) {
return e && e.length > 0 ? {
items: g.call(this, e),
inputItems: e
} : { items: [], inputItems: [] };
}
function C(e) {
let t = {};
const {
text: r,
url: i,
icon: s,
svgIcon: n,
disabled: c,
cssClass: a,
popupClass: d,
cssStyle: f,
separator: u,
render: h,
linkRender: p,
contentRender: v,
data: I
} = e;
return r !== void 0 && (t.text = r), i !== void 0 && (t.url = i), s !== void 0 && (t.icon = s), n !== void 0 && (t.svgIcon = n), c !== void 0 && (t.disabled = c), a !== void 0 && (t.cssClass = a), d !== void 0 && (t.popupClass = d), f !== void 0 && (t.cssStyle = f), u !== void 0 && (t.separator = u), h !== void 0 && (t.render = l.call(
this,
h,
o.call(this)
)), p !== void 0 && (t.linkRender = l.call(
this,
p,
o.call(this)
)), v !== void 0 && (t.contentRender = l.call(
this,
v,
o.call(this)
)), I !== void 0 && (t.data = I), t;
}
function g(e, t) {
const r = [];
for (let i = 0; i < e.length; i++) {
const s = e[i], n = C.call(this, s);
n.id = m(i.toString(), t), n.isLastFromSiblings = i === e.length - 1, n.items = E.call(this, s, n), r.push(n);
}
return r;
}
function E(e, t) {
return e.contentRender ? [{
contentParentItemId: t.id,
id: m(R, t.id),
isLastFromSiblings: !0,
contentRender: l.call(
this,
e.contentRender,
o.call(this)
),
items: []
}] : e.items ? g.call(this, e.items, t.id) : [];
}
export {
b as prepareInputItemsForInternalWork
};