@obliczeniowo/elementary
Version:
Library made in Angular version 20
110 lines (103 loc) • 5.08 kB
TypeScript
import * as i0 from '@angular/core';
import { ElementRef, ChangeDetectorRef, TemplateRef, EventEmitter, SimpleChanges, PipeTransform } from '@angular/core';
import * as i9 from '@obliczeniowo/elementary/scroller-nav';
import { PageControllerRecordAdapter } from '@obliczeniowo/elementary/scroller-nav';
import { OblFileService } from '@obliczeniowo/elementary/files';
import * as i5 from '@angular/common';
import * as i6 from '@angular/forms';
import * as i7 from '@obliczeniowo/elementary/icons';
import * as i8 from '@obliczeniowo/elementary/buttons';
import * as i10 from '@obliczeniowo/elementary/input';
interface Record {
x: number;
y: number;
value: string | number;
}
/**
* Component prepared to display raw data like text/numbers as a quick formatted table
*/
declare class ArrayToTableComponent {
protected elementRef: ElementRef<HTMLElement>;
protected change: ChangeDetectorRef;
protected file: OblFileService;
/**
* Array of elements to display number/string/table of number/string
*/
array: (string | number)[] | (string | number)[][];
/** */
headers: i0.InputSignal<string[] | undefined>;
/**
* Caption text of table to display
*/
caption: i0.InputSignal<string | TemplateRef<any> | undefined>;
/**
* Maximum number of columns in one line, if number of columns is greater then this value
* then it will split data in new record line
*/
maxLength: i0.InputSignal<number | undefined>;
/** */
editable: i0.InputSignal<boolean>;
/** */
display: i0.InputSignal<{
index?: boolean;
download?: "json" | "csv";
}>;
arrayChanged: EventEmitter<(string | number)[][]>;
/**
* Prepared to display data
*/
records: Record[][];
/**
* body of table reference for scroller
*/
tbody: HTMLElement | null;
/**
* y table wrapper reference for scroller
*/
yWrapper: HTMLElement | null;
pageAdapter: PageControllerRecordAdapter;
constructor(elementRef: ElementRef<HTMLElement>, change: ChangeDetectorRef, file: OblFileService);
ngOnChanges(changes: SimpleChanges): void;
ngAfterViewInit(): void;
downloadCsv(name?: string): void;
downloadJson(name?: string): void;
changed(value: any, record: number, index: number): void;
protected convert(): Record[][];
static ɵfac: i0.ɵɵFactoryDeclaration<ArrayToTableComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<ArrayToTableComponent, "obl-array-to-table", never, { "array": { "alias": "array"; "required": false; }; "headers": { "alias": "headers"; "required": false; "isSignal": true; }; "caption": { "alias": "caption"; "required": false; "isSignal": true; }; "maxLength": { "alias": "maxLength"; "required": false; "isSignal": true; }; "editable": { "alias": "editable"; "required": false; "isSignal": true; }; "display": { "alias": "display"; "required": false; "isSignal": true; }; }, { "arrayChanged": "arrayChanged"; }, never, ["*"], false, never>;
}
declare class EditableCellComponent {
protected elementRef: ElementRef<HTMLElement>;
value: i0.ModelSignal<string | number | {
[key: string]: string | number;
}>;
editable: i0.InputSignal<boolean>;
type: 'string' | 'number' | 'json' | 'none';
inputValue: string | number | undefined;
focus: boolean;
get isNumber(): boolean;
get isText(): boolean;
clicked(): void;
blur(event: any): void;
constructor(elementRef: ElementRef<HTMLElement>);
ngAfterViewChecked(): void;
changed(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<EditableCellComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<EditableCellComponent, "td[obl-editable-cell]", never, { "value": { "alias": "value"; "required": true; "isSignal": true; }; "editable": { "alias": "editable"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, false, never>;
}
declare class IsPipe implements PipeTransform {
transform(value: any, ...args: ['string' | 'number']): boolean;
static ɵfac: i0.ɵɵFactoryDeclaration<IsPipe, never>;
static ɵpipe: i0.ɵɵPipeDeclaration<IsPipe, "is", false>;
}
declare class IsTemplatePipe implements PipeTransform {
transform(value: any, ...args: unknown[]): TemplateRef<any> | undefined;
static ɵfac: i0.ɵɵFactoryDeclaration<IsTemplatePipe, never>;
static ɵpipe: i0.ɵɵPipeDeclaration<IsTemplatePipe, "isTemplate", false>;
}
declare class ArrayToTableModule {
static ɵfac: i0.ɵɵFactoryDeclaration<ArrayToTableModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<ArrayToTableModule, [typeof ArrayToTableComponent, typeof EditableCellComponent, typeof IsPipe, typeof IsTemplatePipe], [typeof i5.CommonModule, typeof i6.FormsModule, typeof i7.IconsModule, typeof i8.ButtonsModule, typeof i9.ScrollerNavModule, typeof i10.InputModule], [typeof ArrayToTableComponent]>;
static ɵinj: i0.ɵɵInjectorDeclaration<ArrayToTableModule>;
}
export { ArrayToTableComponent, ArrayToTableModule };