@progress/kendo-vue-grid
Version:
9 lines (8 loc) • 3.54 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 o=require("./messages/main.js"),s=[{text:"grid.filterAndLogic",operator:"and"},{text:"grid.filterOrLogic",operator:"or"}],g={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"}]},l=t=>t==="isnull"||t==="isnotnull"||t==="isempty"||t==="isnotempty",f=(t,r)=>t.map(a=>({text:r.toLanguageString(a.text,o.messages[a.text]),operator:a.operator})),n="eq",u=[{text:"grid.filterBooleanAll",operator:""},{text:"grid.filterIsTrue",operator:!0},{text:"grid.filterIsFalse",operator:!1}],d=(t,r,a)=>{const i=p(a.operators);let e=a.operator;switch(a.filterType){case"numeric":(!e||l(e))&&(e=i),t===null&&e===i&&(e="");break;case"date":(!e||l(e))&&(e=i),t===null&&e===i&&(e="");break;case"text":(!e||l(e))&&(e=i),!t&&e===i&&(e="");break;default:return}return{value:t,operator:e,event:r}},p=(t,r)=>r?t[r][0].operator:t[0].operator,x=t=>t||"text",c=(t,r)=>({value:t,operator:t===""?"":n,event:r}),O=(t,r,a)=>(l(t)&&(a=null),{value:a,operator:t,event:r}),L=(t,r)=>{switch(t){case"text":return r.toLanguageString(o.textFilterAriaLabel,o.messages[o.textFilterAriaLabel]);case"numeric":return r.toLanguageString(o.numericFilterAriaLabel,o.messages[o.numericFilterAriaLabel]);case"boolean":return r.toLanguageString(o.booleanFilterAriaLabel,o.messages[o.booleanFilterAriaLabel]);case"date":return r.toLanguageString(o.dateFilterAriaLabel,o.messages[o.dateFilterAriaLabel]);default:return}};exports.IsUnaryFilter=l;exports.booleanFilterValues=u;exports.cellBoolDropdownChange=c;exports.cellInputChange=d;exports.cellOperatorChange=O;exports.defaultBooleanOperator=n;exports.filterLogicList=s;exports.getAriaLabel=L;exports.getDefaultOperator=p;exports.getFilterType=x;exports.operatorMap=f;exports.operators=g;