projects/netgrif-components-core/src/lib/search/models/predicate/editable-predicate.ts
Base class for editable predicates that allows them to notify their parent predicate tree nodes about updates to their queries.
Properties |
|
Methods |
|
Accessors |
Protected
constructor(parentNotifier?: Subject
|
|||||||||
|
Parameters :
|
| Protected _parentNotifier |
Type : Subject<void>
|
| Protected _filterTextSegmentsGenerator |
Type : function
|
|
Inherited from
Predicate
|
|
Defined in
Predicate:14
|
| Protected _visible |
Type : boolean
|
|
Inherited from
Predicate
|
|
Defined in
Predicate:13
|
| Public destroy |
destroy()
|
|
Returns :
void
|
| Protected notifyParentPredicate |
notifyParentPredicate()
|
|
Notify the parent
Returns :
void
|
| Static combineTextSegmentsWithBooleanOperator | ||||||||||||||||||||
combineTextSegmentsWithBooleanOperator(predicates: IterableIterator<Predicate> | Array<Predicate>, operator: BooleanOperator, wrapWithBrackets)
|
||||||||||||||||||||
|
Inherited from
Predicate
|
||||||||||||||||||||
|
Defined in
Predicate:46
|
||||||||||||||||||||
|
Combines the text segments of the predicates with the given operator and wraps the individual predicates in brackets optionaly (if only one predicate is provided it is never wrapped)
Parameters :
Returns :
Array<FilterTextSegment>
|
| Public createFilterTextSegments |
createFilterTextSegments()
|
|
Inherited from
Predicate
|
|
Defined in
Predicate:93
|
|
The default implementation returns an empty array.
Returns :
Array<FilterTextSegment>
an Array containing text segments representing the content of this predicate. The default implementation returns an empty array. |
| Public setFilterTextSegmentsGenerator | ||||||
setFilterTextSegmentsGenerator(filterTextSegmentsGenerator: () => void)
|
||||||
|
Inherited from
Predicate
|
||||||
|
Defined in
Predicate:85
|
||||||
|
Parameters :
Returns :
void
|
| Public show |
show()
|
|
Inherited from
Predicate
|
|
Defined in
Predicate:81
|
|
Sets the predicates state to
Returns :
void
|
| parentNotifier | ||||||
setparentNotifier(parentNotifier: Subject
|
||||||
|
Parameters :
Returns :
void
|
import {Predicate} from './predicate';
import {Subject} from 'rxjs';
/**
* Base class for editable predicates that allows them to notify their parent predicate tree nodes about updates to their queries.
*/
export abstract class EditablePredicate extends Predicate {
protected _parentNotifier: Subject<void>;
protected constructor(parentNotifier?: Subject<void>, initiallyVisible = true) {
super(initiallyVisible);
this._parentNotifier = parentNotifier;
}
/**
* Notify the parent `Predicate` that this `Predicate` updated its `Query`
*/
protected notifyParentPredicate(): void {
if (this._parentNotifier && !this._parentNotifier.isStopped) {
this._parentNotifier.next();
}
}
public set parentNotifier(parentNotifier: Subject<void>) {
this._parentNotifier = parentNotifier;
}
public destroy() {
this._parentNotifier.complete();
}
}