projects/netgrif-components-core/src/lib/search/models/predicate/editable-elementary-predicate.ts
A simple, editable type of Predicate
. Represents a leaf node in the predicate tree, that can change the Query
it holds
and can notify the parent tree node about changes.
Properties |
|
Methods |
|
Accessors |
constructor(parentNotifier?: Subject
|
|||||||||
Parameters :
|
Protected _query |
Type : Query
|
Protected _parentNotifier |
Type : Subject<void>
|
Inherited from
EditablePredicate
|
Defined in
EditablePredicate:9
|
Protected _filterTextSegmentsGenerator |
Type : function
|
Inherited from
Predicate
|
Defined in
Predicate:16
|
Protected _metadataGenerator |
Type : function
|
Inherited from
Predicate
|
Defined in
Predicate:15
|
Protected _visible |
Type : boolean
|
Inherited from
Predicate
|
Defined in
Predicate:14
|
Public destroy |
destroy()
|
Inherited from
EditablePredicate
|
Defined in
EditablePredicate:29
|
Returns :
void
|
Protected notifyParentPredicate |
notifyParentPredicate()
|
Inherited from
EditablePredicate
|
Defined in
EditablePredicate:19
|
Notify the parent
Returns :
void
|
Static combineTextSegmentsWithBooleanOperator | ||||||||||||||||||||
combineTextSegmentsWithBooleanOperator(predicates: IterableIterator<Predicate> | Array<Predicate>, operator: BooleanOperator, wrapWithBrackets)
|
||||||||||||||||||||
Inherited from
Predicate
|
||||||||||||||||||||
Defined in
Predicate:51
|
||||||||||||||||||||
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:110
|
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 createGeneratorMetadata |
createGeneratorMetadata()
|
Inherited from
Predicate
|
Defined in
Predicate:98
|
Returns
Returns :
GeneratorMetadata | undefined
an object containing the necessary information for the reconstruction of the entire predicate tree in serializable form.
Returns |
Public setFilterTextSegmentsGenerator | ||||||
setFilterTextSegmentsGenerator(filterTextSegmentsGenerator: () => void)
|
||||||
Inherited from
Predicate
|
||||||
Defined in
Predicate:102
|
||||||
Parameters :
Returns :
void
|
Public setMetadataGenerator | ||||||
setMetadataGenerator(metadataGenerator: () => void)
|
||||||
Inherited from
Predicate
|
||||||
Defined in
Predicate:90
|
||||||
Parameters :
Returns :
void
|
Public show |
show()
|
Inherited from
Predicate
|
Defined in
Predicate:86
|
Sets the predicates state to
Returns :
void
|
query | ||||||
getquery()
|
||||||
setquery(query: Query)
|
||||||
Parameters :
Returns :
void
|
import {Subject} from 'rxjs';
import {Query} from '../query/query';
import {EditablePredicate} from './editable-predicate';
/**
* A simple, editable type of `Predicate`. Represents a leaf node in the predicate tree, that can change the `Query` it holds
* and can notify the parent tree node about changes.
*/
export class EditableElementaryPredicate extends EditablePredicate {
protected _query: Query;
constructor(parentNotifier?: Subject<void>, initiallyVisible = true) {
super(parentNotifier, initiallyVisible);
this._query = Query.emptyQuery();
}
get query(): Query {
return this._query;
}
set query(query: Query) {
this._query = query;
this.notifyParentPredicate();
}
}