@progress/kendo-react-grid 11.0.0-develop.2 → 11.0.0-develop.21
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/BasePDFExport.js +8 -0
- package/BasePDFExport.mjs +52 -0
- package/Grid.js +1 -1
- package/Grid.mjs +13 -18
- package/GridClientContextReader.js +1 -1
- package/GridClientContextReader.mjs +16 -13
- package/GridClientWrapper.js +1 -1
- package/GridClientWrapper.mjs +459 -449
- package/GridComponent.js +1 -1
- package/GridComponent.mjs +397 -414
- package/GridPdfExportButton.js +8 -0
- package/GridPdfExportButton.mjs +35 -0
- package/GridSearchBox.js +1 -1
- package/GridSearchBox.mjs +1 -1
- package/GridToolbar.js +1 -1
- package/GridToolbar.mjs +15 -20
- package/StatusBar.js +1 -1
- package/StatusBar.mjs +23 -23
- package/VirtualScroll.js +1 -1
- package/VirtualScroll.mjs +65 -107
- package/cells/GridDetailHierarchyCell.js +1 -1
- package/cells/GridDetailHierarchyCell.mjs +4 -4
- package/cells/GridFilterCell.js +1 -1
- package/cells/GridFilterCell.mjs +46 -46
- package/cells/datacell/GridCell.js +9 -0
- package/cells/datacell/GridCell.mjs +23 -0
- package/cells/datacell/GridCellServer.js +8 -0
- package/cells/datacell/GridCellServer.mjs +27 -0
- package/cells/datacell/GridCellServerContainer.js +9 -0
- package/cells/datacell/GridCellServerContainer.mjs +26 -0
- package/cells/datacell/useCellClientTdProps.js +9 -0
- package/cells/datacell/useCellClientTdProps.mjs +30 -0
- package/cells/datacell/utils.js +8 -0
- package/cells/datacell/utils.mjs +47 -0
- package/cells/detailcell/GridDetailCell.js +9 -0
- package/cells/detailcell/GridDetailCell.mjs +18 -0
- package/cells/detailcell/GridDetailCellServer.js +8 -0
- package/cells/detailcell/GridDetailCellServer.mjs +17 -0
- package/{codemods/index.js → cells/detailcell/GridDetailCellServerContainer.js} +2 -1
- package/cells/detailcell/GridDetailCellServerContainer.mjs +19 -0
- package/cells/detailcell/useDetailCellClientTdProps.js +9 -0
- package/cells/detailcell/useDetailCellClientTdProps.mjs +20 -0
- package/cells/detailcell/utils.js +8 -0
- package/cells/detailcell/utils.mjs +20 -0
- package/cells/editcell/GridEditCell.js +9 -0
- package/cells/editcell/GridEditCell.mjs +20 -0
- package/cells/{client → editcell}/GridEditCellEditor.js +1 -1
- package/cells/{client → editcell}/GridEditCellEditor.mjs +1 -1
- package/cells/editcell/GridEditCellServer.js +8 -0
- package/cells/editcell/GridEditCellServer.mjs +32 -0
- package/cells/editcell/GridEditCellServerContainer.js +9 -0
- package/cells/editcell/GridEditCellServerContainer.mjs +26 -0
- package/cells/editcell/useEditCellClientTdProps.js +9 -0
- package/cells/editcell/useEditCellClientTdProps.mjs +21 -0
- package/cells/editcell/utils.js +8 -0
- package/cells/editcell/utils.mjs +29 -0
- package/cells/groupcell/GridGroupCell.js +9 -0
- package/cells/groupcell/GridGroupCell.mjs +22 -0
- package/cells/groupcell/GridGroupCellServer.js +8 -0
- package/cells/groupcell/GridGroupCellServer.mjs +44 -0
- package/cells/groupcell/GridGroupCellServerContainer.js +9 -0
- package/cells/groupcell/GridGroupCellServerContainer.mjs +38 -0
- package/cells/{client → groupcell}/GridGroupCellToggle.js +1 -1
- package/cells/{client → groupcell}/GridGroupCellToggle.mjs +1 -1
- package/cells/groupcell/useGroupCellClientTdProps.js +9 -0
- package/cells/groupcell/useGroupCellClientTdProps.mjs +44 -0
- package/cells/groupcell/utils.js +8 -0
- package/cells/groupcell/utils.mjs +48 -0
- package/cells/hierarchycell/GridHierarchyCell.js +9 -0
- package/cells/hierarchycell/GridHierarchyCell.mjs +19 -0
- package/cells/hierarchycell/GridHierarchyCellServer.js +8 -0
- package/cells/hierarchycell/GridHierarchyCellServer.mjs +32 -0
- package/cells/hierarchycell/GridHierarchyCellServerContainer.js +9 -0
- package/cells/hierarchycell/GridHierarchyCellServerContainer.mjs +26 -0
- package/cells/{client → hierarchycell}/GridHierarchyCellToggle.js +1 -1
- package/cells/{client → hierarchycell}/GridHierarchyCellToggle.mjs +1 -1
- package/cells/hierarchycell/useHierarchyCellClientTdProps.js +9 -0
- package/cells/hierarchycell/useHierarchyCellClientTdProps.mjs +32 -0
- package/cells/hierarchycell/utils.js +8 -0
- package/cells/hierarchycell/utils.mjs +30 -0
- package/cells/hooks.js +9 -0
- package/cells/hooks.mjs +41 -0
- package/cells/rowreordercell/GridRowReorderCell.js +9 -0
- package/cells/rowreordercell/GridRowReorderCell.mjs +19 -0
- package/cells/rowreordercell/GridRowReorderCellServer.js +8 -0
- package/cells/rowreordercell/GridRowReorderCellServer.mjs +18 -0
- package/cells/rowreordercell/GridRowReorderCellServerContainer.js +9 -0
- package/cells/rowreordercell/GridRowReorderCellServerContainer.mjs +19 -0
- package/cells/rowreordercell/useRowReorderCellClientTdProps.js +9 -0
- package/cells/rowreordercell/useRowReorderCellClientTdProps.mjs +26 -0
- package/cells/rowreordercell/utils.js +8 -0
- package/cells/rowreordercell/utils.mjs +30 -0
- package/cells/selectioncell/GridSelectionCell.js +9 -0
- package/cells/selectioncell/GridSelectionCell.mjs +20 -0
- package/cells/{client → selectioncell}/GridSelectionCellInput.js +1 -1
- package/cells/{client → selectioncell}/GridSelectionCellInput.mjs +1 -1
- package/cells/selectioncell/GridSelectionCellServer.js +8 -0
- package/cells/selectioncell/GridSelectionCellServer.mjs +33 -0
- package/cells/selectioncell/GridSelectionCellServerContainer.js +9 -0
- package/cells/selectioncell/GridSelectionCellServerContainer.mjs +26 -0
- package/cells/selectioncell/useSelectionCellClientTdProps.js +9 -0
- package/cells/selectioncell/useSelectionCellClientTdProps.mjs +21 -0
- package/cells/selectioncell/utils.js +8 -0
- package/cells/selectioncell/utils.mjs +25 -0
- package/codemods/v11/cell-render.js +9 -0
- package/codemods/v11/column-cell.js +9 -0
- package/codemods/v11/column-filter-cell.js +9 -0
- package/codemods/v11/column-footer-cell.js +9 -0
- package/codemods/v11/column-header-cell.js +9 -0
- package/codemods/v11/detail-expand-state.js +9 -0
- package/codemods/v11/edit-state.js +9 -0
- package/codemods/v11/filter-cell-render.js +9 -0
- package/codemods/v11/group-expand-state.js +9 -0
- package/codemods/v11/header-cell-render.js +9 -0
- package/codemods/v11/index.js +9 -0
- package/codemods/v11/row-render.js +9 -0
- package/codemods/v11/selection-state.js +9 -0
- package/codemods/v11/utils.js +9 -0
- package/columnMenu/GridColumnMenuCheckboxFilter.js +1 -1
- package/columnMenu/GridColumnMenuCheckboxFilter.mjs +84 -84
- package/columnMenu/GridColumnMenuColumnsChooser.js +1 -1
- package/columnMenu/GridColumnMenuColumnsChooser.mjs +71 -72
- package/columnMenu/GridColumnMenuFilter.js +1 -1
- package/columnMenu/GridColumnMenuFilter.mjs +83 -84
- package/columnMenu/GridColumnMenuFilterCell.js +1 -1
- package/columnMenu/GridColumnMenuFilterCell.mjs +35 -28
- package/columnMenu/GridColumnMenuFilterUI.js +1 -1
- package/columnMenu/GridColumnMenuFilterUI.mjs +1 -1
- package/columnMenu/GridColumnMenuItem.js +1 -1
- package/columnMenu/GridColumnMenuItem.mjs +9 -9
- package/columnMenu/GridColumnMenuWrapper.js +1 -1
- package/columnMenu/GridColumnMenuWrapper.mjs +62 -49
- package/columnMenu/adaptiveContent/GridAdaptiveCheckboxFilter.js +1 -1
- package/columnMenu/adaptiveContent/GridAdaptiveCheckboxFilter.mjs +40 -34
- package/columnMenu/adaptiveContent/GridAdaptiveColumnChooser.js +1 -1
- package/columnMenu/adaptiveContent/GridAdaptiveColumnChooser.mjs +51 -45
- package/columnMenu/adaptiveContent/GridAdaptiveColumnMenu.js +1 -1
- package/columnMenu/adaptiveContent/GridAdaptiveColumnMenu.mjs +2 -2
- package/columnMenu/adaptiveContent/GridAdaptiveFilterMenu.js +1 -1
- package/columnMenu/adaptiveContent/GridAdaptiveFilterMenu.mjs +40 -33
- package/components/GridContainerElementContainer.js +1 -1
- package/components/GridContainerElementContainer.mjs +1 -1
- package/components/GridDragClue.js +1 -1
- package/components/GridDragClue.mjs +1 -1
- package/components/GridDraggableRowsContainer.js +1 -1
- package/components/GridDraggableRowsContainer.mjs +71 -67
- package/components/GridDropClue.js +1 -1
- package/components/GridDropClue.mjs +1 -1
- package/components/GridEditDialog.js +1 -1
- package/components/GridEditDialog.mjs +1 -1
- package/components/GridElementContainer.js +1 -1
- package/components/GridElementContainer.mjs +1 -1
- package/components/PagerContainer.js +1 -1
- package/components/PagerContainer.mjs +1 -1
- package/components/VirtualScrollHeightContainer.js +1 -1
- package/components/VirtualScrollHeightContainer.mjs +4 -4
- package/components/colGroup/GridColGroup.js +1 -1
- package/components/colGroup/GridColGroup.mjs +1 -1
- package/components/noRecords/GridNoRecordsContainer.js +1 -1
- package/components/noRecords/GridNoRecordsContainer.mjs +1 -1
- package/components/table/GridTable.js +1 -1
- package/components/table/GridTable.mjs +1 -1
- package/components/table/GridTableBody.js +1 -1
- package/components/table/GridTableBody.mjs +1 -1
- package/components/table/GridTableScrollable.js +1 -1
- package/components/table/GridTableScrollable.mjs +16 -15
- package/components/utils.js +1 -1
- package/components/utils.mjs +9 -10
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/footer/Footer.js +1 -1
- package/footer/Footer.mjs +1 -1
- package/footer/FooterCell.js +1 -1
- package/footer/FooterCell.mjs +14 -14
- package/footer/client/FooterCellContainer.js +1 -1
- package/footer/client/FooterCellContainer.mjs +1 -1
- package/header/FilterRow.js +1 -1
- package/header/FilterRow.mjs +42 -46
- package/header/GridHeaderCell.js +1 -1
- package/header/GridHeaderCell.mjs +11 -11
- package/header/GridHeaderSelectionCell.js +1 -1
- package/header/GridHeaderSelectionCell.mjs +14 -14
- package/header/GroupPanel.js +1 -1
- package/header/GroupPanel.mjs +1 -1
- package/header/Header.js +1 -1
- package/header/Header.mjs +1 -1
- package/header/HeaderRow.js +1 -1
- package/header/HeaderRow.mjs +19 -20
- package/header/client/GridFilterCellContainer.js +1 -1
- package/header/client/GridFilterCellContainer.mjs +11 -12
- package/header/client/GridFilterCellElementContainer.js +1 -1
- package/header/client/GridFilterCellElementContainer.mjs +1 -1
- package/header/client/GridHeaderCellContainer.js +1 -1
- package/header/client/GridHeaderCellContainer.mjs +7 -8
- package/header/client/GridHeaderCellElementContainer.js +1 -1
- package/header/client/GridHeaderCellElementContainer.mjs +1 -1
- package/header/client/GridHeaderRowContainer.js +1 -1
- package/header/client/GridHeaderRowContainer.mjs +1 -1
- package/header/client/HeaderCellResizer.js +1 -1
- package/header/client/HeaderCellResizer.mjs +1 -1
- package/header/client/HeaderRowDraggable.js +1 -1
- package/header/client/HeaderRowDraggable.mjs +1 -1
- package/index.d.mts +334 -193
- package/index.d.ts +334 -193
- package/index.js +1 -1
- package/index.mjs +82 -72
- package/messages/index.js +1 -1
- package/messages/index.mjs +94 -76
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +77 -21
- package/paging/GridPagerSettings.js +1 -1
- package/paging/GridPagerSettings.mjs +17 -13
- package/rows/GridRow.js +1 -1
- package/rows/GridRow.mjs +32 -33
- package/toolbar-tools/GridToolbarCheckboxFilter.js +8 -0
- package/toolbar-tools/GridToolbarCheckboxFilter.mjs +312 -0
- package/toolbar-tools/GridToolbarColumnsChooser.js +8 -0
- package/toolbar-tools/GridToolbarColumnsChooser.mjs +178 -0
- package/toolbar-tools/GridToolbarFilter.js +8 -0
- package/toolbar-tools/GridToolbarFilter.mjs +281 -0
- package/toolbar-tools/GridToolbarSort.js +8 -0
- package/toolbar-tools/GridToolbarSort.mjs +146 -0
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarCheckboxFilter.js +9 -0
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarCheckboxFilter.mjs +114 -0
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarColumnChooser.js +9 -0
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarColumnChooser.mjs +89 -0
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarFilter.js +9 -0
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarFilter.mjs +98 -0
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarSort.js +9 -0
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarSort.mjs +68 -0
- package/toolbar-tools/adaptiveContext/GridToolbarAdaptiveContext.js +9 -0
- package/toolbar-tools/adaptiveContext/GridToolbarAdaptiveContext.mjs +17 -0
- package/utils/GridContext.js +9 -0
- package/utils/GridContext.mjs +13 -0
- package/utils/index.js +1 -1
- package/utils/index.mjs +162 -157
- package/utils/premium.js +1 -1
- package/utils/premium.mjs +18 -22
- package/utils/virtualColumns.js +1 -1
- package/utils/virtualColumns.mjs +13 -7
- package/VirtualScrollFixed.js +0 -8
- package/VirtualScrollFixed.mjs +0 -52
- package/cells/GridCell.js +0 -8
- package/cells/GridCell.mjs +0 -52
- package/cells/GridDetailCell.js +0 -8
- package/cells/GridDetailCell.mjs +0 -26
- package/cells/GridEditCell.js +0 -8
- package/cells/GridEditCell.mjs +0 -35
- package/cells/GridGroupCell.js +0 -8
- package/cells/GridGroupCell.mjs +0 -74
- package/cells/GridHierarchyCell.js +0 -8
- package/cells/GridHierarchyCell.mjs +0 -33
- package/cells/GridRowReorderCell.js +0 -8
- package/cells/GridRowReorderCell.mjs +0 -42
- package/cells/GridSelectionCell.js +0 -8
- package/cells/GridSelectionCell.mjs +0 -30
- package/cells/client/DetailCellContainer.js +0 -9
- package/cells/client/DetailCellContainer.mjs +0 -27
- package/cells/client/GridCellContainer.js +0 -9
- package/cells/client/GridCellContainer.mjs +0 -69
- package/cells/client/GridEditCellContainer.js +0 -9
- package/cells/client/GridEditCellContainer.mjs +0 -61
- package/cells/client/GridGroupCellContainer.js +0 -9
- package/cells/client/GridGroupCellContainer.mjs +0 -88
- package/cells/client/GridHierarchyCellContainer.js +0 -9
- package/cells/client/GridHierarchyCellContainer.mjs +0 -64
- package/cells/client/GridRowReorderContainer.js +0 -9
- package/cells/client/GridRowReorderContainer.mjs +0 -31
- package/cells/client/GridSelectionCellContainer.js +0 -9
- package/cells/client/GridSelectionCellContainer.mjs +0 -61
- package/components/GridCustomCellClientContainer.js +0 -9
- package/components/GridCustomCellClientContainer.mjs +0 -34
|
@@ -7,27 +7,26 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as l from "react";
|
|
10
|
-
import { isCompositeFilterDescriptor as
|
|
10
|
+
import { isCompositeFilterDescriptor as R } from "@progress/kendo-data-query";
|
|
11
11
|
import { GridColumnMenuItem as se } from "./GridColumnMenuItem.mjs";
|
|
12
|
-
import { GridColumnMenuItemGroup as
|
|
13
|
-
import { GridColumnMenuItemContent as
|
|
14
|
-
import { useLocalization as
|
|
15
|
-
import { getFilterType as
|
|
16
|
-
import { adaptiveColumnMenuFilterTitle as
|
|
17
|
-
import { GridColumnMenuFilterUI as
|
|
18
|
-
import { Button as
|
|
19
|
-
import { filterIcon as
|
|
20
|
-
import { GridContext as
|
|
21
|
-
import { GridColumnMenuAdaptiveContext as xe } from "./adaptiveContext/GridColumnMenuAdaptiveContext.mjs";
|
|
12
|
+
import { GridColumnMenuItemGroup as ce } from "./GridColumnMenuItemGroup.mjs";
|
|
13
|
+
import { GridColumnMenuItemContent as ue } from "./GridColumnMenuItemContent.mjs";
|
|
14
|
+
import { useLocalization as fe } from "@progress/kendo-react-intl";
|
|
15
|
+
import { getFilterType as $, getDefaultOperator as de, IsUnaryFilter as v, operatorMap as I, booleanFilterValues as me, filterLogicList as ge, defaultHideSecondFilter as Ce } from "../filterCommon.mjs";
|
|
16
|
+
import { adaptiveColumnMenuFilterTitle as j, messages as E, filterTitle as q, filterSubmitButton as J, filterClearButton as K } from "../messages/index.mjs";
|
|
17
|
+
import { GridColumnMenuFilterUI as Fe } from "./GridColumnMenuFilterUI.mjs";
|
|
18
|
+
import { Button as Q } from "@progress/kendo-react-buttons";
|
|
19
|
+
import { filterIcon as he } from "@progress/kendo-svg-icons";
|
|
20
|
+
import { GridContext as ve } from "../utils/GridContext.mjs";
|
|
22
21
|
import { GridAdaptiveFilterMenu as Ee } from "./adaptiveContent/GridAdaptiveFilterMenu.mjs";
|
|
23
|
-
const k = (e) => e || { filters: [], logic: "and" }, x = (e,
|
|
24
|
-
const
|
|
22
|
+
const k = (e) => e || { filters: [], logic: "and" }, x = (e, a) => k(a).filters.filter((f) => R(f) ? f.filters && f.filters.length && !f.filters.find((g) => R(g) || g.field !== e) : !1)[0] || null, Ne = (e, a) => !!x(e, a), Oe = (e) => {
|
|
23
|
+
const a = l.useContext(ve), y = l.useCallback(() => {
|
|
25
24
|
let t;
|
|
26
25
|
if (e.column && e.column.field) {
|
|
27
|
-
const
|
|
26
|
+
const i = $(e.column.filter), r = de(e.filterOperators, i);
|
|
28
27
|
t = x(e.column.field, e.filter), t = t ? {
|
|
29
28
|
...t,
|
|
30
|
-
filters: t.filters.map((
|
|
29
|
+
filters: t.filters.map((n) => ({ ...n }))
|
|
31
30
|
} : {
|
|
32
31
|
logic: "and",
|
|
33
32
|
filters: [
|
|
@@ -42,50 +41,50 @@ const k = (e) => e || { filters: [], logic: "and" }, x = (e, i) => k(i).filters.
|
|
|
42
41
|
value: v(r) ? null : void 0
|
|
43
42
|
}
|
|
44
43
|
]
|
|
45
|
-
}, t.filters.filter((
|
|
44
|
+
}, t.filters.filter((n) => n.field === e.column.field).length === 1 && t.filters.splice(1, 0, { field: e.column.field, operator: r });
|
|
46
45
|
}
|
|
47
46
|
return t;
|
|
48
|
-
}, [e.column]), [
|
|
49
|
-
const t = T(),
|
|
50
|
-
|
|
51
|
-
},
|
|
47
|
+
}, [e.column]), [p, f] = l.useState(e.expanded || !1), [g, M] = l.useState(!1), [s, L] = l.useState(y()), T = () => e.expanded !== void 0, W = () => {
|
|
48
|
+
const t = T(), i = !(t ? e.expanded : p);
|
|
49
|
+
e.onExpandChange && e.onExpandChange(i), M(!g), !t && !a.mobileMode && f(i);
|
|
50
|
+
}, X = (t) => {
|
|
52
51
|
D(0, t);
|
|
53
|
-
},
|
|
52
|
+
}, Y = (t) => {
|
|
54
53
|
D(1, t);
|
|
55
|
-
}, D = (t,
|
|
56
|
-
const r = s.filters.map((
|
|
57
|
-
...
|
|
58
|
-
value:
|
|
59
|
-
operator:
|
|
60
|
-
} :
|
|
61
|
-
|
|
54
|
+
}, D = (t, i) => {
|
|
55
|
+
const r = s.filters.map((n, o) => o === t ? {
|
|
56
|
+
...n,
|
|
57
|
+
value: i.value,
|
|
58
|
+
operator: i.operator
|
|
59
|
+
} : n);
|
|
60
|
+
L({
|
|
62
61
|
...s,
|
|
63
62
|
filters: r
|
|
64
63
|
});
|
|
65
|
-
},
|
|
66
|
-
let
|
|
67
|
-
t.target.tagName === "SPAN" && (
|
|
68
|
-
},
|
|
64
|
+
}, Z = (t) => {
|
|
65
|
+
let i = t.target.value;
|
|
66
|
+
t.target.tagName === "SPAN" && (i = t.target.parentElement.value), L({ ...s, logic: i });
|
|
67
|
+
}, P = (t) => {
|
|
69
68
|
if (t.preventDefault(), !e.onFilterChange)
|
|
70
69
|
return;
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
},
|
|
70
|
+
const i = e.column.field, r = k(e.filter), n = x(i, e.filter), o = r.filters.filter((m) => m !== n);
|
|
71
|
+
o.length ? e.onFilterChange({ ...r, filters: o }, t) : e.onFilterChange(null, t), e.onCloseMenu && e.onCloseMenu();
|
|
72
|
+
}, N = () => ({
|
|
74
73
|
...s,
|
|
75
74
|
filters: s.filters.filter((t) => t.value !== void 0 && t.value !== null && t.value !== "" || t.value === null && t.operator)
|
|
76
|
-
}),
|
|
75
|
+
}), O = (t) => {
|
|
77
76
|
if (t.preventDefault(), !e.onFilterChange)
|
|
78
77
|
return;
|
|
79
|
-
const
|
|
78
|
+
const i = e.column.field, r = k(e.filter), n = x(i, e.filter), o = N();
|
|
80
79
|
let m = null;
|
|
81
|
-
if (
|
|
82
|
-
const F = r.filters.map((h) => h ===
|
|
80
|
+
if (n && o.filters.length > 0) {
|
|
81
|
+
const F = r.filters.map((h) => h === n ? o : h);
|
|
83
82
|
m = {
|
|
84
83
|
...r,
|
|
85
84
|
filters: F
|
|
86
85
|
};
|
|
87
|
-
} else if (
|
|
88
|
-
const F = r.filters.filter((h) => h !==
|
|
86
|
+
} else if (o.filters.length === 0) {
|
|
87
|
+
const F = r.filters.filter((h) => h !== n);
|
|
89
88
|
F.length && (m = {
|
|
90
89
|
...r,
|
|
91
90
|
filters: F
|
|
@@ -93,74 +92,74 @@ const k = (e) => e || { filters: [], logic: "and" }, x = (e, i) => k(i).filters.
|
|
|
93
92
|
} else
|
|
94
93
|
m = {
|
|
95
94
|
...r,
|
|
96
|
-
filters: [...r.filters,
|
|
95
|
+
filters: [...r.filters, o]
|
|
97
96
|
};
|
|
98
97
|
e.onFilterChange(m, t), e.onCloseMenu && e.onCloseMenu();
|
|
99
|
-
}, { column:
|
|
100
|
-
if (!
|
|
98
|
+
}, { column: c, filterUI: ee, hideSecondFilter: V, filterOperators: te } = e, u = fe();
|
|
99
|
+
if (!c || !c.field)
|
|
101
100
|
return /* @__PURE__ */ l.createElement("div", null);
|
|
102
|
-
const C =
|
|
103
|
-
field:
|
|
101
|
+
const C = $(c.filter), le = V !== void 0 ? V : Ce[C], d = s.filters, A = I(te[C], u), B = I(me, u), re = {
|
|
102
|
+
field: c.field,
|
|
104
103
|
value: d[0].value,
|
|
105
104
|
operator: d[0].operator,
|
|
106
|
-
operators:
|
|
105
|
+
operators: A,
|
|
107
106
|
booleanValues: B,
|
|
108
|
-
onChange:
|
|
107
|
+
onChange: X,
|
|
109
108
|
filterType: C
|
|
110
|
-
},
|
|
111
|
-
field:
|
|
109
|
+
}, ie = {
|
|
110
|
+
field: c.field,
|
|
112
111
|
value: d[1].value,
|
|
113
112
|
operator: d[1].operator,
|
|
114
|
-
operators:
|
|
113
|
+
operators: A,
|
|
115
114
|
booleanValues: B,
|
|
116
|
-
onChange:
|
|
115
|
+
onChange: Y,
|
|
117
116
|
filterType: C
|
|
118
|
-
}, U = s.logic,
|
|
119
|
-
value:
|
|
120
|
-
onChange:
|
|
121
|
-
data:
|
|
122
|
-
},
|
|
123
|
-
firstFilterProps:
|
|
124
|
-
secondFilterProps:
|
|
125
|
-
logicData:
|
|
126
|
-
logicValue:
|
|
127
|
-
onLogicChange:
|
|
128
|
-
hideSecondFilter:
|
|
129
|
-
}, _ =
|
|
130
|
-
M(!1)
|
|
131
|
-
},
|
|
117
|
+
}, U = s.logic, w = I(ge, u), G = {
|
|
118
|
+
value: w.find((t) => t.operator === (U === null ? "" : U)),
|
|
119
|
+
onChange: Z,
|
|
120
|
+
data: w
|
|
121
|
+
}, S = ee, b = {
|
|
122
|
+
firstFilterProps: re,
|
|
123
|
+
secondFilterProps: ie,
|
|
124
|
+
logicData: G.data,
|
|
125
|
+
logicValue: G.value,
|
|
126
|
+
onLogicChange: G.onChange,
|
|
127
|
+
hideSecondFilter: le
|
|
128
|
+
}, _ = N().filters.length !== 0 || v(d[0].operator) || v(d[1].operator), z = T() ? e.expanded : p, H = e.alwaysExpand && !a.mobileMode, ne = () => {
|
|
129
|
+
M(!1);
|
|
130
|
+
}, oe = () => {
|
|
132
131
|
M(!1), e.onCloseMenu && e.onCloseMenu();
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
)} ${
|
|
137
|
-
return /* @__PURE__ */ l.createElement(
|
|
132
|
+
}, ae = `${u.toLanguageString(
|
|
133
|
+
j,
|
|
134
|
+
E[j]
|
|
135
|
+
)} ${c.title || c.field}`;
|
|
136
|
+
return /* @__PURE__ */ l.createElement(ce, null, !H && /* @__PURE__ */ l.createElement("div", { className: "k-expander" }, /* @__PURE__ */ l.createElement(
|
|
138
137
|
se,
|
|
139
138
|
{
|
|
140
|
-
title:
|
|
139
|
+
title: u.toLanguageString(q, E[q]),
|
|
141
140
|
iconClass: "k-i-filter",
|
|
142
|
-
svgIcon:
|
|
141
|
+
svgIcon: he,
|
|
143
142
|
expandable: !0,
|
|
144
143
|
expanded: !!z,
|
|
145
|
-
onClick:
|
|
144
|
+
onClick: W
|
|
146
145
|
}
|
|
147
|
-
)),
|
|
146
|
+
)), a.mobileMode && g ? /* @__PURE__ */ l.createElement(
|
|
148
147
|
Ee,
|
|
149
148
|
{
|
|
150
|
-
FilterUI:
|
|
149
|
+
FilterUI: S,
|
|
151
150
|
filterUIProps: b,
|
|
152
|
-
onBackView:
|
|
153
|
-
adaptiveTitle:
|
|
154
|
-
handleClose:
|
|
155
|
-
submit:
|
|
156
|
-
clear:
|
|
151
|
+
onBackView: ne,
|
|
152
|
+
adaptiveTitle: ae,
|
|
153
|
+
handleClose: oe,
|
|
154
|
+
submit: O,
|
|
155
|
+
clear: P,
|
|
157
156
|
isFilterValid: _
|
|
158
157
|
}
|
|
159
|
-
)
|
|
158
|
+
) : /* @__PURE__ */ l.createElement(ue, { show: (H || !!z) && !a.mobileMode }, /* @__PURE__ */ l.createElement("form", { className: "k-filter-menu", onSubmit: O, onReset: P }, /* @__PURE__ */ l.createElement("div", { className: "k-filter-menu-container" }, S ? /* @__PURE__ */ l.createElement(S, { ...b }) : /* @__PURE__ */ l.createElement(Fe, { ...b }), /* @__PURE__ */ l.createElement("div", { className: "k-actions k-actions-stretched" }, /* @__PURE__ */ l.createElement(Q, { themeColor: "primary", disabled: !_ }, u.toLanguageString(J, E[J])), /* @__PURE__ */ l.createElement(Q, { type: "reset" }, u.toLanguageString(K, E[K])))))));
|
|
160
159
|
};
|
|
161
160
|
export {
|
|
162
|
-
|
|
161
|
+
Oe as GridColumnMenuFilter,
|
|
163
162
|
x as filterGroupByField,
|
|
164
|
-
|
|
163
|
+
Ne as isColumnMenuFilterActive,
|
|
165
164
|
k as rootFilterOrDefault
|
|
166
165
|
};
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react"),d=require("@progress/kendo-react-dropdowns"),
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react"),d=require("@progress/kendo-react-dropdowns"),m=require("@progress/kendo-react-inputs"),h=require("@progress/kendo-react-dateinputs"),c=require("../filterCommon.js"),x=require("../utils/GridContext.js");function p(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const i=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,i.get?i:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const o=p(b),D=e=>{const t=o.useContext(x.GridContext),a=()=>{if(e.filterType==="boolean")return;const n=e.operators.find(r=>r.operator===e.operator)||null;return o.createElement(d.DropDownList,{adaptive:t.adaptive,size:t.mobileMode?"large":"medium",value:n,onChange:s,data:e.operators,textField:"text"})},i=n=>{c.cellInputChange(n.value,n.syntheticEvent,e)},s=n=>{c.cellOperatorChange(n,e.value,e.onChange)},g=n=>{c.cellBoolDropdownChange(n,e.onChange)},C=(n,r,u)=>{switch(n){case"numeric":return o.createElement(m.NumericTextBox,{value:r,size:t.mobileMode?"large":"medium",onChange:i,rangeOnEnter:!1});case"date":return o.createElement(h.DatePicker,{value:r,size:t.mobileMode?"large":"medium",onChange:i});case"boolean":{const f=l=>l==null;return o.createElement(d.DropDownList,{adaptive:t.adaptive,onChange:g,size:t.mobileMode?"large":"medium",value:u.find(l=>l.operator===(f(r)?"":r)),data:u,textField:"text"})}default:return o.createElement(m.TextBox,{size:t.mobileMode?"large":"medium",value:r||"",onChange:i})}};return o.createElement(o.Fragment,null,a(),C(e.filterType,e.value,e.booleanValues))};exports.GridColumnMenuFilterCell=D;
|
|
@@ -8,41 +8,41 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as n from "react";
|
|
10
10
|
import { DropDownList as m } from "@progress/kendo-react-dropdowns";
|
|
11
|
-
import {
|
|
11
|
+
import { TextBox as h, NumericTextBox as s } from "@progress/kendo-react-inputs";
|
|
12
12
|
import { DatePicker as f } from "@progress/kendo-react-dateinputs";
|
|
13
|
-
import { cellOperatorChange as x, cellInputChange as
|
|
14
|
-
import { GridContext as
|
|
15
|
-
const
|
|
16
|
-
const
|
|
13
|
+
import { cellOperatorChange as x, cellInputChange as E, cellBoolDropdownChange as b } from "../filterCommon.mjs";
|
|
14
|
+
import { GridContext as p } from "../utils/GridContext.mjs";
|
|
15
|
+
const w = (e) => {
|
|
16
|
+
const o = n.useContext(p), d = () => {
|
|
17
17
|
if (e.filterType === "boolean")
|
|
18
18
|
return;
|
|
19
|
-
const t = e.operators.find((
|
|
19
|
+
const t = e.operators.find((r) => r.operator === e.operator) || null;
|
|
20
20
|
return /* @__PURE__ */ n.createElement(
|
|
21
21
|
m,
|
|
22
22
|
{
|
|
23
|
-
adaptive:
|
|
24
|
-
size:
|
|
23
|
+
adaptive: o.adaptive,
|
|
24
|
+
size: o.mobileMode ? "large" : "medium",
|
|
25
25
|
value: t,
|
|
26
|
-
onChange:
|
|
26
|
+
onChange: c,
|
|
27
27
|
data: e.operators,
|
|
28
28
|
textField: "text"
|
|
29
29
|
}
|
|
30
30
|
);
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
},
|
|
31
|
+
}, i = (t) => {
|
|
32
|
+
E(t.value, t.syntheticEvent, e);
|
|
33
|
+
}, c = (t) => {
|
|
34
34
|
x(t, e.value, e.onChange);
|
|
35
35
|
}, u = (t) => {
|
|
36
|
-
|
|
37
|
-
}, g = (t,
|
|
36
|
+
b(t, e.onChange);
|
|
37
|
+
}, g = (t, r, l) => {
|
|
38
38
|
switch (t) {
|
|
39
39
|
case "numeric":
|
|
40
40
|
return /* @__PURE__ */ n.createElement(
|
|
41
|
-
|
|
41
|
+
s,
|
|
42
42
|
{
|
|
43
|
-
value:
|
|
44
|
-
size:
|
|
45
|
-
onChange:
|
|
43
|
+
value: r,
|
|
44
|
+
size: o.mobileMode ? "large" : "medium",
|
|
45
|
+
onChange: i,
|
|
46
46
|
rangeOnEnter: !1
|
|
47
47
|
}
|
|
48
48
|
);
|
|
@@ -50,9 +50,9 @@ const z = (e) => {
|
|
|
50
50
|
return /* @__PURE__ */ n.createElement(
|
|
51
51
|
f,
|
|
52
52
|
{
|
|
53
|
-
value:
|
|
54
|
-
size:
|
|
55
|
-
onChange:
|
|
53
|
+
value: r,
|
|
54
|
+
size: o.mobileMode ? "large" : "medium",
|
|
55
|
+
onChange: i
|
|
56
56
|
}
|
|
57
57
|
);
|
|
58
58
|
case "boolean": {
|
|
@@ -60,21 +60,28 @@ const z = (e) => {
|
|
|
60
60
|
return /* @__PURE__ */ n.createElement(
|
|
61
61
|
m,
|
|
62
62
|
{
|
|
63
|
-
adaptive:
|
|
63
|
+
adaptive: o.adaptive,
|
|
64
64
|
onChange: u,
|
|
65
|
-
size:
|
|
66
|
-
value:
|
|
67
|
-
data:
|
|
65
|
+
size: o.mobileMode ? "large" : "medium",
|
|
66
|
+
value: l.find((a) => a.operator === (C(r) ? "" : r)),
|
|
67
|
+
data: l,
|
|
68
68
|
textField: "text"
|
|
69
69
|
}
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
72
|
default:
|
|
73
|
-
return /* @__PURE__ */ n.createElement(
|
|
73
|
+
return /* @__PURE__ */ n.createElement(
|
|
74
|
+
h,
|
|
75
|
+
{
|
|
76
|
+
size: o.mobileMode ? "large" : "medium",
|
|
77
|
+
value: r || "",
|
|
78
|
+
onChange: i
|
|
79
|
+
}
|
|
80
|
+
);
|
|
74
81
|
}
|
|
75
82
|
};
|
|
76
|
-
return /* @__PURE__ */ n.createElement(n.Fragment, null,
|
|
83
|
+
return /* @__PURE__ */ n.createElement(n.Fragment, null, d(), g(e.filterType, e.value, e.booleanValues));
|
|
77
84
|
};
|
|
78
85
|
export {
|
|
79
|
-
|
|
86
|
+
w as GridColumnMenuFilterCell
|
|
80
87
|
};
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),d=require("./GridColumnMenuFilterCell.js"),m=require("../
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),d=require("./GridColumnMenuFilterCell.js"),m=require("../utils/GridContext.js"),u=require("@progress/kendo-react-buttons");function g(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return r.default=t,Object.freeze(r)}const e=g(s),C=t=>{const{firstFilterProps:r,hideSecondFilter:n,secondFilterProps:o,logicValue:l,onLogicChange:i}=t,c=e.useContext(m.GridContext),a=(l==null?void 0:l.operator)==="and";return e.createElement(e.Fragment,null,e.createElement(d.GridColumnMenuFilterCell,{...r}),!n&&e.createElement(e.Fragment,null,e.createElement(u.ButtonGroup,null,e.createElement(u.Button,{type:"button",value:"and",size:c.mobileMode?"large":"medium",togglable:!0,selected:a,onClick:i},"And"),e.createElement(u.Button,{type:"button",value:"or",size:c.mobileMode?"large":"medium",togglable:!0,selected:!a,onClick:i},"Or")),e.createElement(d.GridColumnMenuFilterCell,{...o})))};exports.GridColumnMenuFilterUI=C;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as e from "react";
|
|
10
10
|
import { GridColumnMenuFilterCell as l } from "./GridColumnMenuFilterCell.mjs";
|
|
11
|
-
import { GridContext as d } from "../
|
|
11
|
+
import { GridContext as d } from "../utils/GridContext.mjs";
|
|
12
12
|
import { ButtonGroup as s, Button as m } from "@progress/kendo-react-buttons";
|
|
13
13
|
const E = (i) => {
|
|
14
14
|
const { firstFilterProps: a, hideSecondFilter: c, secondFilterProps: u, logicValue: t, onLogicChange: r } = i, o = e.useContext(d), n = (t == null ? void 0 : t.operator) === "and";
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),i=require("@progress/kendo-react-common"),f=require("../utils/GridContext.js"),a=require("@progress/kendo-svg-icons");function p(n){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(c,e,o.get?o:{enumerable:!0,get:()=>n[e]})}}return c.default=n,Object.freeze(c)}const r=p(d),I=n=>{const{title:c,iconClass:e,svgIcon:o,selected:u,expandable:s,expanded:m}=n,t=r.useContext(f.GridContext);let l;return s&&(t!=null&&t.mobileMode?l=(t==null?void 0:t.dir)==="rtl"?a.chevronLeftIcon:a.chevronRightIcon:l=m?a.chevronUpIcon:a.chevronDownIcon),r.createElement("div",{onClick:n.onClick,className:`k-columnmenu-item ${u?"k-selected":""}`},(e||o)&&r.createElement(i.IconWrap,{name:e&&i.toIconName(e),icon:o}),c,r.createElement("span",{className:"k-spacer"}),s&&r.createElement(i.IconWrap,{icon:l}))};exports.GridColumnMenuItem=I;
|
|
@@ -6,15 +6,15 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import { IconWrap as
|
|
11
|
-
import { GridContext as I } from "../
|
|
12
|
-
import { chevronLeftIcon as
|
|
13
|
-
const
|
|
14
|
-
const { title:
|
|
15
|
-
let
|
|
16
|
-
return r && (
|
|
9
|
+
import * as o from "react";
|
|
10
|
+
import { IconWrap as a, toIconName as p } from "@progress/kendo-react-common";
|
|
11
|
+
import { GridContext as I } from "../utils/GridContext.mjs";
|
|
12
|
+
import { chevronLeftIcon as d, chevronRightIcon as v, chevronDownIcon as f, chevronUpIcon as h } from "@progress/kendo-svg-icons";
|
|
13
|
+
const C = (t) => {
|
|
14
|
+
const { title: l, iconClass: n, svgIcon: m, selected: i, expandable: r, expanded: s } = t, e = o.useContext(I);
|
|
15
|
+
let c;
|
|
16
|
+
return r && (e != null && e.mobileMode ? c = (e == null ? void 0 : e.dir) === "rtl" ? d : v : c = s ? h : f), /* @__PURE__ */ o.createElement("div", { onClick: t.onClick, className: `k-columnmenu-item ${i ? "k-selected" : ""}` }, (n || m) && /* @__PURE__ */ o.createElement(a, { name: n && p(n), icon: m }), l, /* @__PURE__ */ o.createElement("span", { className: "k-spacer" }), r && /* @__PURE__ */ o.createElement(a, { icon: c }));
|
|
17
17
|
};
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
C as GridColumnMenuItem
|
|
20
20
|
};
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("react"),_=require("@progress/kendo-react-popup"),s=require("@progress/kendo-react-common"),j=require("@progress/kendo-svg-icons"),h=require("../messages/index.js"),z=require("@progress/kendo-react-intl"),F=require("../utils/GridContext.js"),$=require("./adaptiveContext/GridColumnMenuAdaptiveContext.js"),L=require("./adaptiveContent/GridAdaptiveColumnMenu.js"),V=require("react-dom");function H(t){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const c in t)if(c!=="default"){const a=Object.getOwnPropertyDescriptor(t,c);Object.defineProperty(u,c,a.get?a:{enumerable:!0,get:()=>t[c]})}}return u.default=t,Object.freeze(u)}const n=H(W),J=[".k-columnmenu-item-content",".k-filter-menu-container"].map(t=>s.TABBABLE_ELEMENTS.map(u=>`${t} ${u}`)),Q=[[".k-tabstrip-items"],[".k-columnmenu-item"],...J],U=t=>{var p;const u=n.useContext(F.GridContext),[c,a]=n.useState(!1),i=n.useRef(null),m=n.useRef(null),l=n.useRef(null),M=n.useRef(0),D=s.useDocument(i),{columnMenu:d,...b}=t,{column:C,columnMenuIcon:E,navigatable:k}=t,y=z.useLocalization(),w=C.title||C.field,S=w?`${w} `:"",T="#",q=e=>{const o=s.getActiveElement(document);clearTimeout(M.current),M.current=window.setTimeout(()=>{!u.mobileMode&&o&&e.relatedTarget!==i.current&&m.current&&!m.current.contains(o)&&f()})},R=()=>{clearTimeout(M.current)},x=e=>{e.preventDefault(),c&&t.onCloseMenu&&t.onCloseMenu(),a(!c)},f=()=>{t.onCloseMenu&&t.onCloseMenu(),a(!1),!t.navigatable&&i.current&&i.current.focus()},A=e=>{var o;if(e.keyCode===s.Keys.tab){const r=e.target,v=r&&((o=r.closest(".k-grid"))==null?void 0:o.getElementsByClassName("k-grid-content")[0]);v&&v.scrollWidth>v.clientWidth&&r.scrollIntoView({inline:"center"})}},g=n.useMemo(()=>t.show!==void 0?t.show:c,[t.show,c]),I=e=>{var o;(o=l.current)==null||o.triggerKeyboardEvent(e)},O=e=>{var o;(o=l.current)==null||o.triggerMouseEvent(e)},P=(e,o,r)=>{r.preventDefault(),r.shiftKey?o.focusPrevious(e):o.focusNext(e)},G=(e,o,r)=>{e&&(r.preventDefault(),e.click())},K=(e,o,r)=>{r.preventDefault(),f()},N=(e,o,r)=>{o.focusElement(e)},B=e=>{!e.isAnchorClicked&&a(!1)};return n.useEffect(()=>(g&&m.current&&(l.current=new s.Navigation({tabIndex:0,root:m,selectors:Q,keyboardEvents:{keydown:{Tab:P,Enter:G,Escape:K}},mouseEvents:{mousedown:N}}),l.current.focusElement(l.current.first,null)),()=>{l.current&&(l.current=null)}),[g]),n.createElement(n.Fragment,null,n.createElement("a",{className:"k-grid-header-menu k-grid-column-menu",ref:i,onClick:x,onKeyDown:A,href:T,tabIndex:k?-1:void 0,"aria-label":`${k?"":S}${y.toLanguageString(h.columnMenu,h.messages[h.columnMenu])}`},E?n.createElement(s.IconWrap,{name:E.name,icon:E}):n.createElement(s.IconWrap,{name:"more-vertical",icon:j.moreVerticalIcon})),n.createElement($.GridColumnMenuAdaptiveProvider,null,u.mobileMode?n.createElement(n.Fragment,null,V.createPortal(n.createElement(L.GridAdaptiveColumnMenu,{computedShow:g,ColumnMenu:d,closeMenu:f},d&&n.createElement(d,{...b,onCloseMenu:f})),(p=D())==null?void 0:p.body)):n.createElement(_.Popup,{anchor:i.current,show:g,popupClass:"k-grid-columnmenu-popup",onMouseDownOutside:B},n.createElement("div",{ref:m,onBlur:q,onFocus:R,onMouseDown:O,onKeyDown:I,className:"k-column-menu k-column-menu-md"},d&&n.createElement(d,{...b,onCloseMenu:f})))))};exports.GridColumnMenuWrapper=U;
|
|
@@ -7,55 +7,57 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as n from "react";
|
|
10
|
-
import { Popup as
|
|
11
|
-
import { TABBABLE_ELEMENTS as
|
|
12
|
-
import { moreVerticalIcon as
|
|
13
|
-
import { columnMenu as
|
|
14
|
-
import { useLocalization as
|
|
15
|
-
import { GridContext as
|
|
16
|
-
import { GridColumnMenuAdaptiveProvider as
|
|
17
|
-
import { GridAdaptiveColumnMenu as
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
import { Popup as G } from "@progress/kendo-react-popup";
|
|
11
|
+
import { TABBABLE_ELEMENTS as L, useDocument as W, Navigation as O, IconWrap as k, getActiveElement as V, Keys as _ } from "@progress/kendo-react-common";
|
|
12
|
+
import { moreVerticalIcon as H } from "@progress/kendo-svg-icons";
|
|
13
|
+
import { columnMenu as b, messages as j } from "../messages/index.mjs";
|
|
14
|
+
import { useLocalization as q } from "@progress/kendo-react-intl";
|
|
15
|
+
import { GridContext as J } from "../utils/GridContext.mjs";
|
|
16
|
+
import { GridColumnMenuAdaptiveProvider as Q } from "./adaptiveContext/GridColumnMenuAdaptiveContext.mjs";
|
|
17
|
+
import { GridAdaptiveColumnMenu as U } from "./adaptiveContent/GridAdaptiveColumnMenu.mjs";
|
|
18
|
+
import X from "react-dom";
|
|
19
|
+
const Y = [".k-columnmenu-item-content", ".k-filter-menu-container"].map((o) => L.map((i) => `${o} ${i}`)), Z = [[".k-tabstrip-items"], [".k-columnmenu-item"], ...Y], ie = (o) => {
|
|
20
|
+
var C;
|
|
21
|
+
const i = n.useContext(J), [m, d] = n.useState(!1), l = n.useRef(null), u = n.useRef(null), c = n.useRef(null), E = n.useRef(0), D = W(l), { columnMenu: s, ...g } = o, { column: v, columnMenuIcon: h, navigatable: w } = o, y = q(), p = v.title || v.field, T = p ? `${p} ` : "", S = "#", x = (e) => {
|
|
22
|
+
const t = V(document);
|
|
21
23
|
clearTimeout(E.current), E.current = window.setTimeout(() => {
|
|
22
|
-
!i.mobileMode &&
|
|
24
|
+
!i.mobileMode && t && e.relatedTarget !== l.current && u.current && !u.current.contains(t) && a();
|
|
23
25
|
});
|
|
24
|
-
},
|
|
26
|
+
}, A = () => {
|
|
25
27
|
clearTimeout(E.current);
|
|
26
|
-
},
|
|
27
|
-
e.preventDefault(), m &&
|
|
28
|
+
}, K = (e) => {
|
|
29
|
+
e.preventDefault(), m && o.onCloseMenu && o.onCloseMenu(), d(!m);
|
|
28
30
|
}, a = () => {
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
var
|
|
32
|
-
if (e.keyCode ===
|
|
33
|
-
const r = e.target, M = r && ((
|
|
31
|
+
o.onCloseMenu && o.onCloseMenu(), d(!1), !o.navigatable && l.current && l.current.focus();
|
|
32
|
+
}, B = (e) => {
|
|
33
|
+
var t;
|
|
34
|
+
if (e.keyCode === _.tab) {
|
|
35
|
+
const r = e.target, M = r && ((t = r.closest(".k-grid")) == null ? void 0 : t.getElementsByClassName("k-grid-content")[0]);
|
|
34
36
|
M && M.scrollWidth > M.clientWidth && r.scrollIntoView({ inline: "center" });
|
|
35
37
|
}
|
|
36
|
-
}, f = n.useMemo(() =>
|
|
37
|
-
var
|
|
38
|
-
(
|
|
39
|
-
},
|
|
40
|
-
var
|
|
41
|
-
(
|
|
42
|
-
},
|
|
43
|
-
r.preventDefault(), r.shiftKey ?
|
|
44
|
-
},
|
|
38
|
+
}, f = n.useMemo(() => o.show !== void 0 ? o.show : m, [o.show, m]), I = (e) => {
|
|
39
|
+
var t;
|
|
40
|
+
(t = c.current) == null || t.triggerKeyboardEvent(e);
|
|
41
|
+
}, N = (e) => {
|
|
42
|
+
var t;
|
|
43
|
+
(t = c.current) == null || t.triggerMouseEvent(e);
|
|
44
|
+
}, R = (e, t, r) => {
|
|
45
|
+
r.preventDefault(), r.shiftKey ? t.focusPrevious(e) : t.focusNext(e);
|
|
46
|
+
}, F = (e, t, r) => {
|
|
45
47
|
e && (r.preventDefault(), e.click());
|
|
46
|
-
},
|
|
48
|
+
}, P = (e, t, r) => {
|
|
47
49
|
r.preventDefault(), a();
|
|
48
|
-
}, $ = (e,
|
|
49
|
-
|
|
50
|
+
}, $ = (e, t, r) => {
|
|
51
|
+
t.focusElement(e);
|
|
50
52
|
}, z = (e) => {
|
|
51
53
|
!e.isAnchorClicked && d(!1);
|
|
52
54
|
};
|
|
53
|
-
return n.useEffect(() => (f && u.current && (c.current = new
|
|
55
|
+
return n.useEffect(() => (f && u.current && (c.current = new O({
|
|
54
56
|
tabIndex: 0,
|
|
55
57
|
root: u,
|
|
56
|
-
selectors:
|
|
58
|
+
selectors: Z,
|
|
57
59
|
keyboardEvents: {
|
|
58
|
-
keydown: { Tab:
|
|
60
|
+
keydown: { Tab: R, Enter: F, Escape: P }
|
|
59
61
|
},
|
|
60
62
|
mouseEvents: { mousedown: $ }
|
|
61
63
|
}), c.current.focusElement(c.current.first, null)), () => {
|
|
@@ -65,18 +67,29 @@ const J = [".k-columnmenu-item-content", ".k-filter-menu-container"].map((t) =>
|
|
|
65
67
|
{
|
|
66
68
|
className: "k-grid-header-menu k-grid-column-menu",
|
|
67
69
|
ref: l,
|
|
68
|
-
onClick:
|
|
69
|
-
onKeyDown:
|
|
70
|
-
href:
|
|
70
|
+
onClick: K,
|
|
71
|
+
onKeyDown: B,
|
|
72
|
+
href: S,
|
|
71
73
|
tabIndex: w ? -1 : void 0,
|
|
72
|
-
"aria-label": `${w ? "" :
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
"aria-label": `${w ? "" : T}${y.toLanguageString(
|
|
75
|
+
b,
|
|
76
|
+
j[b]
|
|
75
77
|
)}`
|
|
76
78
|
},
|
|
77
|
-
h ? /* @__PURE__ */ n.createElement(k, { name: h.name, icon: h }) : /* @__PURE__ */ n.createElement(k, { name: "more-vertical", icon:
|
|
78
|
-
), /* @__PURE__ */ n.createElement(
|
|
79
|
-
|
|
79
|
+
h ? /* @__PURE__ */ n.createElement(k, { name: h.name, icon: h }) : /* @__PURE__ */ n.createElement(k, { name: "more-vertical", icon: H })
|
|
80
|
+
), /* @__PURE__ */ n.createElement(Q, null, i.mobileMode ? /* @__PURE__ */ n.createElement(n.Fragment, null, X.createPortal(
|
|
81
|
+
/* @__PURE__ */ n.createElement(
|
|
82
|
+
U,
|
|
83
|
+
{
|
|
84
|
+
computedShow: f,
|
|
85
|
+
ColumnMenu: s,
|
|
86
|
+
closeMenu: a
|
|
87
|
+
},
|
|
88
|
+
s && /* @__PURE__ */ n.createElement(s, { ...g, onCloseMenu: a })
|
|
89
|
+
),
|
|
90
|
+
(C = D()) == null ? void 0 : C.body
|
|
91
|
+
)) : /* @__PURE__ */ n.createElement(
|
|
92
|
+
G,
|
|
80
93
|
{
|
|
81
94
|
anchor: l.current,
|
|
82
95
|
show: f,
|
|
@@ -87,10 +100,10 @@ const J = [".k-columnmenu-item-content", ".k-filter-menu-container"].map((t) =>
|
|
|
87
100
|
"div",
|
|
88
101
|
{
|
|
89
102
|
ref: u,
|
|
90
|
-
onBlur:
|
|
91
|
-
onFocus:
|
|
92
|
-
onMouseDown:
|
|
93
|
-
onKeyDown:
|
|
103
|
+
onBlur: x,
|
|
104
|
+
onFocus: A,
|
|
105
|
+
onMouseDown: N,
|
|
106
|
+
onKeyDown: I,
|
|
94
107
|
className: "k-column-menu k-column-menu-md"
|
|
95
108
|
},
|
|
96
109
|
s && /* @__PURE__ */ n.createElement(s, { ...g, onCloseMenu: a })
|
|
@@ -98,5 +111,5 @@ const J = [".k-columnmenu-item-content", ".k-filter-menu-container"].map((t) =>
|
|
|
98
111
|
)));
|
|
99
112
|
};
|
|
100
113
|
export {
|
|
101
|
-
|
|
114
|
+
ie as GridColumnMenuWrapper
|
|
102
115
|
};
|