@progress/kendo-react-grid
Version:
React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package
75 lines (74 loc) • 3.56 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
"use client";
import e from "react";
import d from "react-dom";
import { ActionSheetHeader as h, ActionSheetContent as E, ActionSheetFooter as g } from "@progress/kendo-react-layout";
import { Button as i } from "@progress/kendo-react-buttons";
import { useLocalization as v } from "@progress/kendo-react-intl";
import { GridColumnMenuAdaptiveContext as I } from "../adaptiveContext/GridColumnMenuAdaptiveContext.mjs";
import { chevronRightIcon as k, chevronLeftIcon as C, xIcon as S, filterClearIcon as b, filterIcon as F } from "@progress/kendo-svg-icons";
import { GridColumnMenuFilterUI as M } from "../GridColumnMenuFilterUI.mjs";
import { filterSubmitButton as a, messages as c, filterClearButton as l } from "../../messages/index.mjs";
import { GridContext as x } from "../../utils/GridContext.mjs";
import { GridActionSheetFooterContent as A } from "./GridActionSheetFooter.mjs";
const z = (t) => {
const o = v(), n = e.useContext(x), { actionSheetRef: r, secondViewRef: m } = e.useContext(I), s = n.dir === "rtl" ? k : C;
e.useEffect(() => {
n.mobileMode && r.current.element.style.setProperty("--kendo-actionsheet-view-current", 2);
}, []);
const u = () => {
n.mobileMode && r.current.element.style.setProperty("--kendo-actionsheet-view-current", 1), t.onBackView && t.onBackView();
};
return /* @__PURE__ */ e.createElement(e.Fragment, null, d.createPortal(
// eslint-disable-next-line react/jsx-no-useless-fragment
/* @__PURE__ */ e.createElement(e.Fragment, null, t.FilterUI ? /* @__PURE__ */ e.createElement(t.FilterUI, { ...t.filterUIProps }) : /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(h, null, /* @__PURE__ */ e.createElement("div", { className: "k-actionsheet-titlebar-group" }, /* @__PURE__ */ e.createElement("div", { className: "k-actionsheet-actions" }, /* @__PURE__ */ e.createElement(
i,
{
type: "button",
onClick: u,
svgIcon: s,
fillMode: "flat"
}
)), /* @__PURE__ */ e.createElement("div", { className: "k-actionsheet-title" }, /* @__PURE__ */ e.createElement("div", { className: "k-text-center" }, t.adaptiveTitle)), /* @__PURE__ */ e.createElement("div", { className: "k-actionsheet-actions" }, /* @__PURE__ */ e.createElement(
i,
{
type: "button",
svgIcon: S,
onClick: t.handleClose,
fillMode: "flat"
}
)))), /* @__PURE__ */ e.createElement(E, null, /* @__PURE__ */ e.createElement("div", { className: "k-filter-menu" }, /* @__PURE__ */ e.createElement("div", { className: "k-filter-menu-container" }, /* @__PURE__ */ e.createElement(
M,
{
...t.filterUIProps
}
)))), /* @__PURE__ */ e.createElement(g, null, /* @__PURE__ */ e.createElement(
A,
{
onApply: t.submit,
onReset: t.clear,
resetIcon: b,
submitIcon: F,
submitMessage: o.toLanguageString(
a,
c[a]
),
resetMessage: o.toLanguageString(
l,
c[l]
),
submitDisabled: !t.isFilterValid
}
)))),
m.current.current
));
};
export {
z as GridAdaptiveFilterMenu
};