@progress/kendo-react-grid 15.1.0-develop.1 → 15.1.0-develop.10
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/GridClientWrapper.js +1 -1
- package/GridClientWrapper.mjs +411 -407
- package/GridComponent.js +1 -1
- package/GridComponent.mjs +305 -290
- package/VirtualScroll.d.ts +4 -0
- package/VirtualScroll.js +1 -1
- package/VirtualScroll.mjs +32 -27
- package/cells/groupcell/useGroupCellClientTdProps.js +1 -1
- package/cells/groupcell/useGroupCellClientTdProps.mjs +7 -7
- package/cells/hierarchycell/GridHierarchyCellToggle.js +1 -1
- package/cells/hierarchycell/GridHierarchyCellToggle.mjs +15 -15
- package/columnMenu/GridColumnMenuWrapper.js +1 -1
- package/columnMenu/GridColumnMenuWrapper.mjs +118 -82
- package/components/GridEditDialog.js +1 -1
- package/components/GridEditDialog.mjs +19 -19
- package/components/VirtualScrollOverlay.d.ts +12 -0
- package/components/VirtualScrollOverlay.js +16 -0
- package/components/VirtualScrollOverlay.mjs +65 -0
- package/components/noRecords/GridNoRecordsContainer.js +1 -1
- package/components/noRecords/GridNoRecordsContainer.mjs +10 -9
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/drag/ColumnResize.js +1 -1
- package/drag/ColumnResize.mjs +84 -84
- package/getRowContents.js +1 -1
- package/getRowContents.mjs +12 -12
- package/index.d.mts +2 -1
- package/index.d.ts +2 -1
- package/interfaces/GridProps.d.ts +2 -1
- package/interfaces/GridScrollableSettings.d.ts +33 -0
- package/interfaces/VirtualScrollInterface.d.ts +2 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +17 -17
- package/toolbar-tools/GridToolbarColumnsChooser.js +1 -1
- package/toolbar-tools/GridToolbarColumnsChooser.mjs +33 -33
- package/toolbar-tools/GridToolbarFilter.js +1 -1
- package/toolbar-tools/GridToolbarFilter.mjs +207 -194
- package/toolbar-tools/GridToolbarSort.js +1 -1
- package/toolbar-tools/GridToolbarSort.mjs +84 -101
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarFilter.js +1 -1
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarFilter.mjs +50 -46
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarSort.d.ts +0 -1
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarSort.js +1 -1
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarSort.mjs +10 -19
- package/utils/index.js +1 -1
- package/utils/index.mjs +161 -161
|
@@ -5,270 +5,283 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import
|
|
10
|
-
import { useDocument as
|
|
11
|
-
import { GridColumnMenuItem as
|
|
12
|
-
import { GridColumnMenuItemContent as
|
|
13
|
-
import { GridColumnMenuItemGroup as
|
|
14
|
-
import { GridContext as
|
|
15
|
-
import { filterIcon as
|
|
16
|
-
import { getFilterType as
|
|
17
|
-
import { Button as
|
|
18
|
-
import { GridColumnMenuFilterUI as
|
|
19
|
-
import { toolbarFilter as
|
|
20
|
-
import { useLocalization as
|
|
21
|
-
import { rootFilterOrDefault as
|
|
22
|
-
import { Popup as
|
|
23
|
-
import { BadgeContainer as
|
|
24
|
-
import { GridToolbarAdaptiveProvider as
|
|
25
|
-
import { GridAdaptiveToolbarFilter as
|
|
26
|
-
const
|
|
27
|
-
var re, oe,
|
|
28
|
-
const
|
|
29
|
-
(
|
|
30
|
-
), [
|
|
31
|
-
() => (
|
|
32
|
-
var
|
|
33
|
-
return (
|
|
8
|
+
import * as r from "react";
|
|
9
|
+
import Pe from "react-dom";
|
|
10
|
+
import { useDocument as Ae, SvgIcon as Ge, classNames as Oe } from "@progress/kendo-react-common";
|
|
11
|
+
import { GridColumnMenuItem as Te } from "../columnMenu/GridColumnMenuItem.mjs";
|
|
12
|
+
import { GridColumnMenuItemContent as Ve } from "../columnMenu/GridColumnMenuItemContent.mjs";
|
|
13
|
+
import { GridColumnMenuItemGroup as Ue } from "../columnMenu/GridColumnMenuItemGroup.mjs";
|
|
14
|
+
import { GridContext as ze } from "../utils/GridContext.mjs";
|
|
15
|
+
import { filterIcon as fe, filterClearIcon as Ke } from "@progress/kendo-svg-icons";
|
|
16
|
+
import { getFilterType as me, operatorMap as z, defaultHideSecondFilter as _e, IsUnaryFilter as D, getDefaultOperator as He, filterLogicList as je, booleanFilterValues as qe } from "../filterCommon.mjs";
|
|
17
|
+
import { Button as y } from "@progress/kendo-react-buttons";
|
|
18
|
+
import { GridColumnMenuFilterUI as Je } from "../columnMenu/GridColumnMenuFilterUI.mjs";
|
|
19
|
+
import { toolbarFilter as I, messages as k, filterSubmitButton as de, filterClearButton as ge, filterClearAllButton as pe } from "../messages/index.mjs";
|
|
20
|
+
import { useLocalization as Qe } from "@progress/kendo-react-intl";
|
|
21
|
+
import { rootFilterOrDefault as N, filterGroupByField as We } from "../columnMenu/GridColumnMenuFilter.mjs";
|
|
22
|
+
import { Popup as Xe } from "@progress/kendo-react-popup";
|
|
23
|
+
import { BadgeContainer as Ye, Badge as Ze } from "@progress/kendo-react-indicators";
|
|
24
|
+
import { GridToolbarAdaptiveProvider as $e } from "./adaptiveContext/GridToolbarAdaptiveContext.mjs";
|
|
25
|
+
import { GridAdaptiveToolbarFilter as xe } from "./adaptiveContent/GridAdaptiveToolbarFilter.mjs";
|
|
26
|
+
const Re = (u) => {
|
|
27
|
+
var re, le, oe, ie, ne, ae, se, ce;
|
|
28
|
+
const i = r.useContext(ze), d = i.columnsRef, g = i.filter, he = !!((re = g == null ? void 0 : g.filters) != null && re.length), [B, L] = r.useState(!1), [p, C] = r.useState(
|
|
29
|
+
(d == null ? void 0 : d.map((e) => ({ column: e, expanded: !1 }))) || []
|
|
30
|
+
), [ve, K] = r.useState(!1), F = r.useRef(null), Fe = r.useRef(null), _ = r.useRef(null), t = r.useRef(null), m = Qe(), Ee = Ae(F), H = r.useMemo(
|
|
31
|
+
() => (d == null ? void 0 : d.filter((e) => {
|
|
32
|
+
var l;
|
|
33
|
+
return (l = e.title || e.field) == null ? void 0 : l.toLowerCase();
|
|
34
34
|
})) || [],
|
|
35
|
-
[
|
|
36
|
-
)
|
|
37
|
-
t.useEffect(() => {
|
|
38
|
-
h(!!(p || U));
|
|
39
|
-
}, [p, U]);
|
|
40
|
-
const H = t.useCallback(
|
|
35
|
+
[d]
|
|
36
|
+
), j = r.useCallback(
|
|
41
37
|
(e) => {
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
var n;
|
|
39
|
+
const l = (n = g == null ? void 0 : g.filters) == null ? void 0 : n.some(
|
|
40
|
+
(o) => {
|
|
41
|
+
var a;
|
|
42
|
+
return o.field === e.field || ((a = o.filters) == null ? void 0 : a.some((f) => f.field === e.field));
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
return /* @__PURE__ */ r.createElement(r.Fragment, null, e.title || e.field, l && /* @__PURE__ */ r.createElement("span", { className: "k-columnmenu-indicators" }, /* @__PURE__ */ r.createElement(Ge, { key: 1, icon: fe })));
|
|
44
46
|
},
|
|
45
|
-
[
|
|
46
|
-
),
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
var
|
|
47
|
+
[g]
|
|
48
|
+
), q = (e, l) => {
|
|
49
|
+
t.current = l, C((n) => n.map((o) => o.column.field === l.field ? { ...o, expanded: !o.expanded } : { ...o, expanded: !1 })), P(J()), K(!ve);
|
|
50
|
+
}, J = () => {
|
|
51
|
+
var l, n, o, a, f, v;
|
|
50
52
|
let e;
|
|
51
|
-
if (
|
|
52
|
-
const
|
|
53
|
-
e =
|
|
53
|
+
if (t != null && t.current && ((l = t == null ? void 0 : t.current) != null && l.field)) {
|
|
54
|
+
const h = me((n = t == null ? void 0 : t.current) == null ? void 0 : n.filter), E = He(i.filterOperators, h);
|
|
55
|
+
if (e = We((o = t == null ? void 0 : t.current) == null ? void 0 : o.field, i.filter), !e) {
|
|
56
|
+
const b = N(i.filter).filters.filter(
|
|
57
|
+
(w) => {
|
|
58
|
+
var ue;
|
|
59
|
+
return !w.filters && w.field === ((ue = t == null ? void 0 : t.current) == null ? void 0 : ue.field);
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
b.length && (e = { logic: "and", filters: b.map((w) => ({ ...w })) });
|
|
63
|
+
}
|
|
64
|
+
e = e ? {
|
|
54
65
|
...e,
|
|
55
|
-
filters: e.filters.map((
|
|
66
|
+
filters: e.filters.map((S) => ({ ...S }))
|
|
56
67
|
} : {
|
|
57
68
|
logic: "and",
|
|
58
69
|
filters: [
|
|
59
70
|
{
|
|
60
|
-
field: (
|
|
61
|
-
operator:
|
|
62
|
-
value:
|
|
71
|
+
field: (a = t == null ? void 0 : t.current) == null ? void 0 : a.field,
|
|
72
|
+
operator: E,
|
|
73
|
+
value: D(E) ? null : void 0
|
|
63
74
|
},
|
|
64
75
|
{
|
|
65
|
-
field: (
|
|
66
|
-
operator:
|
|
67
|
-
value:
|
|
76
|
+
field: (f = t == null ? void 0 : t.current) == null ? void 0 : f.field,
|
|
77
|
+
operator: E,
|
|
78
|
+
value: D(E) ? null : void 0
|
|
68
79
|
}
|
|
69
80
|
]
|
|
70
|
-
}, e.filters.filter((
|
|
71
|
-
var
|
|
72
|
-
return
|
|
81
|
+
}, e.filters.filter((S) => {
|
|
82
|
+
var b;
|
|
83
|
+
return S.field === ((b = t == null ? void 0 : t.current) == null ? void 0 : b.field);
|
|
73
84
|
}).length === 1 && e.filters.splice(1, 0, {
|
|
74
|
-
field: (
|
|
75
|
-
operator:
|
|
85
|
+
field: (v = t == null ? void 0 : t.current) == null ? void 0 : v.field,
|
|
86
|
+
operator: E
|
|
76
87
|
});
|
|
77
88
|
}
|
|
78
89
|
return e;
|
|
79
|
-
}, Ce = (e) => {
|
|
80
|
-
J(0, e);
|
|
81
90
|
}, be = (e) => {
|
|
82
|
-
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
Q(0, e);
|
|
92
|
+
}, ke = (e) => {
|
|
93
|
+
Q(1, e);
|
|
94
|
+
}, Q = (e, l) => {
|
|
95
|
+
const n = c.filters.map((o, a) => a === e ? {
|
|
96
|
+
...o,
|
|
97
|
+
value: l.value || "",
|
|
98
|
+
operator: l.operator || A[a].operator
|
|
99
|
+
} : o);
|
|
100
|
+
P({
|
|
101
|
+
...c,
|
|
102
|
+
filters: n
|
|
92
103
|
});
|
|
93
|
-
}, [
|
|
94
|
-
field: (oe =
|
|
95
|
-
value:
|
|
96
|
-
operator:
|
|
104
|
+
}, [c, P] = r.useState(J()), s = c == null ? void 0 : c.filters, M = me((le = t == null ? void 0 : t.current) == null ? void 0 : le.filter), A = z(i.filterOperators[M], m), W = z(qe, m), Ce = {
|
|
105
|
+
field: (oe = t == null ? void 0 : t.current) == null ? void 0 : oe.field,
|
|
106
|
+
value: s == null ? void 0 : s[0].value,
|
|
107
|
+
operator: s == null ? void 0 : s[0].operator,
|
|
97
108
|
operators: A,
|
|
98
|
-
booleanValues:
|
|
99
|
-
onChange:
|
|
100
|
-
filterType:
|
|
109
|
+
booleanValues: W,
|
|
110
|
+
onChange: be,
|
|
111
|
+
filterType: M
|
|
101
112
|
}, Me = {
|
|
102
|
-
field: (
|
|
103
|
-
value:
|
|
104
|
-
operator:
|
|
113
|
+
field: (ie = t == null ? void 0 : t.current) == null ? void 0 : ie.field,
|
|
114
|
+
value: s == null ? void 0 : s[1].value,
|
|
115
|
+
operator: s == null ? void 0 : s[1].operator,
|
|
105
116
|
operators: A,
|
|
106
|
-
booleanValues:
|
|
107
|
-
onChange:
|
|
108
|
-
filterType:
|
|
109
|
-
},
|
|
110
|
-
let
|
|
111
|
-
e.target.tagName === "SPAN" && (
|
|
112
|
-
},
|
|
113
|
-
value:
|
|
114
|
-
onChange:
|
|
115
|
-
data:
|
|
116
|
-
},
|
|
117
|
-
firstFilterProps:
|
|
117
|
+
booleanValues: W,
|
|
118
|
+
onChange: ke,
|
|
119
|
+
filterType: M
|
|
120
|
+
}, Se = (e) => {
|
|
121
|
+
let l = e.target.value;
|
|
122
|
+
e.target.tagName === "SPAN" && (l = e.target.parentElement.value), P({ ...c, logic: l });
|
|
123
|
+
}, X = c == null ? void 0 : c.logic, Y = z(je, m), G = {
|
|
124
|
+
value: Y.find((e) => e.operator === (X === null ? "" : X)),
|
|
125
|
+
onChange: Se,
|
|
126
|
+
data: Y
|
|
127
|
+
}, we = u.hideSecondFilter !== void 0 ? u.hideSecondFilter : _e[M], O = u.filterUI, T = {
|
|
128
|
+
firstFilterProps: Ce,
|
|
118
129
|
secondFilterProps: Me,
|
|
119
|
-
logicData:
|
|
120
|
-
logicValue:
|
|
121
|
-
onLogicChange:
|
|
122
|
-
hideSecondFilter:
|
|
123
|
-
},
|
|
124
|
-
...
|
|
125
|
-
filters:
|
|
126
|
-
}),
|
|
127
|
-
if (e.preventDefault(), !
|
|
130
|
+
logicData: G.data,
|
|
131
|
+
logicValue: G.value,
|
|
132
|
+
onLogicChange: G.onChange,
|
|
133
|
+
hideSecondFilter: we
|
|
134
|
+
}, Z = () => ({
|
|
135
|
+
...c,
|
|
136
|
+
filters: c == null ? void 0 : c.filters.filter((e) => e.value !== void 0 && e.value !== null && e.value !== "" || e.value === null && e.operator)
|
|
137
|
+
}), V = ((ae = (ne = Z()) == null ? void 0 : ne.filters) == null ? void 0 : ae.length) !== 0 || D(s == null ? void 0 : s[0].operator) || D(s == null ? void 0 : s[1].operator), $ = (e) => {
|
|
138
|
+
if (e.preventDefault(), !i.filterChange)
|
|
128
139
|
return;
|
|
129
|
-
const
|
|
130
|
-
...
|
|
131
|
-
filters:
|
|
132
|
-
var
|
|
133
|
-
return
|
|
140
|
+
const l = N(i.filter), n = {
|
|
141
|
+
...l,
|
|
142
|
+
filters: l.filters.filter((o) => {
|
|
143
|
+
var a, f;
|
|
144
|
+
return !(o.field === ((a = t == null ? void 0 : t.current) == null ? void 0 : a.field) || (f = o.filters) != null && f.some((v) => {
|
|
145
|
+
var h;
|
|
146
|
+
return v.field === ((h = t == null ? void 0 : t.current) == null ? void 0 : h.field);
|
|
147
|
+
}));
|
|
134
148
|
})
|
|
135
149
|
};
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
150
|
+
V && n.filters.push(Z()), i.filterChange(n, e), C(
|
|
151
|
+
(o) => o.map((a) => ({
|
|
152
|
+
...a,
|
|
153
|
+
expanded: !1
|
|
154
|
+
}))
|
|
155
|
+
);
|
|
156
|
+
}, x = (e) => {
|
|
157
|
+
if (e.preventDefault(), !i.filterChange)
|
|
139
158
|
return;
|
|
140
|
-
const
|
|
141
|
-
var
|
|
142
|
-
return
|
|
159
|
+
const l = N(i.filter), n = l.filters.filter((o) => {
|
|
160
|
+
var a, f;
|
|
161
|
+
return !(o.field === ((a = t == null ? void 0 : t.current) == null ? void 0 : a.field) || (f = o.filters) != null && f.some((v) => {
|
|
162
|
+
var h;
|
|
163
|
+
return v.field === ((h = t == null ? void 0 : t.current) == null ? void 0 : h.field);
|
|
164
|
+
}));
|
|
143
165
|
});
|
|
144
|
-
|
|
145
|
-
(
|
|
146
|
-
...
|
|
166
|
+
n.length === 0 ? i.filterChange(null, e) : i.filterChange({ ...l, filters: n }, e), C(
|
|
167
|
+
(o) => o.map((a) => ({
|
|
168
|
+
...a,
|
|
147
169
|
expanded: !1
|
|
148
170
|
}))
|
|
149
171
|
);
|
|
150
172
|
}, De = () => {
|
|
151
|
-
|
|
173
|
+
K(!1);
|
|
152
174
|
}, ye = (e) => {
|
|
153
|
-
e.preventDefault(),
|
|
175
|
+
e.preventDefault(), L(!B);
|
|
154
176
|
}, Ie = (e) => {
|
|
155
|
-
!e.isAnchorClicked &&
|
|
156
|
-
},
|
|
157
|
-
const o = _e(document);
|
|
158
|
-
clearTimeout(I.current), I.current = window.setTimeout(() => {
|
|
159
|
-
!n.mobileMode && o && e.relatedTarget !== g.current && y.current && !y.current.contains(o) && x();
|
|
160
|
-
});
|
|
161
|
-
}, x = () => {
|
|
177
|
+
!e.isAnchorClicked && L(!1);
|
|
178
|
+
}, U = r.useMemo(() => u.show !== void 0 ? u.show : B, [u.show, B]), R = () => {
|
|
162
179
|
var e;
|
|
163
|
-
|
|
164
|
-
},
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
(o = K.current) == null || o.triggerMouseEvent(e);
|
|
172
|
-
}, Pe = (e) => {
|
|
173
|
-
var o;
|
|
174
|
-
(o = K.current) == null || o.triggerKeyboardEvent(e);
|
|
175
|
-
}, R = t.useCallback(
|
|
180
|
+
u.onCloseMenu && u.onCloseMenu(), L(!1), F.current && ((e = F.current.element) == null || e.focus());
|
|
181
|
+
}, Ne = (e) => {
|
|
182
|
+
var l;
|
|
183
|
+
(l = _.current) == null || l.triggerMouseEvent(e);
|
|
184
|
+
}, Be = (e) => {
|
|
185
|
+
var l;
|
|
186
|
+
(l = _.current) == null || l.triggerKeyboardEvent(e);
|
|
187
|
+
}, ee = r.useCallback(
|
|
176
188
|
(e) => {
|
|
177
|
-
if (e.preventDefault(), !
|
|
189
|
+
if (e.preventDefault(), !i.filterChange)
|
|
190
|
+
return;
|
|
191
|
+
const l = N(i.filter);
|
|
192
|
+
if (!l.filters.length)
|
|
178
193
|
return;
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
(
|
|
182
|
-
...
|
|
194
|
+
const n = l.filters.filter(() => !1);
|
|
195
|
+
n.length === 0 ? i.filterChange(null, e) : i.filterChange({ ...l, filters: n }, e), R(), C(
|
|
196
|
+
(o) => o.map((a) => ({
|
|
197
|
+
...a,
|
|
183
198
|
expanded: !1
|
|
184
199
|
}))
|
|
185
200
|
);
|
|
186
201
|
},
|
|
187
|
-
[
|
|
188
|
-
),
|
|
189
|
-
|
|
202
|
+
[i]
|
|
203
|
+
), Le = /* @__PURE__ */ r.createElement(
|
|
204
|
+
y,
|
|
190
205
|
{
|
|
191
|
-
ref:
|
|
206
|
+
ref: F,
|
|
192
207
|
togglable: !0,
|
|
193
|
-
selected:
|
|
194
|
-
svgIcon:
|
|
195
|
-
icon:
|
|
196
|
-
size:
|
|
197
|
-
className:
|
|
198
|
-
"k-icon-button":
|
|
208
|
+
selected: U,
|
|
209
|
+
svgIcon: u.svgIcon ? u.svgIcon : u.icon ? void 0 : fe,
|
|
210
|
+
icon: u.icon,
|
|
211
|
+
size: i.mobileMode ? "large" : "medium",
|
|
212
|
+
className: Oe("k-toolbar-button", {
|
|
213
|
+
"k-icon-button": i.mobileMode
|
|
199
214
|
}),
|
|
200
|
-
title:
|
|
215
|
+
title: m.toLanguageString(I, k[I]),
|
|
201
216
|
onClick: ye
|
|
202
217
|
},
|
|
203
|
-
!
|
|
204
|
-
), te = /* @__PURE__ */
|
|
205
|
-
var
|
|
206
|
-
return e.filterable && /* @__PURE__ */
|
|
207
|
-
|
|
218
|
+
!i.mobileMode && m.toLanguageString(I, k[I])
|
|
219
|
+
), te = /* @__PURE__ */ r.createElement(r.Fragment, null, H.map((e) => {
|
|
220
|
+
var l, n;
|
|
221
|
+
return e.filterable && /* @__PURE__ */ r.createElement(Ue, { key: e.id }, /* @__PURE__ */ r.createElement("div", { className: "k-expander" }, /* @__PURE__ */ r.createElement(
|
|
222
|
+
Te,
|
|
208
223
|
{
|
|
209
|
-
title:
|
|
224
|
+
title: j(e),
|
|
210
225
|
expandable: !0,
|
|
211
|
-
expanded: !!((
|
|
212
|
-
onClick: (
|
|
226
|
+
expanded: !!((l = p == null ? void 0 : p.find((o) => o.column.field === e.field)) != null && l.expanded),
|
|
227
|
+
onClick: (o) => q(o, e)
|
|
213
228
|
}
|
|
214
|
-
)), /* @__PURE__ */
|
|
215
|
-
|
|
229
|
+
)), /* @__PURE__ */ r.createElement(
|
|
230
|
+
Ve,
|
|
216
231
|
{
|
|
217
|
-
show: !!((
|
|
232
|
+
show: !!((n = p == null ? void 0 : p.find((o) => o.column.field === e.field)) != null && n.expanded)
|
|
218
233
|
},
|
|
219
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ r.createElement("form", { className: "k-filter-menu", onSubmit: $, onReset: x }, /* @__PURE__ */ r.createElement("div", { className: "k-filter-menu-container" }, O ? /* @__PURE__ */ r.createElement(O, { ...T }) : /* @__PURE__ */ r.createElement(Je, { ...T }), /* @__PURE__ */ r.createElement("div", { className: "k-actions k-actions-stretched" }, /* @__PURE__ */ r.createElement(y, { themeColor: "primary", disabled: !V }, m.toLanguageString(
|
|
235
|
+
de,
|
|
236
|
+
k[de]
|
|
237
|
+
)), /* @__PURE__ */ r.createElement(y, { type: "reset" }, m.toLanguageString(
|
|
220
238
|
ge,
|
|
221
|
-
|
|
222
|
-
)), /* @__PURE__ */ t.createElement(k, { type: "reset" }, f.toLanguageString(
|
|
223
|
-
pe,
|
|
224
|
-
F[pe]
|
|
239
|
+
k[ge]
|
|
225
240
|
)))))
|
|
226
241
|
));
|
|
227
|
-
}), /* @__PURE__ */
|
|
228
|
-
return /* @__PURE__ */
|
|
229
|
-
/* @__PURE__ */
|
|
230
|
-
|
|
242
|
+
}), /* @__PURE__ */ r.createElement("div", { className: "k-actions k-actions-stretched k-actions-horizontal k-column-menu-footer" }, /* @__PURE__ */ r.createElement(y, { svgIcon: Ke, onClick: ee }, m.toLanguageString(pe, k[pe]))));
|
|
243
|
+
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(Ye, null, Le, he && /* @__PURE__ */ r.createElement(Ze, { themeColor: "primary" })), i.mobileMode ? /* @__PURE__ */ r.createElement($e, null, Pe.createPortal(
|
|
244
|
+
/* @__PURE__ */ r.createElement(
|
|
245
|
+
xe,
|
|
231
246
|
{
|
|
232
|
-
filtered:
|
|
233
|
-
computedShow:
|
|
234
|
-
expandState:
|
|
235
|
-
FilterUI:
|
|
236
|
-
filterUIProps:
|
|
237
|
-
isFilterValid:
|
|
238
|
-
renderTitle:
|
|
247
|
+
filtered: H,
|
|
248
|
+
computedShow: U,
|
|
249
|
+
expandState: p,
|
|
250
|
+
FilterUI: O,
|
|
251
|
+
filterUIProps: T,
|
|
252
|
+
isFilterValid: V,
|
|
253
|
+
renderTitle: j,
|
|
239
254
|
onBackView: De,
|
|
240
|
-
clear:
|
|
241
|
-
submit:
|
|
242
|
-
onClose:
|
|
243
|
-
onFilterExpand:
|
|
244
|
-
handleClearAllFilters:
|
|
255
|
+
clear: x,
|
|
256
|
+
submit: $,
|
|
257
|
+
onClose: R,
|
|
258
|
+
onFilterExpand: q,
|
|
259
|
+
handleClearAllFilters: ee
|
|
245
260
|
},
|
|
246
261
|
te
|
|
247
262
|
),
|
|
248
|
-
(
|
|
249
|
-
)) : /* @__PURE__ */
|
|
250
|
-
|
|
263
|
+
(se = Ee()) == null ? void 0 : se.body
|
|
264
|
+
)) : /* @__PURE__ */ r.createElement(
|
|
265
|
+
Xe,
|
|
251
266
|
{
|
|
252
|
-
anchor: (
|
|
253
|
-
show:
|
|
267
|
+
anchor: (ce = F.current) == null ? void 0 : ce.element,
|
|
268
|
+
show: U,
|
|
254
269
|
popupClass: "k-grid-columnmenu-popup",
|
|
255
270
|
onMouseDownOutside: Ie
|
|
256
271
|
},
|
|
257
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ r.createElement(
|
|
258
273
|
"div",
|
|
259
274
|
{
|
|
260
|
-
ref:
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
onMouseDown: Le,
|
|
264
|
-
onKeyDown: Pe,
|
|
275
|
+
ref: Fe,
|
|
276
|
+
onMouseDown: Ne,
|
|
277
|
+
onKeyDown: Be,
|
|
265
278
|
className: "k-column-menu k-column-menu-md"
|
|
266
279
|
},
|
|
267
280
|
te
|
|
268
281
|
)
|
|
269
282
|
));
|
|
270
283
|
};
|
|
271
|
-
|
|
284
|
+
Re.displayName = "KendoReactGridToolbarFilter";
|
|
272
285
|
export {
|
|
273
|
-
|
|
286
|
+
Re as GridToolbarFilter
|
|
274
287
|
};
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react"),z=require("react-dom"),L=require("../columnMenu/GridColumnMenuItemGroup.js"),K=require("../columnMenu/GridColumnMenuItem.js"),F=require("../utils/GridContext.js"),p=require("@progress/kendo-react-buttons"),d=require("@progress/kendo-svg-icons"),_=require("@progress/kendo-react-intl"),a=require("../messages/index.js"),C=require("@progress/kendo-react-common"),w=require("@progress/kendo-react-indicators"),V=require("@progress/kendo-react-popup"),H=require("./adaptiveContext/GridToolbarAdaptiveContext.js"),J=require("./adaptiveContent/GridAdaptiveToolbarSort.js");function Q(o){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const n in o)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(o,n);Object.defineProperty(c,n,s.get?s:{enumerable:!0,get:()=>o[n]})}}return c.default=o,Object.freeze(c)}const e=Q(j),G=o=>{var E,I;const{onCloseMenu:c}=o,n=e.useContext(F.GridContext),s=n.columnsState,q=n.sortable,l=n.sort,y=!!(l!=null&&l.length),[m,i]=e.useState(!1),u=e.useRef(null),D=e.useRef(null),f=e.useRef(null),g=_.useLocalization(),R=C.useDocument(u),k=e.useMemo(()=>(s==null?void 0:s.filter(t=>{var r;return(r=t.title||t.field)==null?void 0:r.toLowerCase()}))||[],[s]),S=e.useCallback((t,r)=>{n.headerCellClick(t,r)},[n]),h=e.useCallback(t=>{l!=null&&l.length&&(n.sortChange([],t),i(!1),c&&c())},[n,l,c]),M=e.useCallback(t=>{const r=l?l.findIndex(A=>A.field===t.field):-1;return e.createElement(e.Fragment,null,t.title||t.field,e.createElement("span",{className:"k-columnmenu-indicators"},r>=0&&[e.createElement(C.SvgIcon,{key:1,icon:l[r].dir==="asc"?d.sortAscSmallIcon:d.sortDescSmallIcon}),l.length>1&&e.createElement("span",{key:2,className:"k-sort-index"},r+1)]))},[l]),x=t=>{t.preventDefault(),i(!m)},b=e.useMemo(()=>o.show!==void 0?o.show:m,[o.show,m]),B=()=>{var t;o.onCloseMenu&&o.onCloseMenu(),i(!1),u.current&&((t=u.current.element)==null||t.focus())},T=t=>{var r;(r=f.current)==null||r.triggerMouseEvent(t)},O=t=>{var r;(r=f.current)==null||r.triggerKeyboardEvent(t)},N=t=>{!t.isAnchorClicked&&i(!1)},v=e.createElement(e.Fragment,null,e.createElement(L.GridColumnMenuItemGroup,null,k.map(t=>e.createElement(K.GridColumnMenuItem,{key:t.id,title:M(t),onClick:r=>S(r,t)}))),e.createElement("div",{className:"k-actions k-actions-stretched k-actions-horizontal k-column-menu-footer"},e.createElement(p.Button,{svgIcon:d.xIcon,onClick:h},g.toLanguageString(a.sortClearButton,a.messages[a.sortClearButton])))),P=e.createElement(p.Button,{ref:u,togglable:!0,selected:b,svgIcon:o.svgIcon?o.svgIcon:o.icon?void 0:d.arrowsSwapIcon,icon:o.icon,size:n.mobileMode?"large":"medium",className:C.classNames("k-toolbar-button",{"k-icon-button":n.mobileMode}),title:g.toLanguageString(a.toolbarSort,a.messages[a.toolbarSort]),onClick:x},!n.mobileMode&&g.toLanguageString(a.toolbarSort,a.messages[a.toolbarSort]));return q&&e.createElement(e.Fragment,null,e.createElement(w.BadgeContainer,null,P,y&&e.createElement(w.Badge,{themeColor:"primary"})),n.mobileMode?e.createElement(H.GridToolbarAdaptiveProvider,null,z.createPortal(e.createElement(J.GridAdaptiveToolbarSort,{filtered:k,computedShow:b,renderTitle:M,onClose:B,onClear:h,handleSorting:S},v),(E=R())==null?void 0:E.body)):e.createElement(V.Popup,{anchor:(I=u.current)==null?void 0:I.element,show:b,popupClass:"k-grid-columnmenu-popup",onMouseDownOutside:N},e.createElement("div",{ref:D,onMouseDown:T,onKeyDown:O,className:"k-column-menu k-column-menu-md"},v)))};G.displayName="KendoReactGridToolbarSort";exports.GridToolbarSort=G;
|