@progress/kendo-react-data-tools 9.4.0-develop.24 → 9.4.0-develop.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE.txt +51 -40
- package/clipboard/clipboard.service.js +1 -1
- package/clipboard/clipboard.service.mjs +1 -0
- package/clipboard/common.js +5 -5
- package/clipboard/common.mjs +46 -81
- package/columnmenu/ColumnMenu.js +1 -2
- package/columnmenu/ColumnMenuFilterForm.js +1 -2
- package/columnmenu/ColumnMenuFilterLogic.js +1 -2
- package/columnmenu/ColumnMenuFilterLogic.mjs +4 -4
- package/columnmenu/ColumnMenuFilters.js +1 -2
- package/columnmenu/ColumnMenuItem.js +1 -2
- package/columnmenu/ColumnMenuItem.mjs +4 -4
- package/columnmenu/ColumnMenuOperators.js +1 -1
- package/columnmenu/ColumnMenuOperators.mjs +1 -0
- package/detail-expansion/expandReducer.js +1 -1
- package/detail-expansion/expandReducer.mjs +1 -0
- package/detail-expansion/utils.js +1 -1
- package/detail-expansion/utils.mjs +3 -2
- package/dist/cdn/js/kendo-react-datatools.js +1 -8
- package/drag/ColumnDraggable.js +1 -2
- package/drag/ColumnResize.js +1 -1
- package/drag/ColumnResize.mjs +3 -2
- package/drag/ColumnResizer.js +1 -2
- package/drag/CommonDragLogic.js +1 -1
- package/drag/CommonDragLogic.mjs +1 -0
- package/drag/DragClue.js +1 -2
- package/drag/DragClue.mjs +4 -4
- package/drag/DropClue.js +1 -2
- package/drag/DropClue.mjs +3 -3
- package/editing/editReducer.js +1 -1
- package/editing/editReducer.mjs +1 -0
- package/editing/utils.js +1 -1
- package/editing/utils.mjs +5 -4
- package/filter/Expression.js +1 -2
- package/filter/Filter.js +1 -2
- package/filter/Filter.mjs +11 -11
- package/filter/Group.js +1 -2
- package/filter/filters/BooleanFilter.js +1 -2
- package/filter/filters/DateFilter.js +1 -2
- package/filter/filters/DateFilter.mjs +4 -4
- package/filter/filters/EnumFilter.js +1 -2
- package/filter/filters/NumericFilter.js +1 -2
- package/filter/filters/NumericFilter.mjs +4 -4
- package/filter/filters/TextFilter.js +1 -2
- package/filter/operators.js +1 -1
- package/filter/operators.mjs +1 -0
- package/filteringCells/BooleanFilter.js +1 -2
- package/filteringCells/BooleanFilter.mjs +4 -4
- package/filteringCells/DateFilter.js +1 -2
- package/filteringCells/DateFilter.mjs +5 -5
- package/filteringCells/FilterComponent.js +1 -2
- package/filteringCells/FilterComponent.mjs +7 -7
- package/filteringCells/NumericFilter.js +1 -2
- package/filteringCells/TextFilter.js +1 -2
- package/group-expansion/groupExpandReducer.js +1 -1
- package/group-expansion/groupExpandReducer.mjs +13 -12
- package/header/ColumnProps.js +1 -1
- package/header/ColumnProps.mjs +1 -0
- package/header/FilterRow.js +1 -2
- package/header/FilterRow.mjs +2 -2
- package/header/Header.js +1 -2
- package/header/HeaderCell.js +1 -2
- package/header/HeaderRow.js +1 -2
- package/header/HeaderRow.mjs +5 -5
- package/header/HeaderSelectionCell.js +1 -2
- package/header/HeaderTdElement.js +1 -2
- package/header/HeaderTdElement.mjs +6 -6
- package/header/HeaderThElement.js +1 -2
- package/header/HeaderThElement.mjs +6 -6
- package/header/SortSettings.js +1 -1
- package/header/SortSettings.mjs +3 -2
- package/header/utils/index.js +1 -1
- package/header/utils/index.mjs +6 -5
- package/index.d.mts +10 -95
- package/index.d.ts +10 -95
- package/index.js +1 -1
- package/index.mjs +158 -170
- package/messages/index.js +1 -1
- package/messages/index.mjs +1 -0
- package/navigation/NavigatableSettings.js +1 -1
- package/navigation/NavigatableSettings.mjs +3 -2
- package/navigation/TableKeyboardNavigation.js +1 -2
- package/navigation/TableKeyboardNavigationContext.js +1 -2
- package/navigation/TableKeyboardNavigationContext.mjs +4 -4
- package/navigation/constants.js +1 -1
- package/navigation/constants.mjs +9 -8
- package/navigation/hooks.js +1 -2
- package/navigation/hooks.mjs +5 -5
- package/navigation/utils.js +1 -1
- package/navigation/utils.mjs +1 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +3 -2
- package/package.json +11 -11
- package/pager/Pager.js +1 -2
- package/pager/PagerInput.js +1 -2
- package/pager/PagerNumericButtons.js +1 -2
- package/pager/PagerNumericButtons.mjs +9 -9
- package/pager/PagerPageSizes.js +1 -2
- package/pager/PagerPageSizes.mjs +3 -3
- package/pager/utils.js +1 -1
- package/pager/utils.mjs +3 -2
- package/selection/TableSelection.js +1 -2
- package/selection/constants.js +1 -1
- package/selection/constants.mjs +1 -0
- package/selection/utils.js +1 -1
- package/selection/utils.mjs +1 -0
- package/utils/data-operations.js +1 -1
- package/utils/data-operations.mjs +67 -82
- package/utils/group-operations.js +1 -1
- package/utils/group-operations.mjs +8 -7
- package/virtualization/columns.js +1 -1
- package/virtualization/columns.mjs +6 -5
package/utils/data-operations.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@progress/kendo-data-query"),f=require("@progress/kendo-react-common");function g(o,t,e){return e?{...o,[t]:e.length?[...e]:void 0}:o&&o[t]?[...o[t]]:[]}function v(o,t,e){if(o[e]){const n=g(o,e,s.orderBy(g(o,e),t)),r=g(n,e).map(c=>v(c,t,e));return{...n,[e]:r}}return o}function D(o,t,e){let n=s.orderBy(o,t);return n=n.map(r=>v(r,t,e)),n}function y(o,t,e){let n=g(o,e);if(n&&n.length){n=n.map(l=>y(l,t,e));const c={filters:[{filters:t,logic:"and"},{operator:l=>!!(l[e]||[]).length}],logic:"or"},a=s.filterBy(n,c);return g(o,e,a)}return o}function T(o,t,e){let n={[e]:[...o]};return n=y(n,t,e),n[e]||[]}function B(o,t,e){const n=[],r=[];for(let c=o.length-1;c>=0;c--){const a=o[c];n.push({root:a,data:t(a),level:[c],levelCount:o.length})}for(;n.length>0;){const c=n.pop();if(r.push({dataItem:c.root,level:[...c.level],...e(c.root),levelCount:c.levelCount}),c.data.length)for(let a=c.data.length-1;a>=0;a--){const l=c.data[a];n.push({root:l,data:t(l),level:[...c.level,a],levelCount:c.data.length})}}return r}const P=(o,t,e)=>{const n=h=>!!f.getNestedValue(t,h),r=h=>!!f.getNestedValue(e,h),c=h=>{const p=[];return n(h)&&r(h)&&p.push(...f.getNestedValue(e,h)),p},a=(h,p,u)=>{p.push({...h,level:u}),c(h).forEach(C=>a(C,p,u+1))},l=[];return o.forEach(h=>a(h,l,0)),l},x=(o,t,e,n)=>{let r={},c=[],a;return o.forEach(l=>r[t(l)]={...l}),o.forEach(l=>{a=r[e(l)],a?(a[n]=a[n]||[],a[n].push(r[t(l)])):c.push(r[t(l)])}),c},k=(o,t,e)=>f.extendDataItem(o,t,e),w=(o,t,e)=>[...f.mapTree([{[t]:[...o]}],t,r=>E(r,e,t))[0][t]],E=(o,t,e)=>{const n=o[e]||[],r=n.findIndex(t);if(r!==-1){const c=[...n];return c.splice(r,1),{...o,[e]:c}}return o},S=(o,t,e,n)=>f.mapTree(o,t,r=>e(r)?{...r,[t]:n(r[t]||[])}:r),i=(o,t,e)=>f.getItemPath(o,t,e),d=(o,t,e,n)=>{const r=[...o],c=i(r,t,n),a=c.pop(),l=c.pop(),h=t[t.length-1];if(e){const u=i(r,e,n).pop();(l?l[n]:r).splice(h,1),u[n]=u[n]||[],u[n].push(a)}else(l?l[n]:r).splice(h,1),r.push(a);return r};exports.createDataTree=x;exports.extendDataItem=k;exports.filterBy=T;exports.flatData=B;exports.getItemPath=i;exports.modifySubItems=S;exports.moveTreeItem=d;exports.orderBy=D;exports.removeItems=w;exports.treeToFlat=P;
|
|
@@ -5,47 +5,48 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
"use client";
|
|
9
|
+
import { orderBy as s, filterBy as D } from "@progress/kendo-data-query";
|
|
10
|
+
import { extendDataItem as y, mapTree as v, getItemPath as P, getNestedValue as g } from "@progress/kendo-react-common";
|
|
11
|
+
function i(r, n, t) {
|
|
12
|
+
return t ? { ...r, [n]: t.length ? [...t] : void 0 } : r && r[n] ? [...r[n]] : [];
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
-
if (t
|
|
15
|
-
const o = i(
|
|
16
|
-
return { ...o, [
|
|
14
|
+
function C(r, n, t) {
|
|
15
|
+
if (r[t]) {
|
|
16
|
+
const o = i(r, t, s(i(r, t), n)), e = i(o, t).map((c) => C(c, n, t));
|
|
17
|
+
return { ...o, [t]: e };
|
|
17
18
|
}
|
|
18
|
-
return
|
|
19
|
+
return r;
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
-
let o =
|
|
22
|
-
return o = o.map((e) =>
|
|
21
|
+
function $(r, n, t) {
|
|
22
|
+
let o = s(r, n);
|
|
23
|
+
return o = o.map((e) => C(e, n, t)), o;
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
-
let o = i(
|
|
25
|
+
function B(r, n, t) {
|
|
26
|
+
let o = i(r, t);
|
|
26
27
|
if (o && o.length) {
|
|
27
|
-
o = o.map((
|
|
28
|
-
const
|
|
29
|
-
filters: [{ filters: n, logic: "and" }, { operator: (
|
|
28
|
+
o = o.map((h) => B(h, n, t));
|
|
29
|
+
const a = D(o, {
|
|
30
|
+
filters: [{ filters: n, logic: "and" }, { operator: (h) => !!(h[t] || []).length }],
|
|
30
31
|
logic: "or"
|
|
31
32
|
});
|
|
32
|
-
return i(
|
|
33
|
+
return i(r, t, a);
|
|
33
34
|
}
|
|
34
|
-
return
|
|
35
|
+
return r;
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
-
let o = { [
|
|
38
|
-
return o =
|
|
37
|
+
function k(r, n, t) {
|
|
38
|
+
let o = { [t]: [...r] };
|
|
39
|
+
return o = B(o, n, t), o[t] || [];
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
+
function N(r, n, t) {
|
|
41
42
|
const o = [], e = [];
|
|
42
|
-
for (let c =
|
|
43
|
-
const
|
|
43
|
+
for (let c = r.length - 1; c >= 0; c--) {
|
|
44
|
+
const a = r[c];
|
|
44
45
|
o.push({
|
|
45
|
-
root:
|
|
46
|
-
data: n(
|
|
46
|
+
root: a,
|
|
47
|
+
data: n(a),
|
|
47
48
|
level: [c],
|
|
48
|
-
levelCount:
|
|
49
|
+
levelCount: r.length
|
|
49
50
|
});
|
|
50
51
|
}
|
|
51
52
|
for (; o.length > 0; ) {
|
|
@@ -53,86 +54,70 @@ function k(t, n, r) {
|
|
|
53
54
|
if (e.push({
|
|
54
55
|
dataItem: c.root,
|
|
55
56
|
level: [...c.level],
|
|
56
|
-
...
|
|
57
|
+
...t(c.root),
|
|
57
58
|
levelCount: c.levelCount
|
|
58
59
|
}), c.data.length)
|
|
59
|
-
for (let
|
|
60
|
-
const
|
|
60
|
+
for (let a = c.data.length - 1; a >= 0; a--) {
|
|
61
|
+
const h = c.data[a];
|
|
61
62
|
o.push({
|
|
62
|
-
root:
|
|
63
|
-
data: n(
|
|
64
|
-
level: [...c.level,
|
|
63
|
+
root: h,
|
|
64
|
+
data: n(h),
|
|
65
|
+
level: [...c.level, a],
|
|
65
66
|
levelCount: c.data.length
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
70
|
return e;
|
|
70
71
|
}
|
|
71
|
-
const
|
|
72
|
-
const o = (
|
|
72
|
+
const S = (r, n, t) => {
|
|
73
|
+
const o = (l) => !!g(n, l), e = (l) => !!g(t, l), c = (l) => {
|
|
73
74
|
const f = [];
|
|
74
|
-
return o(
|
|
75
|
-
},
|
|
76
|
-
f.push({ ...
|
|
77
|
-
},
|
|
78
|
-
return
|
|
79
|
-
}, V = (
|
|
80
|
-
let e = {}, c = [],
|
|
81
|
-
return
|
|
82
|
-
|
|
75
|
+
return o(l) && e(l) && f.push(...g(t, l)), f;
|
|
76
|
+
}, a = (l, f, p) => {
|
|
77
|
+
f.push({ ...l, level: p }), c(l).forEach((x) => a(x, f, p + 1));
|
|
78
|
+
}, h = [];
|
|
79
|
+
return r.forEach((l) => a(l, h, 0)), h;
|
|
80
|
+
}, V = (r, n, t, o) => {
|
|
81
|
+
let e = {}, c = [], a;
|
|
82
|
+
return r.forEach((h) => e[n(h)] = { ...h }), r.forEach((h) => {
|
|
83
|
+
a = e[t(h)], a ? (a[o] = a[o] || [], a[o].push(e[n(h)])) : c.push(e[n(h)]);
|
|
83
84
|
}), c;
|
|
84
|
-
}, j = (
|
|
85
|
-
[{ [n]: [...
|
|
85
|
+
}, j = (r, n, t) => y(r, n, t), q = (r, n, t) => [...v(
|
|
86
|
+
[{ [n]: [...r] }],
|
|
86
87
|
n,
|
|
87
|
-
(e) => T(e,
|
|
88
|
-
)[0][n]], T = (
|
|
89
|
-
const o = t
|
|
88
|
+
(e) => T(e, t, n)
|
|
89
|
+
)[0][n]], T = (r, n, t) => {
|
|
90
|
+
const o = r[t] || [], e = o.findIndex(n);
|
|
90
91
|
if (e !== -1) {
|
|
91
92
|
const c = [...o];
|
|
92
93
|
return c.splice(e, 1), {
|
|
93
|
-
...
|
|
94
|
-
[
|
|
94
|
+
...r,
|
|
95
|
+
[t]: c
|
|
95
96
|
};
|
|
96
97
|
}
|
|
97
|
-
return
|
|
98
|
-
}, z = (
|
|
99
|
-
|
|
98
|
+
return r;
|
|
99
|
+
}, z = (r, n, t, o) => v(
|
|
100
|
+
r,
|
|
100
101
|
n,
|
|
101
|
-
(e) =>
|
|
102
|
-
), u = (
|
|
103
|
-
const e = [...
|
|
104
|
-
if (
|
|
105
|
-
const p = u(e,
|
|
106
|
-
(
|
|
102
|
+
(e) => t(e) ? { ...e, [n]: o(e[n] || []) } : e
|
|
103
|
+
), u = (r, n, t) => P(r, n, t), A = (r, n, t, o) => {
|
|
104
|
+
const e = [...r], c = u(e, n, o), a = c.pop(), h = c.pop(), l = n[n.length - 1];
|
|
105
|
+
if (t) {
|
|
106
|
+
const p = u(e, t, o).pop();
|
|
107
|
+
(h ? h[o] : e).splice(l, 1), p[o] = p[o] || [], p[o].push(a);
|
|
107
108
|
} else
|
|
108
|
-
(
|
|
109
|
+
(h ? h[o] : e).splice(l, 1), e.push(a);
|
|
109
110
|
return e;
|
|
110
|
-
}, G = (t, n) => ({
|
|
111
|
-
...t,
|
|
112
|
-
filters: t.filters.map((r) => ({ ...r, value: n }))
|
|
113
|
-
}), H = (t) => t != null && t.filters.length && t.filters[0].value || "", J = (t, n) => {
|
|
114
|
-
if (n && !t)
|
|
115
|
-
return n;
|
|
116
|
-
if (t && !n)
|
|
117
|
-
return t;
|
|
118
|
-
if (t && n)
|
|
119
|
-
return {
|
|
120
|
-
logic: "and",
|
|
121
|
-
filters: [t, n]
|
|
122
|
-
};
|
|
123
111
|
};
|
|
124
112
|
export {
|
|
125
|
-
J as combineFilters,
|
|
126
113
|
V as createDataTree,
|
|
127
114
|
j as extendDataItem,
|
|
128
|
-
|
|
129
|
-
|
|
115
|
+
k as filterBy,
|
|
116
|
+
N as flatData,
|
|
130
117
|
u as getItemPath,
|
|
131
|
-
G as getSearchFromString,
|
|
132
|
-
H as getStringFromSearch,
|
|
133
118
|
z as modifySubItems,
|
|
134
119
|
A as moveTreeItem,
|
|
135
|
-
|
|
120
|
+
$ as orderBy,
|
|
136
121
|
q as removeItems,
|
|
137
|
-
|
|
122
|
+
S as treeToFlat
|
|
138
123
|
};
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@progress/kendo-react-common"),d="groupId",n="items",r=(e,t,s)=>{e.items&&(e[d]=`${s}${s&&"_"}${e.value}${e.field}`,t>1&&e.items.forEach(o=>r(o,t-1,e[d])))},c=e=>{const{group:t}=e;if(t&&t.length&&e.data)return e.data.forEach(s=>r(s,t.length,""))},I=e=>{const t=[];return a.mapTree(e.data,n,s=>{s[d]&&t.push(s[d])}),t},u=e=>a.mapTree(e.data,n,t=>a.extendDataItem(t,n,{expanded:!e.collapsedIds.some(s=>s===t[d])}));exports.getGroupIds=I;exports.setExpandedState=u;exports.setGroupIds=c;
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@progress/kendo-react-common"),d="groupId",n="items",r=(e,t,s)=>{e.items&&(e[d]=`${s}${s&&"_"}${e.value}${e.field}`,t>1&&e.items.forEach(o=>r(o,t-1,e[d])))},c=e=>{const{group:t}=e;if(t&&t.length&&e.data)return e.data.forEach(s=>r(s,t.length,""))},I=e=>{const t=[];return a.mapTree(e.data,n,s=>{s[d]&&t.push(s[d])}),t},u=e=>a.mapTree(e.data,n,t=>a.extendDataItem(t,n,{expanded:!e.collapsedIds.some(s=>s===t[d])}));exports.getGroupIds=I;exports.setExpandedState=u;exports.setGroupIds=c;
|
|
@@ -5,19 +5,20 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
+
"use client";
|
|
8
9
|
import { mapTree as n, extendDataItem as I } from "@progress/kendo-react-common";
|
|
9
|
-
const a = "groupId", d = "items",
|
|
10
|
-
t.items && (t[a] = `${s}${s && "_"}${t.value}${t.field}`, e > 1 && t.items.forEach((
|
|
10
|
+
const a = "groupId", d = "items", c = (t, e, s) => {
|
|
11
|
+
t.items && (t[a] = `${s}${s && "_"}${t.value}${t.field}`, e > 1 && t.items.forEach((r) => c(r, e - 1, t[a])));
|
|
11
12
|
}, f = (t) => {
|
|
12
13
|
const { group: e } = t;
|
|
13
14
|
if (e && e.length && t.data)
|
|
14
|
-
return t.data.forEach((s) =>
|
|
15
|
-
},
|
|
15
|
+
return t.data.forEach((s) => c(s, e.length, ""));
|
|
16
|
+
}, l = (t) => {
|
|
16
17
|
const e = [];
|
|
17
18
|
return n(t.data, d, (s) => {
|
|
18
19
|
s[a] && e.push(s[a]);
|
|
19
20
|
}), e;
|
|
20
|
-
},
|
|
21
|
+
}, m = (t) => n(
|
|
21
22
|
t.data,
|
|
22
23
|
d,
|
|
23
24
|
(e) => I(e, d, {
|
|
@@ -25,7 +26,7 @@ const a = "groupId", d = "items", r = (t, e, s) => {
|
|
|
25
26
|
})
|
|
26
27
|
);
|
|
27
28
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
l as getGroupIds,
|
|
30
|
+
m as setExpandedState,
|
|
30
31
|
f as setGroupIds
|
|
31
32
|
};
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function k(b){const{enabled:S,columns:l=[],tableViewPortWidth:w,scrollLeft:g,getColSpan:m,dataItem:C}=b,h=l.map(()=>1),i=l.map(()=>!1);if(!S)return{colSpans:h,hiddenColumns:i};const n=l.map(e=>parseFloat((e.width||"").toString())||10);let o=0;for(let e=0;e<l.length;e++){if(l[e].locked)continue;let
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function k(b){const{enabled:S,columns:l=[],tableViewPortWidth:w,scrollLeft:g,getColSpan:m,dataItem:C}=b,h=l.map(()=>1),i=l.map(()=>!1);if(!S)return{colSpans:h,hiddenColumns:i};const n=l.map(e=>parseFloat((e.width||"").toString())||10);let o=0;for(let e=0;e<l.length;e++){if(l[e].locked)continue;let c=1;if(m!==void 0){let r=m(l[e],C);r>2?c=r-1:r===2&&(c=r)}const O=e<n.length-1?n[e+1]*c:0;if(o+n[e]+O<g)i[e]=!0,o+=n[e];else break}const y=n.reduce((e,c)=>e+c,0);o=0;for(let e=l.length-1;e>=0;e--)if(!l[e].locked)if(o+2*n[e]<y-w-g)i[e]=!0,o+=n[e];else break;const t=[...i],f=e=>e;let s=t.lastIndexOf(!1),p=t.some(f),u=t.every(f),a,d;for(;p&&t.length&&(s!==-1||u);){for(s<t.length-1&&(a=u?t.length:t.length-s-1,d=t.length-a,d===0&&(d=a-1),i[d]=!1,h[d]=a,t.splice(s+1,a));t.length&&!t[t.length-1];)t.pop();s=t.lastIndexOf(!1),p=t.some(f),u=t.every(f)}return{colSpans:h,hiddenColumns:i}}exports.tableColumnsVirtualization=k;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
+
"use client";
|
|
8
9
|
function I(b) {
|
|
9
10
|
const { enabled: w, columns: l = [], tableViewPortWidth: x, scrollLeft: g, getColSpan: p, dataItem: C } = b, r = l.map(() => 1), i = l.map(() => !1);
|
|
10
11
|
if (!w)
|
|
@@ -16,8 +17,8 @@ function I(b) {
|
|
|
16
17
|
continue;
|
|
17
18
|
let f = 1;
|
|
18
19
|
if (p !== void 0) {
|
|
19
|
-
let
|
|
20
|
-
|
|
20
|
+
let h = p(l[e], C);
|
|
21
|
+
h > 2 ? f = h - 1 : h === 2 && (f = h);
|
|
21
22
|
}
|
|
22
23
|
const k = e < n.length - 1 ? n[e + 1] * f : 0;
|
|
23
24
|
if (o + n[e] + k < g)
|
|
@@ -33,12 +34,12 @@ function I(b) {
|
|
|
33
34
|
i[e] = !0, o += n[e];
|
|
34
35
|
else
|
|
35
36
|
break;
|
|
36
|
-
const t = [...i],
|
|
37
|
-
let s = t.lastIndexOf(!1), m = t.some(
|
|
37
|
+
const t = [...i], c = (e) => e;
|
|
38
|
+
let s = t.lastIndexOf(!1), m = t.some(c), u = t.every(c), d, a;
|
|
38
39
|
for (; m && t.length && (s !== -1 || u); ) {
|
|
39
40
|
for (s < t.length - 1 && (d = u ? t.length : t.length - s - 1, a = t.length - d, a === 0 && (a = d - 1), i[a] = !1, r[a] = d, t.splice(s + 1, d)); t.length && !t[t.length - 1]; )
|
|
40
41
|
t.pop();
|
|
41
|
-
s = t.lastIndexOf(!1), m = t.some(
|
|
42
|
+
s = t.lastIndexOf(!1), m = t.some(c), u = t.every(c);
|
|
42
43
|
}
|
|
43
44
|
return { colSpans: r, hiddenColumns: i };
|
|
44
45
|
}
|