@netgrif/components-core
Version:
Netgrif Application engine frontend core Angular library
67 lines (66 loc) • 2.99 kB
TypeScript
import { BooleanOperator } from '../boolean-operator';
import { Subject } from 'rxjs';
import { IncrementingCounter } from '../../../utility/incrementing-counter';
import { Query } from '../query/query';
import { EditablePredicate } from './editable-predicate';
import { Predicate } from './predicate';
/**
* A complex, editable `Predicate`. Represents an inner node in the predicate tree, that can process changes of `Query` objects
* held by its child nodes. It can notify the parent tree node about changes to the held `Query`.
*/
export declare class EditableClausePredicate extends EditablePredicate {
protected _operator: BooleanOperator;
protected _bracketSubPredicateText: boolean;
protected _predicates: Map<number, Predicate>;
protected _childUpdated$: Subject<void>;
protected _childCounter: IncrementingCounter;
protected _query: Query;
constructor(_operator: BooleanOperator, parentNotifier?: Subject<void>, initiallyVisible?: boolean, _bracketSubPredicateText?: boolean);
get query(): Query;
destroy(): void;
show(): void;
/**
* Shows the predicates with the given ids. Skips ids that don't exist.
* @param predicateIds the ids of the predicates that should be shown.
*/
showPredicates(predicateIds: Array<number>): void;
/**
* Adds new child predicate of type {@link EditableElementaryPredicate}
* @param initiallyVisible whether the new predicate should be initially visible
*/
addNewElementaryPredicate(initiallyVisible?: boolean): number;
/**
* Adds new child predicate of type {@link EditableClausePredicate}
* @param operator the operator of the child clause predicate
* @param initiallyVisible whether the new predicate should be initially visible
*/
addNewClausePredicate(operator: BooleanOperator, initiallyVisible?: boolean): number;
/**
* Generates an id for the new predicate, adds it into the map and updates the query
*
* If you want to add an editable predicate, use one of the other methods, so that this predicate can react to changes.
* @param predicate the new predicate
*/
addPredicate(predicate: Predicate): number;
removePredicate(id: number): boolean;
getPredicateMap(): Map<number, Predicate>;
/**
* Updates the `Query` and notifies the parent.
*/
protected updateQueryAndNotify(): void;
/**
* Updates the value of the [_query]{@link ClausePredicate#_query} attribute.
*
* See [combineQueries()]{@link Query#combineQueries} for more information.
*/
protected updateQuery(): void;
/**
* @returns the `Array` of {@link Query} objects stored within this object's [_predicates]{@link ClausePredicate#_predicates} attribute.
*/
protected get queries(): Array<Query>;
/**
* Sets this predicate and all its sub-predicates to visible.
*/
protected showAll(): void;
private initializeFilterTextSegmentsGenerator;
}