import * as i0 from '@angular/core'; import { AfterViewInit, ChangeDetectorRef, TemplateRef, EventEmitter, ViewContainerRef, Type, QueryList } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import * as _messaia_cdk from '@messaia/cdk'; import { GenericReactiveFormComponent, BaseService, FileService, VdGenericFormCustomFieldDirective, GenericListComponent, IEntity, GenericService, SaveAction, Salutation, BaseEntity, ModifiableEntity } from '@messaia/cdk'; import { StepperSelectionEvent } from '@angular/cdk/stepper'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { CdkDropList, CdkDragDrop } from '@angular/cdk/drag-drop'; import { FormArray, AbstractControl, FormGroup } from '@angular/forms'; import { Observable } from 'rxjs'; declare class VdAuditPanelComponent implements AfterViewInit { private viewContainer; protected changeDetectorRef: ChangeDetectorRef; /** * Reference to the template for rendering suggestions. * @type {TemplateRef} */ templateRef: TemplateRef; /** * Reference to the content projected in the left section. * This can be any template defined with the left attribute in the parent component. * @type {TemplateRef} */ leftContent?: TemplateRef; /** * Reference to the content projected in the middle section. * This can be any template defined with the middle attribute in the parent component. * @type {TemplateRef} */ middleContent?: TemplateRef; /** * Reference to the content projected in the right section. * This can be any template defined with the right attribute in the parent component. * @type {TemplateRef} */ rightContent?: TemplateRef; /** * The ID of the entity being audited, passed as an input to the component. * @type {string} */ id?: string; /** * The current item being audited, passed as an input to the component. * @type {any} */ entity?: any; /** * Event emitter for navigating back from the audit panel. * @type {EventEmitter} */ back: EventEmitter; /** * Constructor to inject ViewContainerRef and ChangeDetectorRef. * @param {ViewContainerRef} viewContainer - Used to dynamically insert views. * @param {ChangeDetectorRef} changeDetectorRef - Used to trigger change detection manually. */ constructor(viewContainer: ViewContainerRef, changeDetectorRef: ChangeDetectorRef); /** * A callback method that is invoked immediately after Angular has completed initialization * of the component's view. * It creates the embedded view from the template and triggers change detection. */ ngAfterViewInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class VdAuditComponent { /** * The audit data being passed into the component. * This property holds the information related to the audit, * and it can be of any type. Consider using a more specific type * for better type safety and clarity. * @type {any} */ entity: any; /** * Reference to the content projected in the left section. * This can be any template defined with the left attribute in the parent component. * @type {TemplateRef} */ left?: TemplateRef; /** * Reference to the content projected in the middle section. * This can be any template defined with the middle attribute in the parent component. * @type {TemplateRef} */ middle?: TemplateRef; /** * Reference to the content projected in the right section. * This can be any template defined with the right attribute in the parent component. * @type {TemplateRef} */ right?: TemplateRef; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class VdDynamicEditFormComponent extends GenericReactiveFormComponent { protected service: BaseService; protected fileService: FileService; protected route: ActivatedRoute; protected changeDetectorRef: ChangeDetectorRef; /** * classType: Type */ private _classType?; /** * classType: Type */ get classType(): Type | undefined; set classType(classType: Type); /** * context: any * The current context */ context?: any; /** * Group names */ groupNames: (string | undefined)[]; /** * debugValue: boolean */ debugValue: boolean; /** * initializer: { [key: string]: any } * Initializer values for the form */ initializer?: { [key: string]: any; }; /** * cssClass: string * Additional CSS class for the form */ ngClass?: any; /** * Template ref for custom fields */ footer?: TemplateRef; /** * Template ref for custom fields */ dynamicCustomFields?: TemplateRef; /** * @property Template references for custom fields. * @description The `customFieldsTemplates` holds a collection of `VdGenericFormCustomFieldDirective` templates * used for rendering custom fields in the form. * @type {QueryList} */ customFieldsTemplates?: QueryList; /** * Constructor */ constructor(service: BaseService, fileService: FileService, route: ActivatedRoute, changeDetectorRef: ChangeDetectorRef); /** * Lifecycle hook that is called after data-bound properties * of a directive are initialized. */ ngOnInit(): void; /** * Inits the form * @override */ protected init(): void; /** * Event emitted when the id is set. */ protected onAfterSetId(): void; /** * Loads an item by ID. * This method fetches the item if the component is in edit mode and the service endpoint is defined. * * @param successCallback - A function to be called after the item has been successfully loaded. * This function will receive the loaded item as an argument. * @param errorCallback - A function to be called if an error occurs during loading. * This function will receive the error as an argument. */ loadItem(): void; /** * Event emitted before the form has built. */ protected onBeforeFormBuild(): void; /** * Uploads a file and updates the form with the uploaded file's information. * @param file The file or list of files to be uploaded. * @param filePath The path where the file should be uploaded. * @param isPublicFile A boolean indicating whether the file is public. */ upload(file: File | FileList, filePath: string, isPublicFile: boolean): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class VdDynamicFormComponent extends GenericReactiveFormComponent { protected service: BaseService; protected fileService: FileService; protected route: ActivatedRoute; protected changeDetectorRef: ChangeDetectorRef; /** * An instance of the class to create the table for */ classInstance: any; /** * useStepper: boolean */ useStepper: boolean; /** * debugValue: boolean */ debugValue: boolean; /** * Constructor */ constructor(service: BaseService, fileService: FileService, route: ActivatedRoute, changeDetectorRef: ChangeDetectorRef); /** * Lifecycle hook that is called after data-bound properties * of a directive are initialized. */ ngOnInit(): void; /** * Uploads a file or a list of files to the specified path. * @param file - The file or file list to be uploaded. * @param filePath - The destination path for the uploaded file. * @param isPublicFile - Optional flag to indicate if the file should be publicly accessible. * @param callback - Optional callback function to handle the response. */ upload(file: File | FileList, filePath: string, isPublicFile?: boolean, callback?: (response: any) => void): void; /** * Init some navigations * @param $event */ protected onAfterStepChange($event: StepperSelectionEvent): void; /** * Event emitted before the form has built. */ protected onBeforeFormBuild(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class VdDynamicListComponent extends GenericListComponent { service: BaseService; protected dialog: MatDialog; protected route: ActivatedRoute; protected changeDetectorRef: ChangeDetectorRef; /** * @property exportable * @description Determines if the table is exportable. * @type {boolean} */ exportable: boolean; /** * Constructor */ constructor(service: BaseService, dialog: MatDialog, route: ActivatedRoute, changeDetectorRef: ChangeDetectorRef); /** * Navigates to the add page. */ add(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * @class ExportColumn * @description Represents an individual column configuration for an export operation. * This class defines the attributes of a column, such as its name, display title, * whether it's selected, editable, and its ordering position. */ declare class EntityExportColumn { /** * @property The internal name of the column. * @description This name is used to identify the column within the export logic. * It typically corresponds to a database field or an API field name. * @type {string | undefined} */ name?: string; /** * @property The display title of the column. * @description This title is used for display purposes, such as in a UI or a report, * making the column understandable for end-users. * @type {string | undefined} */ title?: string; /** * @property Indicates if the column is selected for export. * @description This boolean flag determines whether the column will be included * in the exported dataset. * @type {boolean | undefined} */ selected?: boolean; /** * @property Indicates if the column is editable. * @description This boolean flag specifies if the column can be modified or edited * in the context where it's used, such as in a UI form. * @type {boolean | undefined} */ editable?: boolean; /** * @property The ordering index of the column. * @description This number determines the position of the column in the export output. * Lower numbers are displayed first. * @type {number | undefined} */ ordering?: number; /** * Constructor to initialize the `ExportColumn` class. * @param init - An optional object containing properties to initialize the class instance. * This allows partial initialization of the object using a subset of the class's properties. */ constructor(init?: Partial); } /** * @class EntityExport * @description Represents the class for exporting data. * This class defines the core properties and configurations required for an export operation. * It is generic to allow flexible options depending on the specific export requirements. */ declare class EntityExport implements IEntity { /** * @property id * @description Optional unique identifier for the entity. * @type {number} */ id?: number; /** * @property Name of the file for export. * @description The name used for the exported file. * @type {string | undefined} */ fileName?: string; /** * @property Character used to separate values. * @description The delimiter used in the exported file. * @type {string} */ delimiter: string; /** * @property File extension for the export. * @description The file format (e.g., 'csv', 'txt') for the export. * @type {string} */ extension: string; /** * @property Character encoding for the export file. * @description Specifies the encoding used for the export file (e.g., 'UTF-8'). * @type {string} */ encoding: string; /** * @property File path for the export. * @description Location where the export file is saved. * @type {string | undefined} */ projection?: string; /** * @property Flag to enable pagination. * @description Indicates whether pagination is enabled for the export. * @type {boolean | undefined} */ paginable?: boolean; /** * @property Page number for pagination. * @description Defines the current page number for the export. * @type {number | undefined} */ page?: number; /** * @property Page size for pagination. * @description Defines the number of items per page for the export. * @type {number | undefined} */ pageSize?: number; /** * @property Sort order for the export. * @description Defines the sort order for the exported dataset. * @type {string | undefined} */ sortBy?: string; /** * @property Sort order for the export. * @description Defines the sort order for the exported dataset. * @type {'asc' | 'desc' | undefined} */ sortOrder?: 'asc' | 'desc'; /** * @property Columns to be included in the export. * @description Defines the columns to be exported. * @type {ExportColumn[]} */ columns: EntityExportColumn[]; /** * @property Filters to be applied to the export. * @description Defines the filters to be applied to the exported dataset. * @type {Dictionary} */ filters: { [key: string]: any; }; /** * Constructor to initialize the `ExportBase` class. * @param init - An optional object containing properties to initialize the class instance. * This parameter allows partial initialization of the object using a subset * of the class's properties. The provided values will be assigned to the * respective properties of the instance. */ constructor(init?: Partial); } declare class EntityExportService extends GenericService { /** * Constructor */ constructor(); /** * Creates an entity * * @param entity The entity to create * @param path A relative path to the action (optional) * @param httpOptions Additional HTTP options, like headers and so on (optional) * @param handleError Flag to handle errors (optional) * @returns An observable with the response containing data and filename */ create(entity: any, _?: string, __?: Object, ___?: boolean): Observable; /** * Gets available columns to export * * @param exportType The type of export to fetch available columns for * @returns An observable with the available columns */ getAvailableColumns(exportType?: any): Observable; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class VdExportDialogComponent extends GenericReactiveFormComponent { protected service: EntityExportService; protected route: ActivatedRoute; protected changeDetectorRef: ChangeDetectorRef; dialogRef: MatDialogRef; data: { endpoint: string; formData: any; }; /** * Reference to the drop list for available columns (columns not yet selected). * This is used to enable drag-and-drop functionality for these columns. */ availableColumnDropList?: CdkDropList; /** * Reference to the drop list for selected columns. * This allows users to manage and reorder the selected columns. */ columnDropList?: CdkDropList; /** * A FormArray holding columns that are available for selection. * These columns are not currently included in the export but can be dragged in. */ availableColumns: FormArray; /** * A FormArray containing columns that have been selected for export. * Accessed through the form's 'columns' control. */ get selectedColumns(): FormArray; /** * A flag to track the current sort order of the selected columns. * If true, columns are sorted in ascending order; if false, descending. */ private selectedColumnsAzSorted; /** * Constructor to initialize the form component with required services. * * @param service Injects ExportService to handle CRUD operations for Export. * @param route Injects ActivatedRoute to access route parameters and data. * @param changeDetectorRef Injects ChangeDetectorRef to manage change detection manually. */ constructor(service: EntityExportService, route: ActivatedRoute, changeDetectorRef: ChangeDetectorRef, dialogRef: MatDialogRef, data: { endpoint: string; formData: any; }); /** * Lifecycle hook that is called after data-bound properties of a directive are initialized. */ ngOnInit(): void; /** * Loads available columns from the server and initializes them. * This function fetches columns not yet included in the export, * sorts them by title, and updates the available columns list. */ loadAvailableColumns(): void; /** * Handles the drag-and-drop event for columns. * @param event - The drag-and-drop event data. */ drop(event: CdkDragDrop): void; /** * Removes a column from the selected columns based on its index. * The column is moved back to the list of available columns. * @param index - Index of the column to remove. */ removeColumn(index: number): void; /** * Adds a column to the selected columns list. * This method moves a column from the available columns to the selected columns. * @param index The index of the column in the available columns list. * @param column The column control to be added to the selected columns list. */ addColumn(index: number, column: AbstractControl): void; /** * Selects and adds all available columns to the export. * This function retrieves columns from the server and includes them in the selected columns list. */ selectAllColumns(): void; /** * Clears the currently selected columns, making them available for selection again. * Fetches the column list from the server and populates the available columns. */ clearSelectedColumns(): void; /** * Resets the selected columns to their initial state. * Reloads the available and selected columns from the server. */ resetSelectedColumns(): void; /** * Toggles the alphabetical sort order of selected columns by title. * Sorts the columns in ascending or descending order based on the current state. */ sortSelectedColumns(): void; /** * Creates a form group for a column object. * This is used to manage the form structure dynamically based on column data. * @param column - The column data to create a form group for. */ protected createFromGroup(column: EntityExportColumn): FormGroup | _messaia_cdk.RxFormGroup | _messaia_cdk.AppFormGroup; /** * Clears any previously selected or available columns. * This method resets both the selected and available columns lists. */ clearColumns(): void; /** * Sorts columns alphabetically or in reverse order based on the specified criteria. * @param columns - The array of columns to sort. * @param sortBy - The property to sort by (default is 'title'). * @param reverse - Whether to reverse the sort order (default is false). */ protected sortColumns(columns: FormArray, sortBy?: string, reverse?: boolean): void; /** * Callback after form submission, handling the response based on the chosen action. * * @param action - The action to be performed after saving (e.g., SaveAndClose) * @param response - The server response data, if any */ protected onAfterSubmit(action?: SaveAction, response?: any): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare const Common: { countries: { id: string; name: string; }[]; }; declare enum DocumentType { Document = 0, Activity = 1, Issue = 2, Email = 3 } /** * Represents the base address entity, implementing the IEntity interface. * This class includes common address fields such as address lines, postal code, city, state, country, and notice. * It is used as a foundational class for other address-related entities. */ declare class AddressBase implements IEntity { /** * @property id * @description Unique identifier for the address entity. * This field is optional and typically generated by the database. * @type {number} */ id?: number; /** * @property address1 * @description The first line of the address (e.g., street name, house number). * This field is required. * @type {string} */ address1?: string; /** * @property address2 * @description The second line of the address (e.g., apartment number, additional address information). * This field is required. * @type {string} */ address2?: string; /** * @property address3 * @description The third line of the address (e.g., building name, additional info). * This field is optional. * @type {string} */ address3?: string; /** * @property postalCode * @description The postal code for the address. * This field is required and includes a postal code validation pattern based on the country. * @type {string} */ postalCode?: string; /** * @property city * @description The city associated with the address. * This field is required. * @type {string} */ city?: string; /** * @property state * @description The state or region associated with the address. * This field is optional. * @type {string} */ state?: string; /** * @property country * @description The country of the address, with a default value set to 'DE' (Germany). * The country is selectable via an endpoint with additional properties like code, flag, and name for display. * @type {string} */ country: string; /** * @property notice * @description An optional notice field for additional information related to the address. * This field is of type TextArea for multi-line input. * @type {string} */ notice?: string; /** * Constructor to initialize an AddressBase instance. * @param init Optional object to initialize properties of the AddressBase class. */ constructor(init?: Partial); } /** * Represents an address entity, extending from AddressBase. * This class includes fields like salutation, title, first name, and last name, * with validation and form field decorators for UI binding. */ declare class Address extends AddressBase { /** * @property salutation * @description The salutation (e.g., Mr., Mrs., Dr.) for the person associated with the address. * This field is required. * @type {Salutation} */ salutation?: Salutation; /** * @property title * @description The title associated with the person (e.g., Dr., Prof.). * This field is optional. * @type {string} */ title?: string; /** * @property firstName * @description The first name of the person associated with the address. * This field is required. * @type {string} */ firstName?: string; /** * @property lastName * @description The last name of the person associated with the address. * This field is required. * @type {string} */ lastName?: string; /** * Constructor to initialize an Address instance. * @param init Optional object to initialize properties of the Address class. */ constructor(init?: Partial
); } /** * Represents an extended address with additional fields such as phone numbers, email, and newsletter subscription. * This class inherits from the `Address` class and adds extra properties for better personalization. */ declare class AddressExtended extends Address { /** * @property phoneNumber1 * @description The first phone number associated with the address. * This field is optional and can be used for contacting the address holder. * @type {string} */ phoneNumber1?: string; /** * @property phoneNumber2 * @description The second phone number associated with the address. * This field is optional and can be used for an alternative contact number. * @type {string} */ phoneNumber2?: string; /** * @property email * @description The email address associated with the contact. * This field is optional and used for electronic communication. * @type {string} */ email?: string; /** * @property emailConfirmed * @description Indicates whether the provided email address has been confirmed. * This field is mandatory with a default value of `true` (email is confirmed). * @type {boolean} */ emailConfirmed: boolean; /** * @property newsletter * @description Indicates whether the user is subscribed to the newsletter. * This field is optional with a default value of `false`. * @type {boolean} */ newsletter: boolean; /** * Constructor to initialize an extended address with additional fields. * @param init Optional object to initialize properties of the AddressExtended class. */ constructor(init?: Partial
); } /** * Represents an attachment entity, typically used to store file-related metadata. * This class includes the attachment's name, original name, file path, media type, and extension. */ declare class Attachment extends BaseEntity { /** * @property name * @description The name of the attachment. This field is required for the attachment. * @type {string} */ name?: string; /** * @property originalName * @description The original name of the attachment file, without any changes. * @type {string} */ originalName?: string; /** * @property relativePath * @description The relative file path where the attachment is stored in the system. * @type {string} */ relativePath?: string; /** * @property mediaType * @description The media type (MIME type) of the attachment, such as 'image/png' or 'application/pdf'. * @type {string} */ mediaType?: string; /** * @property extension * @description The file extension (e.g., .png, .jpg, .pdf) of the attachment. * @type {string} */ extension?: string; } /** * Represents the base class for a document entity with metadata and associated file details. * This class includes document type, file properties, and metadata for file handling. */ declare abstract class DocumentBase extends ModifiableEntity { /** * @property type * @description The type of the document. Defaults to 'Document'. * @type {DocumentType} */ type: DocumentType; /** * @property name * @description The file name of the document, required for file upload. This field accepts multiple file types (e.g., .png, .jpg, .pdf). * @type {string} */ name?: string; /** * @property originalName * @description The original name of the file, without modifications. * @type {string} */ originalName?: string; /** * @property relativePath * @description The relative path where the document is stored in the system. * @type {string} */ relativePath?: string; /** * @property fullPath * @description The full path where the document is stored on the server. * @type {string} */ fullPath?: string; /** * @property isPublic * @description Flag indicating whether the document is publicly accessible. * @type {boolean} */ isPublic?: boolean; /** * @property extension * @description The file extension of the document. * @type {string} */ extension?: string; /** * @property publicLink * @description A public link to the document if it is accessible externally. * @type {string} */ publicLink?: string; /** * @property size * @description The size of the document file in bytes. * @type {number} */ size?: number; /** * @property preserveOriginalName * @description Flag indicating whether to preserve the original file name when saving the document. * @type {boolean} */ preserveOriginalName?: boolean; /** * @property subject * @description The subject or title of the document. * @type {string} */ subject?: string; /** * @property content * @description The content or body of the document, if applicable. * @type {string} */ content?: string; /** * @property attachments * @description A list of attachments related to the document. * @type {Attachment[]} */ attachments: Attachment[]; /** * Constructor for initializing a DocumentBase instance. * @param init Optional partial initialization for the document entity. */ constructor(init?: Partial); } declare const DynamicListTemplate = "\n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n @if(addable && canCreate)\n {\n \n add\n \n }\n \n \n \n "; declare const TableTemplate = "\n\t\n \t\n\n\t\n\t\n"; export { Address, AddressBase, AddressExtended, Attachment, Common, DocumentBase, DocumentType, DynamicListTemplate, EntityExport, EntityExportColumn, EntityExportService, TableTemplate, VdAuditComponent, VdAuditPanelComponent, VdDynamicEditFormComponent, VdDynamicFormComponent, VdDynamicListComponent, VdExportDialogComponent };