@progress/kendo-react-grid
Version:
React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package
9 lines (8 loc) • 3.39 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
*-------------------------------------------------------------------------------------------
*/
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./messages/index.js"),s=[{text:"grid.filterAndLogic",operator:"and"},{text:"grid.filterOrLogic",operator:"or"}],f={text:[{text:"grid.filterContainsOperator",operator:"contains"},{text:"grid.filterNotContainsOperator",operator:"doesnotcontain"},{text:"grid.filterEqOperator",operator:"eq"},{text:"grid.filterNotEqOperator",operator:"neq"},{text:"grid.filterStartsWithOperator",operator:"startswith"},{text:"grid.filterEndsWithOperator",operator:"endswith"},{text:"grid.filterIsNullOperator",operator:"isnull"},{text:"grid.filterIsNotNullOperator",operator:"isnotnull"},{text:"grid.filterIsEmptyOperator",operator:"isempty"},{text:"grid.filterIsNotEmptyOperator",operator:"isnotempty"}],numeric:[{text:"grid.filterEqOperator",operator:"eq"},{text:"grid.filterNotEqOperator",operator:"neq"},{text:"grid.filterGteOperator",operator:"gte"},{text:"grid.filterGtOperator",operator:"gt"},{text:"grid.filterLteOperator",operator:"lte"},{text:"grid.filterLtOperator",operator:"lt"},{text:"grid.filterIsNullOperator",operator:"isnull"},{text:"grid.filterIsNotNullOperator",operator:"isnotnull"}],date:[{text:"grid.filterEqOperator",operator:"eq"},{text:"grid.filterNotEqOperator",operator:"neq"},{text:"grid.filterAfterOrEqualOperator",operator:"gte"},{text:"grid.filterAfterOperator",operator:"gt"},{text:"grid.filterBeforeOperator",operator:"lt"},{text:"grid.filterBeforeOrEqualOperator",operator:"lte"},{text:"grid.filterIsNullOperator",operator:"isnull"},{text:"grid.filterIsNotNullOperator",operator:"isnotnull"}],boolean:[{text:"grid.filterEqOperator",operator:"eq"}]},i=t=>t==="isnull"||t==="isnotnull"||t==="isempty"||t==="isnotempty",g=(t,o)=>t.map(r=>({text:o.toLanguageString(r.text,p.messages[r.text]),operator:r.operator})),l="eq",d=[{text:"grid.filterBooleanAll",operator:""},{text:"grid.filterIsTrue",operator:!0},{text:"grid.filterIsFalse",operator:!1}],u={text:!1,numeric:!1,date:!1,boolean:!0},c=(t,o,r)=>{const a=n(r.operators);let e=r.operator;switch(r.filterType){case"numeric":(!e||i(e))&&(e=a),t===null&&e===a&&(e="");break;case"date":(!e||i(e))&&(e=a),t===null&&e===a&&(e="");break;case"text":(!e||i(e))&&(e=a),!t&&e===a&&(e="");break;default:return}r.onChange({value:t,operator:e,syntheticEvent:o})},n=(t,o)=>o?t[o][0].operator:t[0].operator,x=t=>t||"text",O=(t,o)=>{const r=t.target.value;o({value:r.operator,operator:r.operator===""?"":l,syntheticEvent:t.syntheticEvent})},q=(t,o,r)=>{let a=o;const e=t.target.value;t.target.state.opened&&(i(e.operator)&&(a=null),o===null&&!i(e.operator)&&(a=void 0),r({value:a,operator:e.operator,syntheticEvent:t.syntheticEvent}))};exports.IsUnaryFilter=i;exports.booleanFilterValues=d;exports.cellBoolDropdownChange=O;exports.cellInputChange=c;exports.cellOperatorChange=q;exports.defaultBooleanOperator=l;exports.defaultHideSecondFilter=u;exports.filterLogicList=s;exports.getDefaultOperator=n;exports.getFilterType=x;exports.operatorMap=g;exports.operators=f;