@progress/kendo-vue-data-tools
Version:
33 lines (32 loc) • 1.07 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 "@progress/kendo-data-query";
import { mapTree as r, extendDataItem as o } from "@progress/kendo-vue-common";
const a = "groupId", d = "items", n = (t, e, s) => {
t.items && (t[a] = `${s}${s && "_"}${t.value}${t.field}`, e > 1 && t.items.forEach((c) => n(c, e - 1, t[a])));
}, m = (t) => {
const { group: e } = t;
if (e && e.length && t.data)
return t.data.forEach((s) => n(s, e.length, ""));
}, E = (t) => {
const e = [];
return r(t.data, d, (s) => {
s[a] && e.push(s[a]);
}), e;
}, i = (t) => r(
t.data,
d,
(e) => o(e, d, {
expanded: !t.collapsedIds.some((s) => s === e[a])
})
);
export {
E as getGroupIds,
i as setExpandedState,
m as setGroupIds
};