UNPKG

@progress/kendo-react-data-tools

Version:

Includes React Pager & React Filter component, an intuitive interface to create complex filter descriptions. KendoReact Data Tools package

114 lines (113 loc) 4.52 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { filterContainsOperator as p, filterNotContainsOperator as n, filterEqOperator as e, filterNotEqOperator as r, filterStartsWithOperator as i, filterEndsWithOperator as s, filterIsNullOperator as o, filterIsNotNullOperator as a, filterIsEmptyOperator as l, filterIsNotEmptyOperator as x, filterGteOperator as O, filterGtOperator as f, filterLteOperator as u, filterLtOperator as c, filterAfterOrEqualOperator as q, filterAfterOperator as m, filterBeforeOperator as g, filterBeforeOrEqualOperator as d } from "../messages/index.mjs"; const y = [ { text: p, operator: "contains" }, { text: n, operator: "doesnotcontain" }, { text: e, operator: "eq" }, { text: r, operator: "neq" }, { text: i, operator: "startswith" }, { text: s, operator: "endswith" }, { text: o, operator: "isnull" }, { text: a, operator: "isnotnull" }, { text: l, operator: "isempty" }, { text: x, operator: "isnotempty" } ], E = [ { text: e, operator: "eq" }, { text: r, operator: "neq" }, { text: O, operator: "gte" }, { text: f, operator: "gt" }, { text: u, operator: "lte" }, { text: c, operator: "lt" }, { text: o, operator: "isnull" }, { text: a, operator: "isnotnull" } ], h = [ { text: e, operator: "eq" }, { text: r, operator: "neq" }, { text: q, operator: "gte" }, { text: m, operator: "gt" }, { text: g, operator: "lt" }, { text: d, operator: "lte" }, { text: o, operator: "isnull" }, { text: a, operator: "isnotnull" } ], N = [ { text: e, operator: "eq" }, { text: r, operator: "neq" } ]; class I { /** * An array containing the operators for the TextFilter component. * * The operators are: * * - { text: 'filter.containsOperator', operator: 'contains' } * - { text: 'filter.notContainsOperator', operator: 'doesnotcontain' } * - { text: 'filter.eqOperator', operator: 'eq' } * - { text: 'filter.notEqOperator', operator: 'neq' } * - { text: 'filter.startsWithOperator', operator: 'startswith' } * - { text: 'filter.endsWithOperator', operator: 'endswith' } * - { text: 'filter.isNullOperator', operator: 'isnull' } * - { text: 'filter.isNotNullOperator', operator: 'isnotnull' } * - { text: 'filter.isEmptyOperator', operator: 'isempty' } * - { text: 'filter.isNotEmptyOperator', operator: 'isnotempty' } */ static get text() { return [...y]; } /** * An array containing the operators for the NumericFilter component. * * The operators are: * * - { text: 'filter.eqOperator', operator: 'eq' } * - { text: 'filter.notEqOperator', operator: 'neq' } * - { text: 'filter.gteOperator', operator: 'gte' } * - { text: 'filter.gtOperator', operator: 'gt' } * - { text: 'filter.lteOperator', operator: 'lte' } * - { text: 'filter.ltOperator', operator: 'lt' } * - { text: 'filter.isNullOperator', operator: 'isnull' } * - { text: 'filter.isNotNullOperator', operator: 'isnotnull' } */ static get numeric() { return [...E]; } /** * An array containing the operators for the DateFilter component. * * The operators are: * * - { text: 'filter.eqOperator', operator: 'eq' } * - { text: 'filter.notEqOperator', operator: 'neq' } * - { text: 'filter.afterOrEqualOperator', operator: 'gte' } * - { text: 'filter.afterOperator', operator: 'gt' } * - { text: 'filter.beforeOperator', operator: 'lt' } * - { text: 'filter.beforeOrEqualOperator', operator: 'lte' } * - { text: 'filter.isNullOperator', operator: 'isnull' } * - { text: 'filter.isNotNullOperator', operator: 'isnotnull' } */ static get date() { return [...h]; } /** * An array containing the operators for the BooleanFilter component. * * The operators are: * * - { text: 'filter.eqOperator', operator: 'eq' } * - { text: 'filter.notEqOperator', operator: 'neq' } */ static get boolean() { return [...N]; } } const b = (t) => t === "contains" || t === "doesnotcontain" || t === "startswith" || t === "endswith", A = (t) => t === "isnull" || t === "isnotnull" || t === "isempty" || t === "isnotempty"; export { I as Operators, b as stringOperator, A as unaryOperator };