import { Popover } from 'primeng/popover'; import type { AellaFilterDefinition, FilterBarLabels } from './filter-bar.models'; import * as i0 from "@angular/core"; /** * Filter Chip Component * * IMPORTANT: Range Filter Value Parsing Logic * ============================================ * * This component receives values from filter-value-selector and parses them * into the internal nested array model format for range filters. * * VALUE PARSING PATTERNS: * ----------------------- * The component receives values from value-selector in these formats: * * 1. Range only: * Receives: [[from, to]] * Parses to: included/excluded = [[from, to]] * Example: [[38, 100]] → { included: [[38, 100]] } * * 2. Range + discrete: * Receives: [[from, to], discrete1, discrete2] * Parses to: included/excluded = [[from, to], discrete1, discrete2] * Example: [[38, 100], 45] → { included: [[38, 100], 45] } * * 3. Discrete only (no active range): * Receives: [discrete1, discrete2] * Parses to: included/excluded = [discrete1, discrete2] * Example: [45, 63] → { included: [45, 63] } * * DETECTION LOGIC: * ---------------- * To distinguish between range and discrete values: * hasRangeTuple = values.length > 0 && Array.isArray(values[0]) && values[0].length === 2 * * If hasRangeTuple = true: * - First element is [from, to] range tuple * - Remaining elements are discrete values * * If hasRangeTuple = false: * - All elements are discrete values * - No range present * * DUAL-MODE RANGE FILTER LOGIC: * ------------------------------ * Range filters support both included AND excluded values simultaneously: * - included: [[from1, to1], discrete1, ...] (IN mode values) * - excluded: [[from2, to2], discrete2, ...] (EX mode values) * * When toggling modes or updating values: * - Extract discrete values from the OPPOSITE array and preserve them * - Remove any range tuple from the OPPOSITE array * - This ensures range only exists in ONE array (included OR excluded) * * EXAMPLE SCENARIOS: * ------------------ * Scenario 1: Toggle range from IN to EX * Before: included = [[38, 100]], excluded = [] * User toggles to EX, applies * After: included = [], excluded = [[38, 100]] * * Scenario 2: Range IN + Discrete IN, toggle to EX * Before: included = [[38, 100], 45], excluded = [] * User toggles range to EX, applies * After: included = [45], excluded = [[38, 100]] * (Discrete 45 preserved in included, range moved to excluded) * * Scenario 3: Range IN + Add Discrete EX * Before: included = [[38, 100]], excluded = [] * User toggles to EX, adds discrete 37, applies * After: included = [], excluded = [[38, 100], 37] * * HELPER FUNCTIONS: * ----------------- * - extractRange(array): Finds and returns [from, to] tuple from array * - extractDiscreteValues(array): Returns all non-tuple elements from array * * @see filter-value-selector.component.ts for emit logic * @see filter-bar.models.ts for helper functions and type definitions */ export declare class FilterChipComponent { readonly filter: import("@angular/core").InputSignal; readonly filterLoading: import("@angular/core").InputSignal; readonly labels: import("@angular/core").InputSignal; readonly removeEvent: import("@angular/core").OutputEmitterRef; readonly includedChanged: import("@angular/core").OutputEmitterRef<(string | number | boolean)[]>; readonly excludedChanged: import("@angular/core").OutputEmitterRef<(string | number | boolean)[]>; readonly filterChanged: import("@angular/core").OutputEmitterRef; valuesPopover: Popover; private readonly ftuDismissed; readonly popoverVisible: import("@angular/core").WritableSignal; readonly editingMode: import("@angular/core").WritableSignal<"include" | "exclude">; readonly isDualMode: import("@angular/core").Signal; readonly hasIncluded: import("@angular/core").Signal; readonly hasExcluded: import("@angular/core").Signal; readonly isExclude: import("@angular/core").Signal; readonly fieldLabel: import("@angular/core").Signal; readonly headerBadge: import("@angular/core").Signal; readonly headerBadgeColor: import("@angular/core").Signal; readonly valueSummary: import("@angular/core").Signal; readonly includedSummary: import("@angular/core").Signal; readonly excludedSummary: import("@angular/core").Signal; readonly chipTooltipText: import("@angular/core").Signal; readonly fieldTooltipText: import("@angular/core").Signal<"Tip: Click a filter name to toggle include / exclude" | "Click to include" | "Click to exclude">; readonly tooltipText: import("@angular/core").Signal; readonly currentValueType: import("@angular/core").Signal<"toggle" | "tree" | "checkbox" | "date-range" | "number-range" | "radio" | "number-range-slider" | "text-input" | "number-input" | "query" | "autocomplete">; readonly currentOptions: import("@angular/core").Signal; readonly currentDisplayOptions: import("@angular/core").Signal; readonly currentSelected: import("@angular/core").Signal; readonly currentSelectedExcluded: import("@angular/core").Signal; readonly currentMin: import("@angular/core").Signal; readonly currentMax: import("@angular/core").Signal; readonly currentStep: import("@angular/core").Signal; readonly currentOptionsLoader: import("@angular/core").Signal; readonly currentFilterContext: import("@angular/core").Signal<{ entity: { id: string; }; }>; onFieldMouseLeave(): void; onToggleMode(): void; onEditIncluded(event: Event, target: HTMLElement): void; onEditExcluded(event: Event, target: HTMLElement): void; onEditValues(event: Event, target: HTMLElement): void; onModeChanged(mode: 'include' | 'exclude'): void; onApplyValues(values: (string | number | boolean)[]): void; /** * Handle apply event from FilterValueSelectorV2 * V2 returns { included: [], excluded: [] } directly */ onApplyValuesV2(event: { included: (string | number | boolean | Date | [number, number] | [Date, Date])[]; excluded: (string | number | boolean | Date | [number, number] | [Date, Date])[]; }): void; private _formatValues; private _formatDiscreteValues; /** * Get summary for range filters (shared logic for included and excluded) */ private _getRangeSummary; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }