UNPKG

ng-prime-tools

Version:

An advanced PrimeNG table for Angular

1,516 lines (1,433 loc) 105 kB
import * as i0 from '@angular/core'; import { OnInit, OnChanges, EventEmitter, SimpleChanges, PipeTransform, OnDestroy, AfterViewInit, Renderer2, ElementRef, ChangeDetectorRef, AfterContentInit, TemplateRef } from '@angular/core'; import * as i2 from '@angular/common'; import * as i3 from '@angular/forms'; import { FormGroup, FormBuilder, FormControl, AbstractControl } from '@angular/forms'; import * as i5 from 'primeng/table'; import { Table, TableRowReorderEvent } from 'primeng/table'; import * as i6 from 'primeng/inputtext'; import * as i3$1 from 'primeng/button'; import * as i8 from 'primeng/datepicker'; import * as i4 from 'primeng/multiselect'; import * as i10 from 'primeng/tag'; import * as i11 from 'primeng/iconfield'; import * as i12 from 'primeng/inputicon'; import * as i13 from 'primeng/progressspinner'; import * as i14 from 'primeng/tooltip'; import * as i15 from 'primeng/progressbar'; import * as i8$1 from 'primeng/inputnumber'; import * as i9 from 'primeng/panel'; import * as i4$1 from 'primeng/checkbox'; import * as i4$2 from 'primeng/inputgroup'; import * as i5$1 from 'primeng/inputgroupaddon'; import * as i4$3 from 'primeng/toggleswitch'; import * as i4$4 from 'primeng/textarea'; import * as i7 from 'primeng/password'; import * as i4$5 from 'primeng/select'; import * as i4$6 from 'primeng/inputotp'; import { ChartType, ChartData, ChartOptions } from 'chart.js'; import * as i3$2 from '@angular/router'; import { Router } from '@angular/router'; import { MenuItem as MenuItem$1, ConfirmationService, MessageService } from 'primeng/api'; import * as rxjs from 'rxjs'; import { Subscription } from 'rxjs'; import * as i3$3 from 'primeng/breadcrumb'; import * as i3$4 from 'primeng/confirmdialog'; import * as i3$5 from 'primeng/toast'; import * as i3$6 from 'primeng/dialog'; interface PTTableActionConfig { code: string; icon?: string; styleClass?: string; tooltip?: string; action: any; visible?: boolean | ((row: any) => boolean); disabled?: boolean | ((row: any) => boolean); } interface PTTableLazyLoadEvent { page: number; rows: number; first: number; search?: string; sortField?: string | null; sortOrder?: 1 | -1 | null; filters?: Record<string, any>; } interface PTTableRowOrderItem { id: any; order: number; } interface PTTableRowReorderEvent { oldIndex: number; newIndex: number; movedRow: any; data: any[]; ordering: PTTableRowOrderItem[]; } declare class PTAdvancedPrimeTableComponent implements OnInit, OnChanges { data: any[]; columns: TableColumn[]; totalRecords: number; rowsPerPage: number[]; hasSearchFilter: boolean; hasExportExcel: boolean; hasExportPDF: boolean; hasColumnFilter: boolean; cellPadding: string; isPaginated: boolean; isLazy: boolean; actions: PTTableActionConfig[]; isSortable: boolean; loading: boolean; maxHeight: string | null; isRowReorderable: boolean; rowReorderIdField: string; rowOrderStartAt: number; selectionDataKey: string; selectionMode: 'single' | 'multiple' | null; selection: any | any[] | null; cellHeight: string | null; selectionChange: EventEmitter<any>; rowSelect: EventEmitter<any>; rowUnselect: EventEmitter<any>; lazyLoad: EventEmitter<PTTableLazyLoadEvent>; search: EventEmitter<string>; exportExcelEvent: EventEmitter<void>; exportPdfEvent: EventEmitter<void>; onPageChange: EventEmitter<{ page: number; rows: number; }>; onSortColumn: EventEmitter<any>; onFilterColumn: EventEmitter<any>; rowReorderChange: EventEmitter<PTTableRowReorderEvent>; filteredData: EventEmitter<any[]>; dt: Table; TableTypeEnum: typeof TableTypeEnum; AlignEnum: typeof AlignEnum; SeverityEnum: typeof SeverityEnum; searchValue: string; filters: { [key: string]: any; }; latestFilterValues: { [field: string]: any; }; private clearedFields; private validCurrencyCodes; iconWidth: number; rows: number; first: number; currentPage: number; currentSortField: string | null; currentSortOrder: 1 | -1 | null; hasGroupedColumns: boolean; isDelete: boolean; isEdit: boolean; Delete: (value: any) => void; initEditableRow: (data: any) => void; saveEditableRow: (data: any) => void; cancelEditableRow: (item: any) => void; customActions: PTTableActionConfig[]; dataMap: Map<any, any>; map: Map<any, Map<any, any>>; optionEntries: Map<string, any[]>; optionValues: any[]; globalFilterFields: string[]; ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; private emitLazyLoad; private resetToFirstPage; canUseRowReorder(): boolean; private buildRowOrdering; onRowReorder(event: TableRowReorderEvent): void; getHeaderTitleClass(col: TableColumn): string; getHeaderAlignClass(col: TableColumn): string; getDataAlignClass(col: TableColumn): string; getCellInnerAlignClass(col: TableColumn): string; private initializeActions; private initializeEditActions; onCustomActionClick(action: PTTableActionConfig, row: any): void; private initializeComposedFilters; getComposedFieldType(col: TableColumn, composedName: string): TableTypeEnum | undefined; onComposedColumnClear(col: TableColumn): void; onComposedFilterValueChange(col: TableColumn, composedName: string, value: any[], filterModel?: any): void; onFilterClear(field: string | undefined): void; onFilterValueChange(field: string | undefined, filterModel: any | null, value: any): void; onNumberFilterChange(field: string | undefined, value: any): void; private findColumnByField; filterColumn(event: any): void; changePage(event: any): void; sortColumn(event: any): void; private parseDate_ddMMyyyy; onChange(event: Event, id: number, key: any): void; changeHandler(id: number, key: any, value: any): void; getColumnFilterType(column: TableColumn): string; isEditable(key: string | undefined): boolean; isMultiSelect(key: any): boolean; isDatePicker(key: any): boolean; isDateTimePicker(key: any): boolean; filterGlobal(event: Event): void; private filterComposedColumn; parseAnyDate(input: any): Date | null; private formatWithPattern; formatDate(date: any): string; formatDateWithColumn(d: Date | null, col: TableColumn): string; formatDateTimeWithColumn(d: Date | null, col: TableColumn): string; private calculateColumnWidth; getHeaderWidth(col: TableColumn): string; clear(table: Table): void; private initializePagination; getCurrencySymbol(column: TableColumn): string | undefined; private isValidCurrencyCode; exportExcel(): void; exportPdf(): void; getImageStyle(style: TitleStyle | ImageStyle | undefined): { [key: string]: string; }; getTitleStyle(style: TitleStyle | ImageStyle | undefined): { [key: string]: string; }; formatNumber(value: number, decimalPlaces?: number, thousandSeparator?: 'comma' | 'space', decimalSeparator?: 'comma' | 'dot'): string; isActionVisible(action: PTTableActionConfig, row: any): boolean; isActionDisabled(action: PTTableActionConfig, row: any): boolean; getComposedCellStyle(col: TableColumn, composedName: string, row: any): { [key: string]: string; }; mergeStyles(...styles: Array<{ [key: string]: string; } | null | undefined>): { [key: string]: string; }; getMergedComposedTextStyle(col: TableColumn, composedName: string, row: any): { [key: string]: string; }; getMergedComposedImageStyle(col: TableColumn, composedName: string, row: any): { [key: string]: string; }; getTagValue(col: TableColumn, row: any): string; getTagSeverity(col: TableColumn, row: any): SeverityEnum; getTagIcon(col: TableColumn, row: any): string | undefined; isTagRounded(col: TableColumn): boolean; getActionTooltip(action: PTTableActionConfig, row: any): string; getDefaultActionTooltip(code: string): string; getProgressValue(col: TableColumn, row: any): number; isProgressShowValue(col: TableColumn): boolean; getProgressUnit(col: TableColumn): string; getProgressSeverity(col: TableColumn, row: any): SeverityEnum; getMultiSelectValues(value: any): any[]; getCellHeight(): string | null; getColumnCellPadding(col: TableColumn): string; getColumnCellMargin(col: TableColumn): string; getCellInnerStyle(col: TableColumn, defaultMargin?: string): { [key: string]: string; }; getCellStyle(col: TableColumn, row: any): { [key: string]: string; }; getHeaderCellStyle(col: TableColumn): { [key: string]: string; }; getStaticCellStyle(): { [key: string]: string; }; static ɵfac: i0.ɵɵFactoryDeclaration<PTAdvancedPrimeTableComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<PTAdvancedPrimeTableComponent, "pt-advanced-prime-table", never, { "data": { "alias": "data"; "required": false; }; "columns": { "alias": "columns"; "required": false; }; "totalRecords": { "alias": "totalRecords"; "required": false; }; "rowsPerPage": { "alias": "rowsPerPage"; "required": false; }; "hasSearchFilter": { "alias": "hasSearchFilter"; "required": false; }; "hasExportExcel": { "alias": "hasExportExcel"; "required": false; }; "hasExportPDF": { "alias": "hasExportPDF"; "required": false; }; "hasColumnFilter": { "alias": "hasColumnFilter"; "required": false; }; "cellPadding": { "alias": "cellPadding"; "required": false; }; "isPaginated": { "alias": "isPaginated"; "required": false; }; "isLazy": { "alias": "isLazy"; "required": false; }; "actions": { "alias": "actions"; "required": false; }; "isSortable": { "alias": "isSortable"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "maxHeight": { "alias": "maxHeight"; "required": false; }; "isRowReorderable": { "alias": "isRowReorderable"; "required": false; }; "rowReorderIdField": { "alias": "rowReorderIdField"; "required": false; }; "rowOrderStartAt": { "alias": "rowOrderStartAt"; "required": false; }; "selectionDataKey": { "alias": "selectionDataKey"; "required": false; }; "selectionMode": { "alias": "selectionMode"; "required": false; }; "selection": { "alias": "selection"; "required": false; }; "cellHeight": { "alias": "cellHeight"; "required": false; }; }, { "selectionChange": "selectionChange"; "rowSelect": "rowSelect"; "rowUnselect": "rowUnselect"; "lazyLoad": "lazyLoad"; "search": "search"; "exportExcelEvent": "exportExcelEvent"; "exportPdfEvent": "exportPdfEvent"; "onPageChange": "onPageChange"; "onSortColumn": "onSortColumn"; "onFilterColumn": "onFilterColumn"; "rowReorderChange": "rowReorderChange"; "filteredData": "filteredData"; }, never, never, false, never>; } declare class CustomDatePipe implements PipeTransform { transform(value: any, format?: string): string | null; static ɵfac: i0.ɵɵFactoryDeclaration<CustomDatePipe, never>; static ɵpipe: i0.ɵɵPipeDeclaration<CustomDatePipe, "customDate", false>; } declare class CustomCurrencyPipe implements PipeTransform { transform(value: number, currency?: string, decimalPlaces?: number, thousandSeparator?: 'comma' | 'space', decimalSeparator?: 'comma' | 'dot'): string; static ɵfac: i0.ɵɵFactoryDeclaration<CustomCurrencyPipe, never>; static ɵpipe: i0.ɵɵPipeDeclaration<CustomCurrencyPipe, "customCurrency", true>; } declare enum TableTypeEnum { DATE = "DATE", DATETIME = "DATETIME", STRING = "STRING", AMOUNT = "AMOUNT", NUMBER = "NUMBER", MULTISELECT = "MULTISELECT", CURRENCY = "CURRENCY", BOOLEAN = "BOOLEAN", ACTION = "ACTION", COMPOSED = "COMPOSED", IMAGE = "IMAGE", TAG = "TAG", PROGRESS = "PROGRESS" } declare enum SearchCriteriaTypeEnum { DATE = "DATE", DATERANGE = "DATERANGE", STRING = "STRING", AMOUNT = "AMOUNT", NUMBER = "NUMBER", MULTISELECT = "MULTISELECT" } declare enum FormInputTypeEnum { DATE = "DATE", TEXT = "TEXT", EMAIL = "EMAIL", TEXTAREA = "TEXTAREA", AMOUNT = "AMOUNT", NUMBER = "NUMBER", MULTISELECT = "MULTISELECT", SELECT = "SELECT", CURRENCY = "CURRENCY", CHECKBOX = "CHECKBOX", SWITCH = "SWITCH", PASSWORD = "PASSWORD", OTP = "OTP" } declare enum ButtonColorEnum { PRIMARY = "p-button-primary", SECONDARY = "p-button-secondary", SUCCESS = "p-button-success", INFO = "p-button-info", WARNING = "p-button-warning", DANGER = "p-button-danger" } declare enum InputValidationEnum { ONLY_LETTERS = "^[A-Za-z ]+$", ONLY_NUMBERS = "^[0-9]+$", LETTERS_AND_NUMBERS = "^[A-Za-z0-9 ]+$", PHONE_NUMBER = "^[0-9 ]+$", EMAIL = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[A-Za-z]{2,}$" } declare enum BadgeType { Info = "info", Danger = "danger", Warning = "warning" } declare const BadgeTypeStyles: { info: { color: string; backgroundColor: string; }; danger: { color: string; backgroundColor: string; }; warning: { color: string; backgroundColor: string; }; }; declare enum SeverityEnum { SUCCESS = "success", SECONDARY = "secondary", INFO = "info", WARN = "warn", WARNING = "warn", DANGER = "danger", CONTRAST = "contrast", HELP = "help", PRIMARY = "primary" } declare enum AlignEnum { LEFT = "left", CENTER = "center", RIGHT = "right" } interface FormField { hidden?: boolean; disabled?: boolean; type?: FormInputTypeEnum; label?: string; name: string; value?: any; required?: boolean; errorText?: string; width?: string; height?: string; margin?: string; placeholder?: string; minLength?: number; maxLength?: number; pattern?: string | RegExp; inputValidation?: InputValidationEnum; /** * PrimeNG InputOtp options. * Used only when type = FormInputTypeEnum.OTP. */ otpLength?: number; otpIntegerOnly?: boolean; otpMask?: boolean; } interface FormMultiSelectField extends FormField { options: any[]; } interface PTMultiSelectConfig { name?: string; label?: string; value?: any[]; options?: any[]; placeholder?: string; width?: string; hidden?: boolean; required?: boolean; disabled?: boolean; errorText?: string; optionLabel?: string; optionValue?: string; filter?: boolean; filterBy?: string; display?: 'comma' | 'chip'; maxSelectedLabels?: number; selectedItemsLabel?: string; } declare class PTMultiSelectComponent implements OnInit, OnChanges, OnDestroy { /** * Form-builder / reactive-form usage. */ formGroup?: FormGroup; formField?: FormMultiSelectField; /** * Standalone usage. */ config?: PTMultiSelectConfig; /** * Two-way standalone value. */ value: any[]; valueChange: EventEmitter<any[]>; selectionChange: EventEmitter<any[]>; private standaloneFormGroup; private valueChangesSubscription?; ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; get activeFormGroup(): FormGroup; get controlName(): string; get inputId(): string; get resolvedHidden(): boolean; get resolvedLabel(): string | undefined; get resolvedWidth(): string; get resolvedOptions(): any[]; get resolvedPlaceholder(): string; get resolvedOptionLabel(): string; get resolvedOptionValue(): string; get resolvedRequired(): boolean; get resolvedDisabled(): boolean; get resolvedErrorText(): string | undefined; get resolvedFilter(): boolean; get resolvedFilterBy(): string; get resolvedDisplay(): 'comma' | 'chip'; get resolvedMaxSelectedLabels(): number; get resolvedSelectedItemsLabel(): string; private setupControl; private getInitialValue; private getValidators; /** * Le MultiSelect doit manipuler un tableau d'identifiants primitifs, * pas des objets complets, pour éviter les problèmes de référence. */ private normalizeValue; getErrorMessage(): string; static ɵfac: i0.ɵɵFactoryDeclaration<PTMultiSelectComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<PTMultiSelectComponent, "pt-multi-select", never, { "formGroup": { "alias": "formGroup"; "required": false; }; "formField": { "alias": "formField"; "required": false; }; "config": { "alias": "config"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, { "valueChange": "valueChange"; "selectionChange": "selectionChange"; }, never, never, false, never>; } declare class PTMultiSelectModule { static ɵfac: i0.ɵɵFactoryDeclaration<PTMultiSelectModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<PTMultiSelectModule, [typeof PTMultiSelectComponent], [typeof i2.CommonModule, typeof i3.ReactiveFormsModule, typeof i4.MultiSelectModule], [typeof PTMultiSelectComponent]>; static ɵinj: i0.ɵɵInjectorDeclaration<PTMultiSelectModule>; } interface ImageStyle { altText: string; imageUrl: string; routerLink?: string; color?: string; width?: string; height?: string; margin?: string; marginLeft?: string; marginRight?: string; marginTop?: string; marginBottom?: string; } interface IconStyle { code: string; color?: string; fontSize?: string; position?: 'left' | 'right'; backgroundColor?: string; shape?: 'circular' | 'rounded-square'; } interface TitleStyle { text: string; icon?: string | IconStyle; position?: 'left' | 'center' | 'right'; color?: string; fontSize?: string; } interface TableColumn { title: string; code?: string; type?: TableTypeEnum; options?: any[]; isEditable?: boolean; isFilter?: boolean; dateFormat?: string; dateTimeFormat?: string; currency?: string; filterOptions?: any[]; decimalPlaces?: number; isSortable?: boolean; thousandSeparator?: 'comma' | 'space'; decimalSeparator?: 'comma' | 'dot'; width?: string; totalWidth?: string; children?: TableColumn[]; composedTypes?: TableTypeEnum[]; composedNames?: string[]; composedStyles?: Record<string, TitleStyle | ImageStyle>; headerAlign?: AlignEnum; dataAlign?: AlignEnum; /** * Padding applied to the table cell <td>/<th>. * Example: '0', '4px 8px', '0.5rem' */ cellPadding?: string; /** * Margin applied to the inner cell wrapper. * Do not apply margin directly on <td>; table layout ignores it in many cases. * Example: '0', '4px', '0 8px' */ cellMargin?: string; cellStyle?: { [key: string]: string; } | ((row: any) => { [key: string]: string; }); composedCellStyles?: Record<string, { [key: string]: string; } | ((row: any) => { [key: string]: string; })>; tagSeverity?: SeverityEnum | ((row: any) => SeverityEnum); tagValue?: string | ((row: any) => string); tagIcon?: string | ((row: any) => string); tagRounded?: boolean; progressValue?: number | ((row: any) => number); progressShowValue?: boolean; progressUnit?: string; progressStyleClass?: string | ((row: any) => string); } interface FilterOption { label: string; value: string; } interface SearchCriteria { title: string; code: string; type: SearchCriteriaTypeEnum; value?: any; filterOptions?: FilterOption[]; currency?: string; thousandSeparator?: 'comma' | 'space'; decimalSeparator?: 'comma' | 'dot'; minFractionDigits?: number; maxFractionDigits?: number; } interface FormButton { text: string; action?: () => void; color?: ButtonColorEnum; fontColor?: string; backgroundColor?: string; borderColor?: string; icon?: string; isSubmit?: boolean; isClear?: boolean; disabled?: boolean; } interface FormFieldGroup { fields?: FormField[]; groups?: FormFieldGroup[]; width?: string; } interface FormCheckBoxField extends FormField { } type DateFormatType = 'mm/dd/yy' | 'yy/mm/dd' | 'dd.mm.yy' | 'dd-mm-yy' | 'dd/mm/yy' | 'HH:mm' | 'HH:mm:ss' | 'dd/mm/yy HH:mm' | 'dd-mm-yy HH:mm' | 'dd.mm.yy HH:mm' | 'mm/dd/yy HH:mm' | 'yy/mm/dd HH:mm' | 'dd/mm/yy HH:mm:ss' | 'dd-mm-yy HH:mm:ss' | 'dd.mm.yy HH:mm:ss' | 'mm/dd/yy HH:mm:ss' | 'yy/mm/dd HH:mm:ss'; type DateInputType = 'date' | 'time' | 'datetime' | 'range'; interface FormDateField extends FormField { dateFormat?: DateFormatType; dateInputType?: DateInputType; hourFormat?: '12' | '24'; minValue?: string; maxValue?: string; } interface IconImageStyle { url: string; position?: 'left' | 'right'; shape?: 'circular' | 'rounded-square'; width?: string; height?: string; marginLeft?: string; marginRight?: string; marginTop?: string; marginBottom?: string; } interface FormDropdownField extends FormField { options: any[]; icon?: string | IconStyle | IconImageStyle; filter?: boolean; filterBy?: string; optionLabel?: string; optionValue?: string; optionDisabled?: string; } interface FormNumberField extends FormField { minValue?: string; maxValue?: string; currency?: string; numberFormat?: 'fr-FR' | 'en-US'; decimalDigits?: number; iconClass?: string; iconPosition?: 'left' | 'right'; } interface FormSwitchField extends FormField { } interface FormTextAreaField extends FormField { rows?: number; cols?: number; autoResize?: boolean; minLength?: number; maxLength?: number; iconClass?: string; iconPosition?: 'left' | 'right'; } interface FormTextField extends FormField { minLength?: number; maxLength?: number; iconClass?: string; iconPosition?: 'left' | 'right'; width?: string; height?: string; margin?: string; toggleMask?: boolean; feedback?: boolean; } interface PTDateInputConfig { name?: string; label?: string; value?: Date | Date[] | string | null; placeholder?: string; width?: string; hidden?: boolean; required?: boolean; disabled?: boolean; errorText?: string; dateInputType?: DateInputType; dateFormat?: DateFormatType; minValue?: string; maxValue?: string; hourFormat?: '12' | '24'; showIcon?: boolean; } interface PTDropdownConfig { name?: string; label?: string; value?: any; options?: any[]; placeholder?: string; width?: string; hidden?: boolean; required?: boolean; disabled?: boolean; errorText?: string; optionLabel?: string; optionValue?: string; optionDisabled?: string; filter?: boolean; filterBy?: string; icon?: string | IconStyle | IconImageStyle; } interface PTSwitchConfig { name?: string; label?: string; value?: boolean | null; width?: string; hidden?: boolean; disabled?: boolean; required?: boolean; errorText?: string; } interface TextStyle { text: string; color?: string; fontSize?: string; fontWeight?: string; position?: 'left' | 'center' | 'right'; } interface LabelSetting extends TextStyle { position?: 'left' | 'right'; } interface ValueSetting extends TextStyle { label?: LabelSetting | string; } interface Size { minWidth?: string; maxWidth?: string; fixedWidth?: string; } interface Divider { show?: boolean; color?: string; } interface VerticalLine { show?: boolean; color?: string; } interface Appearance { backgroundColor?: string; } interface MetricCardData { icon: IconStyle | string; title?: TextStyle | string; value?: ValueSetting | string; additionalInfo?: TextStyle | string; size?: Size; divider?: Divider; verticalLine?: VerticalLine; appearance?: Appearance; } interface MetricIndicateurData { icon?: IconStyle; title?: string | TitleStyle; value: string | TitleStyle; url?: string; } interface MetricPanelData { title?: string | TitleStyle; indicators: MetricIndicateurData[]; } interface Dataset { label?: string; data: number[] | any[]; backgroundColor?: string | string[]; borderColor?: string | string[]; borderWidth?: number; fill?: boolean; tension?: number; stack?: string; type?: ChartType; } interface ChartConfig { type: ChartType; data: ChartData; chartHeight?: string; chartWidth?: string; medianTitle?: string; xAxisTitle?: string; yAxisTitle?: string; scales?: { y?: { min?: number; max?: number; ticks?: { stepSize?: number; beginAtZero?: boolean; }; }; }; options?: ChartOptions; } interface MenuItem extends TextStyle { icon?: string | IconStyle; action?: () => void; /** ✅ optional: render but do not allow click */ disabled?: boolean; /** ✅ optional: render as a header (username line) */ isHeader?: boolean; } interface MenuConfig { menuItems?: MenuItem[]; icon?: IconStyle; color?: string; fontSize?: string; menuDirection?: 'left' | 'right'; } interface Pattern { imageUrl: string; transparencyPercentage?: string; backgroundColor?: string; width?: string; height?: string; repeatX?: boolean; repeatY?: boolean; repeatCount?: number; position?: 'left top' | 'top center' | 'right top' | 'left bottom' | 'bottom center' | 'right bottom' | 'center'; } interface CardConfig { identifier?: string; title?: string | TitleStyle; backgroundColor?: string; transparencyPercentage?: string; width?: string; height?: string; padding?: string; bodyPadding?: string; margin?: string; borderColor?: string; borderWidth?: string; menu?: MenuConfig; menuPosition?: 'left' | 'right'; scrollableVertical?: boolean; scrollableHorizontal?: boolean; pattern?: Pattern; noBorder?: boolean; borderRadius?: string; boxShadow?: string; zIndex?: number; alignContent?: 'center' | 'default'; alignBodyContent?: 'center' | 'default'; alignHeaderContent?: 'center' | 'default'; } interface AxisChartConfig { chartIdentifier?: string; xAxisTitle?: string; yAxisTitle?: string; chartMenu?: Array<{ text: string; action: () => void; icon?: string | { code: string; color?: string; }; }>; chartWidth?: string; cardConfig?: CardConfig; } interface AxisChartData { label: string; value: number; } interface Badge { type?: BadgeType; count: number; color?: string; backgroundColor?: string; } interface Menu { id: number; label: string; idParent: number | null; url: string; code: string; icon?: string; children?: Menu[]; isExpanded?: boolean; badge?: Badge; } type DateFormat = 'dd/MM/YYYY' | 'MM/dd/YYYY' | 'YYYY-MM-dd'; type TimeFormat = 'HH:mm:ss' | 'HH:mm'; type DateTimePosition = 'left' | 'center' | 'right'; type DateTimeSource = 'CLIENT' | 'SERVER'; type NavBarUserAvatarMode = 'ICON' | 'INITIALS'; type NavBarUserProfilePosition = 'NONE' | 'LEFT_OF_AVATAR'; type NavBarUserMenuItemSeverity = 'default' | 'danger'; interface NavBarDateTimeConfig { dateFormat?: DateFormat; timeFormat?: TimeFormat; /** FIXED mode */ dateValue?: string; /** style datetime using TextStyle */ textStyle?: Omit<TextStyle, 'text'>; /** position between left and actions */ position?: DateTimePosition; /** CLIENT or SERVER */ source?: DateTimeSource; } interface NavBarUserMenuItem { text: string; icon?: string; severity?: NavBarUserMenuItemSeverity; disabled?: boolean; visible?: boolean; separatorBefore?: boolean; action?: () => void; } interface NavBarUserConfig { username?: string; firstName?: string; lastName?: string; fullName?: string; profile?: string; avatarMode?: NavBarUserAvatarMode; showProfileInMenu?: boolean; profilePosition?: NavBarUserProfilePosition; avatarBackgroundColor?: string; avatarTextColor?: string; avatarBorderColor?: string; profileTextStyle?: Omit<TextStyle, 'text'>; menuItems?: NavBarUserMenuItem[]; } interface NavBarMenuConfig { logo?: string | ImageStyle; appName?: string | TextStyle; menus?: MenuConfig[]; pattern?: Pattern; toggleButtonIcon?: string; toggleButtonColor?: string; dateTime?: NavBarDateTimeConfig; user?: NavBarUserConfig; height?: string; minHeight?: string; paddingTop?: string; paddingBottom?: string; } interface SideMenuBarConfig { menus: Menu[]; isVisible: boolean; searchable: boolean; width?: string; height?: string; scrollable?: boolean; title?: string | TitleStyle; backgroundColor?: string; pattern?: Pattern; fontColor?: string; fontColorSubMenu?: string; hoverColor?: string; hoverFontColor?: string; hoverColorSubMenu?: string; hoverFontColorSubMenu?: string; } interface BreadCrumbConfig { menuData: Menu[]; pattern?: Pattern; } interface FooterConfig { appName?: string; version?: string; productionYear?: number; cardConfig?: CardConfig; } interface PageSkeletonConfig { navBarMenuConfig: NavBarMenuConfig; sideMenuBarConfig: SideMenuBarConfig; contentCardConfig: CardConfig; backgroundCardConfig?: CardConfig; footerConfig?: FooterConfig; breadCrumbConfig?: BreadCrumbConfig; onUserClick?: () => void; onLogoutClick?: () => void; } interface ButtonModel { label?: string; icon?: string; iconPos?: 'left' | 'right'; disabled?: boolean; styleClass?: string; loading?: boolean; type?: 'button' | 'submit' | 'reset'; width?: string; height?: string; fontColor?: string; backgroundColor?: string; borderColor?: string; severity?: SeverityEnum; outlined?: boolean; } interface FooterModel { version: string; copyright: string; } interface ForgotPasswordConfig { text: string; url: string; target?: '_self' | '_blank' | '_parent' | '_top'; style?: { [key: string]: string; }; styleClass?: string; align?: AlignEnum; } type LoginAdditionalContentType = 'text' | 'link' | 'text-with-link'; type LoginAdditionalContentAlign = 'left' | 'center' | 'right'; type LoginAdditionalContentLinkPosition = 'before' | 'after'; interface LoginAdditionalContent { /** * Optional unique identifier. */ id?: string; /** * Content type. * * text: * Displays only text. * * link: * Displays only a clickable link. * * text-with-link: * Displays text with a clickable link before or after it. */ type?: LoginAdditionalContentType; /** * Plain text displayed by the item. */ text?: string; /** * Text displayed by the clickable link. */ linkText?: string; /** * Destination URL. */ url?: string; /** * Link target. */ target?: '_self' | '_blank' | '_parent' | '_top'; /** * Link relationship attribute. * * When target is _blank, noopener noreferrer is applied by default. */ rel?: string; /** * Positions the link before or after the plain text. * * Default: after. */ linkPosition?: LoginAdditionalContentLinkPosition; /** * Horizontal alignment. * * Default: center. */ align?: LoginAdditionalContentAlign; /** * Optional CSS class applied to the complete item. */ styleClass?: string; /** * Optional inline styles applied to the complete item. */ style?: Record<string, string>; /** * Optional CSS class applied to the link. */ linkStyleClass?: string; /** * Optional inline styles applied to the link. */ linkStyle?: Record<string, string>; /** * Whether this item should be displayed. * * Default: true. */ visible?: boolean; } interface LoginModel { username: string; password: string; errorMessage?: string; emptyFieldsErrorMessage?: string; } interface LoginPageConfig { backgroundImage?: Pattern; title?: TitleStyle; logoUrl?: ImageStyle; footer?: FooterModel; login?: LoginModel; loginCardConfig?: CardConfig; centerCardConfig?: CardConfig; leftCardConfig?: CardConfig; rightCardConfig?: CardConfig; usernameField?: FormTextField; passwordField?: FormTextField; loginButtonLabel?: string; buttonConfig?: ButtonModel; position?: 'center' | 'left' | 'right'; forgotPasswordConfig?: ForgotPasswordConfig; additionalContent?: LoginAdditionalContent[]; } type OtpPagePosition = 'center' | 'left' | 'right'; interface OtpPageConfig { position: OtpPagePosition; centerCardConfig?: CardConfig; leftCardConfig?: CardConfig; rightCardConfig?: CardConfig; otpCardConfig?: CardConfig; logoUrl?: { imageUrl?: string; altText?: string; width?: string; height?: string; }; title?: { text?: string; position?: 'left' | 'center' | 'right'; color?: string; fontSize?: string; }; description?: { text?: string; color?: string; fontSize?: string; }; otp?: { otpCode?: string; errorMessage?: string; emptyFieldErrorMessage?: string; }; otpCodeField?: FormField; buttonConfig?: ButtonModel; footer?: { version?: string; copyright?: string; }; backButtonConfig?: ButtonModel; } interface ChangePasswordModel { currentPassword?: string; newPassword: string; confirmationPassword: string; } interface PasswordPolicyRuleModel { code: string; label: string; valid: boolean; backendOnly?: boolean; visible?: boolean; } interface ChangePasswordPageConfig { backgroundImage?: Pattern; title?: TitleStyle; logoUrl?: ImageStyle; footer?: FooterModel; changePassword?: ChangePasswordModel; changePasswordCardConfig?: CardConfig; centerCardConfig?: CardConfig; leftCardConfig?: CardConfig; rightCardConfig?: CardConfig; currentPasswordField?: FormTextField; newPasswordField?: FormTextField; confirmationPasswordField?: FormTextField; showCurrentPasswordField?: boolean; buttonConfig?: ButtonModel; position?: 'center' | 'left' | 'right'; errorMessage?: string; emptyFieldsErrorMessage?: string; passwordMismatchErrorMessage?: string; showPasswordStrength?: boolean; passwordStrengthLabel?: string; passwordStrengthText?: string; passwordStrengthPercentage?: number; passwordStrengthSeverity?: PasswordStrengthSeverity; passwordPolicyTitle?: string; passwordPolicyRules?: PasswordPolicyRuleModel[]; additionalContent?: LoginAdditionalContent[]; } type PasswordStrengthSeverity = 'neutral' | 'danger' | 'warn' | 'success'; interface ToastMessage { severity: 'success' | 'info' | 'warn' | 'error'; summary: string; detail: string; life?: number; } interface PTConfirmDialogConfig { header?: string | TitleStyle; visible?: boolean; width?: string; height?: string; content?: string | TitleStyle; closeOnEscape?: boolean; confirmButtonConfig?: ButtonModel; cancelButtonConfig?: ButtonModel; toastOnConfirm?: ToastMessage; toastOnCancel?: ToastMessage; dialogStyle?: SeverityEnum; footerAlign?: AlignEnum; } type DialogPosition = 'right' | 'left' | 'center' | 'top' | 'bottom' | 'topleft' | 'topright' | 'bottomleft' | 'bottomright'; interface PTDialogConfig { /** Title text in the header */ header?: string; /** Inline style for the whole dialog container (PrimeNG [style]) */ style?: { [key: string]: any; }; /** Extra classes applied to PrimeNG dialog */ styleClass?: string; /** Optional icon in the header (e.g. 'pi pi-info-circle text-blue-500') */ headerIconClass?: string; /** Optional body max width / height (e.g. '500px', '60vh') */ bodyWidth?: string; bodyHeight?: string; /** Enable scroll when body exceeds given height/width (default: true) */ bodyScrollable?: boolean; /** Control footer visibility (default: true) */ showFooter?: boolean; /** PrimeNG dialog behavior flags */ modal?: boolean; closable?: boolean; draggable?: boolean; resizable?: boolean; maximizable?: boolean; dismissableMask?: boolean; closeOnEscape?: boolean; blockScroll?: boolean; /** Responsive breakpoints */ breakpoints?: { [key: string]: string; }; /** Dialog position (PrimeNG <p-dialog> position) */ position?: DialogPosition; /** Extra style for content (PrimeNG [contentStyle]) */ contentStyle?: { [key: string]: any; }; dialogStyle?: SeverityEnum; } declare class PTButtonComponent implements OnInit, AfterViewInit, OnChanges { private renderer; private el; buttonConfig: ButtonModel; constructor(renderer: Renderer2, el: ElementRef); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; ngAfterViewInit(): void; getIconPos(): 'left' | 'right'; getType(): string; hasCustomColors(): boolean; /** * When custom colors are provided, do not pass PrimeNG severity. * Otherwise PrimeNG theme classes can override the custom colors. */ getSeverity(): SeverityEnum | undefined; getStyleClass(): string; /** * Direct style binding for PrimeNG p-button. * This is the reliable fallback for PrimeNG v21 themes. */ getButtonStyle(): { [key: string]: string; }; private getButtonElement; private updateDisabledStyles; /** * We delegate colors to PrimeNG theme when no manual color is provided. */ private shouldUseThemeColors; applyButtonStyles(): void; static ɵfac: i0.ɵɵFactoryDeclaration<PTButtonComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<PTButtonComponent, "pt-button", never, { "buttonConfig": { "alias": "buttonConfig"; "required": false; }; }, {}, never, never, false, never>; } declare class PTButtonModule { static ɵfac: i0.ɵɵFactoryDeclaration<PTButtonModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<PTButtonModule, [typeof PTButtonComponent], [typeof i2.CommonModule, typeof i3$1.ButtonModule], [typeof PTButtonComponent]>; static ɵinj: i0.ɵɵInjectorDeclaration<PTButtonModule>; } declare class PTAdvancedPrimeTableModule { static ɵfac: i0.ɵɵFactoryDeclaration<PTAdvancedPrimeTableModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<PTAdvancedPrimeTableModule, [typeof PTAdvancedPrimeTableComponent, typeof CustomDatePipe], [typeof i2.CommonModule, typeof i3.FormsModule, typeof i5.TableModule, typeof i6.InputTextModule, typeof i3$1.ButtonModule, typeof i8.DatePickerModule, typeof i4.MultiSelectModule, typeof i10.TagModule, typeof i11.IconFieldModule, typeof i12.InputIconModule, typeof i13.ProgressSpinnerModule, typeof i14.TooltipModule, typeof i15.ProgressBarModule, typeof CustomCurrencyPipe, typeof PTMultiSelectModule, typeof PTButtonModule], [typeof PTAdvancedPrimeTableComponent]>; static ɵinj: i0.ɵɵInjectorDeclaration<PTAdvancedPrimeTableModule>; } declare class MultiSearchCriteriaComponent implements OnInit { SearchCriteriaTypeEnum: typeof SearchCriteriaTypeEnum; title: String; criteria: SearchCriteria[]; inputsPerRow: number; data: any[]; mode: 'static' | 'dynamic'; filteredData: EventEmitter<any[]>; searchCriteria: EventEmitter<{ [key: string]: any; }>; selectAll: boolean; selected: FilterOption[]; ngOnInit(): void; getCurrencySymbol(input: SearchCriteria): string; getMinFractionDigits(input: SearchCriteria): number; getMaxFractionDigits(input: SearchCriteria): number | undefined; getStepValue(input: SearchCriteria): number; search(): void; clear(): void; onSelectAllChange(event: any, criterion: SearchCriteria): void; private parseDate; getDecimalSeparator(input: SearchCriteria): string; static ɵfac: i0.ɵɵFactoryDeclaration<MultiSearchCriteriaComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<MultiSearchCriteriaComponent, "multi-search-criteria", never, { "title": { "alias": "title"; "required": false; }; "criteria": { "alias": "criteria"; "required": false; }; "inputsPerRow": { "alias": "inputsPerRow"; "required": false; }; "data": { "alias": "data"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; }, { "filteredData": "filteredData"; "searchCriteria": "searchCriteria"; }, never, never, false, never>; } declare class MultiSearchCriteriaModule { static ɵfac: i0.ɵɵFactoryDeclaration<MultiSearchCriteriaModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<MultiSearchCriteriaModule, [typeof MultiSearchCriteriaComponent], [typeof i2.CommonModule, typeof i8.DatePickerModule, typeof i6.InputTextModule, typeof i4.MultiSelectModule, typeof i3$1.ButtonModule, typeof i3.FormsModule, typeof i8$1.InputNumberModule, typeof i9.PanelModule], [typeof MultiSearchCriteriaComponent]>; static ɵinj: i0.ɵɵInjectorDeclaration<MultiSearchCriteriaModule>; } declare class PTCheckBoxInputComponent implements OnInit { formGroup: FormGroup; formField: FormCheckBoxField; ngOnInit(): void; get inputId(): string; setupControl(): void; private getValidators; private requireChoiceValidator; getErrorMessage(): string; static ɵfac: i0.ɵɵFactoryDeclaration<PTCheckBoxInputComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<PTCheckBoxInputComponent, "pt-check-box-input", never, { "formGroup": { "alias": "formGroup"; "required": false; }; "formField": { "alias": "formField"; "required": false; }; }, {}, never, never, false, never>; } declare class PTCheckBoxInputModule { static ɵfac: i0.ɵɵFactoryDeclaration<PTCheckBoxInputModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<PTCheckBoxInputModule, [typeof PTCheckBoxInputComponent], [typeof i2.CommonModule, typeof i3.ReactiveFormsModule, typeof i4$1.CheckboxModule], [typeof PTCheckBoxInputComponent]>; static ɵinj: i0.ɵɵInjectorDeclaration<PTCheckBoxInputModule>; } declare class PTDateService { constructor(); assignDefaultDateFormat(dateInputType: DateInputType, currentFormat?: DateFormatType): DateFormatType; validateDateFormatAndType(dateFormat: DateFormatType, dateInputType: DateInputType, minValue?: string, maxValue?: string, hourFormat?: '12' | '24'): void; static ɵfac: i0.ɵɵFactoryDeclaration<PTDateService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<PTDateService>; } declare class PTDateInputComponent implements OnInit, OnChanges, OnDestroy { private dateService; /** * Form-builder / reactive-form usage. */ formGroup?: FormGroup; formField?: FormDateField; /** * Standalone usage. */ config?: PTDateInputConfig; /** * Two-way standalone value. */ value: Date | Date[] | string | null; valueChange: EventEmitter<string | Date | Date[] | null>; dateChange: EventEmitter<string | Date | Date[] | null>; minDate: Date | null; maxDate: Date | null; defaultPlaceholder: string; defaultDateFormat: DateFormatType; private standaloneFormGroup; private valueChangesSubscription?; constructor(dateService: PTDateService); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; get activeFormGroup(): FormGroup; get controlName(): string; get inputId(): string; get resolvedHidden(): boolean; get resolvedLabel(): string | undefined; get resolvedWidth(): string; get resolvedPlaceholder(): string; get resolvedDateInputType(): DateInputType; get resolvedDateFormat(): DateFormatType; get resolvedHourFormat(): '12' | '24'; get resolvedRequired(): boolean; get resolvedDisabled(): boolean; get resolvedShowIcon(): boolean; get resolvedMinValue(): string | undefined; get resolvedMaxValue(): string | undefined; get resolvedErrorText(): string | undefined; private initializeComponent; private setupControl; private getInitialValue; private initializeDateLimits; private validateConfiguration; private getValidators; getErrorMessage(): string; static ɵfac: i0.ɵɵFactoryDeclaration<PTDateInputComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<PTDateInputComponent, "pt-date-input", never, { "formGroup": { "alias": "formGroup"; "required": false; }; "formField": { "alias": "formField"; "required": false; }; "config": { "alias": "config"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, { "valueChange": "valueChange"; "dateChange": "dateChange"; }, never, never, false, never>; } declare class PTDateInputModule { static ɵfac: i0.ɵɵFactoryDeclaration<PTDateInputModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<PTDateInputModule, [typeof PTDateInputComponent], [typeof i2.CommonModule, typeof i3.ReactiveFormsModule, typeof i8.DatePickerModule], [typeof PTDateInputComponent]>; static ɵinj: i0.ɵɵInjectorDeclaration<PTDateInputModule>; } declare class PTFormBuilderComponent implements OnInit, OnChanges, OnDestroy { private readonly fb; mainGroup: FormFieldGroup; buttons: FormButton[]; title?: string; titleStyle?: { [key: string]: string; }; /** * Largeur des inputs/champs. */ inputWidth: string; /** * Largeur globale du composant pt-form-builder. */ formWidth: string; language: 'en' | 'fr'; formSubmit: EventEmitter<{ [key: string]: any; }>; formReady: EventEmitter<FormGroup<any>>; formChange: EventEmitter<{ [key: string]: any; }>; form: FormGroup; FormInputTypeEnum: typeof FormInputTypeEnum; private formValueChangesSub?; private errorMessages; constructor(fb: FormBuilder); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; private rebuildForm; private buildFormGroup; private resolveInitialValue; private buildValidators; private buildOtpPattern; isInvalid(field: FormField): boolean; getErrorMessage(field: FormField): string; onSubmit(): void; onClear(): void; static ɵfac: i0.ɵɵFactoryDeclaration<PTFormBuilderComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<PTFormBuilderComponent, "pt-form-builder", never, { "mainGroup": { "alias": "mainGroup"; "required": false; }; "buttons": { "alias": "buttons"; "required": false; }; "title": { "alias": "title"; "required": false; }; "titleStyle": { "alias": "titleStyle"; "required": false; }; "inputWidth": { "alias": "inputWidth"; "required": false; }; "formWidth": { "alias": "formWidth"; "required": false; }; "language": { "alias": "language"; "required": false; }; }, { "formSubmit": "formSubmit"; "formReady": "formReady"; "formChange": "formChange"; }, never, never, false, never>; } declare class PTDynamicFormFieldComponent { field: FormField; form: FormGroup; inputWidth: string; FormInputTypeEnum: typeof FormInputTypeEnum; asTextField(field: FormField): FormTextField; asNumberField(field: FormField): FormNumberField; asTextAreaField(field: FormField): FormTextAreaField; asDateField(field: FormField): FormDateField; asSelectField(field: FormField): FormDropdownField; asMultiSelectField(field: FormField): FormMultiSelectField; asCheckboxField(field: FormField): FormCheckBoxField; asSwitchField(field: FormField): FormSwitchField; asOtpField(field: FormField): FormField; static ɵfac: i0.ɵɵFactoryDeclaration<PTDynamicFormFieldComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<PTDynamicFormFieldComponent, "pt-dynamic-form-field", never, { "field": { "alias": "field"; "required": false; }; "form": { "alias": "form"; "required": false; }; "inputWidth": { "alias": "inputWidth"; "required": false; }; }, {}, never, never, false, never>; } declare class PTNumberInputComponent implements OnInit, OnChanges { formGroup: FormGroup; formField: FormNumberField; ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; get inputId(): string; private setupControl; private getValidators; private validateWithInputValidation; getErrorMessage(): string; static ɵfac: i0.ɵɵFactoryDeclaration<PTNumberInputComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<PTNumberInputComponent, "pt-number-input", never, { "formGroup": { "alias": "formGroup"; "required": false; }; "formField": { "alias": "formField"; "required": false; }; }, {}, never, never, false, never>; } declare class PTNumberInputModule { static ɵfac: i0.ɵɵFactoryDeclaration<PTNumberInputModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<PTNumberInputModule, [typeof PTNumberInputComponent], [typeof i2.CommonModule, typeof i3.ReactiveFormsModule, typeof i3.FormsModule, typeof i4$2.InputGroupModule, typeof i5$1.InputGroupAddonModule, typeof i6.InputTextModule, typeof i8$1.InputNumberModule], [typeof PTNumberInputComponent]>; static ɵinj: i0.ɵɵInjectorDeclaration<PTNumberInputModule>; } declare class PTSwitchInputComponent implements OnInit, OnChanges, OnDestroy { /** * Form-builder / reactive-form usage. */ formGroup?: FormGroup; formField?: FormSwitchField; /** * Standalone