@progress/kendo-vue-data-tools
Version:
9 lines (8 loc) • 3.17 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/main.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,r)=>t.map(o=>({text:r.toLanguageString(o.text,p.messages[o.text]),operator:o.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},x=(t,r,o)=>{const a=n(o.operators);let e=o.operator;switch(o.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}return{value:t,operator:e,event:r}},n=(t,r)=>r?t[r][0].operator:t[0].operator,c=t=>t||"text",O=(t,r)=>({value:t,operator:t===""?"":l,event:r}),q=(t,r,o)=>(i(t)&&(o=null),{value:o,operator:t,event:r});exports.IsUnaryFilter=i;exports.booleanFilterValues=d;exports.cellBoolDropdownChange=O;exports.cellInputChange=x;exports.cellOperatorChange=q;exports.defaultBooleanOperator=l;exports.defaultHideSecondFilter=u;exports.filterLogicList=s;exports.getDefaultOperator=n;exports.getFilterType=c;exports.operatorMap=g;exports.operators=f;