Options
All
  • Public
  • Public/Protected
  • All
Menu

This class aims to be a simpler more limited version of the CaseDataset Category implementation.

It can only generate "equality" queries for a single field. The category must be configured before it can be used to generate queries.

This category cannot be serialized. If you want to preserve this category's state convert it to CaseDataset with the [transformToCaseDataset()]{@link CaseSimpleDataset#transformToCaseDataset} method and serialize the result.

See [configure]{@link CaseSimpleDataset#configure} for more information.

Hierarchy

Index

Constructors

Properties

_OPERATOR_INPUT: ConfigurationInput

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

_allowedOperators: Operator<any>[]
_elasticKeyword: string
_elasticKeywords: string[]
_fieldId: string
_fieldType: 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
_netIdentifiers: string[]
_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.

translationPath: string
OPERATOR_METADATA: "operator" = 'operator'

The CategoryMetadataConfiguration key for this Category's Operator

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

Accessors

  • 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 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

  • clearOperatorSelection(): void
  • configure(fieldId: string, fieldType: string, netIdentifiers: string[]): void
  • createMetadata(): never
  • 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
  • generateQuery(userInput: unknown[]): Query
  • getActiveInputFormControl(inputIndex: number): FormControl
  • initializeCategory(): void
  • 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(): void
  • selectDefaultOperator(): void
  • selectOperator(operatorIndex: number): void
  • serializeClass(): string
  • serializeOperandValue(valueFormControl: FormControl): unknown
  • setOperands(userInput: string[]): void
  • transformCategoryValue(value: any): string
  • transformToCaseDataset(fieldType: string, fieldTitle: string, userInput: any[]): CaseDataset

Generated using TypeDoc