UNPKG

@progress/kendo-vue-common

Version:

Kendo UI for Vue Common Utilities package

71 lines (70 loc) 1.91 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 { isObject as d } from "./isObject.mjs"; const L = { type: [String, Function, Object, Boolean], default: function() { } }; function O(r, n) { if (!r && r !== !1) return; if (r.kt) return r; const o = this.$slots[r] || (r.toLowerCase ? this.$slots[r.toLowerCase()] : null); return typeof r == "string" && o ? { kt: !0, type: "slot", render: o, listeners: n } : typeof r == "string" || d(r) || typeof r == "function" && r.component ? { kt: !0, type: "component", render: r, listeners: n } : { kt: !0, type: "renderFunction", render: r, listeners: n }; } function b({ h: r, template: n, defaultRendering: o, defaultSlots: s, additionalProps: i, additionalListeners: c, swapDefaultSlots: u }) { if (!n || n && n.render === !0) return o; const f = o ? o.props : {}, e = { ...n.listeners, ...k(c) }, t = { ...f, ...i, ...e }, y = { ...t, ...e }; return n.type === "slot" ? n.render({ props: t, listeners: e, methods: e, defaultSlots: s }) : n.type === "renderFunction" ? u ? n.render ? n.render(r, o, s, t, e) : void 0 : n.render ? n.render(r, o, t, e, s) : void 0 : r( n.render, y, () => [s] ); } function k(r) { if (!r) return r; const n = {}, o = Object.keys(r); for (let s = 0; s < o.length; s++) { const i = o[s]; n["on" + i.charAt(0).toUpperCase() + i.slice(1)] = r[i]; } return n; } export { b as getTemplate, L as templateDefinition, O as templateRendering, k as transformListeners };