import * as i0 from '@angular/core'; import { OnChanges, EventEmitter, SimpleChanges, ElementRef } from '@angular/core'; import { ControlValueAccessor, AbstractControl, ValidationErrors } from '@angular/forms'; import * as i4 from '@angular/common'; import * as i5 from '@obliczeniowo/elementary/text-pipes'; interface Category { name: string; [key: string]: any; } interface CategoryWithId extends Category { name: string; id: number; [key: string]: any; } interface AdapterConnector { selected: string[]; categories: Category[]; } declare abstract class AbstractCombineAdapter { protected adapterConnector: AdapterConnector; constructor(adapterConnector?: AdapterConnector); setAdapterConnector(adapterConnector: AdapterConnector): void; toTag(index1: number, index2: number, reversed?: boolean): string; abstract findIndex(data: T): number; abstract fromIndex(index: number): T; abstract convert(): T[][]; abstract transform(data: T[][], reversed?: boolean): string[]; } interface Coords { x1: number; y1: number; x2: number; y2: number; transform: string; } declare class CombineCategoriesComponent implements OnChanges, ControlValueAccessor, AdapterConnector { /** * Selected list in format of string containing id's combination: ['1-2', '1-3'] values should not repeat * * Used to modify selection by adapter field object * * Rather not modify from outside but you can do that too */ selected: string[]; /** * If set display the obl-single-category components, depends on the displaySingle input field */ single: [CategoryWithId, CategoryWithId][]; protected suffix: string; protected touched: boolean; protected disableParts: string[]; /** * Adapt model input/output to your needs. * * Default: CombineNameAdapter is used * * There exists another ones: * * CombineIdAdapter - accept input/output format: [[1, 2], [1, 3]] <- select / emit categories by * pair of id's. Id's are number from 1 - 6 (step 1 of course) */ adapter: i0.InputSignal>; /** * Set selected categories */ value: (Category | number)[][]; /** * Disable whole things */ disabled: any; /** * Disable specific combination of categories (format depends on type of adapter used inside) * * When the adapter field is instance of CombineNameAdapter then to disable "Category 1" i "Category 2": * * @example * * */ disable: (Category | number)[][]; /** * Let you display a obl-single-category components that represents single combination with names of * categories displayed inside. */ displaySingle: i0.InputSignal; /** * Emit when value changed */ valueChange: EventEmitter; protected headers: { transform: string; href: string; }[]; protected combine: [number, number, Coords][]; categories: Category[]; onChange: (value: (Category | number)[][]) => void; onTouched: () => void; ngOnChanges(changes: SimpleChanges): void; validate(control: AbstractControl): ValidationErrors | null; writeValue(categories: Category[][]): void; registerOnChange(onChange: any): void; registerOnTouched(onTouched: any): void; setDisabledState(disabled: boolean): void; markAsTouched(): void; click(category: number[]): void; toggleAll(category: number): void; connectionFill(category: number[]): string | undefined; protected toSingleCombination(): void; protected set(withEmit?: boolean): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class SingleCombinationComponent { categories: [Category, Category]; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class HalfMatrixCombineCategoriesComponent implements OnChanges, ControlValueAccessor, AdapterConnector { private readonly elementRef; protected touched: boolean; protected disableParts: string[]; selected: string[]; single: [CategoryWithId, CategoryWithId][]; /** * Categories list used to create combination, minimum 2 maximum 7 however there is no limits */ categories: Category[]; value: (Category | number)[][]; adapter: AbstractCombineAdapter; /** * Disable whole things */ disabled: any; /** * Disable speciffic combination of categories (format depends on type of adapter used inside) * * When the adapter field is instance of CombineNameAdapter then to disable "Category 1" i "Category 2": * * @example * * */ disable: (Category | number)[][]; /** * Let you display a obl-single-category components that represents single combination with names of * categories displayed inside. */ displaySingle: i0.InputSignal; /** * Emit when value changed */ valueChanged: EventEmitter; onChange: (value: (Category | number)[][]) => void; onTouched: () => void; constructor(elementRef: ElementRef); table(length: number): Array; select(row: number, col: number): void; toggle(row: number, col: number): void; toggleAll(categoryId: number): void; ngOnChanges(changes: SimpleChanges): void; validate(control: AbstractControl): ValidationErrors | null; writeValue(categories: Category[][]): void; registerOnChange(onChange: any): void; registerOnTouched(onTouched: any): void; setDisabledState(disabled: boolean): void; markAsTouched(): void; protected toSingleCombination(): void; protected set(withEmit?: boolean): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class CategoriesModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare class CombineNameAdapter extends AbstractCombineAdapter { findIndex(data: Category): number; fromIndex(index: number): Category; convert(): Category[][]; transform(data: Category[][], reversed?: boolean): string[]; } declare class CombineNameAndIndexAdapter extends AbstractCombineAdapter { findIndex(data: CategoryWithId): number; fromIndex(index: number): CategoryWithId; convert(): CategoryWithId[][]; transform(data: CategoryWithId[][], reversed?: boolean): string[]; } declare class CombineIdAdapter extends AbstractCombineAdapter { findIndex(data: number): number; fromIndex(index: number): number; convert(): number[][]; transform(data: number[][], reversed?: boolean): string[]; } export { AbstractCombineAdapter, CategoriesModule, CombineCategoriesComponent, CombineIdAdapter, CombineNameAdapter, CombineNameAndIndexAdapter, HalfMatrixCombineCategoriesComponent, SingleCombinationComponent }; export type { AdapterConnector, Category, CategoryWithId };