UNPKG

@progress/kendo-vue-data-tools

Version:
9 lines (8 loc) 1.36 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("@progress/kendo-data-query");function o(r,t,n){return n?{...r,[t]:n.length?[...n]:void 0}:r&&r[t]?[...r[t]]:[]}function u(r,t,n){if(r[n]){let e=o(r,n,g.orderBy(o(r,n),t)),i=o(e,n).map(l=>u(l,t,n));return{...e,[n]:i}}return r}function S(r,t,n){let e=g.orderBy(r,t);return e=e.map(i=>u(i,t,n)),e}function c(r,t,n){let e=o(r,n);if(e&&e.length){e=e.map(f=>c(f,t,n));const l={filters:[{filters:t,logic:"and"},{operator:f=>!!(f[n]||[]).length}],logic:"or"},y=g.filterBy(e,l);return o(r,n,y)}return r}function h(r,t,n){let e={[n]:[...r]};return e=c(e,t,n),e[n]||[]}const B=(r,t)=>({...r,filters:r.filters.map(n=>({...n,value:t}))}),p=r=>r!=null&&r.filters.length&&r.filters[0].value||"",v=(r,t)=>{if(t&&!r)return t;if(r&&!t)return r;if(r&&t)return{logic:"and",filters:[r,t]}};exports.combineFilters=v;exports.filterBy=h;exports.getSearchFromString=B;exports.getStringFromSearch=p;exports.orderBy=S;