import * as _angular_core from '@angular/core';
import { OnInit, AfterViewInit, Signal } from '@angular/core';
import { TLocale } from '@talenra/ngx-base/shared';
import { InputComponent } from '@talenra/ngx-base/input';
import { SelectComponent } from '@talenra/ngx-base/select';
import { DateComponent } from '@talenra/ngx-base/date';
/**
* Operators accepted by the query selection rule in which the type of value is a string. The operator is used to determine the type of comparison that is to be performed.
*
* ### Import
*
* ```typescript
* import { QueryBuilderStringOperator } from '@talenra/ngx-base/query-builder';
* ```
*/
declare const QueryBuilderStringOperator: {
readonly Equal: "equal";
readonly NotEqual: "notEqual";
readonly StartsWith: "startsWith";
readonly EndsWith: "endsWith";
readonly NotStartsWith: "notStartsWith";
readonly NotEndsWith: "notEndsWith";
readonly Contains: "contains";
readonly NotContains: "notContains";
readonly From: "from";
readonly To: "to";
};
/**
* Type of operators accepted by the query selection rule.
*
* ### Import
*
* ```typescript
* import { TQueryBuilderStringOperator } from '@talenra/ngx-base/query-builder';
* ```
*/
type TQueryBuilderStringOperator = (typeof QueryBuilderStringOperator)[keyof typeof QueryBuilderStringOperator];
/**
* Operators accepted by the query selection rule in which the type of value is an option of multiple strings.
* The operator is used to determine the type of comparison that is to be performed.
*
* ### Import
*
* ```typescript
* import { QueryBuilderOptionOperator } from '@talenra/ngx-base/query-builder';
* ```
*/
declare const QueryBuilderOptionOperator: {
readonly Contains: "contains";
readonly NotContains: "notContains";
};
/**
* Type of operators accepted by the query selection rule.
*
* ### Import
*
* ```typescript
* import { TQueryBuilderOptionOperator } from '@talenra/ngx-base/query-builder';
* ```
*/
type TQueryBuilderOptionOperator = (typeof QueryBuilderOptionOperator)[keyof typeof QueryBuilderOptionOperator];
/**
* Operators accepted by the query selection rule in which the type of value is a number.
* The operator is used to determine the type of comparison that is to be performed.
*
* ### Import
*
* ```typescript
* import { QueryBuilderNumberOperator } from '@talenra/ngx-base/query-builder';
* ```
*/
declare const QueryBuilderNumberOperator: {
readonly Equal: "equal";
readonly NotEqual: "notEqual";
readonly Greater: "greater";
readonly Lesser: "lesser";
readonly GreaterOrEqual: "greaterOrEqual";
readonly LesserOrEqual: "lesserOrEqual";
};
/**
* Type of operators accepted by the query selection rule.
*
* ### Import
*
* ```typescript
* import { TQueryBuilderNumberOperator } from '@talenra/ngx-base/query-builder';
* ```
*/
type TQueryBuilderNumberOperator = (typeof QueryBuilderNumberOperator)[keyof typeof QueryBuilderNumberOperator];
/**
* Operators accepted by the query selection rule in which the type of value is a date.
* The operator is used to determine the type of comparison that is to be performed.
*
* ### Import
*
* ```typescript
* import { QueryBuilderDateOperator } from '@talenra/ngx-base/query-builder';
* ```
*/
declare const QueryBuilderDateOperator: {
readonly Equal: "equal";
readonly NotEqual: "notEqual";
readonly Before: "before";
readonly After: "after";
readonly BeforeOrEqual: "beforeOrEqual";
readonly AfterOrEqual: "afterOrEqual";
};
/**
* Type of operators accepted by the query selection rule.
*
* ### Import
*
* ```typescript
* import { TQueryBuilderDateOperator } from '@talenra/ngx-base/query-builder';
* ```
*/
type TQueryBuilderDateOperator = (typeof QueryBuilderDateOperator)[keyof typeof QueryBuilderDateOperator];
/**
* Actions that can be performed on rules of a query.
*
* ### Import
*
* ```typescript
* import { QueryBuilderRuleAction } from '@talenra/ngx-base/query-builder';
* ```
*/
declare const QueryBuilderRuleAction: {
readonly AddRule: "addRule";
readonly AddRuleGroup: "addRuleGroup";
readonly DeleteElement: "deleteElement";
readonly ConditionChange: "conditionChange";
};
/**
* Type of actions which can be performed on rules of a query.
*
* ### Import
*
* ```typescript
* import { TQueryBuilderRuleAction } from '@talenra/ngx-base/query-builder';
* ```
*/
type TQueryBuilderRuleAction = (typeof QueryBuilderRuleAction)[keyof typeof QueryBuilderRuleAction];
/**
* Conditions accepted by the query. The operator is used to determine the type of comparison that is to be performed.
*
* ### Import
*
* ```typescript
* import { QueryBuilderCondition } from '@talenra/ngx-base/query-builder';
* ```
*/
declare const QueryBuilderCondition: {
readonly And: "and";
readonly Or: "or";
};
/**
* Type of condition accepted by the query.
*
* ### Import
*
* ```typescript
* import { TQueryBuilderCondition } from '@talenra/ngx-base/query-builder';
* ```
*/
type TQueryBuilderCondition = (typeof QueryBuilderCondition)[keyof typeof QueryBuilderCondition];
/**
* Value types accepted by the query selection rule. The value type is used to determine the type of comparison that is to be performed.
*
* ### Import
*
* ```typescript
* import { QueryBuilderValueType } from '@talenra/ngx-base/query-builder';
* ```
*/
declare const QueryBuilderValueType: {
readonly String: "string";
readonly Option: "option";
readonly Number: "number";
readonly Date: "date";
readonly Boolean: "boolean";
};
/**
* Type of value types accepted by the query selection rule.
*
* ### Import
*
* ```typescript
* import { TQueryBuilderValueType } from '@talenra/ngx-base/query-builder';
* ```
*/
type TQueryBuilderValueType = (typeof QueryBuilderValueType)[keyof typeof QueryBuilderValueType];
/**
* Interface for the custom operators.
*
* ```typescript
* {
* key: 'equal',
* label: 'Equal'
* }
* ```
*
* ### Import
*
* ```typescript
* import { IQueryBuilderOperator } from '@talenra/ngx-base/query-builder';
* ```
*/
interface IQueryBuilderOperator {
/**
* The operator used to compare the value with the items.
*/
key: string;
/**
* The label is the translated value of the operator.
*/
label: string;
}
/**
* Contains the different attributes of a query builder rule.
*
* ```typescript
* {
* identifier: '1',
* operator: 'equal',
* key: 'name',
* label: 'Name',
* type: 'string',
* value: 'John Doe'
* }
* ```
*
* ### Import
* ```typescript
* import { IQueryBuilderRule } from '@talenra/ngx-base/query-builder';
* ```
*/
interface IQueryBuilderRule {
/**
* Random identifier for the query rule.
*/
identifier: string;
/**
* The operator used to compare the value with the items.
*/
operator?: TQueryBuilderStringOperator | TQueryBuilderOptionOperator | TQueryBuilderNumberOperator | TQueryBuilderDateOperator | string;
/**
* The identifier of the field that is used to compare the value with the items.
*/
key?: string;
/**
* The label is the translated value of the identifier.
*/
label?: string;
/**
* The type of the value that is used to compare the items.
*/
type?: TQueryBuilderValueType;
/**
* The value that is used to compare the items.
*/
value?: string | number | Date | boolean | IQueryBuilderValueOption;
}
/**
* The possible rules that can be used to compare the items.
*
* ```typescript
* {
* key: 'name',
* label: 'Name',
* type: 'string',
* operators: [
* {
* key: 'equal',
* label: 'Equal'
* }
* ]
* }
* ```
*
* ### Import
* ```typescript
* import { IQueryBuilderPossibleRule } from '@talenra/ngx-base/query-builder';
* ```
*/
interface IQueryBuilderPossibleRule {
/**
* The identifier of the field that is used to compare the value with the items.
*/
key: string;
/**
* The label is the translated value of the identifier.
*/
label: string;
/**
* The type of the value that is used to compare the items.
*/
type: TQueryBuilderValueType;
/**
* The value that is used to compare the items.
*/
operators?: IQueryBuilderOperator[];
}
/**
* Query of conditions and rules.
* The query can contain multiple rules and queries.
*
* ```typescript
* {
* condition: 'and',
* identifier: '1',
* hierarchyLevel: 1,
* rules: [
* {
* identifier: '2',
* operator: 'equal',
* key: 'name',
* label: 'Name',
* type: 'string',
* value: 'John Doe'
* },
* {
* condition: 'or',
* identifier: '3',
* hierarchyLevel: 2,
* rules: [
* {
* identifier: '4',
* operator: 'equal',
* key: 'age',
* label: 'Age',
* type: 'number',
* value: 30
* }
* ]
* }
* ]
* }
* ```
*
* ### Import
* ```typescript
* import { IQueryBuilderQuery } from '@talenra/ngx-base/query-builder';
* ```
*/
interface IQueryBuilderQuery {
/**
* The condition used to combine the rules and queries.
*/
condition: TQueryBuilderCondition;
/**
* Random identifier for the query.
*/
identifier: string;
/**
* The hierarchy level of the query. Starting with 1.
*/
hierarchyLevel: number;
/**
* The type of the value that is used to compare the items.
*/
rules: (IQueryBuilderQuery | IQueryBuilderRule)[];
}
/**
* Value options that are connected to a specific identifier.
*
* ```typescript
* {
* key: 'animal',
* valueOptions: [{
* key: 'animal.zebra',
* label: 'Zebra'
* }, {
* key: 'animal.giraffe',
* label: 'Giraffe'
* }]
* }
* ```
*
* ### Import
* ```typescript
* import { IQueryBuilderValueOptions } from '@talenra/ngx-base/query-builder';
* ```
*/
interface IQueryBuilderValueOptions {
/**
* The identifier of the field that is used to connect the identifier with the options.
*/
key: string;
/**
* Options that are available for the specific identifier.
*/
valueOptions: IQueryBuilderValueOption[];
}
/**
* Options that are connected to a specific identifier.
*
* ```typescript
* {
* key: 'animal.zebra',
* label: 'Zebra'
* }
* ```
*
* ### Import
* ```typescript
* import { IQueryBuilderValueOption } from '@talenra/ngx-base/query-builder';
* ```
*/
interface IQueryBuilderValueOption {
/**
* The identifier of the field that is used to compare the value with the items.
*/
key: string;
/**
* The label is the translated value of the identifier.
*/
label: string;
}
/**
* The `talenra-query-builder` component enables the user to create a query with rules and subqueries.
* The user can add rules and subqueries to the query and select the condition for each query and subqueries.
* Rules can be selected from a list of possible rules and the user can select an operator and a value.
*
* ```html
*
* ```
*
* ### Import
*
* ```typescript
* import { QueryBuilderComponent } from '@talenra/ngx-base/query-builder';
* ```
*
* ../../#/query-builder
*
* @experimental
*/
declare class QueryBuilderComponent {
/**
* The query that is currently selected. Contains all selection, even the rules that are not fully filled out and empty groups.
*
* ```html
*
* ```
*/
query: _angular_core.ModelSignal;
/**
* The possible rules that can be selected.
*
* ```html
*
* ```
*/
possibleRules: _angular_core.InputSignal;
/**
* The values that can be selected in connection to each rule identifier.
*
* ```html
*
* ```
*/
values: _angular_core.InputSignal;
/**
* The maximum hierarchy level on how deep the rule can be constructed.
*
* ```html
*
* ```
*/
maxHierarchyLevel: _angular_core.InputSignalWithTransform;
/**
* Locale to dynamically overwrite the app's locale.
* Allowed values, see: Locale
*
* ```html
*
* ```
*
* @see {@link Locale}
* @see {@link TLocale}
*/
dynamicLocale: _angular_core.InputSignal;
/**
* The locale to use.
*/
locale: _angular_core.Signal;
/** The app's global locale */
private appLocale;
/**
* Actions performed on the query. Either deleting and element of adding a new rule or query.
* @param action The action that is to be performed on the query.
* @param queryOrRule The query or rule that is to be changed.
*/
protected queryAction(action: TQueryBuilderRuleAction, queryOrRule: IQueryBuilderRule | IQueryBuilderQuery): void;
/**
* Changes the rule in the query.
* @param availableQuery
* @param rule
*/
protected onRuleChange(availableQuery: IQueryBuilderQuery, rule: IQueryBuilderRule): void;
/**
* Changes the condition in the query.
* @param condition The condition that is to be set.
* @param query The query that is to be changed.
*/
protected conditionChange(condition: TQueryBuilderCondition, query: IQueryBuilderQuery): void;
/**
* Gets the translation for a key.
* @param key The key that is to be translated.
*/
protected getTranslation(key: string): string;
/**
* Gets the disabled or hidden actions for a query.
* @param query The query that is to be checked.
*/
protected getDisableActionsForQuery(query: IQueryBuilderQuery): TQueryBuilderRuleAction[];
/**
* The map of values for the rule. The key is the identifier of the rule and the value is the rule itself.
*/
protected readonly valuesMap: _angular_core.Signal