UNPKG

@obliczeniowo/elementary

Version:
94 lines (93 loc) 4.02 kB
import { CategoryWithId } from './../../interfaces/category'; import { AdapterConnector } from './../../interfaces/adapter-connector'; import { EventEmitter, SimpleChanges, OnChanges } from '@angular/core'; import { AbstractControl, ControlValueAccessor, ValidationErrors } from '@angular/forms'; import { Category } from '../../interfaces/category'; import { AbstractCombineAdapter } from '../../classes/abstract-combine-adapter'; import * as i0 from "@angular/core"; interface Coords { x1: number; y1: number; x2: number; y2: number; transform: string; } export 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: import("@angular/core").InputSignal<AbstractCombineAdapter<any>>; /** * 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 * * <obl-combine-categories [value]="selected" (valueChanged)="changed($event)" * [disable]="[[{ name: 'Category 1' }, { name: 'Category 2' }]]"></obl-combine-categories> */ disable: (Category | number)[][]; /** * Let you display a obl-single-category components that represents single combination with names of * categories displayed inside. */ displaySingle: import("@angular/core").InputSignal<boolean>; /** * Emit when value changed */ valueChange: EventEmitter<any[][]>; 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<CombineCategoriesComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<CombineCategoriesComponent, "obl-combine-categories", never, { "adapter": { "alias": "adapter"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "disable": { "alias": "disable"; "required": false; }; "displaySingle": { "alias": "displaySingle"; "required": false; "isSignal": true; }; "categories": { "alias": "categories"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, false, never>; } export {};