@progress/kendo-react-grid 7.1.0-develop.11 → 7.1.0-develop.12
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/Grid.d.ts +3 -0
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/index.js +1 -1
- package/index.mjs +831 -810
- package/interfaces/GridProps.d.ts +9 -1
- package/package.json +10 -10
package/index.mjs
CHANGED
|
@@ -5,21 +5,21 @@
|
|
|
5
5
|
"use client";
|
|
6
6
|
import * as l from "react";
|
|
7
7
|
import p from "prop-types";
|
|
8
|
-
import { useId as
|
|
9
|
-
import { tableKeyboardNavigationTools as z, useTableKeyboardNavigation as q, TABLE_ROW_INDEX_ATTRIBUTE as
|
|
10
|
-
import { getSelectedState as
|
|
11
|
-
import { useLocalization as Nt, provideLocalizationService as G, registerForLocalization as M, useInternationalization as
|
|
12
|
-
import { minusIcon as
|
|
13
|
-
import { NumericTextBox as
|
|
14
|
-
import { DatePicker as
|
|
15
|
-
import { Popup as
|
|
8
|
+
import { useId as St, Keys as me, IconWrap as O, classNames as y, getScrollbarWidth as It, kendoThemeMaps as V, Draggable as yt, withIdHOC as wt, dispatchEvent as us, canUseDOM as Ie, getActiveElement as gs, memoizeOne as B, validatePackage as fs, shouldShowValidationUI as ms, setScrollbarWidth as ot, getter as we, WatermarkOverlay as Cs, toIconName as bs, clone as xs } from "@progress/kendo-react-common";
|
|
9
|
+
import { tableKeyboardNavigationTools as z, useTableKeyboardNavigation as q, TABLE_ROW_INDEX_ATTRIBUTE as vs, TABLE_COL_INDEX_ATTRIBUTE as ks, isRtl as Rt, tableKeyboardNavigationHeaderAttributes as lt, ColumnResizer as Es, HeaderThElement as Ft, getIndex as nt, tableKeyboardNavigation as X, getSelectionOptions as at, mapColumns as Ss, ClipboardService as Is, tableColumnsVirtualization as ys, Pager as ws, TableKeyboardNavigationContext as Re, tableKeyboardNavigationScopeAttributes as ct, TableSelection as ht, tableKeyboardNavigationBodyAttributes as dt, DropClue as pt, DragClue as ut, updateLeft as Rs, updateRight as Fs } from "@progress/kendo-react-data-tools";
|
|
10
|
+
import { getSelectedState as si, getSelectedStateFromKeyDown as ri, setSelectedState as ii } from "@progress/kendo-react-data-tools";
|
|
11
|
+
import { useLocalization as Nt, provideLocalizationService as G, registerForLocalization as M, useInternationalization as Ns, registerForIntl as Dt } from "@progress/kendo-react-intl";
|
|
12
|
+
import { minusIcon as Ds, plusIcon as Ts, filterIcon as Ce, sortAscSmallIcon as Ke, sortDescSmallIcon as Ve, filterClearIcon as Gs, xCircleIcon as Ms, caretAltDownIcon as Hs, caretAltLeftIcon as zs, caretAltRightIcon as Ls, groupIcon as Os, ungroupIcon as _s, searchIcon as Tt, xIcon as Ps } from "@progress/kendo-svg-icons";
|
|
13
|
+
import { NumericTextBox as Ue, TextBox as Gt, Input as Mt, Checkbox as fe, InputPrefix as As } from "@progress/kendo-react-inputs";
|
|
14
|
+
import { DatePicker as qe } from "@progress/kendo-react-dateinputs";
|
|
15
|
+
import { Popup as Bs } from "@progress/kendo-react-popup";
|
|
16
16
|
import { Button as W } from "@progress/kendo-react-buttons";
|
|
17
17
|
import { DropDownList as oe } from "@progress/kendo-react-dropdowns";
|
|
18
18
|
import { isCompositeFilterDescriptor as gt, filterBy as ft } from "@progress/kendo-data-query";
|
|
19
|
-
import { Reveal as
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
import { Reveal as Ws } from "@progress/kendo-react-animation";
|
|
20
|
+
const ce = (i) => null;
|
|
21
|
+
ce.displayName = "KendoReactGridColumn";
|
|
22
|
+
ce.defaultProps = {
|
|
23
23
|
filterable: !0,
|
|
24
24
|
editable: !0,
|
|
25
25
|
sortable: !0,
|
|
@@ -27,7 +27,7 @@ he.defaultProps = {
|
|
|
27
27
|
reorderable: !0,
|
|
28
28
|
groupable: !0
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
ce.propTypes = {
|
|
31
31
|
field: p.string,
|
|
32
32
|
title: p.string,
|
|
33
33
|
editable: p.bool,
|
|
@@ -58,95 +58,95 @@ he.propTypes = {
|
|
|
58
58
|
columnMenu: p.any,
|
|
59
59
|
locked: p.bool
|
|
60
60
|
};
|
|
61
|
-
function T(
|
|
62
|
-
const s = (
|
|
61
|
+
function T(i, t) {
|
|
62
|
+
const s = (i || "").split(".");
|
|
63
63
|
let o = t;
|
|
64
64
|
return s.forEach((e) => {
|
|
65
65
|
o = o ? o[e] : void 0;
|
|
66
66
|
}), o;
|
|
67
67
|
}
|
|
68
|
-
function Ht(
|
|
68
|
+
function Ht(i, t, s, o, e, r, n = 0) {
|
|
69
69
|
let a = n;
|
|
70
|
-
for (let
|
|
71
|
-
if (!e || t[
|
|
72
|
-
|
|
70
|
+
for (let c = 0; c < t.length; c++) {
|
|
71
|
+
if (!e || t[c].value === void 0 || t[c].items === void 0) {
|
|
72
|
+
i[i.length] = {
|
|
73
73
|
dataIndex: o.index,
|
|
74
|
-
dataItem: t[
|
|
74
|
+
dataItem: t[c],
|
|
75
75
|
rowType: "data",
|
|
76
76
|
level: n,
|
|
77
|
-
expanded:
|
|
77
|
+
expanded: r === void 0 || T(r, t[c])
|
|
78
78
|
}, o.index++;
|
|
79
79
|
continue;
|
|
80
80
|
}
|
|
81
81
|
a = Math.max(a, n + 1);
|
|
82
|
-
const
|
|
83
|
-
|
|
82
|
+
const h = r === void 0 || T(r, t[c]) === void 0 || T(r, t[c]);
|
|
83
|
+
i[i.length] = {
|
|
84
84
|
dataIndex: -1,
|
|
85
|
-
dataItem: t[
|
|
85
|
+
dataItem: t[c],
|
|
86
86
|
level: n,
|
|
87
87
|
rowType: "groupHeader",
|
|
88
|
-
expanded:
|
|
89
|
-
},
|
|
90
|
-
Ht(
|
|
88
|
+
expanded: h
|
|
89
|
+
}, h && (a = Math.max(
|
|
90
|
+
Ht(i, t[c].items, s, o, e, r, n + 1),
|
|
91
91
|
a
|
|
92
|
-
)), (s === "always" ||
|
|
92
|
+
)), (s === "always" || h && s === "visible") && (i[i.length] = {
|
|
93
93
|
dataIndex: -1,
|
|
94
|
-
dataItem: t[
|
|
94
|
+
dataItem: t[c],
|
|
95
95
|
rowType: "groupFooter",
|
|
96
96
|
level: n,
|
|
97
|
-
expanded:
|
|
97
|
+
expanded: h
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
100
|
return a;
|
|
101
101
|
}
|
|
102
|
-
function zt(
|
|
102
|
+
function zt(i, t, s, o = 0) {
|
|
103
103
|
let e = [];
|
|
104
|
-
if (!
|
|
104
|
+
if (!i)
|
|
105
105
|
return [];
|
|
106
|
-
|
|
106
|
+
i && i.length === void 0 && (i = [i]), i.forEach((n, a) => {
|
|
107
107
|
n = n.props ? n.props : n;
|
|
108
|
-
const
|
|
108
|
+
const c = t[a] || null, h = zt(n.children, c && c.children || [], s, o + 1);
|
|
109
109
|
e.push(
|
|
110
110
|
Object.assign(
|
|
111
111
|
{ depth: o },
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
ce.defaultProps,
|
|
113
|
+
h.length ? { cell: () => null, filterCell: () => null } : {},
|
|
114
|
+
c ? { width: c.width, orderIndex: c.orderIndex } : {},
|
|
115
115
|
n,
|
|
116
116
|
{
|
|
117
117
|
id: n.id ? n.id : z.generateNavigatableId(`${s.prevId++}`, s.idPrefix, "column"),
|
|
118
118
|
declarationIndex: e.length,
|
|
119
|
-
children:
|
|
119
|
+
children: h,
|
|
120
120
|
rowSpan: 0,
|
|
121
121
|
colSpan: 0,
|
|
122
122
|
isAccessible: !0,
|
|
123
|
-
left:
|
|
124
|
-
right:
|
|
123
|
+
left: c && Math.floor(c.left),
|
|
124
|
+
right: c && Math.floor(c.right)
|
|
125
125
|
}
|
|
126
126
|
)
|
|
127
127
|
);
|
|
128
128
|
});
|
|
129
|
-
const
|
|
130
|
-
if (e.sort(
|
|
129
|
+
const r = (n, a) => n.orderIndex === a.orderIndex ? n.declarationIndex - a.declarationIndex : (n.orderIndex || 0) - (a.orderIndex || 0);
|
|
130
|
+
if (e.sort(r), o === 0) {
|
|
131
131
|
let n = [];
|
|
132
|
-
const a = (
|
|
133
|
-
d.parentIndex =
|
|
132
|
+
const a = (c, h) => c.forEach((d) => {
|
|
133
|
+
d.parentIndex = h, a(d.children, n.push(d) - 1);
|
|
134
134
|
});
|
|
135
135
|
return a(e, -1), n;
|
|
136
136
|
}
|
|
137
137
|
return e;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function Ks(i, t, s, o) {
|
|
140
140
|
let e = [];
|
|
141
|
-
Array.isArray(
|
|
142
|
-
const
|
|
141
|
+
Array.isArray(i) ? e = i : i && (e = i.data);
|
|
142
|
+
const r = [];
|
|
143
143
|
if (e.length > 0) {
|
|
144
144
|
let n = e[0];
|
|
145
145
|
if (t)
|
|
146
|
-
for (let
|
|
146
|
+
for (let c = 0; c < t.length; c++)
|
|
147
147
|
n = n.items && n.items[0];
|
|
148
|
-
Object.getOwnPropertyNames(n).forEach((
|
|
149
|
-
|
|
148
|
+
Object.getOwnPropertyNames(n).forEach((c) => {
|
|
149
|
+
c !== s && r.push(Object.assign(
|
|
150
150
|
{
|
|
151
151
|
id: z.generateNavigatableId(`${o.prevId++}`, o.idPrefix, "column"),
|
|
152
152
|
declarationIndex: -1,
|
|
@@ -162,71 +162,71 @@ function Bs(r, t, s, o) {
|
|
|
162
162
|
ariaColumnIndex: 0,
|
|
163
163
|
isAccessible: !0
|
|
164
164
|
},
|
|
165
|
-
|
|
166
|
-
{ field:
|
|
165
|
+
ce.defaultProps,
|
|
166
|
+
{ field: c }
|
|
167
167
|
));
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
|
-
return
|
|
170
|
+
return r;
|
|
171
171
|
}
|
|
172
|
-
const
|
|
173
|
-
let s =
|
|
172
|
+
const Vs = (i, t) => {
|
|
173
|
+
let s = i[t.parentIndex];
|
|
174
174
|
for (; s; ) {
|
|
175
175
|
if (s.footerCell)
|
|
176
176
|
return !0;
|
|
177
|
-
s =
|
|
177
|
+
s = i[s.parentIndex];
|
|
178
178
|
}
|
|
179
179
|
return !1;
|
|
180
|
-
},
|
|
180
|
+
}, Us = (i) => i.filter((t) => Vs(i, t) ? !1 : !!t.footerCell || !(t.children && t.children.length > 0)), ye = (i) => i.width !== void 0 ? Math.floor(parseFloat(i.width.toString())) + "px" : void 0, Lt = (i) => (i.sort((t, s) => t.declarationIndex - s.declarationIndex), i.map((t) => {
|
|
181
181
|
const {
|
|
182
182
|
declarationIndex: s,
|
|
183
183
|
parentIndex: o,
|
|
184
184
|
depth: e,
|
|
185
|
-
colSpan:
|
|
185
|
+
colSpan: r,
|
|
186
186
|
rowSpan: n,
|
|
187
187
|
index: a,
|
|
188
|
-
kFirst:
|
|
189
|
-
children:
|
|
188
|
+
kFirst: c,
|
|
189
|
+
children: h,
|
|
190
190
|
...d
|
|
191
191
|
} = t;
|
|
192
|
-
return
|
|
193
|
-
children: Lt(
|
|
192
|
+
return h.length ? {
|
|
193
|
+
children: Lt(h),
|
|
194
194
|
...d
|
|
195
195
|
} : d;
|
|
196
|
-
})),
|
|
197
|
-
if (!(!
|
|
198
|
-
return t ?
|
|
199
|
-
...
|
|
196
|
+
})), Fe = typeof window != "undefined" && /Firefox/.test(window.navigator.userAgent), mt = 17895697, be = (i, t) => {
|
|
197
|
+
if (!(!i && !t))
|
|
198
|
+
return t ? i ? {
|
|
199
|
+
...i,
|
|
200
200
|
...t,
|
|
201
201
|
select: {
|
|
202
|
-
...
|
|
202
|
+
...i.select || {},
|
|
203
203
|
...t.select || {}
|
|
204
204
|
},
|
|
205
205
|
hierarchy: {
|
|
206
|
-
...
|
|
206
|
+
...i.hierarchy || {},
|
|
207
207
|
...t.hierarchy || {}
|
|
208
208
|
},
|
|
209
209
|
group: {
|
|
210
|
-
...
|
|
210
|
+
...i.group || {},
|
|
211
211
|
...t.group || {}
|
|
212
212
|
},
|
|
213
213
|
edit: {
|
|
214
|
-
...
|
|
214
|
+
...i.edit || {},
|
|
215
215
|
...t.edit || {}
|
|
216
216
|
}
|
|
217
|
-
} : t :
|
|
218
|
-
},
|
|
217
|
+
} : t : i;
|
|
218
|
+
}, qs = (i) => {
|
|
219
219
|
const t = l.useCallback(
|
|
220
220
|
(d) => {
|
|
221
|
-
|
|
221
|
+
i.selectionChange && i.selectionChange({ syntheticEvent: d });
|
|
222
222
|
},
|
|
223
|
-
[
|
|
224
|
-
), s =
|
|
225
|
-
let
|
|
226
|
-
colSpan:
|
|
227
|
-
style:
|
|
228
|
-
className:
|
|
229
|
-
["aria-colindex"]:
|
|
223
|
+
[i.selectionChange]
|
|
224
|
+
), s = St(), o = T(i.field, i.dataItem), e = q(i.id);
|
|
225
|
+
let r = {
|
|
226
|
+
colSpan: i.colSpan,
|
|
227
|
+
style: i.style,
|
|
228
|
+
className: i.className,
|
|
229
|
+
["aria-colindex"]: i.ariaColumnIndex,
|
|
230
230
|
role: "gridcell",
|
|
231
231
|
...e
|
|
232
232
|
}, n = [
|
|
@@ -242,50 +242,50 @@ const Ws = (r, t) => {
|
|
|
242
242
|
)),
|
|
243
243
|
/* @__PURE__ */ l.createElement("label", { className: "k-checkbox-label", htmlFor: s, key: 2 })
|
|
244
244
|
];
|
|
245
|
-
const a =
|
|
245
|
+
const a = i.rowType !== "groupHeader" ? /* @__PURE__ */ l.createElement(
|
|
246
246
|
"td",
|
|
247
247
|
{
|
|
248
|
-
...
|
|
248
|
+
...r
|
|
249
249
|
},
|
|
250
250
|
n
|
|
251
|
-
) : null,
|
|
252
|
-
if (
|
|
253
|
-
const d =
|
|
254
|
-
return /* @__PURE__ */ l.createElement(d, { ...
|
|
251
|
+
) : null, c = i.rowType || "data", h = i.cells;
|
|
252
|
+
if (h && h.select && h.select[c]) {
|
|
253
|
+
const d = h.select[c];
|
|
254
|
+
return /* @__PURE__ */ l.createElement(d, { ...i, tdProps: r }, n);
|
|
255
255
|
}
|
|
256
|
-
return
|
|
257
|
-
},
|
|
256
|
+
return i.render ? i.render.call(void 0, a, i) : a;
|
|
257
|
+
}, Ne = "grid.noRecords", $s = "grid.pagerInfo", js = "grid.pagerFirstPage", Xs = "grid.pagerPreviousPage", Ys = "grid.pagerNextPage", Js = "grid.pagerLastPage", Qs = "grid.pagerItemsPerPage", Zs = "grid.pagerPage", er = "grid.pagerPageSizeAriaLabel", tr = "grid.pagerOf", sr = "grid.pagerTotalPages", De = "grid.groupPanelEmpty", Ot = "grid.groupColumn", _t = "grid.ungroupColumn", Te = "grid.columnMenu", U = "grid.filterClearButton", le = "grid.filterSubmitButton", ne = "grid.filterTitle", Ge = "grid.sortAscending", Me = "grid.sortDescending", He = "grid.searchPlaceholder", ze = "grid.filterCheckAll", Le = "grid.filterChooseOperator", Oe = "grid.filterSelectedItems", _e = "grid.sortAriaLabel", Pe = "grid.filterAriaLabel", Ae = "grid.groupPanelAriaLabel", Pt = "grid.groupExpand", At = "grid.groupCollapse", Bt = "grid.detailExpand", Wt = "grid.detailCollapse", k = {
|
|
258
258
|
[Bt]: "Expand detail row",
|
|
259
259
|
[Wt]: "Collapse detail row",
|
|
260
260
|
[Pt]: "Expand group",
|
|
261
261
|
[At]: "Collapse Group",
|
|
262
|
-
[
|
|
263
|
-
[
|
|
262
|
+
[Ne]: "No records available",
|
|
263
|
+
[De]: "Drag a column header and drop it here to group by that column",
|
|
264
264
|
[U]: "Clear",
|
|
265
265
|
[le]: "Filter",
|
|
266
266
|
[ne]: "Filter",
|
|
267
|
-
[
|
|
268
|
-
[
|
|
269
|
-
[
|
|
267
|
+
[Ge]: "Sort Ascending",
|
|
268
|
+
[Me]: "Sort Descending",
|
|
269
|
+
[_e]: "Sortable",
|
|
270
270
|
[Ot]: "Group Column",
|
|
271
271
|
[_t]: "Ungroup Column",
|
|
272
|
-
[
|
|
273
|
-
[
|
|
274
|
-
[
|
|
275
|
-
[
|
|
276
|
-
[
|
|
277
|
-
[
|
|
278
|
-
[
|
|
279
|
-
[
|
|
280
|
-
[
|
|
281
|
-
[
|
|
282
|
-
[
|
|
283
|
-
[
|
|
284
|
-
[
|
|
285
|
-
[
|
|
286
|
-
[
|
|
287
|
-
[
|
|
288
|
-
[
|
|
272
|
+
[Te]: "Column menu",
|
|
273
|
+
[Qs]: "items per page",
|
|
274
|
+
[$s]: "{0} - {1} of {2} items",
|
|
275
|
+
[js]: "Go to the first page",
|
|
276
|
+
[Xs]: "Go to the previous page",
|
|
277
|
+
[Ys]: "Go to the next page",
|
|
278
|
+
[Js]: "Go to the last page",
|
|
279
|
+
[Zs]: "Page",
|
|
280
|
+
[er]: "Page size",
|
|
281
|
+
[tr]: "of",
|
|
282
|
+
[sr]: "{0}",
|
|
283
|
+
[He]: "Search",
|
|
284
|
+
[ze]: "Check All",
|
|
285
|
+
[Le]: "Choose Operator",
|
|
286
|
+
[Oe]: "selected items",
|
|
287
|
+
[Pe]: "Filter",
|
|
288
|
+
[Ae]: "Group panel",
|
|
289
289
|
"grid.filterEqOperator": "Is equal to",
|
|
290
290
|
"grid.filterNotEqOperator": "Is not equal to",
|
|
291
291
|
"grid.filterIsNullOperator": "Is null",
|
|
@@ -310,53 +310,53 @@ const Ws = (r, t) => {
|
|
|
310
310
|
"grid.filterAndLogic": "And",
|
|
311
311
|
"grid.filterOrLogic": "Or"
|
|
312
312
|
};
|
|
313
|
-
function
|
|
314
|
-
const t =
|
|
315
|
-
return { messageKey: t, defaultMessage:
|
|
313
|
+
function rr(i) {
|
|
314
|
+
const t = i.replace(/^pager\.([a-z])/, (s, o) => "grid.pager" + o.toUpperCase());
|
|
315
|
+
return { messageKey: t, defaultMessage: k[t] };
|
|
316
316
|
}
|
|
317
|
-
const
|
|
317
|
+
const ir = (i) => {
|
|
318
318
|
let t = null, s = null, o = null;
|
|
319
|
-
const e = T(
|
|
319
|
+
const e = T(i.field, i.dataItem), r = q(i.id), n = Nt(), a = l.useCallback(
|
|
320
320
|
(d) => {
|
|
321
|
-
d.isDefaultPrevented() || d.keyCode === me.enter &&
|
|
322
|
-
dataItem:
|
|
323
|
-
dataIndex:
|
|
321
|
+
d.isDefaultPrevented() || d.keyCode === me.enter && i.onChange && (d.preventDefault(), i.onChange({
|
|
322
|
+
dataItem: i.dataItem,
|
|
323
|
+
dataIndex: i.dataIndex,
|
|
324
324
|
syntheticEvent: d,
|
|
325
|
-
field:
|
|
325
|
+
field: i.field,
|
|
326
326
|
value: !e
|
|
327
327
|
}));
|
|
328
328
|
},
|
|
329
|
-
[
|
|
329
|
+
[i.dataItem, i.dataIndex, i.field, i.onChange, e]
|
|
330
330
|
);
|
|
331
|
-
if (
|
|
331
|
+
if (i.rowType === "groupFooter")
|
|
332
332
|
s = {
|
|
333
333
|
className: "k-table-td k-hierarchy-cell",
|
|
334
334
|
role: "gridcell",
|
|
335
|
-
...
|
|
335
|
+
...r
|
|
336
336
|
}, t = /* @__PURE__ */ l.createElement(
|
|
337
337
|
"td",
|
|
338
338
|
{
|
|
339
339
|
...s
|
|
340
340
|
}
|
|
341
341
|
);
|
|
342
|
-
else if (
|
|
343
|
-
const d = e ? Wt : Bt, g = n.toLanguageString(d,
|
|
342
|
+
else if (i.rowType !== "groupHeader") {
|
|
343
|
+
const d = e ? Wt : Bt, g = n.toLanguageString(d, k[d]);
|
|
344
344
|
s = {
|
|
345
345
|
className: "k-table-td k-hierarchy-cell",
|
|
346
346
|
onKeyDown: a,
|
|
347
347
|
"aria-expanded": !!e,
|
|
348
348
|
role: "gridcell",
|
|
349
|
-
"aria-colindex":
|
|
350
|
-
...
|
|
349
|
+
"aria-colindex": i.ariaColumnIndex,
|
|
350
|
+
...r
|
|
351
351
|
}, o = /* @__PURE__ */ l.createElement(
|
|
352
352
|
"a",
|
|
353
353
|
{
|
|
354
354
|
onClick: (m) => {
|
|
355
|
-
m.preventDefault(),
|
|
356
|
-
dataItem:
|
|
357
|
-
dataIndex:
|
|
355
|
+
m.preventDefault(), i.onChange && i.onChange({
|
|
356
|
+
dataItem: i.dataItem,
|
|
357
|
+
dataIndex: i.dataIndex,
|
|
358
358
|
syntheticEvent: m,
|
|
359
|
-
field:
|
|
359
|
+
field: i.field,
|
|
360
360
|
value: !e
|
|
361
361
|
});
|
|
362
362
|
},
|
|
@@ -364,7 +364,7 @@ const sr = (r) => {
|
|
|
364
364
|
href: "#",
|
|
365
365
|
tabIndex: -1
|
|
366
366
|
},
|
|
367
|
-
/* @__PURE__ */ l.createElement(O, { name: e ? "minus" : "plus", icon: e ?
|
|
367
|
+
/* @__PURE__ */ l.createElement(O, { name: e ? "minus" : "plus", icon: e ? Ds : Ts })
|
|
368
368
|
), t = /* @__PURE__ */ l.createElement(
|
|
369
369
|
"td",
|
|
370
370
|
{
|
|
@@ -373,61 +373,61 @@ const sr = (r) => {
|
|
|
373
373
|
o
|
|
374
374
|
);
|
|
375
375
|
}
|
|
376
|
-
const
|
|
377
|
-
if (
|
|
378
|
-
const d =
|
|
379
|
-
return /* @__PURE__ */ l.createElement(d, { ...
|
|
376
|
+
const c = i.rowType || "data", h = i.cells;
|
|
377
|
+
if (h && h.hierarchy && h.hierarchy[c]) {
|
|
378
|
+
const d = h.hierarchy[c];
|
|
379
|
+
return /* @__PURE__ */ l.createElement(d, { ...i, tdProps: s }, o);
|
|
380
380
|
}
|
|
381
|
-
return
|
|
382
|
-
},
|
|
383
|
-
const t = T(
|
|
381
|
+
return i.render ? i.render.call(void 0, t, i) : t;
|
|
382
|
+
}, or = vs, re = ks, lr = (i) => {
|
|
383
|
+
const t = T(i.field, i.dataItem);
|
|
384
384
|
let s = null;
|
|
385
385
|
const o = y("k-table-td", "k-grid-edit-cell", {
|
|
386
|
-
["k-selected"]:
|
|
387
|
-
},
|
|
386
|
+
["k-selected"]: i.isSelected
|
|
387
|
+
}, i.className), e = St(), r = q(i.id);
|
|
388
388
|
let n = null, a = null;
|
|
389
|
-
const
|
|
389
|
+
const c = l.useCallback(
|
|
390
390
|
(u) => {
|
|
391
|
-
if (
|
|
391
|
+
if (i.onChange) {
|
|
392
392
|
const b = u.target.type === "checkbox" ? u.target.checked : u.target.value;
|
|
393
|
-
|
|
394
|
-
dataItem:
|
|
395
|
-
dataIndex:
|
|
396
|
-
field:
|
|
393
|
+
i.onChange({
|
|
394
|
+
dataItem: i.dataItem,
|
|
395
|
+
dataIndex: i.dataIndex,
|
|
396
|
+
field: i.field,
|
|
397
397
|
syntheticEvent: u,
|
|
398
398
|
value: b
|
|
399
399
|
});
|
|
400
400
|
}
|
|
401
401
|
},
|
|
402
|
-
[
|
|
403
|
-
),
|
|
404
|
-
|
|
405
|
-
}, [
|
|
402
|
+
[i.onChange, i.dataItem, i.dataIndex, i.field]
|
|
403
|
+
), h = l.useCallback((u) => {
|
|
404
|
+
i.onContextMenu && i.onContextMenu.call(void 0, u, i.dataItem, i.field);
|
|
405
|
+
}, [i.onContextMenu, i.dataItem, i.field]), d = l.useCallback(
|
|
406
406
|
(u) => {
|
|
407
|
-
|
|
408
|
-
dataItem:
|
|
409
|
-
dataIndex:
|
|
410
|
-
field:
|
|
407
|
+
i.onChange && i.onChange({
|
|
408
|
+
dataItem: i.dataItem,
|
|
409
|
+
dataIndex: i.dataIndex,
|
|
410
|
+
field: i.field,
|
|
411
411
|
syntheticEvent: u.syntheticEvent,
|
|
412
412
|
value: u.value
|
|
413
413
|
});
|
|
414
414
|
},
|
|
415
|
-
[
|
|
415
|
+
[i.onChange, i.dataItem, i.dataIndex, i.field]
|
|
416
416
|
);
|
|
417
|
-
switch (
|
|
417
|
+
switch (i.editor) {
|
|
418
418
|
case "numeric": {
|
|
419
419
|
n = {
|
|
420
|
-
onContextMenu:
|
|
421
|
-
colSpan:
|
|
422
|
-
style:
|
|
420
|
+
onContextMenu: h,
|
|
421
|
+
colSpan: i.colSpan,
|
|
422
|
+
style: i.style,
|
|
423
423
|
className: o,
|
|
424
|
-
["aria-colindex"]:
|
|
425
|
-
["aria-selected"]:
|
|
426
|
-
[re]:
|
|
424
|
+
["aria-colindex"]: i.ariaColumnIndex,
|
|
425
|
+
["aria-selected"]: i.isSelected,
|
|
426
|
+
[re]: i.columnIndex,
|
|
427
427
|
role: "gridcell",
|
|
428
|
-
...
|
|
428
|
+
...r
|
|
429
429
|
}, a = /* @__PURE__ */ l.createElement(
|
|
430
|
-
|
|
430
|
+
Ue,
|
|
431
431
|
{
|
|
432
432
|
width: "100%",
|
|
433
433
|
value: t === void 0 ? null : t,
|
|
@@ -444,17 +444,17 @@ const sr = (r) => {
|
|
|
444
444
|
}
|
|
445
445
|
case "date":
|
|
446
446
|
n = {
|
|
447
|
-
onContextMenu:
|
|
448
|
-
colSpan:
|
|
449
|
-
style:
|
|
447
|
+
onContextMenu: h,
|
|
448
|
+
colSpan: i.colSpan,
|
|
449
|
+
style: i.style,
|
|
450
450
|
className: o,
|
|
451
|
-
["aria-colindex"]:
|
|
452
|
-
["aria-selected"]:
|
|
453
|
-
[re]:
|
|
451
|
+
["aria-colindex"]: i.ariaColumnIndex,
|
|
452
|
+
["aria-selected"]: i.isSelected,
|
|
453
|
+
[re]: i.columnIndex,
|
|
454
454
|
role: "gridcell",
|
|
455
|
-
...
|
|
455
|
+
...r
|
|
456
456
|
}, a = /* @__PURE__ */ l.createElement(
|
|
457
|
-
|
|
457
|
+
qe,
|
|
458
458
|
{
|
|
459
459
|
width: "100%",
|
|
460
460
|
value: t,
|
|
@@ -470,15 +470,15 @@ const sr = (r) => {
|
|
|
470
470
|
break;
|
|
471
471
|
case "boolean":
|
|
472
472
|
n = {
|
|
473
|
-
onContextMenu:
|
|
474
|
-
colSpan:
|
|
475
|
-
style:
|
|
473
|
+
onContextMenu: h,
|
|
474
|
+
colSpan: i.colSpan,
|
|
475
|
+
style: i.style,
|
|
476
476
|
className: o,
|
|
477
|
-
["aria-colindex"]:
|
|
478
|
-
["aria-selected"]:
|
|
479
|
-
[re]:
|
|
477
|
+
["aria-colindex"]: i.ariaColumnIndex,
|
|
478
|
+
["aria-selected"]: i.isSelected,
|
|
479
|
+
[re]: i.columnIndex,
|
|
480
480
|
role: "gridcell",
|
|
481
|
-
...
|
|
481
|
+
...r
|
|
482
482
|
}, a = [
|
|
483
483
|
/* @__PURE__ */ l.createElement("span", { key: 1, className: "k-checkbox-wrap" }, /* @__PURE__ */ l.createElement(
|
|
484
484
|
"input",
|
|
@@ -487,7 +487,7 @@ const sr = (r) => {
|
|
|
487
487
|
id: e,
|
|
488
488
|
type: "checkbox",
|
|
489
489
|
className: "k-checkbox k-checkbox-md k-rounded-md",
|
|
490
|
-
onChange:
|
|
490
|
+
onChange: c
|
|
491
491
|
}
|
|
492
492
|
)),
|
|
493
493
|
/* @__PURE__ */ l.createElement("label", { className: "k-checkbox-label", htmlFor: e, key: 2 })
|
|
@@ -501,22 +501,22 @@ const sr = (r) => {
|
|
|
501
501
|
break;
|
|
502
502
|
default:
|
|
503
503
|
n = {
|
|
504
|
-
onContextMenu:
|
|
505
|
-
colSpan:
|
|
506
|
-
style:
|
|
504
|
+
onContextMenu: h,
|
|
505
|
+
colSpan: i.colSpan,
|
|
506
|
+
style: i.style,
|
|
507
507
|
className: o,
|
|
508
|
-
["aria-colindex"]:
|
|
509
|
-
["aria-selected"]:
|
|
510
|
-
[re]:
|
|
508
|
+
["aria-colindex"]: i.ariaColumnIndex,
|
|
509
|
+
["aria-selected"]: i.isSelected,
|
|
510
|
+
[re]: i.columnIndex,
|
|
511
511
|
role: "gridcell",
|
|
512
|
-
...
|
|
512
|
+
...r
|
|
513
513
|
}, a = /* @__PURE__ */ l.createElement(
|
|
514
514
|
"input",
|
|
515
515
|
{
|
|
516
516
|
style: { width: "100%" },
|
|
517
517
|
className: "k-input",
|
|
518
518
|
value: t || "",
|
|
519
|
-
onChange:
|
|
519
|
+
onChange: c
|
|
520
520
|
}
|
|
521
521
|
), s = /* @__PURE__ */ l.createElement(
|
|
522
522
|
"td",
|
|
@@ -526,16 +526,16 @@ const sr = (r) => {
|
|
|
526
526
|
a
|
|
527
527
|
);
|
|
528
528
|
}
|
|
529
|
-
const g =
|
|
529
|
+
const g = i.editor || "text", m = i.cells;
|
|
530
530
|
if (m && m.edit && m.edit[g]) {
|
|
531
531
|
const u = m.edit[g];
|
|
532
|
-
return /* @__PURE__ */ l.createElement(u, { ...
|
|
532
|
+
return /* @__PURE__ */ l.createElement(u, { ...i, tdProps: n }, a);
|
|
533
533
|
}
|
|
534
|
-
return
|
|
534
|
+
return i.render ? i.render.call(void 0, s, i) : s;
|
|
535
535
|
};
|
|
536
|
-
class
|
|
536
|
+
class nr extends l.Component {
|
|
537
537
|
constructor() {
|
|
538
|
-
super(...arguments), this.headerWrap = null, this.table = null, this.syncScroll = !1, this.scrollbarWidth =
|
|
538
|
+
super(...arguments), this.headerWrap = null, this.table = null, this.syncScroll = !1, this.scrollbarWidth = It(), this.onScroll = (t) => {
|
|
539
539
|
if (this.syncScroll) {
|
|
540
540
|
this.syncScroll = !1;
|
|
541
541
|
return;
|
|
@@ -599,7 +599,7 @@ class or extends l.Component {
|
|
|
599
599
|
"k-table k-grid-header-table",
|
|
600
600
|
{
|
|
601
601
|
"k-table-md": !this.props.size,
|
|
602
|
-
[`k-table-${
|
|
602
|
+
[`k-table-${V.sizeMap[this.props.size] || this.props.size}`]: this.props.size
|
|
603
603
|
},
|
|
604
604
|
this.props.className
|
|
605
605
|
),
|
|
@@ -626,8 +626,8 @@ class or extends l.Component {
|
|
|
626
626
|
);
|
|
627
627
|
}
|
|
628
628
|
}
|
|
629
|
-
const
|
|
630
|
-
class
|
|
629
|
+
const Kt = (...i) => Object.assign({ allowUnsort: !0, mode: "single" }, ...i);
|
|
630
|
+
class ar extends l.PureComponent {
|
|
631
631
|
constructor() {
|
|
632
632
|
super(...arguments), this.draggable = null, this.onPress = (t) => {
|
|
633
633
|
const s = this.draggable && this.draggable.element;
|
|
@@ -657,7 +657,7 @@ class lr extends l.PureComponent {
|
|
|
657
657
|
);
|
|
658
658
|
}
|
|
659
659
|
}
|
|
660
|
-
class
|
|
660
|
+
class Vt extends l.Component {
|
|
661
661
|
constructor() {
|
|
662
662
|
super(...arguments), this.state = {
|
|
663
663
|
show: !1
|
|
@@ -691,7 +691,7 @@ class Kt extends l.Component {
|
|
|
691
691
|
};
|
|
692
692
|
}
|
|
693
693
|
render() {
|
|
694
|
-
const { columnMenu: t, ...s } = this.props, { column: o } = this.props, e = G(this),
|
|
694
|
+
const { columnMenu: t, ...s } = this.props, { column: o } = this.props, e = G(this), r = o.title || o.field, n = r ? `${r} ` : "";
|
|
695
695
|
return /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(
|
|
696
696
|
"a",
|
|
697
697
|
{
|
|
@@ -701,11 +701,11 @@ class Kt extends l.Component {
|
|
|
701
701
|
onMouseDown: this.onAnchorMouseDown,
|
|
702
702
|
onKeyDown: this.onAnchorKeyDown,
|
|
703
703
|
href: "#",
|
|
704
|
-
"aria-label": `${n}${e.toLanguageString(
|
|
704
|
+
"aria-label": `${n}${e.toLanguageString(Te, k[Te])}`
|
|
705
705
|
},
|
|
706
706
|
/* @__PURE__ */ l.createElement(O, { name: "filter", icon: Ce })
|
|
707
707
|
), /* @__PURE__ */ l.createElement(
|
|
708
|
-
|
|
708
|
+
Bs,
|
|
709
709
|
{
|
|
710
710
|
anchor: this._anchor,
|
|
711
711
|
show: this.state.show,
|
|
@@ -731,7 +731,7 @@ class Kt extends l.Component {
|
|
|
731
731
|
));
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
|
-
class
|
|
734
|
+
class cr extends l.Component {
|
|
735
735
|
/**
|
|
736
736
|
* @hidden
|
|
737
737
|
*/
|
|
@@ -751,14 +751,14 @@ class nr extends l.Component {
|
|
|
751
751
|
},
|
|
752
752
|
/* @__PURE__ */ l.createElement("span", { className: "k-column-title" }, this.props.title || this.props.field || " "),
|
|
753
753
|
this.props.children
|
|
754
|
-
), t.columnMenu && /* @__PURE__ */ l.createElement(
|
|
754
|
+
), t.columnMenu && /* @__PURE__ */ l.createElement(Vt, { ...t }));
|
|
755
755
|
return this.props.render ? this.props.render.call(void 0, o, this.props) : o;
|
|
756
756
|
}
|
|
757
757
|
}
|
|
758
|
-
const
|
|
758
|
+
const hr = {
|
|
759
759
|
true: { asc: "desc", desc: "", "": "asc" },
|
|
760
760
|
false: { asc: "desc", desc: "asc", "": "asc" }
|
|
761
|
-
},
|
|
761
|
+
}, dr = {
|
|
762
762
|
none: "none",
|
|
763
763
|
asc: "ascending",
|
|
764
764
|
desc: "descending"
|
|
@@ -768,29 +768,29 @@ class Ut extends l.Component {
|
|
|
768
768
|
super(t), this.serviceIndex = 0, this.index = -1, this.cellKeyDown = (s, o) => {
|
|
769
769
|
s.isDefaultPrevented() || s.keyCode === me.enter && this.cellClick(s, o);
|
|
770
770
|
}, this.cells = (s) => s.map((o) => {
|
|
771
|
-
const e = this.props.columns[o],
|
|
771
|
+
const e = this.props.columns[o], r = this.props.sortable && e.sortable, n = this.props.sort ? this.props.sort.findIndex((v) => v.field === e.field) : -1, a = n >= 0 && this.props.sort[n].dir || "none", c = e.columnMenu === null ? null : e.columnMenu || this.props.columnMenu, h = y({
|
|
772
772
|
"k-first": e.kFirst,
|
|
773
|
-
"k-filterable": !!
|
|
773
|
+
"k-filterable": !!c,
|
|
774
774
|
"k-table-th": !0,
|
|
775
775
|
"k-header": !0,
|
|
776
776
|
"k-grid-header-sticky": e.locked,
|
|
777
|
-
"k-sorted": this.props.sort && this.props.sort.some((
|
|
778
|
-
}, e.headerClassName), d = e.left !== void 0 ? this.props.isRtl ? { left: e.right, right: e.left } : { left: e.left, right: e.right } : {}, g = G(this).toLanguageString(
|
|
777
|
+
"k-sorted": this.props.sort && this.props.sort.some((v) => v.field === e.field)
|
|
778
|
+
}, e.headerClassName), d = e.left !== void 0 ? this.props.isRtl ? { left: e.right, right: e.left } : { left: e.left, right: e.right } : {}, g = G(this).toLanguageString(_e, k[_e]);
|
|
779
779
|
let m = e.isAccessible ? {
|
|
780
|
-
ariaSort:
|
|
780
|
+
ariaSort: dr[a],
|
|
781
781
|
role: "columnheader",
|
|
782
782
|
ariaColumnIndex: e.ariaColumnIndex,
|
|
783
783
|
ariaSelected: !1,
|
|
784
|
-
ariaDescription:
|
|
784
|
+
ariaDescription: r ? g : ""
|
|
785
785
|
} : {
|
|
786
786
|
role: "presentation"
|
|
787
787
|
};
|
|
788
|
-
const u = e.declarationIndex >= 0 ? ++this.index : --this.serviceIndex, b = e.headerCell ? e.headerCell :
|
|
788
|
+
const u = e.declarationIndex >= 0 ? ++this.index : --this.serviceIndex, b = e.headerCell ? e.headerCell : cr, E = /* @__PURE__ */ l.createElement(
|
|
789
789
|
b,
|
|
790
790
|
{
|
|
791
791
|
key: 1,
|
|
792
792
|
field: e.field,
|
|
793
|
-
onClick:
|
|
793
|
+
onClick: r && ((v) => this.cellClick(v, e)) || void 0,
|
|
794
794
|
selectionChange: this.props.selectionChange,
|
|
795
795
|
title: e.title,
|
|
796
796
|
selectionValue: e.headerSelectionValue,
|
|
@@ -804,7 +804,7 @@ class Ut extends l.Component {
|
|
|
804
804
|
filter: e.filter,
|
|
805
805
|
id: e.id
|
|
806
806
|
},
|
|
807
|
-
sortable:
|
|
807
|
+
sortable: r && this.props.sortable,
|
|
808
808
|
sort: this.props.sort,
|
|
809
809
|
onSortChange: this.props.sortChange,
|
|
810
810
|
filter: this.props.filter,
|
|
@@ -814,7 +814,7 @@ class Ut extends l.Component {
|
|
|
814
814
|
group: this.props.group,
|
|
815
815
|
groupable: this.props.groupable,
|
|
816
816
|
onGroupChange: this.props.groupChange,
|
|
817
|
-
columnMenu:
|
|
817
|
+
columnMenu: c
|
|
818
818
|
}
|
|
819
819
|
}
|
|
820
820
|
), C = {
|
|
@@ -822,26 +822,26 @@ class Ut extends l.Component {
|
|
|
822
822
|
key: u,
|
|
823
823
|
colSpan: e.colSpan,
|
|
824
824
|
rowSpan: e.rowSpan,
|
|
825
|
-
className:
|
|
825
|
+
className: h,
|
|
826
826
|
style: d,
|
|
827
827
|
columnId: e.id,
|
|
828
828
|
navigatable: e.navigatable,
|
|
829
|
-
onKeyDown:
|
|
829
|
+
onKeyDown: r && ((v) => this.cellKeyDown(v, e)) || void 0,
|
|
830
830
|
role: "columnheader"
|
|
831
831
|
}, x = [
|
|
832
832
|
E,
|
|
833
833
|
this.props.columnResize && this.props.columnResize.resizable && e.resizable && /* @__PURE__ */ l.createElement(
|
|
834
|
-
|
|
834
|
+
Es,
|
|
835
835
|
{
|
|
836
836
|
key: 2,
|
|
837
|
-
resize: (
|
|
838
|
-
autofit: (
|
|
837
|
+
resize: (v, _, D) => this.props.columnResize && this.props.columnResize.dragHandler(v, e, _, D),
|
|
838
|
+
autofit: (v) => this.props.columnResize && this.props.columnResize.dblClickHandler(v, [e.id])
|
|
839
839
|
}
|
|
840
840
|
)
|
|
841
|
-
],
|
|
842
|
-
if (
|
|
843
|
-
const
|
|
844
|
-
return /* @__PURE__ */ l.createElement(
|
|
841
|
+
], S = be(this.props.cells, e.cells);
|
|
842
|
+
if (S && S.headerCell) {
|
|
843
|
+
const v = S.headerCell;
|
|
844
|
+
return /* @__PURE__ */ l.createElement(v, { key: u, thProps: C, index: o }, x);
|
|
845
845
|
}
|
|
846
846
|
return /* @__PURE__ */ l.createElement(
|
|
847
847
|
Ft,
|
|
@@ -856,7 +856,7 @@ class Ut extends l.Component {
|
|
|
856
856
|
cellClick(t, s) {
|
|
857
857
|
if (t.preventDefault(), !this.props.sortChange)
|
|
858
858
|
return;
|
|
859
|
-
const { allowUnsort: o, mode: e } =
|
|
859
|
+
const { allowUnsort: o, mode: e } = Kt(this.props.sortable || !1, s.sortable || !1), r = (this.props.sort || []).filter((c) => c.field === s.field)[0], n = hr[o][r && r.dir || ""], a = e === "single" ? [] : (this.props.sort || []).filter((c) => c.field !== s.field);
|
|
860
860
|
n !== "" && s.field && a.push({ field: s.field, dir: n }), this.props.sortChange(a, t);
|
|
861
861
|
}
|
|
862
862
|
sortIcon(t) {
|
|
@@ -865,7 +865,7 @@ class Ut extends l.Component {
|
|
|
865
865
|
O,
|
|
866
866
|
{
|
|
867
867
|
name: "sort-" + this.props.sort[t].dir + "-small",
|
|
868
|
-
icon: this.props.sort[t].dir === "asc" ?
|
|
868
|
+
icon: this.props.sort[t].dir === "asc" ? Ke : Ve
|
|
869
869
|
}
|
|
870
870
|
)),
|
|
871
871
|
this.props.sort.length > 1 && /* @__PURE__ */ l.createElement("span", { key: 2, className: "k-sort-icon" }, /* @__PURE__ */ l.createElement("span", { className: "k-sort-order" }, t + 1))
|
|
@@ -873,7 +873,7 @@ class Ut extends l.Component {
|
|
|
873
873
|
}
|
|
874
874
|
render() {
|
|
875
875
|
return this.serviceIndex = 0, this.index = -1, this.props.columnsMap.map((t, s) => this.props.pressHandler && /* @__PURE__ */ l.createElement(
|
|
876
|
-
|
|
876
|
+
ar,
|
|
877
877
|
{
|
|
878
878
|
key: s,
|
|
879
879
|
pressHandler: this.props.pressHandler,
|
|
@@ -889,7 +889,7 @@ class Ut extends l.Component {
|
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
891
|
M(Ut);
|
|
892
|
-
const
|
|
892
|
+
const pr = [
|
|
893
893
|
{ text: "grid.filterAndLogic", operator: "and" },
|
|
894
894
|
{ text: "grid.filterOrLogic", operator: "or" }
|
|
895
895
|
], Ct = {
|
|
@@ -928,46 +928,46 @@ const cr = [
|
|
|
928
928
|
boolean: [
|
|
929
929
|
{ text: "grid.filterEqOperator", operator: "eq" }
|
|
930
930
|
]
|
|
931
|
-
}, L = (
|
|
932
|
-
text: t.toLanguageString(s.text,
|
|
931
|
+
}, L = (i) => i === "isnull" || i === "isnotnull" || i === "isempty" || i === "isnotempty", ie = (i, t) => i.map((s) => ({
|
|
932
|
+
text: t.toLanguageString(s.text, k[s.text]),
|
|
933
933
|
operator: s.operator
|
|
934
|
-
})),
|
|
934
|
+
})), ur = "eq", qt = [
|
|
935
935
|
{ text: "grid.filterBooleanAll", operator: "" },
|
|
936
936
|
{ text: "grid.filterIsTrue", operator: !0 },
|
|
937
937
|
{ text: "grid.filterIsFalse", operator: !1 }
|
|
938
|
-
],
|
|
938
|
+
], gr = {
|
|
939
939
|
text: !1,
|
|
940
940
|
numeric: !1,
|
|
941
941
|
date: !1,
|
|
942
942
|
boolean: !0
|
|
943
|
-
}, $t = (
|
|
943
|
+
}, $t = (i, t, s) => {
|
|
944
944
|
const o = jt(s.operators);
|
|
945
945
|
let e = s.operator;
|
|
946
946
|
switch (s.filterType) {
|
|
947
947
|
case "numeric":
|
|
948
|
-
(!e || L(e)) && (e = o),
|
|
948
|
+
(!e || L(e)) && (e = o), i === null && e === o && (e = "");
|
|
949
949
|
break;
|
|
950
950
|
case "date":
|
|
951
|
-
(!e || L(e)) && (e = o),
|
|
951
|
+
(!e || L(e)) && (e = o), i === null && e === o && (e = "");
|
|
952
952
|
break;
|
|
953
953
|
case "text":
|
|
954
|
-
(!e || L(e)) && (e = o), !
|
|
954
|
+
(!e || L(e)) && (e = o), !i && e === o && (e = "");
|
|
955
955
|
break;
|
|
956
956
|
default:
|
|
957
957
|
return;
|
|
958
958
|
}
|
|
959
|
-
s.onChange({ value:
|
|
960
|
-
}, jt = (
|
|
961
|
-
const s =
|
|
959
|
+
s.onChange({ value: i, operator: e, syntheticEvent: t });
|
|
960
|
+
}, jt = (i, t) => t ? i[t][0].operator : i[0].operator, Be = (i) => i || "text", Xt = (i, t) => {
|
|
961
|
+
const s = i.target.value;
|
|
962
962
|
t({
|
|
963
963
|
value: s.operator,
|
|
964
|
-
operator: s.operator === "" ? "" :
|
|
965
|
-
syntheticEvent:
|
|
964
|
+
operator: s.operator === "" ? "" : ur,
|
|
965
|
+
syntheticEvent: i.syntheticEvent
|
|
966
966
|
});
|
|
967
|
-
}, Yt = (
|
|
967
|
+
}, Yt = (i, t, s) => {
|
|
968
968
|
let o = t;
|
|
969
|
-
const e =
|
|
970
|
-
|
|
969
|
+
const e = i.target.value;
|
|
970
|
+
i.target.state.opened && (L(e.operator) && (o = null), t === null && !L(e.operator) && (o = void 0), s({ value: o, operator: e.operator, syntheticEvent: i.syntheticEvent }));
|
|
971
971
|
};
|
|
972
972
|
class Jt extends l.Component {
|
|
973
973
|
constructor(t) {
|
|
@@ -986,7 +986,7 @@ class Jt extends l.Component {
|
|
|
986
986
|
svgIcon: Ce,
|
|
987
987
|
data: this.props.operators,
|
|
988
988
|
textField: "text",
|
|
989
|
-
title: s.toLanguageString(
|
|
989
|
+
title: s.toLanguageString(Le, k[Le]),
|
|
990
990
|
popupSettings: {
|
|
991
991
|
width: ""
|
|
992
992
|
}
|
|
@@ -1003,11 +1003,11 @@ class Jt extends l.Component {
|
|
|
1003
1003
|
{
|
|
1004
1004
|
size: this.props.size,
|
|
1005
1005
|
icon: "filter-clear",
|
|
1006
|
-
svgIcon:
|
|
1006
|
+
svgIcon: Gs,
|
|
1007
1007
|
className: y({
|
|
1008
1008
|
"k-clear-button-visible": !!(!(this.props.value === null || this.props.value === "") || this.props.operator)
|
|
1009
1009
|
}),
|
|
1010
|
-
title: t.toLanguageString(U,
|
|
1010
|
+
title: t.toLanguageString(U, k[U]),
|
|
1011
1011
|
type: "button",
|
|
1012
1012
|
onClick: this.clear,
|
|
1013
1013
|
disabled: !(!(this.props.value === null || this.props.value === "") || this.props.operator)
|
|
@@ -1033,7 +1033,7 @@ class Jt extends l.Component {
|
|
|
1033
1033
|
switch (t) {
|
|
1034
1034
|
case "numeric":
|
|
1035
1035
|
return /* @__PURE__ */ l.createElement(
|
|
1036
|
-
|
|
1036
|
+
Ue,
|
|
1037
1037
|
{
|
|
1038
1038
|
ref: this._inputRef,
|
|
1039
1039
|
size: this.props.size,
|
|
@@ -1047,7 +1047,7 @@ class Jt extends l.Component {
|
|
|
1047
1047
|
);
|
|
1048
1048
|
case "date":
|
|
1049
1049
|
return /* @__PURE__ */ l.createElement(
|
|
1050
|
-
|
|
1050
|
+
qe,
|
|
1051
1051
|
{
|
|
1052
1052
|
ref: this._inputRef,
|
|
1053
1053
|
size: this.props.size,
|
|
@@ -1060,14 +1060,14 @@ class Jt extends l.Component {
|
|
|
1060
1060
|
}
|
|
1061
1061
|
);
|
|
1062
1062
|
case "boolean": {
|
|
1063
|
-
const e = (
|
|
1063
|
+
const e = (r) => r == null;
|
|
1064
1064
|
return /* @__PURE__ */ l.createElement(
|
|
1065
1065
|
oe,
|
|
1066
1066
|
{
|
|
1067
1067
|
ref: this._inputRef,
|
|
1068
1068
|
size: this.props.size,
|
|
1069
1069
|
onChange: this.boolDropdownChange,
|
|
1070
|
-
value: o.find((
|
|
1070
|
+
value: o.find((r) => r.operator === (e(s) ? "" : s)),
|
|
1071
1071
|
data: o,
|
|
1072
1072
|
textField: "text",
|
|
1073
1073
|
title: this.props.title,
|
|
@@ -1093,7 +1093,7 @@ class Jt extends l.Component {
|
|
|
1093
1093
|
}
|
|
1094
1094
|
}
|
|
1095
1095
|
M(Jt);
|
|
1096
|
-
const
|
|
1096
|
+
const fr = "k-table-row k-filter-row";
|
|
1097
1097
|
class Qt extends l.Component {
|
|
1098
1098
|
headerCellClassName(t, s) {
|
|
1099
1099
|
let o = `${s ? "k-grid-header-sticky" : ""}`;
|
|
@@ -1102,45 +1102,45 @@ class Qt extends l.Component {
|
|
|
1102
1102
|
setFilter(t, s, o, e) {
|
|
1103
1103
|
if (!this.props.filterChange)
|
|
1104
1104
|
return;
|
|
1105
|
-
const
|
|
1106
|
-
(t !== "" && t !== null || s !== "") &&
|
|
1105
|
+
const r = [];
|
|
1106
|
+
(t !== "" && t !== null || s !== "") && r.push({
|
|
1107
1107
|
field: o,
|
|
1108
1108
|
operator: s,
|
|
1109
1109
|
value: t
|
|
1110
|
-
}), this.props.filter && this.props.filter.filters && (this.props.filter.filters || []).forEach((
|
|
1111
|
-
const
|
|
1112
|
-
|
|
1110
|
+
}), this.props.filter && this.props.filter.filters && (this.props.filter.filters || []).forEach((c) => {
|
|
1111
|
+
const h = c;
|
|
1112
|
+
h && h.field !== o && r.push(h);
|
|
1113
1113
|
});
|
|
1114
1114
|
const n = this.props.filter && this.props.filter.logic ? this.props.filter.logic : "and";
|
|
1115
|
-
this.props.filterChange(
|
|
1115
|
+
this.props.filterChange(r.length > 0 ? { logic: n, filters: r } : null, e);
|
|
1116
1116
|
}
|
|
1117
1117
|
render() {
|
|
1118
1118
|
const t = G(this), s = this.props.filter && this.props.filter.filters || [], o = (a) => {
|
|
1119
1119
|
if (a === void 0)
|
|
1120
1120
|
return;
|
|
1121
|
-
const
|
|
1122
|
-
return
|
|
1121
|
+
const c = s.filter((h) => h.field === a);
|
|
1122
|
+
return c.length ? c[0] : void 0;
|
|
1123
1123
|
};
|
|
1124
|
-
let e = 0,
|
|
1124
|
+
let e = 0, r = -1;
|
|
1125
1125
|
const n = this.props.columns.filter((a) => a.children.length === 0).map(
|
|
1126
1126
|
(a) => {
|
|
1127
|
-
const
|
|
1128
|
-
let g =
|
|
1129
|
-
g === void 0 && (g =
|
|
1127
|
+
const c = Be(a.filter), h = o(a.field), d = a.filterable ? t.toLanguageString(Pe, k[Pe]) : void 0;
|
|
1128
|
+
let g = h && h.value;
|
|
1129
|
+
g === void 0 && (g = c === "text" ? "" : null);
|
|
1130
1130
|
const m = a.filterable && {
|
|
1131
1131
|
render: this.props.cellRender,
|
|
1132
1132
|
field: a.field,
|
|
1133
1133
|
title: a.filterTitle,
|
|
1134
1134
|
value: g,
|
|
1135
|
-
operator:
|
|
1136
|
-
operators: ie(this.props.filterOperators[
|
|
1135
|
+
operator: h && h.operator,
|
|
1136
|
+
operators: ie(this.props.filterOperators[c] || [], t),
|
|
1137
1137
|
booleanValues: ie(qt, t),
|
|
1138
|
-
filterType:
|
|
1138
|
+
filterType: c,
|
|
1139
1139
|
ariaLabel: d,
|
|
1140
|
-
onChange: (
|
|
1141
|
-
this.setFilter(
|
|
1140
|
+
onChange: (v) => {
|
|
1141
|
+
this.setFilter(v.value, v.operator, a.field, v.syntheticEvent);
|
|
1142
1142
|
}
|
|
1143
|
-
}, u = a.declarationIndex >= 0 ? ++
|
|
1143
|
+
}, u = a.declarationIndex >= 0 ? ++r : --e, b = {
|
|
1144
1144
|
ariaLabel: d,
|
|
1145
1145
|
ariaColumnIndex: a.ariaColumnIndex
|
|
1146
1146
|
}, E = a.left !== void 0 ? this.props.isRtl ? { left: a.right, right: a.left } : { left: a.left, right: a.right } : {}, C = {
|
|
@@ -1150,10 +1150,10 @@ class Qt extends l.Component {
|
|
|
1150
1150
|
className: y("k-table-th", this.headerCellClassName(a.field, a.locked) || void 0),
|
|
1151
1151
|
role: "columnheader",
|
|
1152
1152
|
...b
|
|
1153
|
-
}, x = m && (a.filterCell ? /* @__PURE__ */ l.createElement(a.filterCell, { ...m }) : /* @__PURE__ */ l.createElement(Jt, { size: this.props.size, ...m })),
|
|
1154
|
-
if (
|
|
1155
|
-
const
|
|
1156
|
-
return /* @__PURE__ */ l.createElement(
|
|
1153
|
+
}, x = m && (a.filterCell ? /* @__PURE__ */ l.createElement(a.filterCell, { ...m }) : /* @__PURE__ */ l.createElement(Jt, { size: this.props.size, ...m })), S = be(this.props.cells, a.cells);
|
|
1154
|
+
if (S && S.filterCell) {
|
|
1155
|
+
const v = S.filterCell;
|
|
1156
|
+
return /* @__PURE__ */ l.createElement(v, { key: u, ...m, thProps: C, index: r }, x);
|
|
1157
1157
|
}
|
|
1158
1158
|
return /* @__PURE__ */ l.createElement(
|
|
1159
1159
|
Ft,
|
|
@@ -1165,7 +1165,7 @@ class Qt extends l.Component {
|
|
|
1165
1165
|
);
|
|
1166
1166
|
}
|
|
1167
1167
|
);
|
|
1168
|
-
return /* @__PURE__ */ l.createElement("tr", { className:
|
|
1168
|
+
return /* @__PURE__ */ l.createElement("tr", { className: fr, "aria-rowindex": this.props.ariaRowIndex, role: "row" }, n);
|
|
1169
1169
|
}
|
|
1170
1170
|
}
|
|
1171
1171
|
M(Qt);
|
|
@@ -1220,7 +1220,7 @@ class Zt extends l.Component {
|
|
|
1220
1220
|
O,
|
|
1221
1221
|
{
|
|
1222
1222
|
name: "sort-" + t + "-small",
|
|
1223
|
-
icon: t === "asc" ?
|
|
1223
|
+
icon: t === "asc" ? Ke : Ve,
|
|
1224
1224
|
size: "small"
|
|
1225
1225
|
}
|
|
1226
1226
|
)),
|
|
@@ -1235,7 +1235,7 @@ class Zt extends l.Component {
|
|
|
1235
1235
|
O,
|
|
1236
1236
|
{
|
|
1237
1237
|
name: "x-circle",
|
|
1238
|
-
icon:
|
|
1238
|
+
icon: Ms,
|
|
1239
1239
|
size: "small"
|
|
1240
1240
|
}
|
|
1241
1241
|
)
|
|
@@ -1251,8 +1251,8 @@ class es extends l.Component {
|
|
|
1251
1251
|
const o = this.props.group.slice();
|
|
1252
1252
|
o.splice(s, 1), this.props.groupChange(o, t);
|
|
1253
1253
|
}, this.onGroupSortChange = (t, s, o, e) => {
|
|
1254
|
-
const
|
|
1255
|
-
n.splice(s, 1,
|
|
1254
|
+
const r = Object.assign({}, o, { dir: e }), n = this.props.group.slice();
|
|
1255
|
+
n.splice(s, 1, r), this.props.groupChange(n, t);
|
|
1256
1256
|
};
|
|
1257
1257
|
}
|
|
1258
1258
|
render() {
|
|
@@ -1263,11 +1263,11 @@ class es extends l.Component {
|
|
|
1263
1263
|
index: e,
|
|
1264
1264
|
dir: o.dir || "asc",
|
|
1265
1265
|
title: this.props.resolveTitle(o.field),
|
|
1266
|
-
onRemove: (
|
|
1267
|
-
this.onGroupRemove(
|
|
1266
|
+
onRemove: (r) => {
|
|
1267
|
+
this.onGroupRemove(r, e);
|
|
1268
1268
|
},
|
|
1269
|
-
onSortChange: (
|
|
1270
|
-
this.onGroupSortChange(
|
|
1269
|
+
onSortChange: (r, n) => {
|
|
1270
|
+
this.onGroupSortChange(r, e, o, n);
|
|
1271
1271
|
},
|
|
1272
1272
|
onPress: this.props.pressHandler,
|
|
1273
1273
|
onDrag: this.props.dragHandler,
|
|
@@ -1281,18 +1281,18 @@ class es extends l.Component {
|
|
|
1281
1281
|
ref: this.props.refCallback,
|
|
1282
1282
|
className: "k-grouping-header",
|
|
1283
1283
|
role: "toolbar",
|
|
1284
|
-
"aria-label": G(this).toLanguageString(
|
|
1284
|
+
"aria-label": G(this).toLanguageString(Ae, k[Ae]),
|
|
1285
1285
|
"aria-controls": this.props.ariaControls || ""
|
|
1286
1286
|
},
|
|
1287
1287
|
/* @__PURE__ */ l.createElement("div", { className: "k-chip-list k-chip-list-md", role: "none" }, s),
|
|
1288
|
-
/* @__PURE__ */ l.createElement("div", { className: "k-grouping-drop-container" }, !s.length && G(this).toLanguageString(
|
|
1288
|
+
/* @__PURE__ */ l.createElement("div", { className: "k-grouping-drop-container" }, !s.length && G(this).toLanguageString(De, k[De]), " ")
|
|
1289
1289
|
);
|
|
1290
1290
|
}
|
|
1291
1291
|
}
|
|
1292
1292
|
M(es);
|
|
1293
|
-
class
|
|
1293
|
+
class mr extends l.Component {
|
|
1294
1294
|
constructor() {
|
|
1295
|
-
super(...arguments), this.footerWrap = null, this.table = null, this.scrollbarWidth =
|
|
1295
|
+
super(...arguments), this.footerWrap = null, this.table = null, this.scrollbarWidth = It();
|
|
1296
1296
|
}
|
|
1297
1297
|
componentDidMount() {
|
|
1298
1298
|
this.setState({});
|
|
@@ -1338,7 +1338,7 @@ class gr extends l.Component {
|
|
|
1338
1338
|
"k-table k-grid-footer-table",
|
|
1339
1339
|
{
|
|
1340
1340
|
"k-table-md": !this.props.size,
|
|
1341
|
-
[`k-table-${
|
|
1341
|
+
[`k-table-${V.sizeMap[this.props.size] || this.props.size}`]: this.props.size
|
|
1342
1342
|
},
|
|
1343
1343
|
this.props.className
|
|
1344
1344
|
),
|
|
@@ -1353,19 +1353,19 @@ class gr extends l.Component {
|
|
|
1353
1353
|
) : /* @__PURE__ */ l.createElement("tfoot", { className: "k-table-tfoot" }, this.props.row);
|
|
1354
1354
|
}
|
|
1355
1355
|
}
|
|
1356
|
-
class
|
|
1356
|
+
class Cr {
|
|
1357
1357
|
constructor(t) {
|
|
1358
1358
|
this.table = null, this.containerHeight = 0, this.topCacheCount = 0, this.attendedSkip = 0, this.propsSkip = 0, this.total = 0, this.scrollableVirtual = !1, this.realSkip = 0, this.pageSize = 0, this.PageChange = null, this.tableBodyRef = l.createRef(), this.fixedScroll = !1, this.askedSkip = void 0, this.containerRef = l.createRef(), this.tableTransform = "", this.prevScrollPos = 0, this.tableTranslate = 0, this.scrollSyncing = !1, this.reactVersion = Number.parseFloat(l.version), this.topItems = (s, o) => {
|
|
1359
1359
|
if (!this.container || o)
|
|
1360
1360
|
return { topItemsCount: 0, topItemsHeight: 0 };
|
|
1361
|
-
const e = this.container.clientHeight,
|
|
1361
|
+
const e = this.container.clientHeight, r = Math.ceil(e / s[0].line), n = Math.ceil((s.length - r) / 2);
|
|
1362
1362
|
let a = 0;
|
|
1363
|
-
for (let
|
|
1364
|
-
a += s[
|
|
1363
|
+
for (let c = 0; c < n; c++)
|
|
1364
|
+
a += s[c].line + s[c].acc;
|
|
1365
1365
|
return {
|
|
1366
1366
|
topItemsCount: n,
|
|
1367
1367
|
topItemsHeight: a,
|
|
1368
|
-
itemsNeededOnScreen:
|
|
1368
|
+
itemsNeededOnScreen: r + r / 2
|
|
1369
1369
|
};
|
|
1370
1370
|
}, this.horizontalScrollbarHeight = () => this.container ? this.container.offsetHeight - this.container.clientHeight : 0, t && (this.topCacheCount = 4, this.attendedSkip = -this.topCacheCount), this.scrollHandler = this.scrollHandler.bind(this);
|
|
1371
1371
|
}
|
|
@@ -1409,22 +1409,22 @@ class fr {
|
|
|
1409
1409
|
if (!this.container)
|
|
1410
1410
|
return;
|
|
1411
1411
|
const s = this.rowHeights, o = this.container.scrollTop;
|
|
1412
|
-
let e = this.tableTranslate,
|
|
1412
|
+
let e = this.tableTranslate, r = 0;
|
|
1413
1413
|
const {
|
|
1414
1414
|
topItemsCount: n,
|
|
1415
1415
|
topItemsHeight: a,
|
|
1416
|
-
itemsNeededOnScreen:
|
|
1417
|
-
} = this.topItems(s, !!this.topCacheCount),
|
|
1418
|
-
if (!(
|
|
1419
|
-
for (;
|
|
1420
|
-
e -= s[s.length - 1 -
|
|
1421
|
-
if (
|
|
1416
|
+
itemsNeededOnScreen: c
|
|
1417
|
+
} = this.topItems(s, !!this.topCacheCount), h = o - e;
|
|
1418
|
+
if (!(h > a || s.length <= c)) {
|
|
1419
|
+
for (; r < this.topCacheCount + this.attendedSkip - this.realSkip + n && this.propsSkip - r > 0 && !(e + (s[s.length - 1 - r].line + s[s.length - 1 - r].acc) + h <= o); )
|
|
1420
|
+
e -= s[s.length - 1 - r].line + s[s.length - 1 - r].acc, r++;
|
|
1421
|
+
if (r === 0 && this.topCacheCount === 0 && this.attendedSkip > 0 && (e = Math.max(e - s[0].line, 0), r = 1), this.propsSkip - r <= 0 && e > o) {
|
|
1422
1422
|
this.translate(0), this.changePage(0, t), this.container.scrollTop = 0;
|
|
1423
1423
|
return;
|
|
1424
1424
|
}
|
|
1425
1425
|
if (e > o && (e = o), e !== this.tableTranslate) {
|
|
1426
1426
|
this.translate(Math.max(0, e - a));
|
|
1427
|
-
const d = Math.max(0, this.propsSkip -
|
|
1427
|
+
const d = Math.max(0, this.propsSkip - r - n);
|
|
1428
1428
|
this.changePage(d, t);
|
|
1429
1429
|
}
|
|
1430
1430
|
}
|
|
@@ -1433,26 +1433,26 @@ class fr {
|
|
|
1433
1433
|
if (!this.container)
|
|
1434
1434
|
return;
|
|
1435
1435
|
const s = this.rowHeights, o = this.container.scrollTop;
|
|
1436
|
-
let e = this.tableTranslate,
|
|
1436
|
+
let e = this.tableTranslate, r = 0;
|
|
1437
1437
|
const {
|
|
1438
1438
|
topItemsCount: n,
|
|
1439
1439
|
topItemsHeight: a,
|
|
1440
|
-
itemsNeededOnScreen:
|
|
1440
|
+
itemsNeededOnScreen: c
|
|
1441
1441
|
} = this.topItems(s, !!this.topCacheCount);
|
|
1442
|
-
for (;
|
|
1443
|
-
e += s[
|
|
1444
|
-
n > this.propsSkip +
|
|
1442
|
+
for (; r < s.length - this.topCacheCount && !(e + s[r].line + s[r].acc > o); )
|
|
1443
|
+
e += s[r].line + s[r].acc, r++;
|
|
1444
|
+
n > this.propsSkip + r || s.length <= c || (r >= s.length - this.topCacheCount && this.propsSkip + r >= this.total ? (this.translate(e - a), this.changePage(this.total - 1 - n, t)) : e !== this.tableTranslate && this.propsSkip + r - n !== this.propsSkip && (this.translate(e - a), this.changePage(this.propsSkip + r - n, t)));
|
|
1445
1445
|
}
|
|
1446
1446
|
scrollNonStrict(t) {
|
|
1447
1447
|
const s = this.total * this.prevScrollPos / this.containerHeight;
|
|
1448
1448
|
let o = Math.floor(s);
|
|
1449
1449
|
o >= this.total && (o = this.total - 1);
|
|
1450
1450
|
const e = Math.min(s - o, 1);
|
|
1451
|
-
let
|
|
1451
|
+
let r = 0;
|
|
1452
1452
|
const n = o - this.propsSkip, a = this.rowHeights;
|
|
1453
|
-
n >= 0 && n <= 1 ?
|
|
1454
|
-
const { topItemsCount:
|
|
1455
|
-
this.translate(Math.max(0,
|
|
1453
|
+
n >= 0 && n <= 1 ? r = -((a[0].line + a[0].acc) * e) : n === -1 && (r = -((a[a.length - 1].line + a[a.length - 1].acc) * e));
|
|
1454
|
+
const { topItemsCount: c, topItemsHeight: h } = this.topItems(a, !!this.topCacheCount);
|
|
1455
|
+
this.translate(Math.max(0, r - h - this.horizontalScrollbarHeight() + this.containerHeight * s / this.total)), this.changePage(o - c, t);
|
|
1456
1456
|
}
|
|
1457
1457
|
scrollHandler(t) {
|
|
1458
1458
|
if (!this.scrollableVirtual)
|
|
@@ -1472,11 +1472,11 @@ class fr {
|
|
|
1472
1472
|
class bt {
|
|
1473
1473
|
constructor(t = 0, s, o, e) {
|
|
1474
1474
|
this.total = t, this.offsets = [], this.heights = [];
|
|
1475
|
-
let
|
|
1475
|
+
let r = 0;
|
|
1476
1476
|
for (let n = 0; n < t; n++) {
|
|
1477
|
-
this.offsets.push(
|
|
1477
|
+
this.offsets.push(r);
|
|
1478
1478
|
const a = e && e[n].expanded && e[n].rowType === "data" ? o : s;
|
|
1479
|
-
|
|
1479
|
+
r += a, this.heights.push(a);
|
|
1480
1480
|
}
|
|
1481
1481
|
}
|
|
1482
1482
|
height(t) {
|
|
@@ -1485,13 +1485,13 @@ class bt {
|
|
|
1485
1485
|
index(t) {
|
|
1486
1486
|
if (t < 0)
|
|
1487
1487
|
return;
|
|
1488
|
-
const s = this.offsets.reduce((o, e,
|
|
1488
|
+
const s = this.offsets.reduce((o, e, r) => {
|
|
1489
1489
|
if (o !== void 0)
|
|
1490
1490
|
return o;
|
|
1491
1491
|
if (e === t)
|
|
1492
|
-
return
|
|
1492
|
+
return r;
|
|
1493
1493
|
if (e > t)
|
|
1494
|
-
return
|
|
1494
|
+
return r - 1;
|
|
1495
1495
|
}, void 0);
|
|
1496
1496
|
return s === void 0 ? this.total - 1 : s;
|
|
1497
1497
|
}
|
|
@@ -1511,7 +1511,7 @@ class xt {
|
|
|
1511
1511
|
return this.containerRef.current;
|
|
1512
1512
|
}
|
|
1513
1513
|
translate(t, s) {
|
|
1514
|
-
this.scrollableVirtual && this.table && (
|
|
1514
|
+
this.scrollableVirtual && this.table && (Fe || this.reactVersion <= 17 || s ? this.table.style.transform = "translateY(" + t + "px)" : this.tableTransform = "translateY(" + t + "px)");
|
|
1515
1515
|
}
|
|
1516
1516
|
changePage(t, s) {
|
|
1517
1517
|
this.PageChange && this.PageChange({ skip: Math.max(0, t), take: this.pageSize }, s);
|
|
@@ -1528,71 +1528,71 @@ class xt {
|
|
|
1528
1528
|
}
|
|
1529
1529
|
const s = this.container.scrollTop, o = this.lastScrollTop >= s, e = !o;
|
|
1530
1530
|
this.lastScrollTop = s;
|
|
1531
|
-
let
|
|
1532
|
-
const { offsetHeight: a } = this.containerRef.current,
|
|
1533
|
-
if (e &&
|
|
1534
|
-
const
|
|
1535
|
-
|
|
1531
|
+
let r = this.rowHeightService.index(s), n = this.rowHeightService.offset(r);
|
|
1532
|
+
const { offsetHeight: a } = this.containerRef.current, c = this.rowHeightService.index(s + a);
|
|
1533
|
+
if (e && c >= this.lastLoaded && this.lastLoaded < this.total) {
|
|
1534
|
+
const h = r + this.pageSize - this.total;
|
|
1535
|
+
h > 0 && (r = r - h, n = this.rowHeightService.offset(r)), this.firstLoaded = r, this.translate(n);
|
|
1536
1536
|
let d = this.firstLoaded + this.pageSize;
|
|
1537
1537
|
this.lastLoaded = Math.min(d, this.total), this.changePage(this.firstLoaded, t);
|
|
1538
|
-
} else if (o &&
|
|
1539
|
-
const
|
|
1540
|
-
this.firstLoaded = Math.max(
|
|
1538
|
+
} else if (o && r < this.firstLoaded) {
|
|
1539
|
+
const h = Math.floor(this.pageSize * 0.3);
|
|
1540
|
+
this.firstLoaded = Math.max(r - h, 0), this.translate(this.rowHeightService.offset(this.firstLoaded)), this.lastLoaded = Math.min(this.firstLoaded + this.pageSize, this.total), this.changePage(this.firstLoaded, t);
|
|
1541
1541
|
}
|
|
1542
1542
|
}
|
|
1543
1543
|
}
|
|
1544
|
-
const
|
|
1545
|
-
class
|
|
1544
|
+
const br = 1, xr = 20;
|
|
1545
|
+
class vr {
|
|
1546
1546
|
constructor(t) {
|
|
1547
1547
|
this.columns = [], this.resizable = !1, this.isRtl = !1, this.setIsRtl = (s) => {
|
|
1548
1548
|
this.isRtl = s;
|
|
1549
|
-
}, this.dragHandler = (s, o, e,
|
|
1549
|
+
}, this.dragHandler = (s, o, e, r) => {
|
|
1550
1550
|
const n = s.originalEvent;
|
|
1551
|
-
|
|
1551
|
+
r || (n.preventDefault(), n.stopPropagation(), n.stopImmediatePropagation());
|
|
1552
1552
|
const a = e.closest("th");
|
|
1553
1553
|
if (!a || !a)
|
|
1554
1554
|
return;
|
|
1555
|
-
const
|
|
1556
|
-
let
|
|
1557
|
-
if (this.isRtl ?
|
|
1555
|
+
const c = a.clientWidth;
|
|
1556
|
+
let h = c;
|
|
1557
|
+
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)
|
|
1558
1558
|
return;
|
|
1559
|
-
this.fixateInitialWidths(a.parentElement.clientWidth), this.setWidths(o, Math.floor(
|
|
1559
|
+
this.fixateInitialWidths(a.parentElement.clientWidth), this.setWidths(o, Math.floor(h) / c);
|
|
1560
1560
|
const d = this.columns.filter((g) => !g.children.length).findIndex((g) => g.id === o.id);
|
|
1561
|
-
this.onResize(d,
|
|
1561
|
+
this.onResize(d, c, h, n, r, o.id);
|
|
1562
1562
|
}, this.dblClickHandler = (s, o) => {
|
|
1563
1563
|
const e = this.columns.filter((m) => o.indexOf(m.id) > -1);
|
|
1564
1564
|
if (!this.colGroupMain || !e.length)
|
|
1565
1565
|
return;
|
|
1566
|
-
const
|
|
1566
|
+
const r = {}, n = e;
|
|
1567
1567
|
for (; n.length > 0; ) {
|
|
1568
1568
|
const m = n.pop();
|
|
1569
1569
|
if (!m)
|
|
1570
1570
|
break;
|
|
1571
|
-
m.children.length ? n.push(...m.children) :
|
|
1571
|
+
m.children.length ? n.push(...m.children) : r[m.id] = m;
|
|
1572
1572
|
}
|
|
1573
|
-
const a = this.columns.filter((m) => !m.children.length),
|
|
1573
|
+
const a = this.columns.filter((m) => !m.children.length), c = [];
|
|
1574
1574
|
a.forEach((m, u) => {
|
|
1575
|
-
|
|
1575
|
+
r[m.id] && c.push(u);
|
|
1576
1576
|
});
|
|
1577
|
-
const
|
|
1578
|
-
this.colGroupHeader && (
|
|
1577
|
+
const h = [this.colGroupMain.parentElement], d = [this.colGroupMain];
|
|
1578
|
+
this.colGroupHeader && (h.push(this.colGroupHeader.parentElement), d.push(this.colGroupHeader)), this.colGroupFooter && (h.push(this.colGroupFooter.parentElement), d.push(this.colGroupFooter)), h.forEach((m) => m.classList.add("k-autofitting"));
|
|
1579
1579
|
let g = [];
|
|
1580
1580
|
d.forEach((m) => {
|
|
1581
|
-
|
|
1582
|
-
m.children[u] && (m.children[u].width = "", g[u] = Math.max(g[u] || 0, m.children[u].offsetWidth +
|
|
1581
|
+
c.forEach((u) => {
|
|
1582
|
+
m.children[u] && (m.children[u].width = "", g[u] = Math.max(g[u] || 0, m.children[u].offsetWidth + br));
|
|
1583
1583
|
});
|
|
1584
1584
|
}), d.forEach((m) => {
|
|
1585
|
-
|
|
1585
|
+
c.forEach((u) => {
|
|
1586
1586
|
m.children[u] && (m.children[u].width = g[u] + "px", a[u].width = g[u]);
|
|
1587
1587
|
});
|
|
1588
|
-
}),
|
|
1588
|
+
}), h.forEach((m) => m.classList.remove("k-autofitting")), this.onResize(c[0], 0, 0, s, !0, o[0]);
|
|
1589
1589
|
}, this.updateColElements = (s) => {
|
|
1590
|
-
const o = this.columns.filter((
|
|
1590
|
+
const o = this.columns.filter((r) => !r.children.length);
|
|
1591
1591
|
let e = 1e-10;
|
|
1592
|
-
for (let
|
|
1593
|
-
const n = s[
|
|
1594
|
-
e +=
|
|
1595
|
-
const d =
|
|
1592
|
+
for (let r = 0; r < s.length; r++) {
|
|
1593
|
+
const n = s[r], a = o.findIndex((g) => g.id === n.id), c = parseFloat((n.width || 0).toString()), h = Math.floor(c);
|
|
1594
|
+
e += c - h;
|
|
1595
|
+
const d = h + Math.floor(e);
|
|
1596
1596
|
if (e -= Math.floor(e), this.colGroupMain && this.colGroupMain.children[a]) {
|
|
1597
1597
|
const g = parseInt(this.colGroupMain.children[a].width, 10);
|
|
1598
1598
|
this.colGroupMain.children[a].width = d + "px", this.updateNextLockedCol(
|
|
@@ -1627,63 +1627,63 @@ class br {
|
|
|
1627
1627
|
e[n].width ? t -= parseFloat(e[n].width) : o++;
|
|
1628
1628
|
if (o === 0)
|
|
1629
1629
|
return;
|
|
1630
|
-
const
|
|
1630
|
+
const r = Math.floor(t / o);
|
|
1631
1631
|
for (let n = 0; n < e.length; n++) {
|
|
1632
1632
|
const a = e[n];
|
|
1633
|
-
a.width || (a.width =
|
|
1633
|
+
a.width || (a.width = r, s[n].width = r.toString(), this.colGroupHeader && (this.colGroupHeader.children[n].width = r), this.colGroupFooter && (this.colGroupFooter.children[n].width = r));
|
|
1634
1634
|
}
|
|
1635
1635
|
}
|
|
1636
1636
|
setWidths(t, s) {
|
|
1637
1637
|
const o = this.columns.findIndex((n) => n.id === t.id), e = [];
|
|
1638
|
-
let
|
|
1639
|
-
for (let n = o + 1;
|
|
1638
|
+
let r = t.children.length;
|
|
1639
|
+
for (let n = o + 1; r > 0 && n < this.columns.length; n++, r--) {
|
|
1640
1640
|
const a = this.columns[n];
|
|
1641
|
-
a.children.length ?
|
|
1641
|
+
a.children.length ? r += a.children.length : e.push(a);
|
|
1642
1642
|
}
|
|
1643
1643
|
return e.length === 0 && e.push(t), e.forEach((n) => {
|
|
1644
1644
|
let a = n.width ? parseFloat(n.width.toString()) * s : 0;
|
|
1645
|
-
const
|
|
1646
|
-
a <
|
|
1645
|
+
const c = n.minResizableWidth === void 0 ? 10 : n.minResizableWidth;
|
|
1646
|
+
a < c && (a = c), n.width = a;
|
|
1647
1647
|
}), this.updateColElements(e), e;
|
|
1648
1648
|
}
|
|
1649
1649
|
updateNextLockedCol(t, s, o) {
|
|
1650
|
-
const e = s.index,
|
|
1651
|
-
!s.locked || n <= a +
|
|
1652
|
-
if (
|
|
1653
|
-
const
|
|
1654
|
-
|
|
1650
|
+
const e = s.index, r = this.colGroupMain.parentElement.closest(".k-grid"), n = r == null ? void 0 : r.clientWidth, a = this.columns.filter((c) => c.locked).map((c) => parseInt(c.width + "", 10)).reduce((c, h) => c + h, 0);
|
|
1651
|
+
!s.locked || n <= a + xr || this.columns.forEach((c) => {
|
|
1652
|
+
if (c != null && c.locked && o) {
|
|
1653
|
+
const h = t == null ? void 0 : t.querySelectorAll('[aria-colindex="' + c.ariaColumnIndex + '"]');
|
|
1654
|
+
h == null || h.forEach((d) => {
|
|
1655
1655
|
const g = d.style;
|
|
1656
|
-
this.isRtl ? (
|
|
1656
|
+
this.isRtl ? (c.index > e && g && g.right && (g.right = parseInt(g.right, 10) - o + "px"), c.index < e && g && g.left && (g.left = parseInt(g.left, 10) - o + "px")) : (c.index > e && g && g.left && (g.left = parseInt(g.left, 10) - o + "px"), c.index < e && g && g.right && (g.right = parseInt(g.right, 10) - o + "px"));
|
|
1657
1657
|
});
|
|
1658
1658
|
}
|
|
1659
1659
|
});
|
|
1660
1660
|
}
|
|
1661
1661
|
}
|
|
1662
|
-
class
|
|
1662
|
+
class kr {
|
|
1663
1663
|
constructor(t, s, o) {
|
|
1664
1664
|
this.refDragElementClue = l.createRef(), this.refDropElementClue = l.createRef(), this.columns = [], this.reorderable = !1, this.groupable = !1, this.startColumn = -1, this.startGroup = -1, this.currentColumn = -1, this.currentGroup = -1, this.groupPanelDivElement = null, this.refGroupPanelDiv = (e) => {
|
|
1665
1665
|
this.groupPanelDivElement = e && e.children ? e.children[0] : e;
|
|
1666
|
-
}, this.pressHandler = (e,
|
|
1667
|
-
const n = this.getColumnIndex(e,
|
|
1666
|
+
}, this.pressHandler = (e, r) => {
|
|
1667
|
+
const n = this.getColumnIndex(e, r);
|
|
1668
1668
|
if (this.startGroup = this.getGroupIndex(e), n >= 0) {
|
|
1669
1669
|
const a = this.columns[n];
|
|
1670
1670
|
(a.reorderable && this.reorderable || a.groupable && this.groupable) && (this.startColumn = n);
|
|
1671
1671
|
}
|
|
1672
|
-
}, this.dragHandler = (e,
|
|
1672
|
+
}, this.dragHandler = (e, r) => {
|
|
1673
1673
|
if (e.isTouch || e.originalEvent.preventDefault(), e.originalEvent.stopPropagation(), this.startColumn === -1 && this.startGroup === -1)
|
|
1674
1674
|
return;
|
|
1675
|
-
this.currentColumn = this.getColumnIndex(e,
|
|
1675
|
+
this.currentColumn = this.getColumnIndex(e, r);
|
|
1676
1676
|
const n = this.groupPanelDivElement && this.groupPanelDivElement.children;
|
|
1677
1677
|
this.currentGroup = this.isTargetGroupingContainer(e) ? n && n.length ? n.length : 0 : this.getGroupIndex(e);
|
|
1678
1678
|
const a = !this.isValid();
|
|
1679
1679
|
a && (this.currentColumn = -1, this.currentGroup = -1);
|
|
1680
|
-
const
|
|
1681
|
-
this.updateDragElementClue(e,
|
|
1680
|
+
const c = this.currentColumn >= 0 ? r.children[this.columns[this.currentColumn].index] : this.isTargetGroupingContainer(e) ? e.originalEvent.target : this.groupPanelDivElement && this.groupPanelDivElement.children[this.currentGroup];
|
|
1681
|
+
this.updateDragElementClue(e, r, c, a), this.updateDropElementClue(e, r, c, a);
|
|
1682
1682
|
}, this.releaseHandler = (e) => {
|
|
1683
|
-
const
|
|
1683
|
+
const r = this.startColumn, n = this.currentColumn, a = this.startGroup, c = this.currentGroup;
|
|
1684
1684
|
e.originalEvent.preventDefault(), this.dropElementClue && this.dropElementClue.setState({ visible: !1 }), this.dragElementClue && this.dragElementClue.setState({ visible: !1 });
|
|
1685
|
-
const
|
|
1686
|
-
this.startColumn = this.startGroup = this.currentColumn = this.currentGroup = -1,
|
|
1685
|
+
const h = this.isValid();
|
|
1686
|
+
this.startColumn = this.startGroup = this.currentColumn = this.currentGroup = -1, h && (r >= 0 && n >= 0 ? this.columnReorder(r, n, e.originalEvent) : a >= 0 && c >= 0 ? this.groupReorder(a, c, e.originalEvent) : r >= 0 && c >= 0 && this.columnToGroup(r, c, e.originalEvent));
|
|
1687
1687
|
}, this.columnReorder = t, this.groupReorder = s, this.columnToGroup = o;
|
|
1688
1688
|
}
|
|
1689
1689
|
get dragClueRef() {
|
|
@@ -1706,7 +1706,7 @@ class xr {
|
|
|
1706
1706
|
return -1;
|
|
1707
1707
|
for (let e = 0; e < s.parentNode.children.length; e++)
|
|
1708
1708
|
if (s.parentNode.children[e] === s)
|
|
1709
|
-
return this.columns.findIndex((
|
|
1709
|
+
return this.columns.findIndex((r) => r.index === o && r.depth === e);
|
|
1710
1710
|
return -1;
|
|
1711
1711
|
}
|
|
1712
1712
|
isTargetGroupingContainer(t) {
|
|
@@ -1722,12 +1722,12 @@ class xr {
|
|
|
1722
1722
|
updateDragElementClue(t, s, o, e) {
|
|
1723
1723
|
if (!this.dragElementClue)
|
|
1724
1724
|
return;
|
|
1725
|
-
const
|
|
1725
|
+
const r = this.startColumn >= 0 ? s.children[this.columns[this.startColumn].index].innerText : s.innerText;
|
|
1726
1726
|
this.dragElementClue.setState({
|
|
1727
1727
|
visible: !0,
|
|
1728
1728
|
top: t.pageY + 10,
|
|
1729
1729
|
left: t.pageX,
|
|
1730
|
-
innerText:
|
|
1730
|
+
innerText: r,
|
|
1731
1731
|
status: e || !o ? "k-i-cancel" : "k-i-plus"
|
|
1732
1732
|
});
|
|
1733
1733
|
}
|
|
@@ -1738,109 +1738,109 @@ class xr {
|
|
|
1738
1738
|
this.dropElementClue.setState({ visible: !1 });
|
|
1739
1739
|
return;
|
|
1740
1740
|
}
|
|
1741
|
-
const
|
|
1742
|
-
let
|
|
1743
|
-
!this.isTargetGroupingContainer(t) && (this.currentColumn > this.startColumn || this.currentGroup > this.startGroup && this.startGroup !== -1) && (
|
|
1744
|
-
const
|
|
1741
|
+
const r = o.getBoundingClientRect(), a = (o.closest(".k-grouping-header") || o).getBoundingClientRect();
|
|
1742
|
+
let c = r.left + t.pageX - t.clientX - 6;
|
|
1743
|
+
!this.isTargetGroupingContainer(t) && (this.currentColumn > this.startColumn || this.currentGroup > this.startGroup && this.startGroup !== -1) && (c += r.width);
|
|
1744
|
+
const h = a.top + t.pageY - t.clientY;
|
|
1745
1745
|
this.dropElementClue.setState({
|
|
1746
1746
|
visible: !0,
|
|
1747
|
-
top:
|
|
1748
|
-
left:
|
|
1747
|
+
top: h,
|
|
1748
|
+
left: c,
|
|
1749
1749
|
height: this.currentColumn >= 0 ? s.clientHeight : a.height
|
|
1750
1750
|
});
|
|
1751
1751
|
}
|
|
1752
1752
|
}
|
|
1753
|
-
const
|
|
1753
|
+
const Er = (i) => {
|
|
1754
1754
|
let t = null;
|
|
1755
|
-
const s =
|
|
1756
|
-
|
|
1757
|
-
}, [
|
|
1758
|
-
let
|
|
1759
|
-
if (
|
|
1760
|
-
|
|
1755
|
+
const s = Ns(), o = q(i.id), e = l.useCallback((h) => {
|
|
1756
|
+
i.onContextMenu && i.onContextMenu.call(void 0, h, i.dataItem, i.field);
|
|
1757
|
+
}, [i.onContextMenu, i.dataItem, i.field]);
|
|
1758
|
+
let r = null, n = null;
|
|
1759
|
+
if (i.rowType === "groupFooter")
|
|
1760
|
+
r = {
|
|
1761
1761
|
onContextMenu: e,
|
|
1762
|
-
className:
|
|
1763
|
-
}, t = /* @__PURE__ */ l.createElement("td", { ...
|
|
1764
|
-
else if (
|
|
1765
|
-
if (
|
|
1766
|
-
const d = T(
|
|
1767
|
-
d != null && (n =
|
|
1762
|
+
className: i.className
|
|
1763
|
+
}, t = /* @__PURE__ */ l.createElement("td", { ...r });
|
|
1764
|
+
else if (i.rowType !== "groupHeader") {
|
|
1765
|
+
if (i.field !== void 0) {
|
|
1766
|
+
const d = T(i.field, i.dataItem);
|
|
1767
|
+
d != null && (n = i.format ? s.format(i.format, d) : d.toString());
|
|
1768
1768
|
}
|
|
1769
|
-
const
|
|
1769
|
+
const h = y(
|
|
1770
1770
|
"k-table-td",
|
|
1771
|
-
|
|
1772
|
-
{ "k-selected":
|
|
1771
|
+
i.className,
|
|
1772
|
+
{ "k-selected": i.isSelected }
|
|
1773
1773
|
);
|
|
1774
|
-
|
|
1774
|
+
r = {
|
|
1775
1775
|
onContextMenu: e,
|
|
1776
|
-
colSpan:
|
|
1777
|
-
style:
|
|
1778
|
-
className:
|
|
1776
|
+
colSpan: i.colSpan,
|
|
1777
|
+
style: i.style,
|
|
1778
|
+
className: h,
|
|
1779
1779
|
role: "gridcell",
|
|
1780
|
-
"aria-colindex":
|
|
1781
|
-
"aria-selected":
|
|
1782
|
-
[re]:
|
|
1780
|
+
"aria-colindex": i.ariaColumnIndex,
|
|
1781
|
+
"aria-selected": i.isSelected,
|
|
1782
|
+
[re]: i.columnIndex,
|
|
1783
1783
|
...o
|
|
1784
|
-
}, t = /* @__PURE__ */ l.createElement("td", { ...
|
|
1784
|
+
}, t = /* @__PURE__ */ l.createElement("td", { ...r }, n);
|
|
1785
1785
|
}
|
|
1786
|
-
const a =
|
|
1787
|
-
if (
|
|
1788
|
-
const
|
|
1789
|
-
return /* @__PURE__ */ l.createElement(
|
|
1786
|
+
const a = i.rowType || "data", c = i.cells;
|
|
1787
|
+
if (c && c[a]) {
|
|
1788
|
+
const h = c[a];
|
|
1789
|
+
return /* @__PURE__ */ l.createElement(h, { ...i, tdProps: r }, n);
|
|
1790
1790
|
}
|
|
1791
|
-
return
|
|
1792
|
-
},
|
|
1791
|
+
return i.render ? i.render.call(void 0, t, i) : t;
|
|
1792
|
+
}, vt = (i) => {
|
|
1793
1793
|
let t = null;
|
|
1794
|
-
const { columnIndex: s, level: o, columnsCount: e, rowType:
|
|
1795
|
-
let x = null,
|
|
1794
|
+
const { columnIndex: s, level: o, columnsCount: e, rowType: r, dataItem: n, field: a, onChange: c, expanded: h, render: d, dataIndex: g, ariaColumnIndex: m, isRtl: u } = i, b = a || "", E = q(i.id), C = Nt();
|
|
1795
|
+
let x = null, S = null, v = null;
|
|
1796
1796
|
const _ = l.useCallback(
|
|
1797
1797
|
(F) => {
|
|
1798
|
-
F.isDefaultPrevented() || F.keyCode === me.enter &&
|
|
1798
|
+
F.isDefaultPrevented() || F.keyCode === me.enter && c && (F.preventDefault(), c({
|
|
1799
1799
|
dataItem: n,
|
|
1800
1800
|
dataIndex: g,
|
|
1801
1801
|
syntheticEvent: F,
|
|
1802
1802
|
field: void 0,
|
|
1803
|
-
value: !
|
|
1803
|
+
value: !h
|
|
1804
1804
|
}));
|
|
1805
1805
|
},
|
|
1806
|
-
[
|
|
1806
|
+
[h, c, n, g]
|
|
1807
1807
|
), D = l.useCallback((F) => {
|
|
1808
|
-
|
|
1809
|
-
}, [
|
|
1810
|
-
const pe =
|
|
1808
|
+
i.onContextMenu && i.onContextMenu.call(void 0, F, i.dataItem, i.field);
|
|
1809
|
+
}, [i.onContextMenu, i.dataItem, i.field]), de = (F, ve) => {
|
|
1810
|
+
const pe = h ? At : Pt, ke = C.toLanguageString(pe, k[pe]);
|
|
1811
1811
|
return x = {
|
|
1812
1812
|
className: "k-table-td",
|
|
1813
|
-
style: { ...
|
|
1813
|
+
style: { ...i.style, ...ve },
|
|
1814
1814
|
colSpan: F,
|
|
1815
1815
|
key: "g-colspan",
|
|
1816
1816
|
role: "gridcell",
|
|
1817
1817
|
["aria-selected"]: !1,
|
|
1818
|
-
["aria-expanded"]:
|
|
1818
|
+
["aria-expanded"]: h,
|
|
1819
1819
|
["aria-colindex"]: m,
|
|
1820
1820
|
onKeyDown: _,
|
|
1821
1821
|
onContextMenu: D,
|
|
1822
1822
|
...E
|
|
1823
|
-
},
|
|
1823
|
+
}, v = /* @__PURE__ */ l.createElement("p", { className: "k-reset" }, /* @__PURE__ */ l.createElement(
|
|
1824
1824
|
"a",
|
|
1825
1825
|
{
|
|
1826
1826
|
onClick: (J) => {
|
|
1827
|
-
J.preventDefault(),
|
|
1827
|
+
J.preventDefault(), c && c({
|
|
1828
1828
|
dataItem: n,
|
|
1829
1829
|
dataIndex: g,
|
|
1830
1830
|
syntheticEvent: J,
|
|
1831
1831
|
field: void 0,
|
|
1832
|
-
value: !
|
|
1832
|
+
value: !h
|
|
1833
1833
|
});
|
|
1834
1834
|
},
|
|
1835
1835
|
href: "#",
|
|
1836
1836
|
tabIndex: -1,
|
|
1837
|
-
"aria-label":
|
|
1837
|
+
"aria-label": ke
|
|
1838
1838
|
},
|
|
1839
1839
|
/* @__PURE__ */ l.createElement(
|
|
1840
1840
|
O,
|
|
1841
1841
|
{
|
|
1842
|
-
name:
|
|
1843
|
-
icon:
|
|
1842
|
+
name: h ? "caret-alt-down" : u ? "caret-alt-left" : "caret-alt-right",
|
|
1843
|
+
icon: h ? Hs : u ? zs : Ls
|
|
1844
1844
|
}
|
|
1845
1845
|
)
|
|
1846
1846
|
), n[b] instanceof Date && n[b].toString ? n[b].toString() : n[b]), /* @__PURE__ */ l.createElement(
|
|
@@ -1849,16 +1849,16 @@ const kr = (r) => {
|
|
|
1849
1849
|
...x,
|
|
1850
1850
|
key: x.key
|
|
1851
1851
|
},
|
|
1852
|
-
|
|
1852
|
+
v
|
|
1853
1853
|
);
|
|
1854
1854
|
};
|
|
1855
|
-
s === void 0 || o === void 0 || s < o || e === void 0 ||
|
|
1856
|
-
style:
|
|
1855
|
+
s === void 0 || o === void 0 || s < o || e === void 0 || r !== "groupHeader" || n[b] === void 0 ? (x = {
|
|
1856
|
+
style: i.style,
|
|
1857
1857
|
key: "g" + s,
|
|
1858
1858
|
className: y(
|
|
1859
1859
|
"k-table-td",
|
|
1860
1860
|
"k-group-cell",
|
|
1861
|
-
{ "k-grid-content-sticky":
|
|
1861
|
+
{ "k-grid-content-sticky": i.locked }
|
|
1862
1862
|
),
|
|
1863
1863
|
role: "gridcell",
|
|
1864
1864
|
onContextMenu: D
|
|
@@ -1868,7 +1868,7 @@ const kr = (r) => {
|
|
|
1868
1868
|
...x,
|
|
1869
1869
|
key: x.key
|
|
1870
1870
|
}
|
|
1871
|
-
)) : s <= o && !
|
|
1871
|
+
)) : s <= o && !i.locked ? t = de(e - s, {}) : s <= o && i.locked && (S = {
|
|
1872
1872
|
className: "k-table-td",
|
|
1873
1873
|
role: "gridcell",
|
|
1874
1874
|
colSpan: e - s,
|
|
@@ -1877,17 +1877,17 @@ const kr = (r) => {
|
|
|
1877
1877
|
}, t = /* @__PURE__ */ l.createElement(l.Fragment, null, de(0, { position: "sticky", zIndex: 2 }), /* @__PURE__ */ l.createElement(
|
|
1878
1878
|
"td",
|
|
1879
1879
|
{
|
|
1880
|
-
...
|
|
1880
|
+
...S
|
|
1881
1881
|
}
|
|
1882
1882
|
)));
|
|
1883
|
-
const Y =
|
|
1883
|
+
const Y = i.rowType || "data", $ = i.cells;
|
|
1884
1884
|
if ($ && $.group && $.group[Y]) {
|
|
1885
1885
|
const F = $.group[Y];
|
|
1886
|
-
return /* @__PURE__ */ l.createElement(F, { ...
|
|
1886
|
+
return /* @__PURE__ */ l.createElement(F, { ...i, tdProps: x, td2Props: S }, v);
|
|
1887
1887
|
}
|
|
1888
|
-
return d ? d.call(void 0, t,
|
|
1888
|
+
return d ? d.call(void 0, t, i) : t;
|
|
1889
1889
|
};
|
|
1890
|
-
class
|
|
1890
|
+
class Sr extends l.Component {
|
|
1891
1891
|
/**
|
|
1892
1892
|
* @hidden
|
|
1893
1893
|
*/
|
|
@@ -1917,14 +1917,14 @@ class vr extends l.Component {
|
|
|
1917
1917
|
"aria-rowindex": this.props.ariaRowIndex,
|
|
1918
1918
|
"absolute-row-index": this.props.absoluteRowIndex,
|
|
1919
1919
|
key: this.props.absoluteRowIndex,
|
|
1920
|
-
[
|
|
1920
|
+
[or]: this.props.rowType === "data" ? this.props.dataIndex : void 0
|
|
1921
1921
|
},
|
|
1922
1922
|
this.props.children
|
|
1923
1923
|
);
|
|
1924
1924
|
return this.props.render ? this.props.render.call(void 0, s, this.props) : s;
|
|
1925
1925
|
}
|
|
1926
1926
|
}
|
|
1927
|
-
class
|
|
1927
|
+
class Ir extends l.Component {
|
|
1928
1928
|
get _inputId() {
|
|
1929
1929
|
return this.props.id;
|
|
1930
1930
|
}
|
|
@@ -1944,23 +1944,23 @@ class Er extends l.Component {
|
|
|
1944
1944
|
}
|
|
1945
1945
|
)),
|
|
1946
1946
|
/* @__PURE__ */ l.createElement("label", { key: 1, className: "k-checkbox-label", htmlFor: this._inputId }),
|
|
1947
|
-
t.columnMenu && /* @__PURE__ */ l.createElement(
|
|
1947
|
+
t.columnMenu && /* @__PURE__ */ l.createElement(Vt, { ...t })
|
|
1948
1948
|
];
|
|
1949
1949
|
return this.props.render ? this.props.render.call(void 0, s, this.props) : s;
|
|
1950
1950
|
}
|
|
1951
1951
|
}
|
|
1952
|
-
const
|
|
1953
|
-
class
|
|
1952
|
+
const yr = wt(Ir);
|
|
1953
|
+
class $e extends l.Component {
|
|
1954
1954
|
/**
|
|
1955
1955
|
* @hidden
|
|
1956
1956
|
*/
|
|
1957
1957
|
render() {
|
|
1958
|
-
return this.props.children || G(this).toLanguageString(
|
|
1958
|
+
return this.props.children || G(this).toLanguageString(Ne, k[Ne]);
|
|
1959
1959
|
}
|
|
1960
1960
|
}
|
|
1961
|
-
|
|
1962
|
-
M(
|
|
1963
|
-
class
|
|
1961
|
+
$e.displayName = "KendoReactGridNoRecords";
|
|
1962
|
+
M($e);
|
|
1963
|
+
class wr extends l.Component {
|
|
1964
1964
|
constructor() {
|
|
1965
1965
|
super(...arguments), this._element = null, this.renderCell = (t, s) => {
|
|
1966
1966
|
const o = {
|
|
@@ -1977,9 +1977,9 @@ class Sr extends l.Component {
|
|
|
1977
1977
|
field: t.field,
|
|
1978
1978
|
ariaColumnIndex: t.ariaColumnIndex,
|
|
1979
1979
|
...o
|
|
1980
|
-
},
|
|
1981
|
-
if (
|
|
1982
|
-
const n =
|
|
1980
|
+
}, r = be(this.props.cells, t.cells);
|
|
1981
|
+
if (r && r.footerCell) {
|
|
1982
|
+
const n = r.footerCell;
|
|
1983
1983
|
return /* @__PURE__ */ l.createElement(n, { ...e, tdProps: o, index: s });
|
|
1984
1984
|
}
|
|
1985
1985
|
return t.footerCell && /* @__PURE__ */ l.createElement(t.footerCell, { ...e, key: s }) || /* @__PURE__ */ l.createElement("td", { ...o });
|
|
@@ -1989,36 +1989,36 @@ class Sr extends l.Component {
|
|
|
1989
1989
|
return this._element;
|
|
1990
1990
|
}
|
|
1991
1991
|
render() {
|
|
1992
|
-
return /* @__PURE__ */ l.createElement("tr", { className: "k-table-row", role: "row", "aria-rowindex": this.props.ariaRowIndex },
|
|
1992
|
+
return /* @__PURE__ */ l.createElement("tr", { className: "k-table-row", role: "row", "aria-rowindex": this.props.ariaRowIndex }, Us(this.props.columns).map(this.renderCell));
|
|
1993
1993
|
}
|
|
1994
1994
|
}
|
|
1995
|
-
const
|
|
1996
|
-
buttonCount:
|
|
1995
|
+
const Rr = ({
|
|
1996
|
+
buttonCount: i = 10,
|
|
1997
1997
|
info: t = !0,
|
|
1998
1998
|
type: s = "numeric",
|
|
1999
1999
|
pageSizes: o = void 0,
|
|
2000
2000
|
previousNext: e = !0,
|
|
2001
|
-
responsive:
|
|
2001
|
+
responsive: r = void 0,
|
|
2002
2002
|
pageSizeValue: n = void 0
|
|
2003
2003
|
}) => ({
|
|
2004
|
-
buttonCount:
|
|
2004
|
+
buttonCount: i,
|
|
2005
2005
|
info: t,
|
|
2006
2006
|
pageSizes: o === !0 ? [5, 10, 20] : o || void 0,
|
|
2007
2007
|
previousNext: e,
|
|
2008
|
-
responsive:
|
|
2008
|
+
responsive: r !== !1,
|
|
2009
2009
|
type: s,
|
|
2010
2010
|
pageSizeValue: n
|
|
2011
|
-
}),
|
|
2011
|
+
}), Fr = (i) => Rr(i === !0 ? {} : i), kt = {
|
|
2012
2012
|
name: "@progress/kendo-react-grid",
|
|
2013
2013
|
productName: "KendoReact",
|
|
2014
2014
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
2015
|
-
publishDate:
|
|
2015
|
+
publishDate: 1706183511,
|
|
2016
2016
|
version: "",
|
|
2017
2017
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
2018
|
-
},
|
|
2019
|
-
const { colSpan: t, ariaColIndex: s, dataItem: o, dataIndex: e, id:
|
|
2020
|
-
|
|
2021
|
-
}, [
|
|
2018
|
+
}, Nr = (i) => {
|
|
2019
|
+
const { colSpan: t, ariaColIndex: s, dataItem: o, dataIndex: e, id: r } = i, n = q(r), a = l.useCallback((c) => {
|
|
2020
|
+
i.onContextMenu && i.onContextMenu.call(void 0, c, i.dataItem);
|
|
2021
|
+
}, [i.onContextMenu, i.dataItem]);
|
|
2022
2022
|
return /* @__PURE__ */ l.createElement(
|
|
2023
2023
|
"td",
|
|
2024
2024
|
{
|
|
@@ -2029,96 +2029,96 @@ const yr = ({
|
|
|
2029
2029
|
role: "gridcell",
|
|
2030
2030
|
...n
|
|
2031
2031
|
},
|
|
2032
|
-
/* @__PURE__ */ l.createElement(
|
|
2032
|
+
/* @__PURE__ */ l.createElement(i.detail, { dataItem: o, dataIndex: e })
|
|
2033
2033
|
);
|
|
2034
|
-
},
|
|
2035
|
-
const t = q(
|
|
2034
|
+
}, Dr = (i) => {
|
|
2035
|
+
const t = q(i.id);
|
|
2036
2036
|
return /* @__PURE__ */ l.createElement("td", { className: "k-table-td k-hierarchy-cell", ...t, role: "gridcell" });
|
|
2037
2037
|
};
|
|
2038
|
-
let
|
|
2038
|
+
let he = class extends l.Component {
|
|
2039
2039
|
constructor(t) {
|
|
2040
2040
|
super(t), this._columns = [], this._columnsMap = [[]], this._columnsMutations = 0, this._resized = !1, this._shouldUpdateLeftRight = !0, this.contextStateRef = { current: void 0 }, this.navigationStateRef = { current: void 0 }, this._data = [], this._slicedData = void 0, this.wrapperScrollTop = 0, this.showLicenseWatermark = !1, this.headerRef = l.createRef(), this.headerElementRef = l.createRef(), this._element = null, this.tableElement = null, this.containerRef = l.createRef(), this.tableBodyRef = l.createRef(), this._footer = null, this.forceUpdateTimeout = void 0, this.isRtl = !1, this.observer = null, this.handleIntersection = (e) => {
|
|
2041
|
-
const
|
|
2041
|
+
const r = { rowIndex: this.rowIndex };
|
|
2042
2042
|
e.forEach((n) => {
|
|
2043
|
-
n.isIntersecting || this.setCurrentOnTop(
|
|
2043
|
+
n.isIntersecting || this.setCurrentOnTop(r);
|
|
2044
2044
|
});
|
|
2045
2045
|
}, this.setCurrentOnTop = (e) => {
|
|
2046
2046
|
if (!this.vs.container || this.props.scrollable === "none")
|
|
2047
2047
|
return;
|
|
2048
2048
|
this.observer && this.observer.disconnect();
|
|
2049
|
-
const { rowIndex:
|
|
2049
|
+
const { rowIndex: r } = e;
|
|
2050
2050
|
if (this.props.scrollable === "virtual")
|
|
2051
|
-
this.vs.askedSkip =
|
|
2051
|
+
this.vs.askedSkip = r, this.vs.container.scroll(0, Math.round(this.vs.askedSkip / this.vs.total * this.vs.container.scrollHeight));
|
|
2052
2052
|
else if (this.element) {
|
|
2053
|
-
const n =
|
|
2053
|
+
const n = r < 1 ? this.element.querySelector("tbody > tr:nth-child(1)") : this.element.querySelector(`tbody > tr:nth-child(${r + 1})`);
|
|
2054
2054
|
n && this.containerRef.current && (this.containerRef.current.scrollTop = n.offsetTop);
|
|
2055
2055
|
}
|
|
2056
2056
|
}, this.scrollIntoView = (e) => {
|
|
2057
2057
|
if (!this.vs.container || this.props.scrollable === "none")
|
|
2058
2058
|
return;
|
|
2059
2059
|
this.rowIndex = e.rowIndex;
|
|
2060
|
-
const { rowIndex:
|
|
2060
|
+
const { rowIndex: r } = e, n = this.element;
|
|
2061
2061
|
if (this.observer && n) {
|
|
2062
2062
|
this.observer.disconnect();
|
|
2063
|
-
const a = n.querySelector(`[absolute-row-index="${
|
|
2063
|
+
const a = n.querySelector(`[absolute-row-index="${r}"]`);
|
|
2064
2064
|
a ? this.observer.observe(a) : this.setCurrentOnTop(e);
|
|
2065
2065
|
}
|
|
2066
2066
|
}, this.fitColumns = (e) => {
|
|
2067
2067
|
this.columnResize.dblClickHandler(null, e);
|
|
2068
|
-
}, this.onContextMenu = (e,
|
|
2068
|
+
}, this.onContextMenu = (e, r, n) => {
|
|
2069
2069
|
if (this.props.onContextMenu) {
|
|
2070
2070
|
const a = {
|
|
2071
2071
|
target: this,
|
|
2072
2072
|
syntheticEvent: e,
|
|
2073
2073
|
nativeEvent: e.nativeEvent,
|
|
2074
|
-
dataItem:
|
|
2074
|
+
dataItem: r,
|
|
2075
2075
|
field: n
|
|
2076
2076
|
};
|
|
2077
2077
|
this.props.onContextMenu.call(void 0, a);
|
|
2078
2078
|
}
|
|
2079
2079
|
}, this.getVirtualScroll = (e) => {
|
|
2080
|
-
const { rowHeight:
|
|
2081
|
-
return !g || u && !d || !!(a &&
|
|
2080
|
+
const { rowHeight: r, detailRowHeight: n, detail: a, expandField: c, groupable: h } = e, d = this.isAllData(), g = r !== void 0 && r > 0, m = n !== void 0 && n > 0, u = h === !0 || typeof h == "object" && h.enabled !== !1;
|
|
2081
|
+
return !g || u && !d || !!(a && c) && (!m || !d) ? Cr : xt;
|
|
2082
2082
|
}, this.isAllData = () => {
|
|
2083
|
-
const { data: e, total:
|
|
2084
|
-
return Array.isArray(e) ? e.length ===
|
|
2085
|
-
}, this.initializeVirtualization = (e,
|
|
2083
|
+
const { data: e, total: r } = this.props;
|
|
2084
|
+
return Array.isArray(e) ? e.length === r : e ? r === e.total : !1;
|
|
2085
|
+
}, this.initializeVirtualization = (e, r) => {
|
|
2086
2086
|
if (this.reInitVirtualization(
|
|
2087
2087
|
this.props.scrollable === "virtual",
|
|
2088
2088
|
this.props.total,
|
|
2089
2089
|
this.props.filter,
|
|
2090
2090
|
this.props.group,
|
|
2091
2091
|
this.props.sort,
|
|
2092
|
-
|
|
2093
|
-
), this.vs.fixedScroll = this.props.fixedScroll || !1, this.vs.PageChange = this.pageChange, this.vs.realSkip = this.props.skip || 0, this.vs.pageSize = (this.props.take !== void 0 ? this.props.take : this.props.pageSize) || 0, this.vs.scrollableVirtual = this.props.scrollable === "virtual", this.vs.total = e, this.vs.propsSkip = (this.props.skip || 0) + (this.props.scrollable === "virtual" ? this.vs.topCacheCount + (this.vs.attendedSkip - (this.props.skip || 0)) : 0), this.props.rowHeight !== void 0 && this.props.rowHeight > 0 && !
|
|
2092
|
+
r || this.props.rowHeight === void 0 || this.props.rowHeight === 0
|
|
2093
|
+
), this.vs.fixedScroll = this.props.fixedScroll || !1, this.vs.PageChange = this.pageChange, this.vs.realSkip = this.props.skip || 0, this.vs.pageSize = (this.props.take !== void 0 ? this.props.take : this.props.pageSize) || 0, this.vs.scrollableVirtual = this.props.scrollable === "virtual", this.vs.total = e, this.vs.propsSkip = (this.props.skip || 0) + (this.props.scrollable === "virtual" ? this.vs.topCacheCount + (this.vs.attendedSkip - (this.props.skip || 0)) : 0), this.props.rowHeight !== void 0 && this.props.rowHeight > 0 && !r) {
|
|
2094
2094
|
const n = this.props.rowHeight * e;
|
|
2095
|
-
this.vs.containerHeight =
|
|
2095
|
+
this.vs.containerHeight = Fe ? Math.min(mt, n) : n;
|
|
2096
2096
|
} else
|
|
2097
2097
|
this.vs.containerHeight = 1533915;
|
|
2098
2098
|
if (this.vs.containerRef = this.containerRef, this.vs.tableBodyRef = this.tableBodyRef, this.vs.table = this.tableElement, this._slicedData = void 0, this.vs instanceof xt) {
|
|
2099
|
-
const { rowHeight: n = 0, detail: a, expandField:
|
|
2100
|
-
let { detailRowHeight:
|
|
2101
|
-
|
|
2099
|
+
const { rowHeight: n = 0, detail: a, expandField: c } = this.props;
|
|
2100
|
+
let { detailRowHeight: h = 0 } = this.props;
|
|
2101
|
+
h = a && c ? h : n, this.isAllData() ? (this.vs.total = this._data.length, this._slicedData = this._data.slice(this.vs.realSkip, this.vs.realSkip + this.vs.pageSize), this.vs.rowHeightService = this.rowHeightService(this.vs, this._data.length, n, h, this._data)) : this.vs.rowHeightService = new bt(e, n, h);
|
|
2102
2102
|
const d = this.vs.rowHeightService.totalHeight();
|
|
2103
|
-
this.vs.containerHeight =
|
|
2103
|
+
this.vs.containerHeight = Fe ? Math.min(mt, d) : d;
|
|
2104
2104
|
}
|
|
2105
2105
|
}, this.scrollHandler = (e) => {
|
|
2106
2106
|
if (e.target !== e.currentTarget)
|
|
2107
2107
|
return;
|
|
2108
2108
|
clearTimeout(this.forceUpdateTimeout), this.vs.table = this.tableElement;
|
|
2109
|
-
const
|
|
2109
|
+
const r = e.currentTarget.scrollLeft, n = e.currentTarget.scrollTop;
|
|
2110
2110
|
this.props.columnVirtualization && (!this.vs.scrollableVirtual || n === this.wrapperScrollTop) && (this.forceUpdateTimeout = window.setTimeout(() => {
|
|
2111
2111
|
this.forceUpdate();
|
|
2112
|
-
}, 0)), this._header && this._header.setScrollLeft(
|
|
2112
|
+
}, 0)), this._header && this._header.setScrollLeft(r), this._footer && this._footer.setScrollLeft(r), this.vs && n !== this.wrapperScrollTop && this.vs.scrollHandler(e), us(this.props.onScroll, e, this, void 0), this.wrapperScrollTop = n;
|
|
2113
2113
|
}, this.onKeyDown = (e) => {
|
|
2114
2114
|
if (X.onKeyDown(e, {
|
|
2115
2115
|
contextStateRef: this.contextStateRef,
|
|
2116
2116
|
navigationStateRef: this.navigationStateRef,
|
|
2117
2117
|
onNavigationAction: this.onNavigationAction
|
|
2118
2118
|
}), this.props.onKeyDown) {
|
|
2119
|
-
const { mode:
|
|
2119
|
+
const { mode: r, cell: n } = at(this.props.selectable), a = {
|
|
2120
2120
|
dataItems: this.getLeafDataItems(),
|
|
2121
|
-
mode:
|
|
2121
|
+
mode: r,
|
|
2122
2122
|
cell: n,
|
|
2123
2123
|
componentId: this._gridId,
|
|
2124
2124
|
selectedField: this.props.selectedField,
|
|
@@ -2132,30 +2132,30 @@ let ce = class extends l.Component {
|
|
|
2132
2132
|
});
|
|
2133
2133
|
}, this.onNavigationAction = (e) => {
|
|
2134
2134
|
if (this.props.onNavigationAction) {
|
|
2135
|
-
const
|
|
2135
|
+
const r = {
|
|
2136
2136
|
focusElement: e.focusElement,
|
|
2137
2137
|
...this.getArguments(e.event)
|
|
2138
2138
|
};
|
|
2139
|
-
this.props.onNavigationAction.call(void 0,
|
|
2139
|
+
this.props.onNavigationAction.call(void 0, r);
|
|
2140
2140
|
}
|
|
2141
|
-
}, this.rowClick = (e,
|
|
2141
|
+
}, this.rowClick = (e, r) => {
|
|
2142
2142
|
this.props.onRowClick && e.target.nodeName === "TD" && this.props.onRowClick.call(
|
|
2143
2143
|
void 0,
|
|
2144
2144
|
{
|
|
2145
|
-
dataItem:
|
|
2145
|
+
dataItem: r.dataItem,
|
|
2146
2146
|
...this.getArguments(e)
|
|
2147
2147
|
}
|
|
2148
2148
|
);
|
|
2149
|
-
}, this.rowDblClick = (e,
|
|
2149
|
+
}, this.rowDblClick = (e, r) => {
|
|
2150
2150
|
this.props.onRowDoubleClick && e.target.nodeName === "TD" && this.props.onRowDoubleClick.call(
|
|
2151
2151
|
void 0,
|
|
2152
2152
|
{
|
|
2153
|
-
dataItem:
|
|
2153
|
+
dataItem: r.dataItem,
|
|
2154
2154
|
...this.getArguments(e)
|
|
2155
2155
|
}
|
|
2156
2156
|
);
|
|
2157
2157
|
}, this.itemChange = (e) => {
|
|
2158
|
-
const
|
|
2158
|
+
const r = this.props.onItemChange;
|
|
2159
2159
|
if (e.field === this.props.expandField || this.props.group && e.field === void 0) {
|
|
2160
2160
|
const n = this.props.onExpandChange;
|
|
2161
2161
|
n && n.call(
|
|
@@ -2169,7 +2169,7 @@ let ce = class extends l.Component {
|
|
|
2169
2169
|
);
|
|
2170
2170
|
return;
|
|
2171
2171
|
}
|
|
2172
|
-
|
|
2172
|
+
r && r.call(
|
|
2173
2173
|
void 0,
|
|
2174
2174
|
{
|
|
2175
2175
|
...this.getArguments(e.syntheticEvent),
|
|
@@ -2192,7 +2192,7 @@ let ce = class extends l.Component {
|
|
|
2192
2192
|
);
|
|
2193
2193
|
}, this.selectionRelease = (e) => {
|
|
2194
2194
|
if (this.props.onSelectionChange) {
|
|
2195
|
-
const
|
|
2195
|
+
const r = {
|
|
2196
2196
|
syntheticEvent: void 0,
|
|
2197
2197
|
target: this,
|
|
2198
2198
|
selectedField: this.props.selectedField || "",
|
|
@@ -2201,78 +2201,99 @@ let ce = class extends l.Component {
|
|
|
2201
2201
|
dataItem: null,
|
|
2202
2202
|
...e
|
|
2203
2203
|
};
|
|
2204
|
-
this.props.onSelectionChange.call(void 0,
|
|
2204
|
+
this.props.onSelectionChange.call(void 0, r);
|
|
2205
2205
|
}
|
|
2206
|
-
}, this.pageChange = (e,
|
|
2206
|
+
}, this.pageChange = (e, r, n) => {
|
|
2207
2207
|
this.raiseDataEvent(
|
|
2208
2208
|
this.props.onPageChange,
|
|
2209
2209
|
{ page: e },
|
|
2210
2210
|
{ skip: e.skip, take: e.take },
|
|
2211
|
-
|
|
2211
|
+
r,
|
|
2212
2212
|
n
|
|
2213
2213
|
);
|
|
2214
2214
|
}, this.pagerPageChange = (e) => {
|
|
2215
2215
|
this.pageChange({ skip: e.skip, take: e.take }, e.syntheticEvent, e.targetEvent);
|
|
2216
|
-
}, this.sortChange = (e,
|
|
2216
|
+
}, this.sortChange = (e, r) => {
|
|
2217
2217
|
this.raiseDataEvent(
|
|
2218
2218
|
this.props.onSortChange,
|
|
2219
2219
|
{ sort: e },
|
|
2220
2220
|
{ sort: e, ...this.props.scrollable === "virtual" ? { skip: 0 } : {} },
|
|
2221
|
-
|
|
2221
|
+
r
|
|
2222
2222
|
);
|
|
2223
|
-
}, this.filterChange = (e,
|
|
2223
|
+
}, this.filterChange = (e, r) => {
|
|
2224
2224
|
this.raiseDataEvent(
|
|
2225
2225
|
this.props.onFilterChange,
|
|
2226
2226
|
{ filter: e },
|
|
2227
2227
|
{ filter: e || void 0, skip: 0 },
|
|
2228
|
-
|
|
2228
|
+
r
|
|
2229
2229
|
);
|
|
2230
|
-
}, this.groupChange = (e,
|
|
2231
|
-
const n =
|
|
2230
|
+
}, this.groupChange = (e, r) => {
|
|
2231
|
+
const n = r.nativeEvent ? r : { nativeEvent: r.nativeEvent || r.originalEvent };
|
|
2232
2232
|
this.raiseDataEvent(
|
|
2233
2233
|
this.props.onGroupChange,
|
|
2234
2234
|
{ group: e },
|
|
2235
2235
|
{ group: e, skip: 0 },
|
|
2236
2236
|
n
|
|
2237
2237
|
);
|
|
2238
|
-
}, this.
|
|
2238
|
+
}, this.onClipboard = (e, r) => {
|
|
2239
|
+
if (this.props.onClipboard) {
|
|
2240
|
+
if (!this.inActiveElement() || !e)
|
|
2241
|
+
return;
|
|
2242
|
+
this.props.onClipboard.call(
|
|
2243
|
+
void 0,
|
|
2244
|
+
{
|
|
2245
|
+
type: e,
|
|
2246
|
+
nativeEvent: r,
|
|
2247
|
+
columns: this._columns,
|
|
2248
|
+
dataItemKey: this.props.dataItemKey || "",
|
|
2249
|
+
...typeof this.props.clipboard != "boolean" ? this.props.clipboard : {}
|
|
2250
|
+
}
|
|
2251
|
+
);
|
|
2252
|
+
}
|
|
2253
|
+
}, this.inActiveElement = () => {
|
|
2254
|
+
var c, h, d;
|
|
2255
|
+
if (!Ie)
|
|
2256
|
+
return !1;
|
|
2257
|
+
const e = gs(this.document), r = e ? e.matches(".k-table-td") ? e : (c = this.document) == null ? void 0 : c.body : (h = this.document) == null ? void 0 : h.body, n = r.closest(".k-grid-container"), a = r && ((d = this._element) == null ? void 0 : d.contains(r));
|
|
2258
|
+
return !!(r && a && n);
|
|
2259
|
+
}, this.onResize = (e, r, n, a, c, h) => {
|
|
2239
2260
|
this.resetTableWidth(), this._shouldUpdateLeftRight = !0, this._resized = !0, this._columnsMutations++, this.props.onColumnResize && this.props.onColumnResize.call(
|
|
2240
2261
|
void 0,
|
|
2241
2262
|
{
|
|
2242
2263
|
columns: this.columns,
|
|
2243
2264
|
nativeEvent: a,
|
|
2244
|
-
targetColumnId:
|
|
2265
|
+
targetColumnId: h,
|
|
2245
2266
|
index: e,
|
|
2246
|
-
newWidth:
|
|
2267
|
+
newWidth: r,
|
|
2247
2268
|
oldWidth: n,
|
|
2248
|
-
end:
|
|
2269
|
+
end: c,
|
|
2249
2270
|
target: this
|
|
2250
2271
|
}
|
|
2251
2272
|
);
|
|
2252
|
-
}, this.reInitVirtualization = B((e,
|
|
2273
|
+
}, this.reInitVirtualization = B((e, r, n, a, c, h) => {
|
|
2253
2274
|
this.vs.reset();
|
|
2254
2275
|
const d = this.getVirtualScroll(this.props);
|
|
2255
|
-
this.vs = new d(
|
|
2256
|
-
}), this.flatData = B((e,
|
|
2276
|
+
this.vs = new d(h);
|
|
2277
|
+
}), this.flatData = B((e, r, n, a, c, h, d) => {
|
|
2257
2278
|
const g = [], m = Ht(
|
|
2258
2279
|
g,
|
|
2259
2280
|
e,
|
|
2260
|
-
|
|
2281
|
+
r,
|
|
2261
2282
|
{ index: n },
|
|
2262
2283
|
a !== void 0,
|
|
2263
|
-
|
|
2284
|
+
c
|
|
2264
2285
|
);
|
|
2265
2286
|
return { flattedData: g, resolvedGroupsCount: m };
|
|
2266
|
-
}), this.rowHeightService = B((e,
|
|
2267
|
-
(e,
|
|
2268
|
-
const a = e.filter((
|
|
2269
|
-
return zt(a, this.columns, { prevId: 0, idPrefix:
|
|
2287
|
+
}), this.rowHeightService = B((e, r, n, a, c) => new bt(r, n, a, c)), this.childrenToArray = B((e) => l.Children.toArray(e)), this.readColumns = B(
|
|
2288
|
+
(e, r, n) => {
|
|
2289
|
+
const a = e.filter((c) => c && c.type && c.type.displayName === "KendoReactGridColumn");
|
|
2290
|
+
return zt(a, this.columns, { prevId: 0, idPrefix: r });
|
|
2270
2291
|
}
|
|
2271
2292
|
), this.mapColumns = B(
|
|
2272
|
-
(e) =>
|
|
2273
|
-
), this.configureColumns = B((e,
|
|
2274
|
-
this.props.selectedField && e.filter((
|
|
2275
|
-
|
|
2293
|
+
(e) => Ss(e)
|
|
2294
|
+
), this.configureColumns = B((e, r, n) => {
|
|
2295
|
+
this.props.selectedField && e.filter((h) => h.field === this.props.selectedField).forEach((h) => {
|
|
2296
|
+
h.width = h.width || "50px", h.cell = h.cell || qs, h.headerCell = h.headerCell || yr;
|
|
2276
2297
|
});
|
|
2277
2298
|
const a = {
|
|
2278
2299
|
id: "",
|
|
@@ -2293,35 +2314,35 @@ let ce = class extends l.Component {
|
|
|
2293
2314
|
ariaColumnIndex: 0,
|
|
2294
2315
|
isAccessible: !0
|
|
2295
2316
|
};
|
|
2296
|
-
let
|
|
2317
|
+
let c = 0;
|
|
2297
2318
|
this.props.expandField && this.props.onExpandChange && this.props.detail && (e.unshift({
|
|
2298
2319
|
...a,
|
|
2299
|
-
cell:
|
|
2320
|
+
cell: ir,
|
|
2300
2321
|
field: this.props.expandField,
|
|
2301
2322
|
headerClassName: "k-hierarchy-cell k-header",
|
|
2302
2323
|
id: z.generateNavigatableId(`${this._columns.length}`, n, "column")
|
|
2303
|
-
}),
|
|
2304
|
-
for (let
|
|
2324
|
+
}), c++);
|
|
2325
|
+
for (let h = 0; h < r; h++)
|
|
2305
2326
|
e.unshift({
|
|
2306
2327
|
...a,
|
|
2307
2328
|
isAccessible: !1,
|
|
2308
|
-
cell:
|
|
2329
|
+
cell: vt,
|
|
2309
2330
|
field: "value",
|
|
2310
2331
|
locked: this.props.lockGroups
|
|
2311
|
-
}),
|
|
2312
|
-
e.slice(
|
|
2313
|
-
}), this.getHeaderRow = B((e,
|
|
2332
|
+
}), c++;
|
|
2333
|
+
e.slice(c).forEach((h) => h.parentIndex >= 0 && (h.parentIndex += c));
|
|
2334
|
+
}), this.getHeaderRow = B((e, r, n, a, c, h, d, g, m, u, b, E) => /* @__PURE__ */ l.createElement(
|
|
2314
2335
|
Ut,
|
|
2315
2336
|
{
|
|
2316
2337
|
cells: this.props.cells,
|
|
2317
2338
|
sort: e,
|
|
2318
|
-
sortable:
|
|
2339
|
+
sortable: r,
|
|
2319
2340
|
sortChange: this.sortChange,
|
|
2320
2341
|
group: n || [],
|
|
2321
2342
|
groupable: a,
|
|
2322
2343
|
groupChange: this.groupChange,
|
|
2323
|
-
filter:
|
|
2324
|
-
filterable:
|
|
2344
|
+
filter: c,
|
|
2345
|
+
filterable: h,
|
|
2325
2346
|
filterOperators: d,
|
|
2326
2347
|
filterChange: this.filterChange,
|
|
2327
2348
|
columnMenu: m,
|
|
@@ -2339,15 +2360,15 @@ let ce = class extends l.Component {
|
|
|
2339
2360
|
containerRef: this.containerRef
|
|
2340
2361
|
}
|
|
2341
2362
|
)), this.resolveTitle = (e) => {
|
|
2342
|
-
const
|
|
2363
|
+
const r = this._columns.find((a) => a.field === e), n = r && (r.title || r.field);
|
|
2343
2364
|
return n === void 0 ? e : n;
|
|
2344
|
-
}, this.getLeafDataItems = () => this._data.filter((e) => e.rowType === "data").map((e) => e.dataItem),
|
|
2365
|
+
}, this.getLeafDataItems = () => this._data.filter((e) => e.rowType === "data").map((e) => e.dataItem), fs(kt), this.showLicenseWatermark = ms(kt);
|
|
2345
2366
|
const s = this.props.groupable === !0 || typeof this.props.groupable == "object" && this.props.groupable.enabled !== !1, o = this.getVirtualScroll(t);
|
|
2346
|
-
this.vs = new o(s || t.rowHeight === void 0 || t.rowHeight === 0), this.dragLogic = new
|
|
2367
|
+
this.vs = new o(s || t.rowHeight === void 0 || t.rowHeight === 0), this.dragLogic = new kr(
|
|
2347
2368
|
this.columnReorder.bind(this),
|
|
2348
2369
|
this.groupReorder.bind(this),
|
|
2349
2370
|
this.columnToGroup.bind(this)
|
|
2350
|
-
), this.columnResize = new
|
|
2371
|
+
), this.columnResize = new vr(this.onResize), this.props.clipboard && (this.clipboardService = new Is(this.onClipboard)), X.onConstructor({
|
|
2351
2372
|
navigatable: !!t.navigatable,
|
|
2352
2373
|
contextStateRef: this.contextStateRef,
|
|
2353
2374
|
navigationStateRef: this.navigationStateRef,
|
|
@@ -2405,7 +2426,7 @@ let ce = class extends l.Component {
|
|
|
2405
2426
|
return this._element;
|
|
2406
2427
|
}
|
|
2407
2428
|
get document() {
|
|
2408
|
-
if (
|
|
2429
|
+
if (Ie)
|
|
2409
2430
|
return this.element && this.element.ownerDocument || document;
|
|
2410
2431
|
}
|
|
2411
2432
|
get _header() {
|
|
@@ -2429,7 +2450,7 @@ let ce = class extends l.Component {
|
|
|
2429
2450
|
rootMargin: "0px",
|
|
2430
2451
|
threshold: 0.9
|
|
2431
2452
|
};
|
|
2432
|
-
this.observer =
|
|
2453
|
+
this.clipboardService && this.clipboardService.addEventListeners(this.document), this.observer = Ie && window.IntersectionObserver && new window.IntersectionObserver(this.handleIntersection, s) || null;
|
|
2433
2454
|
}
|
|
2434
2455
|
/**
|
|
2435
2456
|
* @hidden
|
|
@@ -2455,18 +2476,18 @@ let ce = class extends l.Component {
|
|
|
2455
2476
|
* @hidden
|
|
2456
2477
|
*/
|
|
2457
2478
|
componentWillUnmount() {
|
|
2458
|
-
clearTimeout(this.forceUpdateTimeout);
|
|
2479
|
+
clearTimeout(this.forceUpdateTimeout), this.clipboardService && this.clipboardService.removeEventListeners(this.document);
|
|
2459
2480
|
}
|
|
2460
2481
|
/**
|
|
2461
2482
|
* @hidden
|
|
2462
2483
|
*/
|
|
2463
2484
|
render() {
|
|
2464
|
-
var
|
|
2485
|
+
var rt;
|
|
2465
2486
|
let t = this.props.total || 0;
|
|
2466
2487
|
const s = z.getIdPrefix(this.navigationStateRef);
|
|
2467
2488
|
let o = [];
|
|
2468
2489
|
Array.isArray(this.props.data) ? (o = this.props.data, t = t || this.props.data.length) : this.props.data && (o = this.props.data.data, t = t || this.props.data.total);
|
|
2469
|
-
const e = typeof this.props.groupable == "object" && this.props.groupable.footer || "none", { resolvedGroupsCount:
|
|
2490
|
+
const e = typeof this.props.groupable == "object" && this.props.groupable.footer || "none", { resolvedGroupsCount: r, flattedData: n } = this.flatData(
|
|
2470
2491
|
o,
|
|
2471
2492
|
e,
|
|
2472
2493
|
this.props.skip || 0,
|
|
@@ -2478,11 +2499,11 @@ let ce = class extends l.Component {
|
|
|
2478
2499
|
this._data = n;
|
|
2479
2500
|
const a = this.props.groupable === !0 || typeof this.props.groupable == "object" && this.props.groupable.enabled !== !1;
|
|
2480
2501
|
this.columnResize.resizable = this.props.resizable || !1, this.dragLogic.reorderable = this.props.reorderable || !1, this.dragLogic.groupable = a;
|
|
2481
|
-
const
|
|
2502
|
+
const c = this.props.selectable && this.props.selectable.drag ? "none" : void 0;
|
|
2482
2503
|
this.initializeVirtualization(t, a);
|
|
2483
|
-
const
|
|
2484
|
-
this.initColumns(
|
|
2485
|
-
const d =
|
|
2504
|
+
const h = this.childrenToArray(this.props.children);
|
|
2505
|
+
this.initColumns(h, r);
|
|
2506
|
+
const d = h.map((f) => f && f.type && f.type.displayName === "KendoReactGridToolbar" ? l.cloneElement(f, { ...f.props, ariaControls: this._gridId }) : null), g = h.filter((f) => f && f.type && f.type.displayName === "KendoReactGridNoRecords"), m = h.filter((f) => f && f.type && f.type.displayName === "KendoReactGridStatusBar"), u = this._columns.filter((f) => f.children.length === 0), b = a && /* @__PURE__ */ l.createElement(
|
|
2486
2507
|
es,
|
|
2487
2508
|
{
|
|
2488
2509
|
group: this.props.group || [],
|
|
@@ -2495,8 +2516,8 @@ let ce = class extends l.Component {
|
|
|
2495
2516
|
ariaControls: this._gridId,
|
|
2496
2517
|
onContextMenu: this.onContextMenu
|
|
2497
2518
|
}
|
|
2498
|
-
), { sort: E, sortable: C, group: x, filter:
|
|
2499
|
-
|
|
2519
|
+
), { sort: E, sortable: C, group: x, filter: S, filterable: v, filterOperators: _ = Ct, headerCellRender: D, columnMenu: de } = this.props, Y = /* @__PURE__ */ l.createElement(
|
|
2520
|
+
nr,
|
|
2500
2521
|
{
|
|
2501
2522
|
size: this.props.size,
|
|
2502
2523
|
columnResize: this.columnResize,
|
|
@@ -2510,8 +2531,8 @@ let ce = class extends l.Component {
|
|
|
2510
2531
|
C,
|
|
2511
2532
|
x,
|
|
2512
2533
|
a,
|
|
2513
|
-
|
|
2514
|
-
|
|
2534
|
+
S,
|
|
2535
|
+
v,
|
|
2515
2536
|
_,
|
|
2516
2537
|
D,
|
|
2517
2538
|
de,
|
|
@@ -2538,44 +2559,44 @@ let ce = class extends l.Component {
|
|
|
2538
2559
|
"col",
|
|
2539
2560
|
{
|
|
2540
2561
|
key: w.toString(),
|
|
2541
|
-
width:
|
|
2562
|
+
width: ye(f)
|
|
2542
2563
|
}
|
|
2543
2564
|
))
|
|
2544
2565
|
}
|
|
2545
|
-
), $ = this.vs && this.vs.container && this.vs.container.scrollLeft || 0, F = parseFloat(((this.props.style || {}).width || "").toString()), { colSpans:
|
|
2566
|
+
), $ = this.vs && this.vs.container && this.vs.container.scrollLeft || 0, F = parseFloat(((this.props.style || {}).width || "").toString()), { colSpans: ve, hiddenColumns: pe } = ys({
|
|
2546
2567
|
enabled: this.props.columnVirtualization,
|
|
2547
2568
|
columns: u,
|
|
2548
2569
|
tableViewPortWidth: F,
|
|
2549
2570
|
scrollLeft: $
|
|
2550
|
-
}),
|
|
2571
|
+
}), ke = (f, w, R) => {
|
|
2551
2572
|
let j = !1;
|
|
2552
|
-
const
|
|
2573
|
+
const K = this.props.selectedField ? T(this.props.selectedField, f.dataItem) : void 0;
|
|
2553
2574
|
return {
|
|
2554
|
-
row: u.map((
|
|
2575
|
+
row: u.map((I, N) => {
|
|
2555
2576
|
if (pe[N])
|
|
2556
2577
|
return null;
|
|
2557
|
-
const ee =
|
|
2578
|
+
const ee = I.id ? I.id : N, te = `${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 } : {};
|
|
2558
2579
|
let A = !1;
|
|
2559
|
-
if (
|
|
2580
|
+
if (I.editable && this.props.editField) {
|
|
2560
2581
|
const H = T(this.props.editField, f.dataItem);
|
|
2561
|
-
H && (H === !0 || H ===
|
|
2582
|
+
H && (H === !0 || H === I.field) && (j = !0, A = !0);
|
|
2562
2583
|
}
|
|
2563
|
-
let
|
|
2584
|
+
let Se = I.cell || A && lr || Er;
|
|
2564
2585
|
return /* @__PURE__ */ l.createElement(
|
|
2565
|
-
|
|
2586
|
+
Se,
|
|
2566
2587
|
{
|
|
2567
2588
|
onContextMenu: this.onContextMenu,
|
|
2568
2589
|
key: ee,
|
|
2569
2590
|
locked: this.props.lockGroups,
|
|
2570
2591
|
id: z.generateNavigatableId(`${w}-${String(N)}`, s),
|
|
2571
|
-
colSpan:
|
|
2592
|
+
colSpan: ve[N],
|
|
2572
2593
|
dataItem: f.dataItem,
|
|
2573
|
-
field:
|
|
2574
|
-
editor:
|
|
2575
|
-
format:
|
|
2594
|
+
field: I.field,
|
|
2595
|
+
editor: I.editor,
|
|
2596
|
+
format: I.format,
|
|
2576
2597
|
className: te,
|
|
2577
2598
|
render: this.props.cellRender,
|
|
2578
|
-
cells: be(this.props.cells,
|
|
2599
|
+
cells: be(this.props.cells, I.cells),
|
|
2579
2600
|
onChange: this.itemChange,
|
|
2580
2601
|
selectionChange: this.props.onSelectionChange ? (H) => {
|
|
2581
2602
|
this.selectionChange({ event: H, dataItem: f.dataItem, dataIndex: R, columnIndex: N });
|
|
@@ -2587,13 +2608,13 @@ let ce = class extends l.Component {
|
|
|
2587
2608
|
expanded: f.expanded,
|
|
2588
2609
|
dataIndex: f.dataIndex,
|
|
2589
2610
|
style: P,
|
|
2590
|
-
ariaColumnIndex:
|
|
2591
|
-
isSelected: Array.isArray(
|
|
2611
|
+
ariaColumnIndex: I.ariaColumnIndex,
|
|
2612
|
+
isSelected: Array.isArray(K) && K.indexOf(N) > -1
|
|
2592
2613
|
}
|
|
2593
2614
|
);
|
|
2594
2615
|
}),
|
|
2595
2616
|
isInEdit: j,
|
|
2596
|
-
isSelected: typeof
|
|
2617
|
+
isSelected: typeof K == "boolean" && K
|
|
2597
2618
|
};
|
|
2598
2619
|
};
|
|
2599
2620
|
let J = 0;
|
|
@@ -2605,24 +2626,24 @@ let ce = class extends l.Component {
|
|
|
2605
2626
|
else
|
|
2606
2627
|
break;
|
|
2607
2628
|
}
|
|
2608
|
-
const
|
|
2609
|
-
let
|
|
2629
|
+
const Xe = (f) => f >= this._data.length - J;
|
|
2630
|
+
let Ye = this.vs.realSkip || 0;
|
|
2610
2631
|
const Q = [], Ee = this._columnsMap.length + (this.props.filterable ? 1 : 0) + 1;
|
|
2611
2632
|
let Z = 0;
|
|
2612
2633
|
if (this._data.length) {
|
|
2613
2634
|
let f = -1, w = 0;
|
|
2614
2635
|
(this._slicedData || this._data).forEach((R, j) => {
|
|
2615
|
-
R.rowType === "data" && (
|
|
2616
|
-
const
|
|
2636
|
+
R.rowType === "data" && (Ye++, f++);
|
|
2637
|
+
const K = Ye % 2 === 0, I = this.props.dataItemKey && we(this.props.dataItemKey)(R.dataItem), N = j + (this.vs.realSkip || 0), ee = I || "ai" + N, te = ee + "_1", P = ke(R, ee, f);
|
|
2617
2638
|
if (Z = N + Ee + w, Q.push(/* @__PURE__ */ l.createElement(
|
|
2618
|
-
|
|
2639
|
+
Sr,
|
|
2619
2640
|
{
|
|
2620
2641
|
key: ee,
|
|
2621
2642
|
dataItem: R.dataItem,
|
|
2622
|
-
isAltRow:
|
|
2643
|
+
isAltRow: K,
|
|
2623
2644
|
isInEdit: P.isInEdit,
|
|
2624
2645
|
rowType: R.rowType,
|
|
2625
|
-
isHidden:
|
|
2646
|
+
isHidden: Xe(j),
|
|
2626
2647
|
onClick: (A) => this.rowClick(A, R),
|
|
2627
2648
|
onDoubleClick: (A) => this.rowDblClick(A, R),
|
|
2628
2649
|
selectedField: this.props.selectedField,
|
|
@@ -2642,21 +2663,21 @@ let ce = class extends l.Component {
|
|
|
2642
2663
|
key: te,
|
|
2643
2664
|
className: y(
|
|
2644
2665
|
"k-table-row",
|
|
2645
|
-
|
|
2666
|
+
K ? "k-detail-row k-table-alt-row k-alt" : "k-detail-row"
|
|
2646
2667
|
),
|
|
2647
|
-
style: { visibility:
|
|
2668
|
+
style: { visibility: Xe(j) ? "hidden" : "", height: this.props.detailRowHeight },
|
|
2648
2669
|
role: "row",
|
|
2649
2670
|
"aria-rowindex": Z
|
|
2650
2671
|
},
|
|
2651
|
-
this.props.group && this.props.group.map((
|
|
2652
|
-
var
|
|
2653
|
-
const se = (
|
|
2672
|
+
this.props.group && this.props.group.map((Se, H) => {
|
|
2673
|
+
var it;
|
|
2674
|
+
const se = (it = P == null ? void 0 : P.row[H]) == null ? void 0 : it.props.style, ps = se ? this.isRtl ? { left: se.right, right: se.left } : { left: se.left, right: se.right } : {};
|
|
2654
2675
|
return /* @__PURE__ */ l.createElement(
|
|
2655
|
-
|
|
2676
|
+
vt,
|
|
2656
2677
|
{
|
|
2657
2678
|
id: "",
|
|
2658
2679
|
dataIndex: R.dataIndex,
|
|
2659
|
-
field:
|
|
2680
|
+
field: Se.field,
|
|
2660
2681
|
dataItem: R.dataItem,
|
|
2661
2682
|
key: H,
|
|
2662
2683
|
style: ps,
|
|
@@ -2669,13 +2690,13 @@ let ce = class extends l.Component {
|
|
|
2669
2690
|
);
|
|
2670
2691
|
}),
|
|
2671
2692
|
this.props.expandField && /* @__PURE__ */ l.createElement(
|
|
2672
|
-
|
|
2693
|
+
Dr,
|
|
2673
2694
|
{
|
|
2674
2695
|
id: z.generateNavigatableId(`${te}-dhcell`, s)
|
|
2675
2696
|
}
|
|
2676
2697
|
),
|
|
2677
2698
|
/* @__PURE__ */ l.createElement(
|
|
2678
|
-
|
|
2699
|
+
Nr,
|
|
2679
2700
|
{
|
|
2680
2701
|
onContextMenu: this.onContextMenu,
|
|
2681
2702
|
dataItem: R.dataItem,
|
|
@@ -2690,36 +2711,36 @@ let ce = class extends l.Component {
|
|
|
2690
2711
|
}
|
|
2691
2712
|
});
|
|
2692
2713
|
} else
|
|
2693
|
-
Q.push(/* @__PURE__ */ l.createElement("tr", { key: "no-records", className: "k-table-row k-grid-norecords", role: "row", "aria-rowindex": Ee }, /* @__PURE__ */ l.createElement("td", { className: "k-table-td", colSpan: u.length, role: "gridcell" }, g.length ? g : /* @__PURE__ */ l.createElement(
|
|
2694
|
-
const
|
|
2714
|
+
Q.push(/* @__PURE__ */ l.createElement("tr", { key: "no-records", className: "k-table-row k-grid-norecords", role: "row", "aria-rowindex": Ee }, /* @__PURE__ */ l.createElement("td", { className: "k-table-td", colSpan: u.length, role: "gridcell" }, g.length ? g : /* @__PURE__ */ l.createElement($e, null))));
|
|
2715
|
+
const Je = {
|
|
2695
2716
|
size: this.props.size,
|
|
2696
2717
|
onPageChange: this.pagerPageChange,
|
|
2697
2718
|
total: t,
|
|
2698
2719
|
dir: this.isRtl ? "rtl" : void 0,
|
|
2699
2720
|
skip: this.vs.propsSkip || 0,
|
|
2700
2721
|
take: (this.props.take !== void 0 ? this.props.take : this.props.pageSize) || 10,
|
|
2701
|
-
messagesMap:
|
|
2702
|
-
...
|
|
2703
|
-
},
|
|
2722
|
+
messagesMap: rr,
|
|
2723
|
+
...Fr(this.props.pageable || {})
|
|
2724
|
+
}, Qe = this.props.pager ? /* @__PURE__ */ l.createElement(this.props.pager, { ...Je }) : /* @__PURE__ */ l.createElement(ws, { className: "k-grid-pager", ...Je }), hs = (f) => this.props.sort && this.props.sort.filter((w) => w.field === f).length > 0, ds = (f, w) => /* @__PURE__ */ l.createElement(
|
|
2704
2725
|
"col",
|
|
2705
2726
|
{
|
|
2706
2727
|
key: w.toString(),
|
|
2707
|
-
width:
|
|
2728
|
+
width: ye(f)
|
|
2708
2729
|
}
|
|
2709
|
-
),
|
|
2730
|
+
), Ze = (rt = this.props.cells) != null && rt.footerCell || this._columns.some(
|
|
2710
2731
|
(f) => {
|
|
2711
2732
|
var w;
|
|
2712
2733
|
return !!(f.footerCell || (w = f.cells) != null && w.footerCell);
|
|
2713
2734
|
}
|
|
2714
2735
|
) ? /* @__PURE__ */ l.createElement(
|
|
2715
|
-
|
|
2736
|
+
mr,
|
|
2716
2737
|
{
|
|
2717
2738
|
size: this.props.size,
|
|
2718
2739
|
columnResize: this.columnResize,
|
|
2719
2740
|
staticHeaders: this.props.scrollable !== "none",
|
|
2720
2741
|
ref: (f) => this._footer = f,
|
|
2721
2742
|
row: /* @__PURE__ */ l.createElement(
|
|
2722
|
-
|
|
2743
|
+
wr,
|
|
2723
2744
|
{
|
|
2724
2745
|
cells: this.props.cells,
|
|
2725
2746
|
columns: this._columns,
|
|
@@ -2729,7 +2750,7 @@ let ce = class extends l.Component {
|
|
|
2729
2750
|
),
|
|
2730
2751
|
cols: u.map(ds)
|
|
2731
2752
|
}
|
|
2732
|
-
) : null,
|
|
2753
|
+
) : null, et = /* @__PURE__ */ l.createElement(
|
|
2733
2754
|
"colgroup",
|
|
2734
2755
|
{
|
|
2735
2756
|
ref: (f) => {
|
|
@@ -2741,14 +2762,14 @@ let ce = class extends l.Component {
|
|
|
2741
2762
|
"col",
|
|
2742
2763
|
{
|
|
2743
2764
|
key: w.toString(),
|
|
2744
|
-
className:
|
|
2745
|
-
width:
|
|
2765
|
+
className: hs(f.field) ? "k-sorted" : void 0,
|
|
2766
|
+
width: ye(f)
|
|
2746
2767
|
}
|
|
2747
2768
|
)
|
|
2748
2769
|
)
|
|
2749
|
-
),
|
|
2770
|
+
), tt = this.dragLogic.reorderable || this.dragLogic.groupable, st = this.props.columnVirtualization ? "block" : "table";
|
|
2750
2771
|
if (this.props.scrollable === "none")
|
|
2751
|
-
return /* @__PURE__ */ l.createElement(
|
|
2772
|
+
return /* @__PURE__ */ l.createElement(Re.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ l.createElement(
|
|
2752
2773
|
"div",
|
|
2753
2774
|
{
|
|
2754
2775
|
id: this.props.id,
|
|
@@ -2757,7 +2778,7 @@ let ce = class extends l.Component {
|
|
|
2757
2778
|
"k-grid",
|
|
2758
2779
|
{
|
|
2759
2780
|
"k-grid-md": !this.props.size,
|
|
2760
|
-
[`k-grid-${
|
|
2781
|
+
[`k-grid-${V.sizeMap[this.props.size] || this.props.size}`]: this.props.size
|
|
2761
2782
|
},
|
|
2762
2783
|
this.props.className
|
|
2763
2784
|
),
|
|
@@ -2767,12 +2788,12 @@ let ce = class extends l.Component {
|
|
|
2767
2788
|
"aria-label": this.props.ariaLabel,
|
|
2768
2789
|
onKeyDown: this.onKeyDown,
|
|
2769
2790
|
onFocus: this.onFocus,
|
|
2770
|
-
...
|
|
2791
|
+
...ct
|
|
2771
2792
|
},
|
|
2772
2793
|
d,
|
|
2773
2794
|
b,
|
|
2774
2795
|
/* @__PURE__ */ l.createElement(
|
|
2775
|
-
|
|
2796
|
+
ht,
|
|
2776
2797
|
{
|
|
2777
2798
|
selectable: this.props.selectable,
|
|
2778
2799
|
onRelease: this.selectionRelease,
|
|
@@ -2785,20 +2806,20 @@ let ce = class extends l.Component {
|
|
|
2785
2806
|
{
|
|
2786
2807
|
className: y(
|
|
2787
2808
|
"k-table k-grid-table",
|
|
2788
|
-
{ [`k-table-${
|
|
2809
|
+
{ [`k-table-${V.sizeMap[this.props.size] || this.props.size}`]: this.props.size }
|
|
2789
2810
|
),
|
|
2790
|
-
style: { userSelect:
|
|
2811
|
+
style: { userSelect: c, display: st }
|
|
2791
2812
|
},
|
|
2792
|
-
|
|
2813
|
+
et,
|
|
2793
2814
|
Y,
|
|
2794
2815
|
/* @__PURE__ */ l.createElement("tbody", { role: "rowgroup", className: "k-table-tbody", ...dt }, Q),
|
|
2795
|
-
|
|
2816
|
+
Ze
|
|
2796
2817
|
)
|
|
2797
2818
|
),
|
|
2798
|
-
|
|
2799
|
-
), m, this.props.pageable &&
|
|
2819
|
+
tt && /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(pt, { ref: this.dragLogic.refDropElementClue }), /* @__PURE__ */ l.createElement(ut, { ref: this.dragLogic.refDragElementClue }))
|
|
2820
|
+
), m, this.props.pageable && Qe);
|
|
2800
2821
|
let ue = this.props.style || {};
|
|
2801
|
-
return this.props.scrollable === "virtual" && (ue.height || (ue = Object.assign({}, ue, { height: "450px" }))), /* @__PURE__ */ l.createElement(
|
|
2822
|
+
return this.props.scrollable === "virtual" && (ue.height || (ue = Object.assign({}, ue, { height: "450px" }))), /* @__PURE__ */ l.createElement(Re.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ l.createElement(
|
|
2802
2823
|
"div",
|
|
2803
2824
|
{
|
|
2804
2825
|
id: this.props.id,
|
|
@@ -2807,7 +2828,7 @@ let ce = class extends l.Component {
|
|
|
2807
2828
|
"k-grid",
|
|
2808
2829
|
{
|
|
2809
2830
|
"k-grid-md": !this.props.size,
|
|
2810
|
-
[`k-grid-${
|
|
2831
|
+
[`k-grid-${V.sizeMap[this.props.size] || this.props.size}`]: this.props.size,
|
|
2811
2832
|
"k-grid-virtual": this.props.scrollable === "virtual"
|
|
2812
2833
|
},
|
|
2813
2834
|
this.props.className
|
|
@@ -2818,7 +2839,7 @@ let ce = class extends l.Component {
|
|
|
2818
2839
|
"aria-label": this.props.ariaLabel,
|
|
2819
2840
|
onKeyDown: this.onKeyDown,
|
|
2820
2841
|
onFocus: this.onFocus,
|
|
2821
|
-
...
|
|
2842
|
+
...ct
|
|
2822
2843
|
},
|
|
2823
2844
|
d,
|
|
2824
2845
|
b,
|
|
@@ -2841,7 +2862,7 @@ let ce = class extends l.Component {
|
|
|
2841
2862
|
role: "presentation"
|
|
2842
2863
|
},
|
|
2843
2864
|
/* @__PURE__ */ l.createElement("div", { className: "k-grid-table-wrap", role: "presentation" }, /* @__PURE__ */ l.createElement(
|
|
2844
|
-
|
|
2865
|
+
ht,
|
|
2845
2866
|
{
|
|
2846
2867
|
selectable: this.props.selectable,
|
|
2847
2868
|
onRelease: this.selectionRelease,
|
|
@@ -2856,13 +2877,13 @@ let ce = class extends l.Component {
|
|
|
2856
2877
|
"k-table k-grid-table",
|
|
2857
2878
|
{
|
|
2858
2879
|
"k-table-md": !this.props.size,
|
|
2859
|
-
[`k-table-${
|
|
2880
|
+
[`k-table-${V.sizeMap[this.props.size] || this.props.size}`]: this.props.size
|
|
2860
2881
|
}
|
|
2861
2882
|
),
|
|
2862
2883
|
role: "presentation",
|
|
2863
|
-
style: { userSelect:
|
|
2884
|
+
style: { userSelect: c, display: st }
|
|
2864
2885
|
},
|
|
2865
|
-
|
|
2886
|
+
et,
|
|
2866
2887
|
/* @__PURE__ */ l.createElement(
|
|
2867
2888
|
"tbody",
|
|
2868
2889
|
{
|
|
@@ -2882,21 +2903,21 @@ let ce = class extends l.Component {
|
|
|
2882
2903
|
}
|
|
2883
2904
|
))
|
|
2884
2905
|
)),
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
this.showLicenseWatermark && /* @__PURE__ */ l.createElement(
|
|
2906
|
+
Ze,
|
|
2907
|
+
tt && /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(pt, { ref: this.dragLogic.refDropElementClue }), /* @__PURE__ */ l.createElement(ut, { ref: this.dragLogic.refDragElementClue })),
|
|
2908
|
+
this.showLicenseWatermark && /* @__PURE__ */ l.createElement(Cs, null)
|
|
2888
2909
|
),
|
|
2889
2910
|
m,
|
|
2890
|
-
this.props.pageable &&
|
|
2911
|
+
this.props.pageable && Qe
|
|
2891
2912
|
));
|
|
2892
2913
|
}
|
|
2893
2914
|
selectionChange(t) {
|
|
2894
2915
|
if (this.props.onSelectionChange) {
|
|
2895
|
-
const { event: s, dataItem: o, dataIndex: e, columnIndex:
|
|
2916
|
+
const { event: s, dataItem: o, dataIndex: e, columnIndex: r } = t, { mode: n, cell: a } = at(this.props.selectable), c = {
|
|
2896
2917
|
...this.getArguments(s.syntheticEvent),
|
|
2897
2918
|
dataItem: o,
|
|
2898
|
-
startColIndex:
|
|
2899
|
-
endColIndex:
|
|
2919
|
+
startColIndex: r,
|
|
2920
|
+
endColIndex: r,
|
|
2900
2921
|
startRowIndex: e,
|
|
2901
2922
|
endRowIndex: e,
|
|
2902
2923
|
dataItems: this.getLeafDataItems(),
|
|
@@ -2910,20 +2931,20 @@ let ce = class extends l.Component {
|
|
|
2910
2931
|
componentId: this._gridId,
|
|
2911
2932
|
selectedField: this.props.selectedField || ""
|
|
2912
2933
|
};
|
|
2913
|
-
this.props.onSelectionChange.call(void 0,
|
|
2934
|
+
this.props.onSelectionChange.call(void 0, c);
|
|
2914
2935
|
}
|
|
2915
2936
|
}
|
|
2916
|
-
raiseDataEvent(t, s, o, e,
|
|
2937
|
+
raiseDataEvent(t, s, o, e, r) {
|
|
2917
2938
|
const n = this.props.onDataStateChange;
|
|
2918
2939
|
if (t) {
|
|
2919
|
-
const a = { ...this.getArguments(e), ...s, targetEvent:
|
|
2940
|
+
const a = { ...this.getArguments(e), ...s, targetEvent: r };
|
|
2920
2941
|
t.call(void 0, a);
|
|
2921
2942
|
} else
|
|
2922
2943
|
n && n.call(
|
|
2923
2944
|
void 0,
|
|
2924
2945
|
{
|
|
2925
2946
|
...this.getArguments(e),
|
|
2926
|
-
targetEvent:
|
|
2947
|
+
targetEvent: r || {},
|
|
2927
2948
|
dataState: {
|
|
2928
2949
|
...this.getDataState(),
|
|
2929
2950
|
...o
|
|
@@ -2932,20 +2953,20 @@ let ce = class extends l.Component {
|
|
|
2932
2953
|
);
|
|
2933
2954
|
}
|
|
2934
2955
|
columnReorder(t, s, o) {
|
|
2935
|
-
const e = this._columns[t],
|
|
2956
|
+
const e = this._columns[t], r = e.depth, n = (d) => {
|
|
2936
2957
|
do
|
|
2937
2958
|
d++;
|
|
2938
|
-
while (d < this._columns.length && this._columns[d].depth >
|
|
2959
|
+
while (d < this._columns.length && this._columns[d].depth > r);
|
|
2939
2960
|
return d;
|
|
2940
2961
|
}, a = this._columns.splice(t, n(t) - t);
|
|
2941
2962
|
this._columns.splice(t < s ? n(s - a.length) : s, 0, ...a), this._columns.filter((d) => d.declarationIndex >= 0).forEach((d, g) => d.orderIndex = g), this._columnsMutations++;
|
|
2942
|
-
const
|
|
2943
|
-
|
|
2944
|
-
const
|
|
2963
|
+
const c = this._columns[t].locked && this._columns[s].locked;
|
|
2964
|
+
Rs(this._columnsMap, this._columns, c || this._shouldUpdateLeftRight), Fs(this._columnsMap, this._columns, c || this._shouldUpdateLeftRight), this._resized && (this._shouldUpdateLeftRight = !1, this._resized = !1);
|
|
2965
|
+
const h = this.columns;
|
|
2945
2966
|
if (this.forceUpdate(), this.props.onColumnReorder) {
|
|
2946
2967
|
const d = {
|
|
2947
2968
|
target: this,
|
|
2948
|
-
columns:
|
|
2969
|
+
columns: h,
|
|
2949
2970
|
columnId: e.id,
|
|
2950
2971
|
nativeEvent: o
|
|
2951
2972
|
};
|
|
@@ -2962,8 +2983,8 @@ let ce = class extends l.Component {
|
|
|
2962
2983
|
const e = this._columns[t].field;
|
|
2963
2984
|
if (!e)
|
|
2964
2985
|
return;
|
|
2965
|
-
const
|
|
2966
|
-
|
|
2986
|
+
const r = (this.props.group || []).slice();
|
|
2987
|
+
r.splice(s, 0, { field: e }), this.groupChange(r, o);
|
|
2967
2988
|
}
|
|
2968
2989
|
resetTableWidth() {
|
|
2969
2990
|
let t = 0;
|
|
@@ -2980,7 +3001,7 @@ let ce = class extends l.Component {
|
|
|
2980
3001
|
}
|
|
2981
3002
|
initColumns(t, s) {
|
|
2982
3003
|
const o = z.getIdPrefix(this.navigationStateRef);
|
|
2983
|
-
this._columns = this.readColumns(t, o, this._columnsMutations), this._columns.length === 0 && (this._columns =
|
|
3004
|
+
this._columns = this.readColumns(t, o, this._columnsMutations), this._columns.length === 0 && (this._columns = Ks(this.props.data, this.props.group, this.props.expandField, { prevId: 0, idPrefix: o })), this.configureColumns(this._columns, s, o), this._columnsMap = this.mapColumns(this._columns), this.columnResize.columns = this._columns, this.dragLogic.columns = this._columns;
|
|
2984
3005
|
}
|
|
2985
3006
|
getDataState() {
|
|
2986
3007
|
return {
|
|
@@ -2999,11 +3020,11 @@ let ce = class extends l.Component {
|
|
|
2999
3020
|
};
|
|
3000
3021
|
}
|
|
3001
3022
|
};
|
|
3002
|
-
|
|
3003
|
-
|
|
3023
|
+
he.displayName = "KendoReactGrid";
|
|
3024
|
+
he.defaultProps = {
|
|
3004
3025
|
// never use this
|
|
3005
3026
|
};
|
|
3006
|
-
|
|
3027
|
+
he.propTypes = {
|
|
3007
3028
|
data: p.oneOfType([
|
|
3008
3029
|
p.array,
|
|
3009
3030
|
p.shape({
|
|
@@ -3080,7 +3101,7 @@ ce.propTypes = {
|
|
|
3080
3101
|
navigatable: p.bool,
|
|
3081
3102
|
size: p.oneOf(["small", "medium"])
|
|
3082
3103
|
};
|
|
3083
|
-
|
|
3104
|
+
he.contextType = Re;
|
|
3084
3105
|
class xe extends l.Component {
|
|
3085
3106
|
/**
|
|
3086
3107
|
* @hidden
|
|
@@ -3104,7 +3125,7 @@ class ae extends l.Component {
|
|
|
3104
3125
|
*/
|
|
3105
3126
|
render() {
|
|
3106
3127
|
const { title: t, iconClass: s, svgIcon: o, selected: e } = this.props;
|
|
3107
|
-
return /* @__PURE__ */ l.createElement("div", { onClick: this.props.onClick, className: `k-columnmenu-item ${e ? "k-selected" : ""}` }, (s || o) && /* @__PURE__ */ l.createElement(O, { name: s &&
|
|
3128
|
+
return /* @__PURE__ */ l.createElement("div", { onClick: this.props.onClick, className: `k-columnmenu-item ${e ? "k-selected" : ""}` }, (s || o) && /* @__PURE__ */ l.createElement(O, { name: s && bs(s), icon: o }), t);
|
|
3108
3129
|
}
|
|
3109
3130
|
}
|
|
3110
3131
|
class ts extends l.Component {
|
|
@@ -3114,7 +3135,7 @@ class ts extends l.Component {
|
|
|
3114
3135
|
const { column: s } = this.props;
|
|
3115
3136
|
if (!s.field)
|
|
3116
3137
|
return;
|
|
3117
|
-
const o = (this.props.group || []).slice(), e = o.findIndex((
|
|
3138
|
+
const o = (this.props.group || []).slice(), e = o.findIndex((r) => r.field === s.field);
|
|
3118
3139
|
e > -1 ? o.splice(e, 1) : o.push({
|
|
3119
3140
|
field: s.field
|
|
3120
3141
|
}), this.props.onGroupChange(o, t);
|
|
@@ -3126,13 +3147,13 @@ class ts extends l.Component {
|
|
|
3126
3147
|
* @hidden
|
|
3127
3148
|
*/
|
|
3128
3149
|
render() {
|
|
3129
|
-
const { group: t, column: s } = this.props, o = G(this), e = !!(t && s.field && t.find((n) => n.field === s.field)),
|
|
3150
|
+
const { group: t, column: s } = this.props, o = G(this), e = !!(t && s.field && t.find((n) => n.field === s.field)), r = e ? _t : Ot;
|
|
3130
3151
|
return /* @__PURE__ */ l.createElement(xe, null, /* @__PURE__ */ l.createElement(
|
|
3131
3152
|
ae,
|
|
3132
3153
|
{
|
|
3133
|
-
title: o.toLanguageString(
|
|
3154
|
+
title: o.toLanguageString(r, k[r]),
|
|
3134
3155
|
iconClass: e ? "k-i-ungroup" : "k-i-group",
|
|
3135
|
-
svgIcon: e ?
|
|
3156
|
+
svgIcon: e ? _s : Os,
|
|
3136
3157
|
onClick: this.onGroupClick
|
|
3137
3158
|
}
|
|
3138
3159
|
));
|
|
@@ -3140,7 +3161,7 @@ class ts extends l.Component {
|
|
|
3140
3161
|
}
|
|
3141
3162
|
Dt(ts);
|
|
3142
3163
|
M(ts);
|
|
3143
|
-
const ss = "asc", rs = "desc",
|
|
3164
|
+
const ss = "asc", rs = "desc", Tr = {
|
|
3144
3165
|
true: {
|
|
3145
3166
|
asc: { asc: "", desc: "desc" },
|
|
3146
3167
|
desc: { asc: "asc", desc: "" },
|
|
@@ -3151,8 +3172,8 @@ const ss = "asc", rs = "desc", Nr = {
|
|
|
3151
3172
|
desc: { asc: "asc", desc: "desc" },
|
|
3152
3173
|
"": { asc: "asc", desc: "desc" }
|
|
3153
3174
|
}
|
|
3154
|
-
}, is = (
|
|
3155
|
-
class
|
|
3175
|
+
}, is = (i, t) => t ? t.findIndex((s) => s.field === i) : -1, os = (i, t) => !!(t && i > -1 && t[i].dir === ss), ls = (i, t) => !!(t && i > -1 && t[i].dir === rs);
|
|
3176
|
+
class je extends l.Component {
|
|
3156
3177
|
constructor() {
|
|
3157
3178
|
super(...arguments), this.onAscClick = (t) => {
|
|
3158
3179
|
this.onSort(t, ss), this.props.onCloseMenu && this.props.onCloseMenu();
|
|
@@ -3161,8 +3182,8 @@ class $e extends l.Component {
|
|
|
3161
3182
|
}, this.onSort = (t, s) => {
|
|
3162
3183
|
if (t.preventDefault(), !this.props.onSortChange)
|
|
3163
3184
|
return;
|
|
3164
|
-
const { column: o, sortable: e, sort:
|
|
3165
|
-
|
|
3185
|
+
const { column: o, sortable: e, sort: r } = this.props, { allowUnsort: n, mode: a } = Kt(e || !1, !1), c = (r || []).filter((g) => g.field === o.field)[0], h = Tr[n][c && c.dir || ""][s], d = a === "single" ? [] : (this.props.sort || []).filter((g) => g.field !== o.field);
|
|
3186
|
+
h !== "" && o.field && d.push({ field: o.field, dir: h }), this.props.onSortChange(d, t);
|
|
3166
3187
|
};
|
|
3167
3188
|
}
|
|
3168
3189
|
/**
|
|
@@ -3173,16 +3194,16 @@ class $e extends l.Component {
|
|
|
3173
3194
|
return /* @__PURE__ */ l.createElement(xe, null, /* @__PURE__ */ l.createElement(
|
|
3174
3195
|
ae,
|
|
3175
3196
|
{
|
|
3176
|
-
title: e.toLanguageString(
|
|
3197
|
+
title: e.toLanguageString(Ge, k[Ge]),
|
|
3177
3198
|
iconClass: "k-i-sort-asc-sm",
|
|
3178
|
-
svgIcon:
|
|
3199
|
+
svgIcon: Ke,
|
|
3179
3200
|
selected: os(o, t),
|
|
3180
3201
|
onClick: this.onAscClick
|
|
3181
3202
|
}
|
|
3182
3203
|
), /* @__PURE__ */ l.createElement(
|
|
3183
3204
|
ae,
|
|
3184
3205
|
{
|
|
3185
|
-
title: e.toLanguageString(
|
|
3206
|
+
title: e.toLanguageString(Me, k[Me]),
|
|
3186
3207
|
iconClass: "k-i-sort-desc-sm",
|
|
3187
3208
|
svgIcon: Ve,
|
|
3188
3209
|
selected: ls(o, t),
|
|
@@ -3191,12 +3212,12 @@ class $e extends l.Component {
|
|
|
3191
3212
|
));
|
|
3192
3213
|
}
|
|
3193
3214
|
}
|
|
3194
|
-
|
|
3195
|
-
const s = is(
|
|
3215
|
+
je.active = (i, t) => {
|
|
3216
|
+
const s = is(i, t);
|
|
3196
3217
|
return ls(s, t) || os(s, t);
|
|
3197
3218
|
};
|
|
3198
|
-
Dt(
|
|
3199
|
-
M(
|
|
3219
|
+
Dt(je);
|
|
3220
|
+
M(je);
|
|
3200
3221
|
class ns extends l.Component {
|
|
3201
3222
|
/**
|
|
3202
3223
|
* @hidden
|
|
@@ -3209,7 +3230,7 @@ class ns extends l.Component {
|
|
|
3209
3230
|
className: y("k-columnmenu-item-content", this.props.className),
|
|
3210
3231
|
style: this.props.style
|
|
3211
3232
|
},
|
|
3212
|
-
/* @__PURE__ */ l.createElement(
|
|
3233
|
+
/* @__PURE__ */ l.createElement(Ws, { style: { position: "relative", display: "block" } }, this.props.show ? this.props.children : null)
|
|
3213
3234
|
);
|
|
3214
3235
|
}
|
|
3215
3236
|
}
|
|
@@ -3249,7 +3270,7 @@ class Et extends l.Component {
|
|
|
3249
3270
|
switch (t) {
|
|
3250
3271
|
case "numeric":
|
|
3251
3272
|
return /* @__PURE__ */ l.createElement(
|
|
3252
|
-
|
|
3273
|
+
Ue,
|
|
3253
3274
|
{
|
|
3254
3275
|
value: s,
|
|
3255
3276
|
onChange: (e) => {
|
|
@@ -3260,7 +3281,7 @@ class Et extends l.Component {
|
|
|
3260
3281
|
);
|
|
3261
3282
|
case "date":
|
|
3262
3283
|
return /* @__PURE__ */ l.createElement(
|
|
3263
|
-
|
|
3284
|
+
qe,
|
|
3264
3285
|
{
|
|
3265
3286
|
value: s,
|
|
3266
3287
|
onChange: (e) => {
|
|
@@ -3269,12 +3290,12 @@ class Et extends l.Component {
|
|
|
3269
3290
|
}
|
|
3270
3291
|
);
|
|
3271
3292
|
case "boolean": {
|
|
3272
|
-
const e = (
|
|
3293
|
+
const e = (r) => r == null;
|
|
3273
3294
|
return /* @__PURE__ */ l.createElement(
|
|
3274
3295
|
oe,
|
|
3275
3296
|
{
|
|
3276
3297
|
onChange: this.boolDropdownChange,
|
|
3277
|
-
value: o.find((
|
|
3298
|
+
value: o.find((r) => r.operator === (e(s) ? "" : s)),
|
|
3278
3299
|
data: o,
|
|
3279
3300
|
textField: "text"
|
|
3280
3301
|
}
|
|
@@ -3293,21 +3314,21 @@ class Et extends l.Component {
|
|
|
3293
3314
|
}
|
|
3294
3315
|
}
|
|
3295
3316
|
}
|
|
3296
|
-
class
|
|
3317
|
+
class Gr extends l.Component {
|
|
3297
3318
|
render() {
|
|
3298
3319
|
const {
|
|
3299
3320
|
firstFilterProps: t,
|
|
3300
3321
|
hideSecondFilter: s,
|
|
3301
3322
|
secondFilterProps: o,
|
|
3302
3323
|
logicData: e,
|
|
3303
|
-
logicValue:
|
|
3324
|
+
logicValue: r,
|
|
3304
3325
|
onLogicChange: n
|
|
3305
3326
|
} = this.props;
|
|
3306
3327
|
return /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(Et, { ...t }), !s && /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(
|
|
3307
3328
|
oe,
|
|
3308
3329
|
{
|
|
3309
3330
|
data: e,
|
|
3310
|
-
value:
|
|
3331
|
+
value: r,
|
|
3311
3332
|
onChange: n,
|
|
3312
3333
|
className: "k-filter-and",
|
|
3313
3334
|
textField: "text"
|
|
@@ -3315,14 +3336,14 @@ class Dr extends l.Component {
|
|
|
3315
3336
|
), /* @__PURE__ */ l.createElement(Et, { ...o })));
|
|
3316
3337
|
}
|
|
3317
3338
|
}
|
|
3318
|
-
const
|
|
3339
|
+
const We = (i) => i || { filters: [], logic: "and" }, ge = (i, t) => We(t).filters.filter((e) => gt(e) ? e.filters && e.filters.length && e.filters.length <= 2 && !e.filters.find((r) => gt(r) || r.field !== i) : !1)[0] || null;
|
|
3319
3340
|
class as extends l.Component {
|
|
3320
3341
|
constructor(t) {
|
|
3321
3342
|
super(t), this.removeGroup = (o, e) => {
|
|
3322
|
-
const
|
|
3323
|
-
return n > -1 &&
|
|
3343
|
+
const r = [...e.filters], n = r.findIndex((a) => a === o);
|
|
3344
|
+
return n > -1 && r.splice(n, 1), {
|
|
3324
3345
|
...e,
|
|
3325
|
-
filters:
|
|
3346
|
+
filters: r
|
|
3326
3347
|
};
|
|
3327
3348
|
}, this.insertGroup = (o, e) => ({
|
|
3328
3349
|
...e,
|
|
@@ -3340,7 +3361,7 @@ class as extends l.Component {
|
|
|
3340
3361
|
}, this.secondFilterChange = (o) => {
|
|
3341
3362
|
this.filterChange(1, o);
|
|
3342
3363
|
}, this.filterChange = (o, e) => {
|
|
3343
|
-
const
|
|
3364
|
+
const r = this.state.filterGroup.filters.map((n, a) => a === o ? {
|
|
3344
3365
|
...n,
|
|
3345
3366
|
value: e.value,
|
|
3346
3367
|
operator: e.operator
|
|
@@ -3348,7 +3369,7 @@ class as extends l.Component {
|
|
|
3348
3369
|
this.setState({
|
|
3349
3370
|
filterGroup: {
|
|
3350
3371
|
...this.state.filterGroup,
|
|
3351
|
-
filters:
|
|
3372
|
+
filters: r
|
|
3352
3373
|
}
|
|
3353
3374
|
});
|
|
3354
3375
|
}, this.logicChange = (o) => {
|
|
@@ -3361,48 +3382,48 @@ class as extends l.Component {
|
|
|
3361
3382
|
}, this.clear = (o) => {
|
|
3362
3383
|
if (o.preventDefault(), !this.props.onFilterChange)
|
|
3363
3384
|
return;
|
|
3364
|
-
const e = this.props.column.field,
|
|
3365
|
-
a.length ? this.props.onFilterChange({ ...
|
|
3385
|
+
const e = this.props.column.field, r = We(this.props.filter), n = ge(e, this.props.filter), a = r.filters.filter((c) => c !== n);
|
|
3386
|
+
a.length ? this.props.onFilterChange({ ...r, filters: a }, o) : this.props.onFilterChange(null, o), this.props.onCloseMenu && this.props.onCloseMenu();
|
|
3366
3387
|
}, this.currentFilterGroup = () => ({
|
|
3367
3388
|
...this.state.filterGroup,
|
|
3368
3389
|
filters: this.state.filterGroup.filters.filter((o) => o.value !== void 0 && o.value !== null && o.value !== "" || o.value === null && o.operator)
|
|
3369
3390
|
}), this.submit = (o) => {
|
|
3370
3391
|
if (o.preventDefault(), !this.props.onFilterChange)
|
|
3371
3392
|
return;
|
|
3372
|
-
const e = this.props.column.field,
|
|
3373
|
-
let
|
|
3393
|
+
const e = this.props.column.field, r = We(this.props.filter), n = ge(e, this.props.filter), a = this.currentFilterGroup();
|
|
3394
|
+
let c = null;
|
|
3374
3395
|
if (n && a.filters.length > 0) {
|
|
3375
|
-
const
|
|
3376
|
-
|
|
3377
|
-
...
|
|
3378
|
-
filters:
|
|
3396
|
+
const h = r.filters.map((d) => d === n ? a : d);
|
|
3397
|
+
c = {
|
|
3398
|
+
...r,
|
|
3399
|
+
filters: h
|
|
3379
3400
|
};
|
|
3380
3401
|
} else if (a.filters.length === 0) {
|
|
3381
|
-
const
|
|
3382
|
-
|
|
3383
|
-
...
|
|
3384
|
-
filters:
|
|
3402
|
+
const h = r.filters.filter((d) => d !== n);
|
|
3403
|
+
h.length && (c = {
|
|
3404
|
+
...r,
|
|
3405
|
+
filters: h
|
|
3385
3406
|
});
|
|
3386
3407
|
} else
|
|
3387
|
-
|
|
3388
|
-
...
|
|
3389
|
-
filters: [...
|
|
3408
|
+
c = {
|
|
3409
|
+
...r,
|
|
3410
|
+
filters: [...r.filters, a]
|
|
3390
3411
|
};
|
|
3391
|
-
this.props.onFilterChange(
|
|
3412
|
+
this.props.onFilterChange(c, o), this.props.onCloseMenu && this.props.onCloseMenu();
|
|
3392
3413
|
};
|
|
3393
3414
|
let s;
|
|
3394
3415
|
if (t.column && t.column.field) {
|
|
3395
|
-
const o =
|
|
3416
|
+
const o = Be(t.column.filter), e = jt(t.filterOperators, o);
|
|
3396
3417
|
s = ge(t.column.field, t.filter), s = s ? {
|
|
3397
3418
|
...s,
|
|
3398
|
-
filters: s.filters.map((
|
|
3419
|
+
filters: s.filters.map((r) => ({ ...r }))
|
|
3399
3420
|
} : {
|
|
3400
3421
|
logic: "and",
|
|
3401
3422
|
filters: [
|
|
3402
3423
|
{ field: t.column.field, operator: e, value: L(e) ? null : void 0 },
|
|
3403
3424
|
{ field: t.column.field, operator: e, value: L(e) ? null : void 0 }
|
|
3404
3425
|
]
|
|
3405
|
-
}, s.filters.filter((
|
|
3426
|
+
}, s.filters.filter((r) => r.field === t.column.field).length === 1 && s.filters.splice(1, 0, { field: t.column.field, operator: e });
|
|
3406
3427
|
}
|
|
3407
3428
|
this.state = {
|
|
3408
3429
|
expanded: t.expanded || !1,
|
|
@@ -3416,23 +3437,23 @@ class as extends l.Component {
|
|
|
3416
3437
|
const { column: t, filterUI: s, hideSecondFilter: o, filterOperators: e } = this.props;
|
|
3417
3438
|
if (!t || !t.field)
|
|
3418
3439
|
return /* @__PURE__ */ l.createElement("div", null);
|
|
3419
|
-
const
|
|
3440
|
+
const r = Be(t.filter), n = o !== void 0 ? o : gr[r], a = G(this), c = this.state.filterGroup.filters, h = ie(e[r], a), d = ie(qt, a), g = {
|
|
3420
3441
|
field: t.field,
|
|
3421
|
-
value:
|
|
3422
|
-
operator:
|
|
3423
|
-
operators:
|
|
3442
|
+
value: c[0].value,
|
|
3443
|
+
operator: c[0].operator,
|
|
3444
|
+
operators: h,
|
|
3424
3445
|
booleanValues: d,
|
|
3425
3446
|
onChange: this.firstFilterChange,
|
|
3426
|
-
filterType:
|
|
3447
|
+
filterType: r
|
|
3427
3448
|
}, m = {
|
|
3428
3449
|
field: t.field,
|
|
3429
|
-
value:
|
|
3430
|
-
operator:
|
|
3431
|
-
operators:
|
|
3450
|
+
value: c[1].value,
|
|
3451
|
+
operator: c[1].operator,
|
|
3452
|
+
operators: h,
|
|
3432
3453
|
booleanValues: d,
|
|
3433
3454
|
onChange: this.secondFilterChange,
|
|
3434
|
-
filterType:
|
|
3435
|
-
}, u = this.state.filterGroup.logic, b = ie(
|
|
3455
|
+
filterType: r
|
|
3456
|
+
}, u = this.state.filterGroup.logic, b = ie(pr, a), E = {
|
|
3436
3457
|
value: b.find((D) => D.operator === (u === null ? "" : u)),
|
|
3437
3458
|
onChange: this.logicChange,
|
|
3438
3459
|
data: b
|
|
@@ -3443,16 +3464,16 @@ class as extends l.Component {
|
|
|
3443
3464
|
logicValue: E.value,
|
|
3444
3465
|
onLogicChange: E.onChange,
|
|
3445
3466
|
hideSecondFilter: n
|
|
3446
|
-
},
|
|
3467
|
+
}, S = this.currentFilterGroup().filters.length !== 0 || L(c[0].operator) || L(c[1].operator), v = this.isControlled() ? this.props.expanded : this.state.expanded, _ = this.props.alwaysExpand;
|
|
3447
3468
|
return /* @__PURE__ */ l.createElement(xe, null, !_ && /* @__PURE__ */ l.createElement(
|
|
3448
3469
|
ae,
|
|
3449
3470
|
{
|
|
3450
|
-
title: a.toLanguageString(ne,
|
|
3471
|
+
title: a.toLanguageString(ne, k[ne]),
|
|
3451
3472
|
iconClass: "k-i-filter",
|
|
3452
3473
|
svgIcon: Ce,
|
|
3453
3474
|
onClick: this.onFilterExpand
|
|
3454
3475
|
}
|
|
3455
|
-
), /* @__PURE__ */ l.createElement(ns, { show: _ || !!
|
|
3476
|
+
), /* @__PURE__ */ l.createElement(ns, { show: _ || !!v }, /* @__PURE__ */ l.createElement("div", { className: "kendo-grid-filter-menu-container" }, /* @__PURE__ */ l.createElement(
|
|
3456
3477
|
"form",
|
|
3457
3478
|
{
|
|
3458
3479
|
className: "k-filter-menu",
|
|
@@ -3460,34 +3481,34 @@ class as extends l.Component {
|
|
|
3460
3481
|
onReset: this.clear,
|
|
3461
3482
|
onKeyDown: (D) => D.stopPropagation()
|
|
3462
3483
|
},
|
|
3463
|
-
/* @__PURE__ */ l.createElement("div", { className: "k-filter-menu-container" }, C ? /* @__PURE__ */ l.createElement(C, { ...x }) : /* @__PURE__ */ l.createElement(
|
|
3484
|
+
/* @__PURE__ */ l.createElement("div", { className: "k-filter-menu-container" }, C ? /* @__PURE__ */ l.createElement(C, { ...x }) : /* @__PURE__ */ l.createElement(Gr, { ...x }), /* @__PURE__ */ l.createElement("div", { className: "k-actions k-actions-stretched" }, /* @__PURE__ */ l.createElement(
|
|
3464
3485
|
W,
|
|
3465
3486
|
{
|
|
3466
3487
|
themeColor: "primary",
|
|
3467
|
-
disabled: !
|
|
3488
|
+
disabled: !S
|
|
3468
3489
|
},
|
|
3469
|
-
a.toLanguageString(le,
|
|
3490
|
+
a.toLanguageString(le, k[le])
|
|
3470
3491
|
), /* @__PURE__ */ l.createElement(
|
|
3471
3492
|
W,
|
|
3472
3493
|
{
|
|
3473
3494
|
type: "reset"
|
|
3474
3495
|
},
|
|
3475
|
-
a.toLanguageString(U,
|
|
3496
|
+
a.toLanguageString(U, k[U])
|
|
3476
3497
|
)))
|
|
3477
3498
|
))));
|
|
3478
3499
|
}
|
|
3479
3500
|
}
|
|
3480
|
-
as.active = (
|
|
3501
|
+
as.active = (i, t) => !!ge(i, t);
|
|
3481
3502
|
M(as);
|
|
3482
|
-
const
|
|
3483
|
-
class
|
|
3503
|
+
const Mr = (i, t) => i.length !== t.length ? !1 : i.every((s, o) => s === t[o]);
|
|
3504
|
+
class cs extends l.Component {
|
|
3484
3505
|
constructor(t) {
|
|
3485
|
-
super(t), this.defaultFilter = () => this.props.filter ?
|
|
3486
|
-
let e = this.props.column.field || "",
|
|
3487
|
-
return o ?
|
|
3506
|
+
super(t), this.defaultFilter = () => this.props.filter ? xs(this.props.filter) : { filters: [], logic: "and" }, this.isControlled = () => this.props.expanded !== void 0, this.parseData = (s, o) => {
|
|
3507
|
+
let e = this.props.column.field || "", r = s.map((n) => T(e, n));
|
|
3508
|
+
return o ? r.filter((n, a) => r.indexOf(n) === a) : r;
|
|
3488
3509
|
}, this.getFilterIndex = () => {
|
|
3489
3510
|
let s = this.props.column.field;
|
|
3490
|
-
return this.defaultFilter().filters.findIndex((
|
|
3511
|
+
return this.defaultFilter().filters.findIndex((r) => r.filters && r.filters.length > 0 && r.filters[0].field === s);
|
|
3491
3512
|
}, this.onFilterExpand = () => {
|
|
3492
3513
|
const s = this.isControlled(), o = !(s ? this.props.expanded : this.state.expanded);
|
|
3493
3514
|
this.props.onExpandChange && this.props.onExpandChange(o), s || this.setState({
|
|
@@ -3527,24 +3548,24 @@ class hs extends l.Component {
|
|
|
3527
3548
|
this.props.onFilterChange(o, s), this.props.onCloseMenu && this.props.onCloseMenu();
|
|
3528
3549
|
}, this.handleCheckBoxChange = (s, o) => {
|
|
3529
3550
|
const e = this.props.column.field || "";
|
|
3530
|
-
let
|
|
3531
|
-
if (this.compositeFilterIndex !== -1 &&
|
|
3532
|
-
this.state.data.forEach((
|
|
3533
|
-
a.push({ field: e, operator: "eq", value:
|
|
3551
|
+
let r = { ...this.state.currentFilter }, n = [...this.state.currentFilter.filters], a = [];
|
|
3552
|
+
if (this.compositeFilterIndex !== -1 && r.filters[this.compositeFilterIndex].filters && o !== "all" && (a = r.filters[this.compositeFilterIndex].filters), s.value && o === "all")
|
|
3553
|
+
this.state.data.forEach((c) => {
|
|
3554
|
+
a.push({ field: e, operator: "eq", value: c });
|
|
3534
3555
|
});
|
|
3535
3556
|
else if (s.value)
|
|
3536
3557
|
a.push({ field: e, operator: "eq", value: o });
|
|
3537
3558
|
else if (this.state.currentFilter) {
|
|
3538
|
-
let
|
|
3539
|
-
a.splice(
|
|
3559
|
+
let c = a.findIndex((h) => h.value === o);
|
|
3560
|
+
a.splice(c, 1);
|
|
3540
3561
|
}
|
|
3541
|
-
|
|
3562
|
+
r.logic = "and", this.compositeFilterIndex !== -1 ? n[this.compositeFilterIndex] = {
|
|
3542
3563
|
logic: "or",
|
|
3543
3564
|
filters: a
|
|
3544
3565
|
} : n.push({
|
|
3545
3566
|
logic: "or",
|
|
3546
3567
|
filters: a
|
|
3547
|
-
}), (!s.value && o === "all" || a.length === 0) && n.splice(this.compositeFilterIndex, 1),
|
|
3568
|
+
}), (!s.value && o === "all" || a.length === 0) && n.splice(this.compositeFilterIndex, 1), r.filters = n, this.setState({ currentFilter: r });
|
|
3548
3569
|
}, this.isAllSelected = () => {
|
|
3549
3570
|
let s = !1;
|
|
3550
3571
|
if (this.state.currentFilter) {
|
|
@@ -3565,7 +3586,7 @@ class hs extends l.Component {
|
|
|
3565
3586
|
*/
|
|
3566
3587
|
componentDidUpdate() {
|
|
3567
3588
|
let t = this.props.column.field || "", s = this.props.data.map((o) => T(t, o));
|
|
3568
|
-
|
|
3589
|
+
Mr(s, this.state.dataFromProps) || this.setState({
|
|
3569
3590
|
data: s,
|
|
3570
3591
|
dataFromProps: s
|
|
3571
3592
|
});
|
|
@@ -3581,16 +3602,16 @@ class hs extends l.Component {
|
|
|
3581
3602
|
let e = [];
|
|
3582
3603
|
if (this.state.currentFilter) {
|
|
3583
3604
|
const a = [...this.state.currentFilter.filters];
|
|
3584
|
-
this.compositeFilterIndex = a.findIndex((
|
|
3585
|
-
|
|
3605
|
+
this.compositeFilterIndex = a.findIndex((c) => c.filters && c.filters.length > 0 ? c.filters[0].field === t.field : !1), this.compositeFilterIndex !== -1 && a[this.compositeFilterIndex].filters.length > 0 && a[this.compositeFilterIndex].filters.forEach((c) => {
|
|
3606
|
+
c.field === this.props.column.field && e.push(c.value);
|
|
3586
3607
|
});
|
|
3587
3608
|
}
|
|
3588
|
-
const
|
|
3609
|
+
const r = this.props.searchBox ? /* @__PURE__ */ l.createElement(this.props.searchBox, { value: this.state.value, onChange: this.handleSearchChange }) : /* @__PURE__ */ l.createElement("div", { className: "k-searchbox k-textbox k-input k-input-md k-input-solid" }, /* @__PURE__ */ l.createElement(O, { className: "k-input-icon", name: "search", icon: Tt }), /* @__PURE__ */ l.createElement(
|
|
3589
3610
|
Mt,
|
|
3590
3611
|
{
|
|
3591
3612
|
className: "k-input-inner",
|
|
3592
3613
|
type: "text",
|
|
3593
|
-
placeholder: s.toLanguageString(
|
|
3614
|
+
placeholder: s.toLanguageString(He, k[He]),
|
|
3594
3615
|
value: this.state.value,
|
|
3595
3616
|
onChange: (a) => this.handleSearchChange(a.nativeEvent)
|
|
3596
3617
|
}
|
|
@@ -3602,13 +3623,13 @@ class hs extends l.Component {
|
|
|
3602
3623
|
className: "k-input-button",
|
|
3603
3624
|
onClick: this.handleClear,
|
|
3604
3625
|
icon: "x",
|
|
3605
|
-
svgIcon:
|
|
3626
|
+
svgIcon: Ps
|
|
3606
3627
|
}
|
|
3607
|
-
)), n = e.filter((a,
|
|
3628
|
+
)), n = e.filter((a, c) => e.indexOf(a) === c);
|
|
3608
3629
|
return /* @__PURE__ */ l.createElement(xe, null, /* @__PURE__ */ l.createElement(
|
|
3609
3630
|
ae,
|
|
3610
3631
|
{
|
|
3611
|
-
title: s.toLanguageString(ne,
|
|
3632
|
+
title: s.toLanguageString(ne, k[ne]),
|
|
3612
3633
|
iconClass: "k-i-filter",
|
|
3613
3634
|
svgIcon: Ce,
|
|
3614
3635
|
onClick: this.onFilterExpand
|
|
@@ -3620,64 +3641,64 @@ class hs extends l.Component {
|
|
|
3620
3641
|
onSubmit: this.submit,
|
|
3621
3642
|
onReset: this.clear
|
|
3622
3643
|
},
|
|
3623
|
-
/* @__PURE__ */ l.createElement("div", { className: "k-filter-menu-container" },
|
|
3644
|
+
/* @__PURE__ */ l.createElement("div", { className: "k-filter-menu-container" }, r, /* @__PURE__ */ l.createElement("ul", { className: "k-reset k-multicheck-wrap" }, /* @__PURE__ */ l.createElement("li", { className: "k-item k-check-all-wrap" }, /* @__PURE__ */ l.createElement(
|
|
3624
3645
|
fe,
|
|
3625
3646
|
{
|
|
3626
|
-
label: s.toLanguageString(
|
|
3647
|
+
label: s.toLanguageString(ze, k[ze]),
|
|
3627
3648
|
onChange: (a) => this.handleCheckBoxChange(a, "all"),
|
|
3628
3649
|
checked: this.isAllSelected()
|
|
3629
3650
|
}
|
|
3630
|
-
)), this.state.data.map((a,
|
|
3651
|
+
)), this.state.data.map((a, c) => /* @__PURE__ */ l.createElement("li", { className: "k-item", key: c }, /* @__PURE__ */ l.createElement(
|
|
3631
3652
|
fe,
|
|
3632
3653
|
{
|
|
3633
3654
|
label: String(a),
|
|
3634
|
-
onChange: (
|
|
3655
|
+
onChange: (h) => this.handleCheckBoxChange(h, a),
|
|
3635
3656
|
checked: n.includes(a)
|
|
3636
3657
|
}
|
|
3637
|
-
)))), /* @__PURE__ */ l.createElement("div", { className: "k-filter-selected-items" }, n.length + " " + s.toLanguageString(
|
|
3658
|
+
)))), /* @__PURE__ */ l.createElement("div", { className: "k-filter-selected-items" }, n.length + " " + s.toLanguageString(Oe, k[Oe])), /* @__PURE__ */ l.createElement("div", { className: "k-actions k-hstack k-justify-content-stretch" }, /* @__PURE__ */ l.createElement(
|
|
3638
3659
|
W,
|
|
3639
3660
|
{
|
|
3640
3661
|
themeColor: "primary",
|
|
3641
3662
|
type: "submit"
|
|
3642
3663
|
},
|
|
3643
|
-
s.toLanguageString(le,
|
|
3664
|
+
s.toLanguageString(le, k[le])
|
|
3644
3665
|
), /* @__PURE__ */ l.createElement(
|
|
3645
3666
|
W,
|
|
3646
3667
|
{
|
|
3647
3668
|
className: "k-button",
|
|
3648
3669
|
type: "reset"
|
|
3649
3670
|
},
|
|
3650
|
-
s.toLanguageString(U,
|
|
3671
|
+
s.toLanguageString(U, k[U])
|
|
3651
3672
|
)))
|
|
3652
3673
|
))));
|
|
3653
3674
|
}
|
|
3654
3675
|
}
|
|
3655
|
-
|
|
3676
|
+
cs.defaultProps = {
|
|
3656
3677
|
uniqueData: !0
|
|
3657
3678
|
};
|
|
3658
|
-
M(
|
|
3659
|
-
const
|
|
3660
|
-
const [t, s] = l.useState(""), o = l.useMemo(() => new Set(
|
|
3679
|
+
M(cs);
|
|
3680
|
+
const Hr = (i) => {
|
|
3681
|
+
const [t, s] = l.useState(""), o = l.useMemo(() => new Set(i.columnsState.map((u) => u.id)), [i.columnsState]), e = l.useMemo(() => i.columns.filter((u) => {
|
|
3661
3682
|
var b;
|
|
3662
3683
|
return (b = u.title || u.field) == null ? void 0 : b.toLowerCase().includes(t.toLowerCase());
|
|
3663
|
-
}), [
|
|
3664
|
-
const u =
|
|
3665
|
-
|
|
3666
|
-
}, [
|
|
3667
|
-
n(
|
|
3668
|
-
}, [o,
|
|
3669
|
-
n(
|
|
3670
|
-
}, [
|
|
3671
|
-
const E =
|
|
3684
|
+
}), [i.columns, t]), [r, n] = l.useState(i.columns.map((u) => o.has(u.id))), a = l.useCallback(() => {
|
|
3685
|
+
const u = i.columns.filter((b, E) => r[E]);
|
|
3686
|
+
i.onColumnsChange.call(void 0, u), i.onCloseMenu.call(void 0);
|
|
3687
|
+
}, [r, i.columns, i.onColumnsChange, i.onCloseMenu]), c = l.useCallback(() => {
|
|
3688
|
+
n(i.columns.map((u) => o.has(u.id)));
|
|
3689
|
+
}, [o, i.columns]), h = r.filter((u) => u).length, d = h === r.length, g = l.useCallback(() => {
|
|
3690
|
+
n(i.columns.map((u, b) => d && b === 0 ? !0 : !d));
|
|
3691
|
+
}, [i.columns, d]), m = l.useCallback((u, b) => {
|
|
3692
|
+
const E = r.slice();
|
|
3672
3693
|
E[b] = u, n(E);
|
|
3673
|
-
}, [
|
|
3694
|
+
}, [r]);
|
|
3674
3695
|
return /* @__PURE__ */ l.createElement("form", { className: "k-filter-menu" }, /* @__PURE__ */ l.createElement("div", { className: "k-filter-menu-container" }, /* @__PURE__ */ l.createElement(
|
|
3675
3696
|
Gt,
|
|
3676
3697
|
{
|
|
3677
3698
|
className: "k-searchbox",
|
|
3678
3699
|
value: t,
|
|
3679
3700
|
onChange: (u) => s(String(u.target.value)),
|
|
3680
|
-
prefix: () => /* @__PURE__ */ l.createElement(
|
|
3701
|
+
prefix: () => /* @__PURE__ */ l.createElement(As, null, /* @__PURE__ */ l.createElement(O, { name: "search", icon: Tt }))
|
|
3681
3702
|
}
|
|
3682
3703
|
), /* @__PURE__ */ l.createElement("ul", { className: "k-reset k-multicheck-wrap" }, !t && /* @__PURE__ */ l.createElement("li", { className: "k-item k-check-all-wrap" }, /* @__PURE__ */ l.createElement(
|
|
3683
3704
|
fe,
|
|
@@ -3689,18 +3710,18 @@ const Gr = (r) => {
|
|
|
3689
3710
|
)), e.map((u, b) => /* @__PURE__ */ l.createElement("li", { key: u.id, className: "k-item" }, /* @__PURE__ */ l.createElement(
|
|
3690
3711
|
fe,
|
|
3691
3712
|
{
|
|
3692
|
-
disabled:
|
|
3693
|
-
checked:
|
|
3713
|
+
disabled: r[b] && h === 1,
|
|
3714
|
+
checked: r[b],
|
|
3694
3715
|
onChange: (E) => {
|
|
3695
3716
|
var C;
|
|
3696
3717
|
return m(!!((C = E.target.element) != null && C.checked), b);
|
|
3697
3718
|
},
|
|
3698
3719
|
label: u.title || u.field
|
|
3699
3720
|
}
|
|
3700
|
-
)))), /* @__PURE__ */ l.createElement("div", { className: "k-filter-selected-items" },
|
|
3721
|
+
)))), /* @__PURE__ */ l.createElement("div", { className: "k-filter-selected-items" }, h, " selected items"), /* @__PURE__ */ l.createElement("div", { className: "k-actions k-actions-start k-actions-horizontal" }, /* @__PURE__ */ l.createElement(W, { type: "button", themeColor: "primary", onClick: a }, "Apply"), /* @__PURE__ */ l.createElement(W, { type: "button", onClick: c }, "Reset"))));
|
|
3701
3722
|
};
|
|
3702
|
-
|
|
3703
|
-
class
|
|
3723
|
+
Hr.displayName = "GridColumnMenuColumnsList";
|
|
3724
|
+
class Qr extends l.Component {
|
|
3704
3725
|
/**
|
|
3705
3726
|
* @hidden
|
|
3706
3727
|
*/
|
|
@@ -3708,7 +3729,7 @@ class Yr extends l.Component {
|
|
|
3708
3729
|
return null;
|
|
3709
3730
|
}
|
|
3710
3731
|
}
|
|
3711
|
-
class
|
|
3732
|
+
class zr extends l.Component {
|
|
3712
3733
|
/**
|
|
3713
3734
|
* @hidden
|
|
3714
3735
|
*/
|
|
@@ -3720,7 +3741,7 @@ class Mr extends l.Component {
|
|
|
3720
3741
|
"k-toolbar k-grid-toolbar",
|
|
3721
3742
|
{
|
|
3722
3743
|
"k-toolbar-md": !this.props.size,
|
|
3723
|
-
[`k-toolbar-${
|
|
3744
|
+
[`k-toolbar-${V.sizeMap[this.props.size] || this.props.size}`]: this.props.size
|
|
3724
3745
|
},
|
|
3725
3746
|
this.props.className
|
|
3726
3747
|
),
|
|
@@ -3732,30 +3753,30 @@ class Mr extends l.Component {
|
|
|
3732
3753
|
);
|
|
3733
3754
|
}
|
|
3734
3755
|
}
|
|
3735
|
-
|
|
3736
|
-
const
|
|
3737
|
-
const { data: t = [] } =
|
|
3756
|
+
zr.displayName = "KendoReactGridToolbar";
|
|
3757
|
+
const Lr = (i) => {
|
|
3758
|
+
const { data: t = [] } = i;
|
|
3738
3759
|
return /* @__PURE__ */ l.createElement("div", { className: "k-selection-aggregates k-grid-selection-aggregates" }, t.map((s, o) => /* @__PURE__ */ l.createElement("div", { key: o }, /* @__PURE__ */ l.createElement("span", { className: "k-selection-aggregates-item-text" }, s.type, ": "), /* @__PURE__ */ l.createElement("span", { className: "k-selection-aggregates-item-value" }, s.formattedValue))));
|
|
3739
3760
|
};
|
|
3740
|
-
|
|
3741
|
-
const
|
|
3761
|
+
Lr.displayName = "KendoReactGridStatusBar";
|
|
3762
|
+
const Or = (i) => {
|
|
3742
3763
|
var s;
|
|
3743
|
-
const t =
|
|
3764
|
+
const t = i.slice();
|
|
3744
3765
|
for (let o = 0; o < t.length; o++)
|
|
3745
3766
|
for (; t[o] && ((s = t[o].children) != null && s.length); )
|
|
3746
3767
|
t.splice(o, 1, ...t[o].children);
|
|
3747
3768
|
return t;
|
|
3748
|
-
},
|
|
3749
|
-
const { dataItems: t, target: s, selectedField: o } =
|
|
3769
|
+
}, Zr = (i) => {
|
|
3770
|
+
const { dataItems: t, target: s, selectedField: o } = i, r = Or(s.columns).map((C) => C.field).filter((C) => C && typeof C == "string").map((C) => we(C)), n = we(o), a = { dates: [], numbers: [], booleans: [], others: [] }, c = (C) => {
|
|
3750
3771
|
typeof C == "number" ? a.numbers.push(C) : typeof C == "boolean" ? a.booleans.push(C) : C instanceof Date ? a.dates.push(C) : a.others.push(C);
|
|
3751
3772
|
};
|
|
3752
3773
|
t.forEach((C) => {
|
|
3753
3774
|
const x = n(C);
|
|
3754
|
-
x && x.forEach((
|
|
3755
|
-
|
|
3775
|
+
x && x.forEach((S) => {
|
|
3776
|
+
c(r[S](C));
|
|
3756
3777
|
});
|
|
3757
3778
|
});
|
|
3758
|
-
const
|
|
3779
|
+
const h = a.dates.map((C) => C.getTime()), d = a.booleans.filter((C) => C).length, g = a.booleans.filter((C) => !C).length, m = a.numbers.length ? a.numbers.reduce((C, x) => C += x, 0) : void 0, u = {
|
|
3759
3780
|
sum: m,
|
|
3760
3781
|
average: typeof m == "number" ? m / a.numbers.length : void 0,
|
|
3761
3782
|
min: a.numbers.length ? Math.min(...a.numbers) : void 0,
|
|
@@ -3763,59 +3784,59 @@ const zr = (r) => {
|
|
|
3763
3784
|
count: a.numbers.length + a.booleans.length + a.dates.length + a.others.length,
|
|
3764
3785
|
isTrue: d > 0 ? d : void 0,
|
|
3765
3786
|
isFalse: g > 0 ? g : void 0,
|
|
3766
|
-
earliest: a.dates.length ? new Date(Math.min(...
|
|
3767
|
-
latest: a.dates.length ? new Date(Math.max(...
|
|
3787
|
+
earliest: a.dates.length ? new Date(Math.min(...h)) : void 0,
|
|
3788
|
+
latest: a.dates.length ? new Date(Math.max(...h)) : void 0
|
|
3768
3789
|
}, 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 = [];
|
|
3769
3790
|
return Object.keys(u).forEach((C) => {
|
|
3770
|
-
const x = C,
|
|
3771
|
-
|
|
3791
|
+
const x = C, S = u[x];
|
|
3792
|
+
S !== void 0 && E.push({ type: x, value: S, formattedValue: b(S, x) });
|
|
3772
3793
|
}), E;
|
|
3773
|
-
},
|
|
3774
|
-
|
|
3794
|
+
}, _r = wt(he);
|
|
3795
|
+
_r.displayName = "KendoReactGrid";
|
|
3775
3796
|
export {
|
|
3776
3797
|
re as GRID_COL_INDEX_ATTRIBUTE,
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3798
|
+
or as GRID_ROW_INDEX_ATTRIBUTE,
|
|
3799
|
+
_r as Grid,
|
|
3800
|
+
Er as GridCell,
|
|
3801
|
+
he as GridClassComponent,
|
|
3802
|
+
ce as GridColumn,
|
|
3803
|
+
cs as GridColumnMenuCheckboxFilter,
|
|
3804
|
+
Hr as GridColumnMenuColumnsList,
|
|
3784
3805
|
as as GridColumnMenuFilter,
|
|
3785
3806
|
Et as GridColumnMenuFilterCell,
|
|
3786
|
-
|
|
3807
|
+
Gr as GridColumnMenuFilterUI,
|
|
3787
3808
|
ts as GridColumnMenuGroup,
|
|
3788
3809
|
ae as GridColumnMenuItem,
|
|
3789
3810
|
ns as GridColumnMenuItemContent,
|
|
3790
3811
|
xe as GridColumnMenuItemGroup,
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3812
|
+
je as GridColumnMenuSort,
|
|
3813
|
+
Vt as GridColumnMenuWrapper,
|
|
3814
|
+
kr as GridCommonDragLogic,
|
|
3815
|
+
Qr as GridDetailRow,
|
|
3816
|
+
lr as GridEditCell,
|
|
3796
3817
|
Jt as GridFilterCell,
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3818
|
+
vt as GridGroupCell,
|
|
3819
|
+
cr as GridHeaderCell,
|
|
3820
|
+
ir as GridHierarchyCell,
|
|
3821
|
+
$e as GridNoRecords,
|
|
3822
|
+
Sr as GridRow,
|
|
3823
|
+
qs as GridSelectionCell,
|
|
3824
|
+
zr as GridToolbar,
|
|
3825
|
+
Lr as StatusBar,
|
|
3805
3826
|
qt as booleanFilterValues,
|
|
3806
3827
|
ge as filterGroupByField,
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3828
|
+
si as getSelectedState,
|
|
3829
|
+
ri as getSelectedStateFromKeyDown,
|
|
3830
|
+
Zr as getStatusData,
|
|
3831
|
+
k as gridMessages,
|
|
3832
|
+
Or as leafColumns,
|
|
3812
3833
|
Ct as operators,
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3834
|
+
js as pagerFirstPage,
|
|
3835
|
+
$s as pagerInfo,
|
|
3836
|
+
Qs as pagerItemPerPage,
|
|
3837
|
+
Js as pagerLastPage,
|
|
3838
|
+
Ys as pagerNextPage,
|
|
3839
|
+
Xs as pagerPreviousPage,
|
|
3840
|
+
We as rootFilterOrDefault,
|
|
3841
|
+
ii as setSelectedState
|
|
3821
3842
|
};
|