@progress/kendo-react-grid 7.2.0 → 7.2.1-develop.1
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/dist/cdn/js/kendo-react-grid.js +1 -1
- package/index.js +1 -1
- package/index.mjs +165 -163
- package/interfaces/GridProps.d.ts +2 -2
- package/package.json +10 -10
package/index.mjs
CHANGED
|
@@ -278,8 +278,8 @@ function lr(i) {
|
|
|
278
278
|
}
|
|
279
279
|
const ar = (i) => {
|
|
280
280
|
const t = Ue(), s = n.useCallback(
|
|
281
|
-
(
|
|
282
|
-
i.selectionChange && i.selectionChange({ syntheticEvent:
|
|
281
|
+
(f) => {
|
|
282
|
+
i.selectionChange && i.selectionChange({ syntheticEvent: f });
|
|
283
283
|
},
|
|
284
284
|
[i.selectionChange]
|
|
285
285
|
), o = Rt(), e = M(i.field, i.dataItem), r = q(i.id), l = {
|
|
@@ -289,28 +289,29 @@ const ar = (i) => {
|
|
|
289
289
|
"aria-colindex": i.ariaColumnIndex,
|
|
290
290
|
role: "gridcell",
|
|
291
291
|
...r
|
|
292
|
-
}, a = /* @__PURE__ */ n.createElement("span", { key: 1, className: "k-checkbox-wrap" }, /* @__PURE__ */ n.createElement(
|
|
292
|
+
}, a = typeof e == "boolean" && e, c = /* @__PURE__ */ n.createElement("span", { key: 1, className: "k-checkbox-wrap" }, /* @__PURE__ */ n.createElement(
|
|
293
293
|
"input",
|
|
294
294
|
{
|
|
295
295
|
id: o,
|
|
296
296
|
type: "checkbox",
|
|
297
297
|
className: "k-checkbox k-checkbox-md k-rounded-md",
|
|
298
298
|
"aria-label": t.toLanguageString(le, k[le]),
|
|
299
|
-
"aria-checked":
|
|
299
|
+
"aria-checked": a,
|
|
300
|
+
checked: a,
|
|
300
301
|
onChange: s
|
|
301
302
|
}
|
|
302
|
-
)),
|
|
303
|
+
)), h = i.rowType !== "groupHeader" ? /* @__PURE__ */ n.createElement(
|
|
303
304
|
"td",
|
|
304
305
|
{
|
|
305
306
|
...l
|
|
306
307
|
},
|
|
307
|
-
|
|
308
|
-
) : null,
|
|
309
|
-
if (
|
|
310
|
-
const
|
|
311
|
-
return /* @__PURE__ */ n.createElement(
|
|
308
|
+
c
|
|
309
|
+
) : null, d = i.rowType || "data", u = i.cells;
|
|
310
|
+
if (u && u.select && u.select[d]) {
|
|
311
|
+
const f = u.select[d];
|
|
312
|
+
return /* @__PURE__ */ n.createElement(f, { ...i, tdProps: l }, c);
|
|
312
313
|
}
|
|
313
|
-
return i.render ? i.render.call(void 0,
|
|
314
|
+
return i.render ? i.render.call(void 0, h, i) : h;
|
|
314
315
|
}, cr = (i) => {
|
|
315
316
|
let t = null, s = null, o = null;
|
|
316
317
|
const e = M(i.field, i.dataItem), r = q(i.id), l = Ue(), a = n.useCallback(
|
|
@@ -337,7 +338,7 @@ const ar = (i) => {
|
|
|
337
338
|
}
|
|
338
339
|
);
|
|
339
340
|
else if (i.rowType !== "groupHeader") {
|
|
340
|
-
const d = e ? Ut : Kt,
|
|
341
|
+
const d = e ? Ut : Kt, u = l.toLanguageString(d, k[d]);
|
|
341
342
|
s = {
|
|
342
343
|
className: "k-table-td k-hierarchy-cell",
|
|
343
344
|
onKeyDown: a,
|
|
@@ -348,16 +349,16 @@ const ar = (i) => {
|
|
|
348
349
|
}, o = /* @__PURE__ */ n.createElement(
|
|
349
350
|
"a",
|
|
350
351
|
{
|
|
351
|
-
onClick: (
|
|
352
|
-
|
|
352
|
+
onClick: (f) => {
|
|
353
|
+
f.preventDefault(), i.onChange && i.onChange({
|
|
353
354
|
dataItem: i.dataItem,
|
|
354
355
|
dataIndex: i.dataIndex,
|
|
355
|
-
syntheticEvent:
|
|
356
|
+
syntheticEvent: f,
|
|
356
357
|
field: i.field,
|
|
357
358
|
value: !e
|
|
358
359
|
});
|
|
359
360
|
},
|
|
360
|
-
"aria-label":
|
|
361
|
+
"aria-label": u,
|
|
361
362
|
href: "#",
|
|
362
363
|
tabIndex: -1
|
|
363
364
|
},
|
|
@@ -384,29 +385,29 @@ const ar = (i) => {
|
|
|
384
385
|
}, i.className), e = Rt(), r = q(i.id);
|
|
385
386
|
let l = null, a = null;
|
|
386
387
|
const c = n.useCallback(
|
|
387
|
-
(
|
|
388
|
+
(g) => {
|
|
388
389
|
if (i.onChange) {
|
|
389
|
-
const b =
|
|
390
|
+
const b = g.target.type === "checkbox" ? g.target.checked : g.target.value;
|
|
390
391
|
i.onChange({
|
|
391
392
|
dataItem: i.dataItem,
|
|
392
393
|
dataIndex: i.dataIndex,
|
|
393
394
|
field: i.field,
|
|
394
|
-
syntheticEvent:
|
|
395
|
+
syntheticEvent: g,
|
|
395
396
|
value: b
|
|
396
397
|
});
|
|
397
398
|
}
|
|
398
399
|
},
|
|
399
400
|
[i.onChange, i.dataItem, i.dataIndex, i.field]
|
|
400
|
-
), h = n.useCallback((
|
|
401
|
-
i.onContextMenu && i.onContextMenu.call(void 0,
|
|
401
|
+
), h = n.useCallback((g) => {
|
|
402
|
+
i.onContextMenu && i.onContextMenu.call(void 0, g, i.dataItem, i.field);
|
|
402
403
|
}, [i.onContextMenu, i.dataItem, i.field]), d = n.useCallback(
|
|
403
|
-
(
|
|
404
|
+
(g) => {
|
|
404
405
|
i.onChange && i.onChange({
|
|
405
406
|
dataItem: i.dataItem,
|
|
406
407
|
dataIndex: i.dataIndex,
|
|
407
408
|
field: i.field,
|
|
408
|
-
syntheticEvent:
|
|
409
|
-
value:
|
|
409
|
+
syntheticEvent: g.syntheticEvent,
|
|
410
|
+
value: g.value
|
|
410
411
|
});
|
|
411
412
|
},
|
|
412
413
|
[i.onChange, i.dataItem, i.dataIndex, i.field]
|
|
@@ -523,10 +524,10 @@ const ar = (i) => {
|
|
|
523
524
|
a
|
|
524
525
|
);
|
|
525
526
|
}
|
|
526
|
-
const
|
|
527
|
-
if (
|
|
528
|
-
const
|
|
529
|
-
return /* @__PURE__ */ n.createElement(
|
|
527
|
+
const u = i.editor || "text", f = i.cells;
|
|
528
|
+
if (f && f.edit && f.edit[u]) {
|
|
529
|
+
const g = f.edit[u];
|
|
530
|
+
return /* @__PURE__ */ n.createElement(g, { ...i, tdProps: l }, a);
|
|
530
531
|
}
|
|
531
532
|
return i.render ? i.render.call(void 0, s, i) : s;
|
|
532
533
|
};
|
|
@@ -772,17 +773,17 @@ class jt extends n.Component {
|
|
|
772
773
|
"k-header": !0,
|
|
773
774
|
"k-grid-header-sticky": e.locked,
|
|
774
775
|
"k-sorted": this.props.sort && this.props.sort.some((v) => v.field === e.field)
|
|
775
|
-
}, e.headerClassName), d = e.left !== void 0 ? this.props.isRtl ? { left: e.right, right: e.left } : { left: e.left, right: e.right } : {},
|
|
776
|
-
let
|
|
776
|
+
}, e.headerClassName), d = e.left !== void 0 ? this.props.isRtl ? { left: e.right, right: e.left } : { left: e.left, right: e.right } : {}, u = D(this).toLanguageString(Ae, k[Ae]);
|
|
777
|
+
let f = e.isAccessible ? {
|
|
777
778
|
ariaSort: mr[a],
|
|
778
779
|
role: "columnheader",
|
|
779
780
|
ariaColumnIndex: e.ariaColumnIndex,
|
|
780
781
|
ariaSelected: !1,
|
|
781
|
-
ariaDescription: r ?
|
|
782
|
+
ariaDescription: r ? u : ""
|
|
782
783
|
} : {
|
|
783
784
|
role: "presentation"
|
|
784
785
|
};
|
|
785
|
-
const
|
|
786
|
+
const g = e.declarationIndex >= 0 ? ++this.index : --this.serviceIndex, b = e.headerCell ? e.headerCell : gr, E = /* @__PURE__ */ n.createElement(
|
|
786
787
|
b,
|
|
787
788
|
{
|
|
788
789
|
key: 1,
|
|
@@ -815,8 +816,8 @@ class jt extends n.Component {
|
|
|
815
816
|
}
|
|
816
817
|
}
|
|
817
818
|
), C = {
|
|
818
|
-
...
|
|
819
|
-
key:
|
|
819
|
+
...f,
|
|
820
|
+
key: g,
|
|
820
821
|
colSpan: e.colSpan,
|
|
821
822
|
rowSpan: e.rowSpan,
|
|
822
823
|
className: h,
|
|
@@ -838,13 +839,13 @@ class jt extends n.Component {
|
|
|
838
839
|
], S = xe(this.props.cells, e.cells);
|
|
839
840
|
if (S && S.headerCell) {
|
|
840
841
|
const v = S.headerCell;
|
|
841
|
-
return /* @__PURE__ */ n.createElement(v, { key:
|
|
842
|
+
return /* @__PURE__ */ n.createElement(v, { key: g, thProps: C, index: o }, x);
|
|
842
843
|
}
|
|
843
844
|
return /* @__PURE__ */ n.createElement(
|
|
844
845
|
Mt,
|
|
845
846
|
{
|
|
846
847
|
...C,
|
|
847
|
-
key:
|
|
848
|
+
key: g
|
|
848
849
|
},
|
|
849
850
|
x
|
|
850
851
|
);
|
|
@@ -1122,13 +1123,13 @@ class ts extends n.Component {
|
|
|
1122
1123
|
const l = this.props.columns.filter((a) => a.children.length === 0).map(
|
|
1123
1124
|
(a) => {
|
|
1124
1125
|
const c = Ve(a.filter), h = o(a.field), d = a.filterable ? t.toLanguageString(Be, k[Be]) : void 0;
|
|
1125
|
-
let
|
|
1126
|
-
|
|
1127
|
-
const
|
|
1126
|
+
let u = h && h.value;
|
|
1127
|
+
u === void 0 && (u = c === "text" ? "" : null);
|
|
1128
|
+
const f = a.filterable && {
|
|
1128
1129
|
render: this.props.cellRender,
|
|
1129
1130
|
field: a.field,
|
|
1130
1131
|
title: a.filterTitle,
|
|
1131
|
-
value:
|
|
1132
|
+
value: u,
|
|
1132
1133
|
operator: h && h.operator,
|
|
1133
1134
|
operators: re(this.props.filterOperators[c] || [], t),
|
|
1134
1135
|
booleanValues: re(Xt, t),
|
|
@@ -1137,7 +1138,7 @@ class ts extends n.Component {
|
|
|
1137
1138
|
onChange: (v) => {
|
|
1138
1139
|
this.setFilter(v.value, v.operator, a.field, v.syntheticEvent);
|
|
1139
1140
|
}
|
|
1140
|
-
},
|
|
1141
|
+
}, g = a.declarationIndex >= 0 ? ++r : --e, b = {
|
|
1141
1142
|
ariaLabel: d,
|
|
1142
1143
|
ariaColumnIndex: a.ariaColumnIndex
|
|
1143
1144
|
}, E = a.left !== void 0 ? this.props.isRtl ? { left: a.right, right: a.left } : { left: a.left, right: a.right } : {}, C = {
|
|
@@ -1147,15 +1148,15 @@ class ts extends n.Component {
|
|
|
1147
1148
|
className: y("k-table-th", this.headerCellClassName(a.field, a.locked) || void 0),
|
|
1148
1149
|
role: "columnheader",
|
|
1149
1150
|
...b
|
|
1150
|
-
}, x =
|
|
1151
|
+
}, x = f && (a.filterCell ? /* @__PURE__ */ n.createElement(a.filterCell, { ...f }) : /* @__PURE__ */ n.createElement(es, { size: this.props.size, ...f })), S = xe(this.props.cells, a.cells);
|
|
1151
1152
|
if (S && S.filterCell) {
|
|
1152
1153
|
const v = S.filterCell;
|
|
1153
|
-
return /* @__PURE__ */ n.createElement(v, { key:
|
|
1154
|
+
return /* @__PURE__ */ n.createElement(v, { key: g, ...f, thProps: C, index: r }, x);
|
|
1154
1155
|
}
|
|
1155
1156
|
return /* @__PURE__ */ n.createElement(
|
|
1156
1157
|
Mt,
|
|
1157
1158
|
{
|
|
1158
|
-
key:
|
|
1159
|
+
key: g,
|
|
1159
1160
|
...C
|
|
1160
1161
|
},
|
|
1161
1162
|
x
|
|
@@ -1554,64 +1555,64 @@ class yr {
|
|
|
1554
1555
|
if (this.isRtl ? h += e.getBoundingClientRect().right - e.offsetWidth / 2 - s.clientX : h += s.clientX - e.getBoundingClientRect().left - e.offsetWidth / 2, !r && Math.abs(h - c) < 1)
|
|
1555
1556
|
return;
|
|
1556
1557
|
this.fixateInitialWidths(a.parentElement.clientWidth), this.setWidths(o, Math.floor(h) / c);
|
|
1557
|
-
const d = this.columns.filter((
|
|
1558
|
+
const d = this.columns.filter((u) => !u.children.length).findIndex((u) => u.id === o.id);
|
|
1558
1559
|
this.onResize(d, c, h, l, r, o.id);
|
|
1559
1560
|
}, this.dblClickHandler = (s, o) => {
|
|
1560
|
-
const e = this.columns.filter((
|
|
1561
|
+
const e = this.columns.filter((f) => o.indexOf(f.id) > -1);
|
|
1561
1562
|
if (!this.colGroupMain || !e.length)
|
|
1562
1563
|
return;
|
|
1563
1564
|
const r = {}, l = e;
|
|
1564
1565
|
for (; l.length > 0; ) {
|
|
1565
|
-
const
|
|
1566
|
-
if (!
|
|
1566
|
+
const f = l.pop();
|
|
1567
|
+
if (!f)
|
|
1567
1568
|
break;
|
|
1568
|
-
|
|
1569
|
+
f.children.length ? l.push(...f.children) : r[f.id] = f;
|
|
1569
1570
|
}
|
|
1570
|
-
const a = this.columns.filter((
|
|
1571
|
-
a.forEach((
|
|
1572
|
-
r[
|
|
1571
|
+
const a = this.columns.filter((f) => !f.children.length), c = [];
|
|
1572
|
+
a.forEach((f, g) => {
|
|
1573
|
+
r[f.id] && c.push(g);
|
|
1573
1574
|
});
|
|
1574
1575
|
const h = [this.colGroupMain.parentElement], d = [this.colGroupMain];
|
|
1575
|
-
this.colGroupHeader && (h.push(this.colGroupHeader.parentElement), d.push(this.colGroupHeader)), this.colGroupFooter && (h.push(this.colGroupFooter.parentElement), d.push(this.colGroupFooter)), h.forEach((
|
|
1576
|
-
let
|
|
1577
|
-
d.forEach((
|
|
1578
|
-
c.forEach((
|
|
1579
|
-
|
|
1576
|
+
this.colGroupHeader && (h.push(this.colGroupHeader.parentElement), d.push(this.colGroupHeader)), this.colGroupFooter && (h.push(this.colGroupFooter.parentElement), d.push(this.colGroupFooter)), h.forEach((f) => f.classList.add("k-autofitting"));
|
|
1577
|
+
let u = [];
|
|
1578
|
+
d.forEach((f) => {
|
|
1579
|
+
c.forEach((g) => {
|
|
1580
|
+
f.children[g] && (f.children[g].width = "", u[g] = Math.max(u[g] || 0, f.children[g].offsetWidth + Sr));
|
|
1580
1581
|
});
|
|
1581
|
-
}), d.forEach((
|
|
1582
|
-
c.forEach((
|
|
1583
|
-
|
|
1582
|
+
}), d.forEach((f) => {
|
|
1583
|
+
c.forEach((g) => {
|
|
1584
|
+
f.children[g] && (f.children[g].width = u[g] + "px", a[g].width = u[g]);
|
|
1584
1585
|
});
|
|
1585
|
-
}), h.forEach((
|
|
1586
|
+
}), h.forEach((f) => f.classList.remove("k-autofitting")), this.onResize(c[0], 0, 0, s, !0, o[0]);
|
|
1586
1587
|
}, this.updateColElements = (s) => {
|
|
1587
1588
|
const o = this.columns.filter((r) => !r.children.length);
|
|
1588
1589
|
let e = 1e-10;
|
|
1589
1590
|
for (let r = 0; r < s.length; r++) {
|
|
1590
|
-
const l = s[r], a = o.findIndex((
|
|
1591
|
+
const l = s[r], a = o.findIndex((u) => u.id === l.id), c = parseFloat((l.width || 0).toString()), h = Math.floor(c);
|
|
1591
1592
|
e += c - h;
|
|
1592
1593
|
const d = h + Math.floor(e);
|
|
1593
1594
|
if (e -= Math.floor(e), this.colGroupMain && this.colGroupMain.children[a]) {
|
|
1594
|
-
const
|
|
1595
|
+
const u = parseInt(this.colGroupMain.children[a].width, 10);
|
|
1595
1596
|
this.colGroupMain.children[a].width = d + "px", this.updateNextLockedCol(
|
|
1596
1597
|
this.colGroupMain.parentElement,
|
|
1597
1598
|
l,
|
|
1598
|
-
|
|
1599
|
+
u - d
|
|
1599
1600
|
);
|
|
1600
1601
|
}
|
|
1601
1602
|
if (this.colGroupHeader && this.colGroupHeader.children[a]) {
|
|
1602
|
-
const
|
|
1603
|
+
const u = parseInt(this.colGroupHeader.children[a].width, 10);
|
|
1603
1604
|
this.colGroupHeader.children[a].width = d + "px", this.updateNextLockedCol(
|
|
1604
1605
|
this.colGroupHeader.parentElement,
|
|
1605
1606
|
l,
|
|
1606
|
-
|
|
1607
|
+
u - d
|
|
1607
1608
|
);
|
|
1608
1609
|
}
|
|
1609
1610
|
if (this.colGroupFooter && this.colGroupFooter.children[a]) {
|
|
1610
|
-
const
|
|
1611
|
+
const u = parseInt(this.colGroupFooter.children[a].width, 10);
|
|
1611
1612
|
this.colGroupFooter.children[a].width = d + "px", this.updateNextLockedCol(
|
|
1612
1613
|
this.colGroupFooter.parentElement,
|
|
1613
1614
|
l,
|
|
1614
|
-
|
|
1615
|
+
u - d
|
|
1615
1616
|
);
|
|
1616
1617
|
}
|
|
1617
1618
|
}
|
|
@@ -1649,8 +1650,8 @@ class yr {
|
|
|
1649
1650
|
if (c != null && c.locked && o) {
|
|
1650
1651
|
const h = t == null ? void 0 : t.querySelectorAll('[aria-colindex="' + c.ariaColumnIndex + '"]');
|
|
1651
1652
|
h == null || h.forEach((d) => {
|
|
1652
|
-
const
|
|
1653
|
-
this.isRtl ? (c.index > e &&
|
|
1653
|
+
const u = d.style;
|
|
1654
|
+
this.isRtl ? (c.index > e && u && u.right && (u.right = parseInt(u.right, 10) - o + "px"), c.index < e && u && u.left && (u.left = parseInt(u.left, 10) - o + "px")) : (c.index > e && u && u.left && (u.left = parseInt(u.left, 10) - o + "px"), c.index < e && u && u.right && (u.right = parseInt(u.right, 10) - o + "px"));
|
|
1654
1655
|
});
|
|
1655
1656
|
}
|
|
1656
1657
|
});
|
|
@@ -1788,19 +1789,19 @@ const Rr = (i) => {
|
|
|
1788
1789
|
return i.render ? i.render.call(void 0, t, i) : t;
|
|
1789
1790
|
}, It = (i) => {
|
|
1790
1791
|
let t = null;
|
|
1791
|
-
const { columnIndex: s, level: o, columnsCount: e, rowType: r, dataItem: l, field: a, onChange: c, expanded: h, render: d, dataIndex:
|
|
1792
|
+
const { columnIndex: s, level: o, columnsCount: e, rowType: r, dataItem: l, field: a, onChange: c, expanded: h, render: d, dataIndex: u, ariaColumnIndex: f, isRtl: g } = i, b = a || "", E = q(i.id), C = Ue();
|
|
1792
1793
|
let x = null, S = null, v = null;
|
|
1793
1794
|
const _ = n.useCallback(
|
|
1794
1795
|
(F) => {
|
|
1795
1796
|
F.isDefaultPrevented() || F.keyCode === Ce.enter && c && (F.preventDefault(), c({
|
|
1796
1797
|
dataItem: l,
|
|
1797
|
-
dataIndex:
|
|
1798
|
+
dataIndex: u,
|
|
1798
1799
|
syntheticEvent: F,
|
|
1799
1800
|
field: void 0,
|
|
1800
1801
|
value: !h
|
|
1801
1802
|
}));
|
|
1802
1803
|
},
|
|
1803
|
-
[h, c, l,
|
|
1804
|
+
[h, c, l, u]
|
|
1804
1805
|
), T = n.useCallback((F) => {
|
|
1805
1806
|
i.onContextMenu && i.onContextMenu.call(void 0, F, i.dataItem, i.field);
|
|
1806
1807
|
}, [i.onContextMenu, i.dataItem, i.field]), de = (F, ke) => {
|
|
@@ -1813,7 +1814,7 @@ const Rr = (i) => {
|
|
|
1813
1814
|
role: "gridcell",
|
|
1814
1815
|
["aria-selected"]: !1,
|
|
1815
1816
|
["aria-expanded"]: h,
|
|
1816
|
-
["aria-colindex"]:
|
|
1817
|
+
["aria-colindex"]: f,
|
|
1817
1818
|
onKeyDown: _,
|
|
1818
1819
|
onContextMenu: T,
|
|
1819
1820
|
...E
|
|
@@ -1823,7 +1824,7 @@ const Rr = (i) => {
|
|
|
1823
1824
|
onClick: (J) => {
|
|
1824
1825
|
J.preventDefault(), c && c({
|
|
1825
1826
|
dataItem: l,
|
|
1826
|
-
dataIndex:
|
|
1827
|
+
dataIndex: u,
|
|
1827
1828
|
syntheticEvent: J,
|
|
1828
1829
|
field: void 0,
|
|
1829
1830
|
value: !h
|
|
@@ -1836,8 +1837,8 @@ const Rr = (i) => {
|
|
|
1836
1837
|
/* @__PURE__ */ n.createElement(
|
|
1837
1838
|
O,
|
|
1838
1839
|
{
|
|
1839
|
-
name: h ? "caret-alt-down" :
|
|
1840
|
-
icon: h ? Ps :
|
|
1840
|
+
name: h ? "caret-alt-down" : g ? "caret-alt-left" : "caret-alt-right",
|
|
1841
|
+
icon: h ? Ps : g ? As : Bs
|
|
1841
1842
|
}
|
|
1842
1843
|
)
|
|
1843
1844
|
), l[b] instanceof Date && l[b].toString ? l[b].toString() : l[b]), /* @__PURE__ */ n.createElement(
|
|
@@ -1935,6 +1936,7 @@ class is extends n.Component {
|
|
|
1935
1936
|
className: "k-checkbox k-checkbox-md k-rounded-md",
|
|
1936
1937
|
"aria-label": t.toLanguageString(le, k[le]),
|
|
1937
1938
|
"aria-checked": this.props.selectionValue,
|
|
1939
|
+
checked: this.props.selectionValue,
|
|
1938
1940
|
onChange: (e) => this.props.selectionChange({
|
|
1939
1941
|
field: this.props.field,
|
|
1940
1942
|
syntheticEvent: e
|
|
@@ -2010,7 +2012,7 @@ const Tr = ({
|
|
|
2010
2012
|
name: "@progress/kendo-react-grid",
|
|
2011
2013
|
productName: "KendoReact",
|
|
2012
2014
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
2013
|
-
publishDate:
|
|
2015
|
+
publishDate: 1708511741,
|
|
2014
2016
|
version: "",
|
|
2015
2017
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
2016
2018
|
}, Gr = (i) => {
|
|
@@ -2075,8 +2077,8 @@ let he = class extends n.Component {
|
|
|
2075
2077
|
this.props.onContextMenu.call(void 0, a);
|
|
2076
2078
|
}
|
|
2077
2079
|
}, this.getVirtualScroll = (e) => {
|
|
2078
|
-
const { rowHeight: r, detailRowHeight: l, detail: a, expandField: c, groupable: h } = e, d = this.isAllData(),
|
|
2079
|
-
return !
|
|
2080
|
+
const { rowHeight: r, detailRowHeight: l, detail: a, expandField: c, groupable: h } = e, d = this.isAllData(), u = r !== void 0 && r > 0, f = l !== void 0 && l > 0, g = h === !0 || typeof h == "object" && h.enabled !== !1;
|
|
2081
|
+
return !u || g && !d || !!(a && c) && (!f || !d) ? Er : St;
|
|
2080
2082
|
}, this.isAllData = () => {
|
|
2081
2083
|
const { data: e, total: r } = this.props;
|
|
2082
2084
|
return Array.isArray(e) ? e.length === r : e ? r === e.total : !1;
|
|
@@ -2273,15 +2275,15 @@ let he = class extends n.Component {
|
|
|
2273
2275
|
const d = this.getVirtualScroll(this.props);
|
|
2274
2276
|
this.vs = new d(h);
|
|
2275
2277
|
}), this.flatData = B((e, r, l, a, c, h, d) => {
|
|
2276
|
-
const
|
|
2277
|
-
|
|
2278
|
+
const u = [], f = Ot(
|
|
2279
|
+
u,
|
|
2278
2280
|
e,
|
|
2279
2281
|
r,
|
|
2280
2282
|
{ index: l },
|
|
2281
2283
|
a !== void 0,
|
|
2282
2284
|
c
|
|
2283
2285
|
);
|
|
2284
|
-
return { flattedData:
|
|
2286
|
+
return { flattedData: u, resolvedGroupsCount: f };
|
|
2285
2287
|
}), this.rowHeightService = B((e, r, l, a, c) => new Et(r, l, a, c)), this.childrenToArray = B((e) => n.Children.toArray(e)), this.readColumns = B(
|
|
2286
2288
|
(e, r, l) => {
|
|
2287
2289
|
const a = e.filter((c) => c && c.type && c.type.displayName === "KendoReactGridColumn");
|
|
@@ -2329,7 +2331,7 @@ let he = class extends n.Component {
|
|
|
2329
2331
|
locked: this.props.lockGroups
|
|
2330
2332
|
}), c++;
|
|
2331
2333
|
e.slice(c).forEach((h) => h.parentIndex >= 0 && (h.parentIndex += c));
|
|
2332
|
-
}), this.getHeaderRow = B((e, r, l, a, c, h, d,
|
|
2334
|
+
}), this.getHeaderRow = B((e, r, l, a, c, h, d, u, f, g, b, E) => /* @__PURE__ */ n.createElement(
|
|
2333
2335
|
jt,
|
|
2334
2336
|
{
|
|
2335
2337
|
cells: this.props.cells,
|
|
@@ -2343,15 +2345,15 @@ let he = class extends n.Component {
|
|
|
2343
2345
|
filterable: h,
|
|
2344
2346
|
filterOperators: d,
|
|
2345
2347
|
filterChange: this.filterChange,
|
|
2346
|
-
columnMenu:
|
|
2348
|
+
columnMenu: f,
|
|
2347
2349
|
selectionChange: this.onHeaderSelectionChange,
|
|
2348
|
-
columns:
|
|
2350
|
+
columns: g,
|
|
2349
2351
|
columnResize: this.columnResize,
|
|
2350
2352
|
pressHandler: this.dragLogic.pressHandler,
|
|
2351
2353
|
dragHandler: this.dragLogic.dragHandler,
|
|
2352
2354
|
releaseHandler: this.dragLogic.releaseHandler,
|
|
2353
2355
|
columnsMap: b,
|
|
2354
|
-
cellRender:
|
|
2356
|
+
cellRender: u,
|
|
2355
2357
|
isRtl: E,
|
|
2356
2358
|
dragClue: this.dragLogic.dragClueRef,
|
|
2357
2359
|
headerRef: this.headerElementRef,
|
|
@@ -2501,7 +2503,7 @@ let he = class extends n.Component {
|
|
|
2501
2503
|
this.initializeVirtualization(t, a);
|
|
2502
2504
|
const h = this.childrenToArray(this.props.children);
|
|
2503
2505
|
this.initColumns(h, r);
|
|
2504
|
-
const d = h.map((
|
|
2506
|
+
const d = h.map((m) => m && m.type && m.type.displayName === "KendoReactGridToolbar" ? n.cloneElement(m, { ...m.props, ariaControls: this._gridId }) : null), u = h.filter((m) => m && m.type && m.type.displayName === "KendoReactGridNoRecords"), f = h.filter((m) => m && m.type && m.type.displayName === "KendoReactGridStatusBar"), g = this._columns.filter((m) => m.children.length === 0), b = a && /* @__PURE__ */ n.createElement(
|
|
2505
2507
|
rs,
|
|
2506
2508
|
{
|
|
2507
2509
|
group: this.props.group || [],
|
|
@@ -2553,30 +2555,30 @@ let he = class extends n.Component {
|
|
|
2553
2555
|
ariaRowIndex: this._columnsMap.length + 1
|
|
2554
2556
|
}
|
|
2555
2557
|
) || void 0,
|
|
2556
|
-
cols:
|
|
2558
|
+
cols: g.map((m, w) => /* @__PURE__ */ n.createElement(
|
|
2557
2559
|
"col",
|
|
2558
2560
|
{
|
|
2559
2561
|
key: w.toString(),
|
|
2560
|
-
width: Re(
|
|
2562
|
+
width: Re(m)
|
|
2561
2563
|
}
|
|
2562
2564
|
))
|
|
2563
2565
|
}
|
|
2564
2566
|
), $ = this.vs && this.vs.container && this.vs.container.scrollLeft || 0, F = parseFloat(((this.props.style || {}).width || "").toString()), { colSpans: ke, hiddenColumns: pe } = Ds({
|
|
2565
2567
|
enabled: this.props.columnVirtualization,
|
|
2566
|
-
columns:
|
|
2568
|
+
columns: g,
|
|
2567
2569
|
tableViewPortWidth: F,
|
|
2568
2570
|
scrollLeft: $
|
|
2569
|
-
}), Ee = (
|
|
2571
|
+
}), Ee = (m, w, R) => {
|
|
2570
2572
|
let j = !1;
|
|
2571
|
-
const V = this.props.selectedField ? M(this.props.selectedField,
|
|
2573
|
+
const V = this.props.selectedField ? M(this.props.selectedField, m.dataItem) : void 0;
|
|
2572
2574
|
return {
|
|
2573
|
-
row:
|
|
2575
|
+
row: g.map((I, N) => {
|
|
2574
2576
|
if (pe[N])
|
|
2575
2577
|
return null;
|
|
2576
2578
|
const Z = I.id ? I.id : N, ee = `${I.className ? I.className + " " : ""}${I.locked ? "k-grid-content-sticky" : ""}`, P = I.left !== void 0 ? this.isRtl ? { left: I.right, right: I.left } : { left: I.left, right: I.right } : {};
|
|
2577
2579
|
let A = !1;
|
|
2578
2580
|
if (I.editable && this.props.editField) {
|
|
2579
|
-
const H = M(this.props.editField,
|
|
2581
|
+
const H = M(this.props.editField, m.dataItem);
|
|
2580
2582
|
H && (H === !0 || H === I.field) && (j = !0, A = !0);
|
|
2581
2583
|
}
|
|
2582
2584
|
const ye = I.cell || A && dr || Rr;
|
|
@@ -2588,7 +2590,7 @@ let he = class extends n.Component {
|
|
|
2588
2590
|
locked: this.props.lockGroups,
|
|
2589
2591
|
id: z.generateNavigatableId(`${w}-${String(N)}`, s),
|
|
2590
2592
|
colSpan: ke[N],
|
|
2591
|
-
dataItem:
|
|
2593
|
+
dataItem: m.dataItem,
|
|
2592
2594
|
field: I.field,
|
|
2593
2595
|
editor: I.editor,
|
|
2594
2596
|
format: I.format,
|
|
@@ -2597,14 +2599,14 @@ let he = class extends n.Component {
|
|
|
2597
2599
|
cells: xe(this.props.cells, I.cells),
|
|
2598
2600
|
onChange: this.itemChange,
|
|
2599
2601
|
selectionChange: this.props.onSelectionChange ? (H) => {
|
|
2600
|
-
this.selectionChange({ event: H, dataItem:
|
|
2602
|
+
this.selectionChange({ event: H, dataItem: m.dataItem, dataIndex: R, columnIndex: N });
|
|
2601
2603
|
} : void 0,
|
|
2602
2604
|
columnIndex: N,
|
|
2603
|
-
columnsCount:
|
|
2604
|
-
rowType:
|
|
2605
|
-
level:
|
|
2606
|
-
expanded:
|
|
2607
|
-
dataIndex:
|
|
2605
|
+
columnsCount: g.length,
|
|
2606
|
+
rowType: m.rowType,
|
|
2607
|
+
level: m.level,
|
|
2608
|
+
expanded: m.expanded,
|
|
2609
|
+
dataIndex: m.dataIndex,
|
|
2608
2610
|
style: P,
|
|
2609
2611
|
ariaColumnIndex: I.ariaColumnIndex,
|
|
2610
2612
|
isSelected: Array.isArray(V) && V.indexOf(N) > -1
|
|
@@ -2617,24 +2619,24 @@ let he = class extends n.Component {
|
|
|
2617
2619
|
};
|
|
2618
2620
|
let J = 0;
|
|
2619
2621
|
if (this.props.scrollable === "virtual")
|
|
2620
|
-
for (let
|
|
2622
|
+
for (let m = 0; m < this.vs.topCacheCount + this.vs.attendedSkip - (this.props.skip || 0); m++) {
|
|
2621
2623
|
const w = this._data.shift();
|
|
2622
2624
|
if (w)
|
|
2623
|
-
this._data.push(w), J++, w.rowType === "groupHeader" &&
|
|
2625
|
+
this._data.push(w), J++, w.rowType === "groupHeader" && m--;
|
|
2624
2626
|
else
|
|
2625
2627
|
break;
|
|
2626
2628
|
}
|
|
2627
|
-
const Qe = (
|
|
2629
|
+
const Qe = (m) => m >= this._data.length - J;
|
|
2628
2630
|
let Ze = this.vs.realSkip || 0;
|
|
2629
2631
|
const ue = [];
|
|
2630
2632
|
let Se = !1;
|
|
2631
|
-
const Ie = this._columnsMap.length + (this.props.filterable ? 1 : 0) + 1, et = /* @__PURE__ */ n.createElement("div", { key: "no-records", className: "k-grid-norecords", "aria-rowindex": Ie }, /* @__PURE__ */ n.createElement("div", { className: "k-grid-norecords-template" },
|
|
2633
|
+
const Ie = this._columnsMap.length + (this.props.filterable ? 1 : 0) + 1, et = /* @__PURE__ */ n.createElement("div", { key: "no-records", className: "k-grid-norecords", "aria-rowindex": Ie }, /* @__PURE__ */ n.createElement("div", { className: "k-grid-norecords-template" }, u.length ? u : /* @__PURE__ */ n.createElement(Ye, null)));
|
|
2632
2634
|
let Q = 0;
|
|
2633
2635
|
if (this._data.length) {
|
|
2634
|
-
let
|
|
2636
|
+
let m = -1, w = 0;
|
|
2635
2637
|
(this._slicedData || this._data).forEach((R, j) => {
|
|
2636
|
-
R.rowType === "data" && (Ze++,
|
|
2637
|
-
const V = Ze % 2 === 0, I = this.props.dataItemKey && Fe(this.props.dataItemKey)(R.dataItem), N = j + (this.vs.realSkip || 0), Z = I || "ai" + N, ee = Z + "_1", P = Ee(R, Z,
|
|
2638
|
+
R.rowType === "data" && (Ze++, m++);
|
|
2639
|
+
const V = Ze % 2 === 0, I = this.props.dataItemKey && Fe(this.props.dataItemKey)(R.dataItem), N = j + (this.vs.realSkip || 0), Z = I || "ai" + N, ee = Z + "_1", P = Ee(R, Z, m);
|
|
2638
2640
|
if (Q = N + Ie + w, ue.push(/* @__PURE__ */ n.createElement(
|
|
2639
2641
|
Fr,
|
|
2640
2642
|
{
|
|
@@ -2651,12 +2653,12 @@ let he = class extends n.Component {
|
|
|
2651
2653
|
render: this.props.rowRender,
|
|
2652
2654
|
ariaRowIndex: Q,
|
|
2653
2655
|
absoluteRowIndex: N,
|
|
2654
|
-
dataIndex:
|
|
2656
|
+
dataIndex: m,
|
|
2655
2657
|
isSelected: P.isSelected
|
|
2656
2658
|
},
|
|
2657
2659
|
P.row
|
|
2658
2660
|
)), this.props.detail && R.rowType === "data" && R.expanded) {
|
|
2659
|
-
const A =
|
|
2661
|
+
const A = g.length - (this.props.expandField ? 1 : 0) - (this.props.group ? this.props.group.length : 0) || 1;
|
|
2660
2662
|
w++, Q = N + Ie + w, ue.push(/* @__PURE__ */ n.createElement(
|
|
2661
2663
|
"tr",
|
|
2662
2664
|
{
|
|
@@ -2721,16 +2723,16 @@ let he = class extends n.Component {
|
|
|
2721
2723
|
take: (this.props.take !== void 0 ? this.props.take : this.props.pageSize) || 10,
|
|
2722
2724
|
messagesMap: lr,
|
|
2723
2725
|
...Mr(this.props.pageable || {})
|
|
2724
|
-
}, st = this.props.pager ? /* @__PURE__ */ n.createElement(this.props.pager, { ...tt }) : /* @__PURE__ */ n.createElement(Ts, { className: "k-grid-pager", ...tt }), gs = (
|
|
2726
|
+
}, st = this.props.pager ? /* @__PURE__ */ n.createElement(this.props.pager, { ...tt }) : /* @__PURE__ */ n.createElement(Ts, { className: "k-grid-pager", ...tt }), gs = (m) => this.props.sort && this.props.sort.filter((w) => w.field === m).length > 0, fs = (m, w) => /* @__PURE__ */ n.createElement(
|
|
2725
2727
|
"col",
|
|
2726
2728
|
{
|
|
2727
2729
|
key: w.toString(),
|
|
2728
|
-
width: Re(
|
|
2730
|
+
width: Re(m)
|
|
2729
2731
|
}
|
|
2730
2732
|
), rt = (lt = this.props.cells) != null && lt.footerCell || this._columns.some(
|
|
2731
|
-
(
|
|
2733
|
+
(m) => {
|
|
2732
2734
|
var w;
|
|
2733
|
-
return !!(
|
|
2735
|
+
return !!(m.footerCell || (w = m.cells) != null && w.footerCell);
|
|
2734
2736
|
}
|
|
2735
2737
|
) ? /* @__PURE__ */ n.createElement(
|
|
2736
2738
|
kr,
|
|
@@ -2738,7 +2740,7 @@ let he = class extends n.Component {
|
|
|
2738
2740
|
size: this.props.size,
|
|
2739
2741
|
columnResize: this.columnResize,
|
|
2740
2742
|
staticHeaders: this.props.scrollable !== "none",
|
|
2741
|
-
ref: (
|
|
2743
|
+
ref: (m) => this._footer = m,
|
|
2742
2744
|
row: /* @__PURE__ */ n.createElement(
|
|
2743
2745
|
Dr,
|
|
2744
2746
|
{
|
|
@@ -2748,22 +2750,22 @@ let he = class extends n.Component {
|
|
|
2748
2750
|
ariaRowIndex: Q + 1
|
|
2749
2751
|
}
|
|
2750
2752
|
),
|
|
2751
|
-
cols:
|
|
2753
|
+
cols: g.map(fs)
|
|
2752
2754
|
}
|
|
2753
2755
|
) : null, it = /* @__PURE__ */ n.createElement(
|
|
2754
2756
|
"colgroup",
|
|
2755
2757
|
{
|
|
2756
|
-
ref: (
|
|
2757
|
-
this.columnResize.colGroupMain =
|
|
2758
|
+
ref: (m) => {
|
|
2759
|
+
this.columnResize.colGroupMain = m;
|
|
2758
2760
|
}
|
|
2759
2761
|
},
|
|
2760
|
-
|
|
2761
|
-
(
|
|
2762
|
+
g.map(
|
|
2763
|
+
(m, w) => /* @__PURE__ */ n.createElement(
|
|
2762
2764
|
"col",
|
|
2763
2765
|
{
|
|
2764
2766
|
key: w.toString(),
|
|
2765
|
-
className: gs(
|
|
2766
|
-
width: Re(
|
|
2767
|
+
className: gs(m.field) ? "k-sorted" : void 0,
|
|
2768
|
+
width: Re(m)
|
|
2767
2769
|
}
|
|
2768
2770
|
)
|
|
2769
2771
|
)
|
|
@@ -2782,8 +2784,8 @@ let he = class extends n.Component {
|
|
|
2782
2784
|
},
|
|
2783
2785
|
this.props.className
|
|
2784
2786
|
),
|
|
2785
|
-
ref: (
|
|
2786
|
-
this._element =
|
|
2787
|
+
ref: (m) => {
|
|
2788
|
+
this._element = m;
|
|
2787
2789
|
},
|
|
2788
2790
|
"aria-label": this.props.ariaLabel,
|
|
2789
2791
|
onKeyDown: this.onKeyDown,
|
|
@@ -2797,8 +2799,8 @@ let he = class extends n.Component {
|
|
|
2797
2799
|
{
|
|
2798
2800
|
selectable: this.props.selectable,
|
|
2799
2801
|
onRelease: this.selectionRelease,
|
|
2800
|
-
childRef: (
|
|
2801
|
-
this.tableElement =
|
|
2802
|
+
childRef: (m) => {
|
|
2803
|
+
this.tableElement = m;
|
|
2802
2804
|
}
|
|
2803
2805
|
},
|
|
2804
2806
|
/* @__PURE__ */ n.createElement(
|
|
@@ -2818,7 +2820,7 @@ let he = class extends n.Component {
|
|
|
2818
2820
|
),
|
|
2819
2821
|
Se && et,
|
|
2820
2822
|
ot && /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(mt, { ref: this.dragLogic.refDropElementClue }), /* @__PURE__ */ n.createElement(Ct, { ref: this.dragLogic.refDragElementClue }))
|
|
2821
|
-
),
|
|
2823
|
+
), f, this.props.pageable && st);
|
|
2822
2824
|
let ge = this.props.style || {};
|
|
2823
2825
|
return this.props.scrollable === "virtual" && (ge.height || (ge = Object.assign({}, ge, { height: "450px" }))), /* @__PURE__ */ n.createElement(Ne.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ n.createElement(
|
|
2824
2826
|
"div",
|
|
@@ -2834,8 +2836,8 @@ let he = class extends n.Component {
|
|
|
2834
2836
|
},
|
|
2835
2837
|
this.props.className
|
|
2836
2838
|
),
|
|
2837
|
-
ref: (
|
|
2838
|
-
this._element =
|
|
2839
|
+
ref: (m) => {
|
|
2840
|
+
this._element = m;
|
|
2839
2841
|
},
|
|
2840
2842
|
"aria-label": this.props.ariaLabel,
|
|
2841
2843
|
onKeyDown: this.onKeyDown,
|
|
@@ -2849,7 +2851,7 @@ let he = class extends n.Component {
|
|
|
2849
2851
|
{
|
|
2850
2852
|
className: "k-grid-aria-root",
|
|
2851
2853
|
role: "grid",
|
|
2852
|
-
"aria-colcount":
|
|
2854
|
+
"aria-colcount": g.length,
|
|
2853
2855
|
"aria-rowcount": t,
|
|
2854
2856
|
id: this._gridId
|
|
2855
2857
|
},
|
|
@@ -2867,8 +2869,8 @@ let he = class extends n.Component {
|
|
|
2867
2869
|
{
|
|
2868
2870
|
selectable: this.props.selectable,
|
|
2869
2871
|
onRelease: this.selectionRelease,
|
|
2870
|
-
childRef: (
|
|
2871
|
-
this.tableElement =
|
|
2872
|
+
childRef: (m) => {
|
|
2873
|
+
this.tableElement = m;
|
|
2872
2874
|
}
|
|
2873
2875
|
},
|
|
2874
2876
|
/* @__PURE__ */ n.createElement(
|
|
@@ -2908,7 +2910,7 @@ let he = class extends n.Component {
|
|
|
2908
2910
|
ot && /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(mt, { ref: this.dragLogic.refDropElementClue }), /* @__PURE__ */ n.createElement(Ct, { ref: this.dragLogic.refDragElementClue })),
|
|
2909
2911
|
this.showLicenseWatermark && /* @__PURE__ */ n.createElement(ks, null)
|
|
2910
2912
|
),
|
|
2911
|
-
|
|
2913
|
+
f,
|
|
2912
2914
|
this.props.pageable && st
|
|
2913
2915
|
));
|
|
2914
2916
|
}
|
|
@@ -2960,7 +2962,7 @@ let he = class extends n.Component {
|
|
|
2960
2962
|
while (d < this._columns.length && this._columns[d].depth > r);
|
|
2961
2963
|
return d;
|
|
2962
2964
|
}, a = this._columns.splice(t, l(t) - t);
|
|
2963
|
-
this._columns.splice(t < s ? l(s - a.length) : s, 0, ...a), this._columns.filter((d) => d.declarationIndex >= 0).forEach((d,
|
|
2965
|
+
this._columns.splice(t < s ? l(s - a.length) : s, 0, ...a), this._columns.filter((d) => d.declarationIndex >= 0).forEach((d, u) => d.orderIndex = u), this._columnsMutations++;
|
|
2964
2966
|
const c = this._columns[t].locked && this._columns[s].locked;
|
|
2965
2967
|
Ms(this._columnsMap, this._columns, c || this._shouldUpdateLeftRight), Gs(this._columnsMap, this._columns, c || this._shouldUpdateLeftRight), this._resized && (this._shouldUpdateLeftRight = !1, this._resized = !1);
|
|
2966
2968
|
const h = this.columns;
|
|
@@ -3183,7 +3185,7 @@ class Je extends n.Component {
|
|
|
3183
3185
|
}, this.onSort = (t, s) => {
|
|
3184
3186
|
if (t.preventDefault(), !this.props.onSortChange)
|
|
3185
3187
|
return;
|
|
3186
|
-
const { column: o, sortable: e, sort: r } = this.props, { allowUnsort: l, mode: a } = qt(e || !1, !1), c = (r || []).filter((
|
|
3188
|
+
const { column: o, sortable: e, sort: r } = this.props, { allowUnsort: l, mode: a } = qt(e || !1, !1), c = (r || []).filter((u) => u.field === o.field)[0], h = zr[l][c && c.dir || ""][s], d = a === "single" ? [] : (this.props.sort || []).filter((u) => u.field !== o.field);
|
|
3187
3189
|
h !== "" && o.field && d.push({ field: o.field, dir: h }), this.props.onSortChange(d, t);
|
|
3188
3190
|
};
|
|
3189
3191
|
}
|
|
@@ -3438,7 +3440,7 @@ class ps extends n.Component {
|
|
|
3438
3440
|
const { column: t, filterUI: s, hideSecondFilter: o, filterOperators: e } = this.props;
|
|
3439
3441
|
if (!t || !t.field)
|
|
3440
3442
|
return /* @__PURE__ */ n.createElement("div", null);
|
|
3441
|
-
const r = Ve(t.filter), l = o !== void 0 ? o : xr[r], a = D(this), c = this.state.filterGroup.filters, h = re(e[r], a), d = re(Xt, a),
|
|
3443
|
+
const r = Ve(t.filter), l = o !== void 0 ? o : xr[r], a = D(this), c = this.state.filterGroup.filters, h = re(e[r], a), d = re(Xt, a), u = {
|
|
3442
3444
|
field: t.field,
|
|
3443
3445
|
value: c[0].value,
|
|
3444
3446
|
operator: c[0].operator,
|
|
@@ -3446,7 +3448,7 @@ class ps extends n.Component {
|
|
|
3446
3448
|
booleanValues: d,
|
|
3447
3449
|
onChange: this.firstFilterChange,
|
|
3448
3450
|
filterType: r
|
|
3449
|
-
},
|
|
3451
|
+
}, f = {
|
|
3450
3452
|
field: t.field,
|
|
3451
3453
|
value: c[1].value,
|
|
3452
3454
|
operator: c[1].operator,
|
|
@@ -3454,13 +3456,13 @@ class ps extends n.Component {
|
|
|
3454
3456
|
booleanValues: d,
|
|
3455
3457
|
onChange: this.secondFilterChange,
|
|
3456
3458
|
filterType: r
|
|
3457
|
-
},
|
|
3458
|
-
value: b.find((T) => T.operator === (
|
|
3459
|
+
}, g = this.state.filterGroup.logic, b = re(Cr, a), E = {
|
|
3460
|
+
value: b.find((T) => T.operator === (g === null ? "" : g)),
|
|
3459
3461
|
onChange: this.logicChange,
|
|
3460
3462
|
data: b
|
|
3461
3463
|
}, C = s, x = {
|
|
3462
|
-
firstFilterProps:
|
|
3463
|
-
secondFilterProps:
|
|
3464
|
+
firstFilterProps: u,
|
|
3465
|
+
secondFilterProps: f,
|
|
3464
3466
|
logicData: E.data,
|
|
3465
3467
|
logicValue: E.value,
|
|
3466
3468
|
onLogicChange: E.onChange,
|
|
@@ -3678,45 +3680,45 @@ us.defaultProps = {
|
|
|
3678
3680
|
};
|
|
3679
3681
|
G(us);
|
|
3680
3682
|
const _r = (i) => {
|
|
3681
|
-
const [t, s] = n.useState(""), o = n.useMemo(() => new Set(i.columnsState.map((
|
|
3683
|
+
const [t, s] = n.useState(""), o = n.useMemo(() => new Set(i.columnsState.map((g) => g.id)), [i.columnsState]), e = n.useMemo(() => i.columns.filter((g) => {
|
|
3682
3684
|
var b;
|
|
3683
|
-
return (b =
|
|
3684
|
-
}), [i.columns, t]), [r, l] = n.useState(i.columns.map((
|
|
3685
|
-
const
|
|
3686
|
-
i.onColumnsChange.call(void 0,
|
|
3685
|
+
return (b = g.title || g.field) == null ? void 0 : b.toLowerCase().includes(t.toLowerCase());
|
|
3686
|
+
}), [i.columns, t]), [r, l] = n.useState(i.columns.map((g) => o.has(g.id))), a = n.useCallback(() => {
|
|
3687
|
+
const g = i.columns.filter((b, E) => r[E]);
|
|
3688
|
+
i.onColumnsChange.call(void 0, g), i.onCloseMenu.call(void 0);
|
|
3687
3689
|
}, [r, i.columns, i.onColumnsChange, i.onCloseMenu]), c = n.useCallback(() => {
|
|
3688
|
-
l(i.columns.map((
|
|
3689
|
-
}, [o, i.columns]), h = r.filter((
|
|
3690
|
-
l(i.columns.map((
|
|
3691
|
-
}, [i.columns, d]),
|
|
3690
|
+
l(i.columns.map((g) => o.has(g.id)));
|
|
3691
|
+
}, [o, i.columns]), h = r.filter((g) => g).length, d = h === r.length, u = n.useCallback(() => {
|
|
3692
|
+
l(i.columns.map((g, b) => d && b === 0 ? !0 : !d));
|
|
3693
|
+
}, [i.columns, d]), f = n.useCallback((g, b) => {
|
|
3692
3694
|
const E = r.slice();
|
|
3693
|
-
E[b] =
|
|
3695
|
+
E[b] = g, l(E);
|
|
3694
3696
|
}, [r]);
|
|
3695
3697
|
return /* @__PURE__ */ n.createElement("form", { className: "k-filter-menu" }, /* @__PURE__ */ n.createElement("div", { className: "k-filter-menu-container" }, /* @__PURE__ */ n.createElement(
|
|
3696
3698
|
zt,
|
|
3697
3699
|
{
|
|
3698
3700
|
className: "k-searchbox",
|
|
3699
3701
|
value: t,
|
|
3700
|
-
onChange: (
|
|
3702
|
+
onChange: (g) => s(String(g.target.value)),
|
|
3701
3703
|
prefix: () => /* @__PURE__ */ n.createElement(Us, null, /* @__PURE__ */ n.createElement(O, { name: "search", icon: Ht }))
|
|
3702
3704
|
}
|
|
3703
3705
|
), /* @__PURE__ */ n.createElement("ul", { className: "k-reset k-multicheck-wrap" }, !t && /* @__PURE__ */ n.createElement("li", { className: "k-item k-check-all-wrap" }, /* @__PURE__ */ n.createElement(
|
|
3704
3706
|
me,
|
|
3705
3707
|
{
|
|
3706
3708
|
checked: d,
|
|
3707
|
-
onChange:
|
|
3709
|
+
onChange: u,
|
|
3708
3710
|
label: "(Select all)"
|
|
3709
3711
|
}
|
|
3710
|
-
)), e.map((
|
|
3712
|
+
)), e.map((g, b) => /* @__PURE__ */ n.createElement("li", { key: g.id, className: "k-item" }, /* @__PURE__ */ n.createElement(
|
|
3711
3713
|
me,
|
|
3712
3714
|
{
|
|
3713
3715
|
disabled: r[b] && h === 1,
|
|
3714
3716
|
checked: r[b],
|
|
3715
3717
|
onChange: (E) => {
|
|
3716
3718
|
var C;
|
|
3717
|
-
return
|
|
3719
|
+
return f(!!((C = E.target.element) != null && C.checked), b);
|
|
3718
3720
|
},
|
|
3719
|
-
label:
|
|
3721
|
+
label: g.title || g.field
|
|
3720
3722
|
}
|
|
3721
3723
|
)))), /* @__PURE__ */ n.createElement("div", { className: "k-filter-selected-items" }, h, " selected items"), /* @__PURE__ */ n.createElement("div", { className: "k-actions k-actions-start k-actions-horizontal" }, /* @__PURE__ */ n.createElement(W, { type: "button", themeColor: "primary", onClick: a }, "Apply"), /* @__PURE__ */ n.createElement(W, { type: "button", onClick: c }, "Reset"))));
|
|
3722
3724
|
};
|
|
@@ -3776,19 +3778,19 @@ const Br = (i) => {
|
|
|
3776
3778
|
c(r[S](C));
|
|
3777
3779
|
});
|
|
3778
3780
|
});
|
|
3779
|
-
const h = a.dates.map((C) => C.getTime()), d = a.booleans.filter((C) => C).length,
|
|
3780
|
-
sum:
|
|
3781
|
-
average: typeof
|
|
3781
|
+
const h = a.dates.map((C) => C.getTime()), d = a.booleans.filter((C) => C).length, u = a.booleans.filter((C) => !C).length, f = a.numbers.length ? a.numbers.reduce((C, x) => C += x, 0) : void 0, g = {
|
|
3782
|
+
sum: f,
|
|
3783
|
+
average: typeof f == "number" ? f / a.numbers.length : void 0,
|
|
3782
3784
|
min: a.numbers.length ? Math.min(...a.numbers) : void 0,
|
|
3783
3785
|
max: a.numbers.length ? Math.max(...a.numbers) : void 0,
|
|
3784
3786
|
count: a.numbers.length + a.booleans.length + a.dates.length + a.others.length,
|
|
3785
3787
|
isTrue: d > 0 ? d : void 0,
|
|
3786
|
-
isFalse:
|
|
3788
|
+
isFalse: u > 0 ? u : void 0,
|
|
3787
3789
|
earliest: a.dates.length ? new Date(Math.min(...h)) : void 0,
|
|
3788
3790
|
latest: a.dates.length ? new Date(Math.max(...h)) : void 0
|
|
3789
3791
|
}, b = (C, x) => (x === "sum" || x === "average") && typeof C == "number" ? C.toFixed(2) : (x === "earliest" || x === "latest") && C instanceof Date ? C.toLocaleDateString() : String(C), E = [];
|
|
3790
|
-
return Object.keys(
|
|
3791
|
-
const x = C, S =
|
|
3792
|
+
return Object.keys(g).forEach((C) => {
|
|
3793
|
+
const x = C, S = g[x];
|
|
3792
3794
|
S !== void 0 && E.push({ type: x, value: S, formattedValue: b(S, x) });
|
|
3793
3795
|
}), E;
|
|
3794
3796
|
}, Wr = Dt(he);
|