Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Implements

Index

Constructors

Properties

Accessors

Methods

Constructors

Properties

_DATAFIELD_INPUT: ConfigurationInput
_OPERATOR_INPUT: ConfigurationInput

Utility variable that can be used as value for the [configurationInputs$]{@link Category#configurationInputs$} Observable.

_allowedNetsSub: Subscription
_allowedOperators: Operator<any>[]
_configurationInputs$: BehaviorSubject<ConfigurationInput[]>
_datafieldOptions: Map<string, Datafield[]>
_datafieldOptionsInitialized$: ReplaySubject<void>
_elasticKeywords: string[]
_generatedPredicate$: BehaviorSubject<ElementaryPredicate>

Emit a new Predicate if the Category is in a state that it can be created. Emits undefined if the Category is not in such state.

_inputType: SearchInputType
_operandsFormControls: FormControl[]

Stores the FormControl objects that are pushed into the observable when the number of operands changes.

_operandsFormControls$: ReplaySubject<FormControl[]>

Contains the FormControl objects that can be used to input search arguments.

_operatorFormControl: FormControl

Contains the FormControl object that is used to drive the operator selection.

The category can subscribe to it if it wishes to react to the selection change by the user.

_operatorService: OperatorService
_operatorTemplate$: BehaviorSubject<OperatorTemplatePart[]>

Contains the operator template parts that make up the operands GUI.

_optionalDependencies: OptionalDependencies
_processCategory: CaseProcess
_trackByIdGenerator: IncrementingCounter

Generates IDs for template parts supplied to ng for.

_userAutocomplete: UserAutocomplete
translationPath: string
AUTOCOMPLETE_ICON: "account_circle" = 'account_circle'
DATAFIELD_METADATA: "datafield" = 'datafield'
DISABLED_TYPES: string[] = ...
OPERATOR_METADATA: "operator" = 'operator'

The CategoryMetadataConfiguration key for this Category's Operator

_i18n: "search.category.case.dataset" = 'search.category.case.dataset'

Accessors

  • get _selectedDatafields(): Datafield[]
  • The allowed operators are dependant on the selected data field.

    Beware that if you want to change the order of the allowed operators, then you must also update the [selectDefaultOperator()]{@link Category#selectDefaultOperator} method, so that default operator for each data field type matches the default operator of the CaseSimpleDataset search category. Otherwise the transition of header search into the search GUI won't work properly.

    Returns Operator<any>[]

  • get datafieldOptionsInitialized$(): Observable<void>
  • get displayBold(): boolean
  • get elasticKeywords(): string[]
  • If you use the Category class as a sort of PredicateBuilder, then you want to use the [generatePredicate()]{@link Category#generatePredicate} method instead.

    This stream publishes either a new Predicate object or undefined based on changes to the FormControls that are managed by this class. If (based on user input) the Category reaches a state when construction of a Predicate is possible it will emit this Predicate. If it reaches a state when the Predicate can not longer be created undefined is emitted.

    Returns Observable<ElementaryPredicate>

  • get hasSelectedDatafields(): boolean
  • get inputPlaceholder(): string
  • get operandsFormControls$(): Observable<FormControl[]>
  • Returns Observable<FormControl[]>

    an array of FormControl objects that contains as many controls as is the arity of the selected operator. Calling this method multiple times will return the same FormControl instances. When no operator is selected undefined is emitted.

  • get providesPredicate(): boolean
  • get selectedOperatorArity(): number

Methods

  • addToDatafieldOptionsMap(key: string, value: Datafield): void
  • clearOperatorSelection(): void
  • createDatafieldOptions(): void
  • Provides the necessary information for the serialisation of this category's state.

    Not every state must be preservable. The default library implementation supports only the preservation of the final state when the Category is generating a predicate object.

    Returns CategoryGeneratorMetadata

    an object containing all the necessary information for the reconstruction of this category's state, barring information about allowed nets. Returns undefined if the category is not in a state that generates a predicate. See [providesPredicate()]{@link Category#providesPredicate}.

  • createMetadataValues(): unknown[]
  • The default implementation returns the value of all operand form control objects up to the current number of operands. To serialize value of each operand the [serializeOperandValue()]{@link Category#serializeOperandValue} method is used.

    If the values used by this category are not serializable, then either this method, or the serializeOperandValue method, must be overridden.

    Returns unknown[]

    an array containing values input by the user in a serializable form

  • deserializeOperandValue(value: unknown): Observable<any>
  • destroy(): void
  • generateNetConstraint(datafield: Datafield): Query
  • generateQuery(userInput: unknown[]): Query
  • initializeCategory(): void
  • This method is calle in the constructor. Apart from calling this method, the constructor only creates instances to fill the protected fields of this class.

    The default implementation manages creation of operand FormControl instances and manages subscriptions to them.

    You can override this method to change the initialization of your category without having to rewrite the base constructor from scratch.

    Returns void

  • isNullOperatorQueryGenerationStrategy(datafield: Datafield): Query
  • isOperandValueSelected(newValue: any): boolean
  • isOperatorSelected(): boolean
  • isSelectedOperator(operatorClass: Type<any>): boolean
  • loadValuesFromMetadata(values: unknown[]): Observable<void>
  • The default implementation sets the provided values into this Category's operand form controls.

    An operator must be set before calling this method! Otherwise an error will be thrown.

    If the number of values doesn't match the arity of the selected operator an error will be thrown!

    If this Category overrides the [serializeOperandValue()]{@link Category#serializeOperandValue}, it must also override its deserialization counterpart - [deserializeOperandValue()]{@link #Category#deserializeOperandValue}!

    Parameters

    • values: unknown[]

      the serialized values that should be loaded into this Category instance

    Returns Observable<void>

    an Observable. When the Observable emits the category has finished loading its values.

  • operandValueChanges(operandIndex: number): void
  • reset(): void
  • resolveElasticKeyword(datafield: Datafield): string
  • selectDatafields(datafieldMapKey: string, selectDefaultOperator?: boolean): void
  • selectDefaultOperator(): void
  • selectOperator(operatorIndex: number): void
  • serializeClass(): string
  • serializeOperandValue(valueFormControl: FormControl): unknown
  • setOperands(userInput: Datafield[]): void
  • Changes the state of the Category and generates a query if all necessary operands were set.

    If you are using the category as a builder. Consider using the [generatePredicate()]{@link Category#generatePredicate} method instead.

    Parameters

    • userInput: Datafield[]

      values entered by the user. The length of the array should match the [arity]{@link Operator#_numberOfOperands} of the selected Operator.

    Returns void

  • standardQueryGenerationStrategy(datafield: Datafield, userInput: unknown[], escapeInput?: boolean): Query
  • transformCategoryValue(value: any): any

Generated using TypeDoc