@progress/kendo-react-grid
Version:
React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package
10 lines (9 loc) • 5.27 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";
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),n=require("../../messages/index.js"),A=require("../../utils/GridContext.js"),l=require("@progress/kendo-react-layout"),u=require("@progress/kendo-react-buttons"),c=require("@progress/kendo-svg-icons"),N=require("@progress/kendo-react-intl"),g=require("@progress/kendo-react-inputs"),I=require("../../columnMenu/adaptiveContent/GridActionSheetFooter.js"),y=require("../adaptiveContext/GridToolbarAdaptiveContext.js"),M=require("@progress/kendo-react-common"),w=require("../../columnMenu/GridColumnMenuItemGroup.js"),B=require("../../columnMenu/GridColumnMenuItem.js"),q=t=>{const i=e.useContext(A.GridContext),{actionSheetRef:d,firstViewRef:v,secondViewRef:f}=e.useContext(y.GridToolbarAdaptiveContext),r=M.useAdaptiveModeContext(),o=N.useLocalization(),[k,E]=e.useState(""),S={animation:!0,navigatable:!1,navigatableElements:[],expand:t.computedShow,animationStyles:r&&i.adaptiveColumnMenuRef<=r.small?{top:0,width:"100%",height:"100%"}:void 0,className:"k-adaptive-actionsheet",position:r&&i.adaptiveColumnMenuRef<=r.small?"fullscreen":void 0},b=i.dir==="rtl"?c.chevronRightIcon:c.chevronLeftIcon,C=o.toLanguageString(n.adaptiveColumnMenuCheckboxFilterTitle,n.messages[n.adaptiveColumnMenuCheckboxFilterTitle]),x=()=>{t.onBackView&&t.onBackView(),i!=null&&i.mobileMode&&d.current.element.style.setProperty("--kendo-actionsheet-view-current",1)};return e.createElement(l.ActionSheet,{...S,ref:d,style:{"--kendo-actionsheet-view-current":1},onClose:t.onClose},e.createElement(l.ActionSheetView,{className:"k-actionsheet-view-animated",ref:v,style:{transitionDuration:"500ms",transitionProperty:"transform"}},e.createElement(l.ActionSheetHeader,null,e.createElement("div",{className:"k-actionsheet-titlebar-group"},e.createElement("div",{className:"k-actionsheet-title"},e.createElement("div",{className:"k-text-center"},C)),e.createElement("div",{className:"k-actionsheet-actions"},e.createElement(u.Button,{svgIcon:c.xIcon,onClick:t.onClose,fillMode:"flat"})))),e.createElement(l.ActionSheetContent,null,e.createElement("div",{className:"k-column-menu k-column-menu-lg"},t.filtered.map(a=>{var s,m;return e.createElement(w.GridColumnMenuItemGroup,{key:a.id},e.createElement("div",{className:"k-expander"},e.createElement(B.GridColumnMenuItem,{title:t.renderTitle(a),expandable:!0,expanded:!!((m=(s=t.expandState)==null?void 0:s.find(h=>h.column.field===a.field))!=null&&m.expanded),onClick:h=>(d.current.element.style.setProperty("--kendo-actionsheet-view-current",2),E(a.field),t.onFilterExpand(h,a))})))}))),e.createElement(l.ActionSheetFooter,null,e.createElement("div",{className:"k-actions k-actions-stretched k-actions-horizontal k-column-menu-footer"},e.createElement(u.Button,{svgIcon:c.filterClearIcon,onClick:t.handleClearAllFilters,size:"large"},o.toLanguageString(n.filterClearAllButton,n.messages[n.filterClearAllButton]))))),e.createElement(l.ActionSheetView,{className:"k-actionsheet-view-animated",ref:f,style:{transitionDuration:"500ms",transitionProperty:"transform"}},e.createElement(l.ActionSheetHeader,null,e.createElement("div",{className:"k-actionsheet-titlebar-group"},e.createElement("div",{className:"k-actionsheet-actions"},e.createElement(u.Button,{type:"button",onClick:x,svgIcon:b,fillMode:"flat"})),e.createElement("div",{className:"k-actionsheet-title"},e.createElement("div",{className:"k-text-center"},C+(k?` ${k}`:""))),e.createElement("div",{className:"k-actionsheet-actions"},e.createElement(u.Button,{type:"button",svgIcon:c.xIcon,onClick:t.onClose,fillMode:"flat"})))),e.createElement(l.ActionSheetContent,null,e.createElement("div",{className:"k-filter-menu"},e.createElement("div",{className:"k-filter-menu-container"},t.searchBox,e.createElement("ul",{className:"k-multicheck-wrap"},e.createElement("li",{className:"k-item k-check-all-wrap"},e.createElement(g.Checkbox,{size:i.mobileMode?"large":"medium",label:o.toLanguageString(n.filterCheckAll,n.messages[n.filterCheckAll]),onChange:a=>t.handleCheckBoxChange(a,"all"),checked:t.isAllSelected()})),t.currentData.map((a,s)=>e.createElement("li",{className:"k-item",key:`colmenu-checkbox-item-${s}`},e.createElement(g.Checkbox,{size:i.mobileMode?"large":"medium",label:String(a),onChange:m=>t.handleCheckBoxChange(m,a),checked:t.uniqueFilterValues.includes(a)})))),e.createElement("div",{className:"k-filter-selected-items"},t.uniqueFilterValues.length+" "+o.toLanguageString(n.filterSelectedItems,n.messages[n.filterSelectedItems]))))),e.createElement(l.ActionSheetFooter,null,e.createElement(I.GridActionSheetFooterContent,{onApply:t.submit,onReset:t.clear,submitMessage:o.toLanguageString(n.filterSubmitButton,n.messages[n.filterSubmitButton]),resetMessage:o.toLanguageString(n.filterClearButton,n.messages[n.filterClearButton])}))))};exports.GridAdaptiveToolbarCheckboxFilter=q;