@js-smart/ng-kit
Version:
Reusable Angular components built with Angular Material and Bootstrap 5.x, Utility classes/functions for Date, Form and String operations
1,088 lines (1,039 loc) • 53.2 kB
TypeScript
import * as _angular_core from '@angular/core';
import { OnInit, ChangeDetectorRef, ElementRef, AfterViewInit, OnDestroy, ViewContainerRef, WritableSignal, Signal, InjectionToken, EnvironmentProviders } from '@angular/core';
import { ThemePalette } from '@angular/material/core';
import { ControlValueAccessor, FormControl } from '@angular/forms';
import { MatAutocompleteTrigger, MatAutocomplete } from '@angular/material/autocomplete';
import { MatFormFieldAppearance } from '@angular/material/form-field';
import { MatPaginator } from '@angular/material/paginator';
import { MatTableDataSource } from '@angular/material/table';
import { MatDialogRef } from '@angular/material/dialog';
import { MatSnackBarHorizontalPosition, MatSnackBarVerticalPosition, MatSnackBar } from '@angular/material/snack-bar';
import { MutationObserverResult, MutateOptions, MutationObserverOptions, QueryKey, QueryObserverOptions, QueryObserverResult, QueryClient, QueryClientConfig } from '@tanstack/query-core';
interface ProgressState {
isLoading: boolean;
isSuccess: boolean;
isError: boolean;
isComplete?: boolean;
message: string;
}
type AlertType = 'info' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'dark' | 'light';
/**
* Boostrap Alert component that can be used to alert messages to the user
*
* @author Pavan Kumar Jadda
* @since 12.0.0
*/
declare class AlertComponent implements OnInit {
cdr: ChangeDetectorRef;
/**
* Type of the BootStrap Alert. Following values are supported. See BootStrap docs for more information
*/
type: _angular_core.InputSignal<AlertType>;
/**
* Is alert visible or open
*/
isOpen: _angular_core.InputSignal<boolean>;
/**
* Writable signal for isOpen
*/
open: _angular_core.WritableSignal<boolean>;
/**
* If set, displays an inline “Close” button
*/
dismissible: _angular_core.InputSignal<boolean>;
/**
* If set, dismisses the alert after Dismiss Timeout
*/
dismissOnTimeout: _angular_core.InputSignal<boolean>;
/**
* Number in milliseconds, after which alert will be closed. Default value is 5000 ms
*/
dismissTimeout: _angular_core.InputSignal<number>;
/**
* Additional classes to be added to the alert. This can be used to add custom styles to the alert
*/
class: _angular_core.InputSignal<string>;
/**
* Emits when the alert is closed.
*/
closed: _angular_core.OutputEmitterRef<void>;
constructor();
/**
* Initialize the component and settings
*
* @author Pavan Kumar Jadda
* @since 12.0.0
*/
ngOnInit(): void;
/**
* Closes BootStrap Alert if not open
*
* @author Pavan Kumar Jadda
* @since 12.0.0
*/
closeAlert(): void;
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AlertComponent, never>;
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AlertComponent, "lib-alert, alert", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "isOpen": { "alias": "isOpen"; "required": false; "isSignal": true; }; "dismissible": { "alias": "dismissible"; "required": false; "isSignal": true; }; "dismissOnTimeout": { "alias": "dismissOnTimeout"; "required": false; "isSignal": true; }; "dismissTimeout": { "alias": "dismissTimeout"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; }, { "closed": "closed"; }, never, ["*"], true, never>;
}
declare class SpinnerComponent {
/**
* Use Boostrap Spinner. Default `true`
*/
bootstrapSpinner: _angular_core.InputSignal<boolean>;
/**
* Diameter of the Angular Material spinner
*/
diameter: _angular_core.InputSignal<number>;
/**
* Color of the Angular Material spinner
*/
color: _angular_core.InputSignal<ThemePalette>;
/**
* Stroke Width of the Angular Material spinner
*/
strokeWidth: _angular_core.InputSignal<number>;
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SpinnerComponent, never>;
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SpinnerComponent, "spinner,lib-spinner", never, { "bootstrapSpinner": { "alias": "bootstrapSpinner"; "required": false; "isSignal": true; }; "diameter": { "alias": "diameter"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "strokeWidth": { "alias": "strokeWidth"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
/**
* Reusable Auto Complete component that extends MatAutoComplete to show Clear icon and Arrow buttons
*
* @author Pavan Kumar Jadda
* @since 12.0.0
*/
declare class AutocompleteComponent<T = string> implements ControlValueAccessor {
/** Gets reference to the MatAutocompleteTrigger to programmatically open/close the panel */
autocompleteTrigger: _angular_core.Signal<MatAutocompleteTrigger>;
/** MatAutocomplete instance (used to scroll the selected option into view when the panel opens) */
matAutocomplete: _angular_core.Signal<MatAutocomplete>;
/** Gets reference to the input element for re-focusing after clear */
inputElement: _angular_core.Signal<ElementRef<HTMLInputElement>>;
/** Label of the autocomplete form field */
label: _angular_core.InputSignal<string>;
/** Placeholder text displayed inside the input when empty */
placeholder: _angular_core.InputSignal<string>;
/** Appearance of the form field. Defaults to `outline` */
appearance: _angular_core.InputSignal<MatFormFieldAppearance>;
/** List of CSS classes to apply to the form field */
classes: _angular_core.InputSignal<string>;
/** List of options to display in the dropdown */
options: _angular_core.InputSignal<T[]>;
/**
* Function that maps an option to its display string.
* Used for rendering options in the dropdown and showing the selected value in the input.
* Defaults to `String(value)` which works for primitive string options.
*/
displayWith: _angular_core.InputSignal<(value: T) => string>;
/** Whether the autocomplete is in a loading state. Shows a spinner instead of options */
loading: _angular_core.InputSignal<boolean>;
/** Text displayed when the autocomplete is in a loading state. Defaults to 'Loading...' */
loadingText: _angular_core.InputSignal<string>;
/** Text displayed when no options match the filter input. Defaults to 'No values found' */
noOptionsText: _angular_core.InputSignal<string>;
/** Emits the selected value when an option is picked from the dropdown */
selectionChange: _angular_core.OutputEmitterRef<T>;
/** Emits the raw text in the input on each keystroke (filter text while typing) */
onInputChange: _angular_core.OutputEmitterRef<string>;
/** Internal form control for the autocomplete input */
control: FormControl<string | T | null>;
/** Signal that tracks whether the autocomplete panel is currently open */
isExpanded: _angular_core.WritableSignal<boolean>;
/** Signal that tracks the current filter text typed by the user */
filterText: _angular_core.WritableSignal<string>;
/**
* Computed signal that filters options based on the current filter text.
* Uses the `displayWith` function to extract searchable text from each option.
* Returns all options when filter text is empty.
*/
filteredOptions: _angular_core.Signal<T[]>;
/**
* Display function passed to mat-autocomplete's [displayWith] to render the
* selected value in the input field. Returns empty string for null/undefined values.
*/
displayFn: (value: T) => string;
/**
* Writes a new value to the internal control. Called by the parent form
* when the form control value is set programmatically.
*/
writeValue(value: T | null): void;
/**
* Registers a callback function that is called when the control's value
* changes in the UI (option selected or input cleared).
*/
registerOnChange(fn: (value: T | null) => void): void;
/**
* Registers a callback function that is called when the control is
* first interacted with (blur or selection).
*/
registerOnTouched(fn: () => void): void;
/**
* Sets the disabled state of the internal control. Called by the parent form
* when `control.disable()` or `control.enable()` is invoked.
*/
setDisabledState(isDisabled: boolean): void;
/** Updates the filter text signal as the user types in the input */
onInput(event: Event): void;
/**
* Clears the input value, resets the filter, notifies the parent form,
* and re-focuses the input element.
*/
clearInput(event: Event): void;
/** Runs when the autocomplete overlay opens: keep expanded state and scroll the selected option into view. */
onPanelOpened(): void;
private scrollSelectedOptionIntoView;
/** Opens the autocomplete panel programmatically */
openPanel(): void;
/**
* Handles option selection from the dropdown. Resets the filter text,
* notifies the parent form of the new value, and emits the selectionChange output.
*/
onOptionSelected(value: T): void;
/** Callback function registered by the parent form to propagate value changes */
private onChange;
/** Callback function registered by the parent form to propagate touched state */
private onTouched;
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AutocompleteComponent<any>, never>;
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AutocompleteComponent<any>, "autocomplete, lib-autocomplete", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "appearance": { "alias": "appearance"; "required": false; "isSignal": true; }; "classes": { "alias": "classes"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "displayWith": { "alias": "displayWith"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "loadingText": { "alias": "loadingText"; "required": false; "isSignal": true; }; "noOptionsText": { "alias": "noOptionsText"; "required": false; "isSignal": true; }; }, { "selectionChange": "selectionChange"; "onInputChange": "onInputChange"; }, never, never, true, never>;
}
declare class AutocompleteClearButtonComponent {
readonly clicked: _angular_core.OutputEmitterRef<MouseEvent>;
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AutocompleteClearButtonComponent, never>;
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AutocompleteClearButtonComponent, "autocomplete-clear-button", never, {}, { "clicked": "clicked"; }, never, never, true, never>;
}
declare class AutocompleteDropdownButtonComponent {
readonly expanded: _angular_core.WritableSignal<boolean>;
readonly clicked: _angular_core.OutputEmitterRef<MouseEvent>;
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AutocompleteDropdownButtonComponent, never>;
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AutocompleteDropdownButtonComponent, "autocomplete-dropdown-button", never, {}, { "clicked": "clicked"; }, never, never, true, never>;
}
/**
* Single directive that adds clear and dropdown-toggle icon buttons to a
* Material autocomplete input. Unlike {@link LibAutocompleteActionsDirective},
* this directive is applied directly to the `input` element and does not require
* an anchor directive or a separate suffix component.
*
* Usage:
* ```html
* <mat-form-field appearance="outline">
* <mat-label>City</mat-label>
* <input matInput [matAutocomplete]="auto" formControlName="city" autocompleteSuffix />
* <mat-autocomplete #auto="matAutocomplete"> … </mat-autocomplete>
* </mat-form-field>
* ```
*
* @author Pavan Kumar Jadda
* @since 21.8.0
*/
declare class AutocompleteSuffixDirective implements AfterViewInit {
private readonly trigger;
private readonly el;
private readonly renderer;
private readonly destroyRef;
private readonly ngControl;
private readonly appRef;
private readonly envInjector;
private clearRef;
private dropdownRef;
private isExpanded;
private readonly unlisten;
ngAfterViewInit(): void;
private createSuffixElements;
private setupListeners;
private clearInput;
private togglePanel;
private updateClearButtonVisibility;
private scrollSelectedOptionIntoView;
private updateDropdownIcon;
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AutocompleteSuffixDirective, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AutocompleteSuffixDirective, "input[matAutocomplete][autocompleteSuffix]", never, {}, {}, never, never, true, never>;
}
declare class PrintOptions {
printSectionId: string;
printTitle: string;
useExistingCss: boolean;
bodyClass: string;
openNewTab: boolean;
previewOnly: boolean;
closeWindow: boolean;
printDelay: number;
constructor(options?: Partial<PrintOptions>);
}
/**
* Reusable Angular directory that prints given contents of HTML element
*
* @since 12.0.0
* @author Pavan Kumar Jadda
*/
declare class NgxPrintDirective<T = unknown> {
document: Document;
/**
* ID of the HTML element those contents need to be printed
*
* @since 12.0.0
* @author Pavan Kumar Jadda
*/
printSectionId: string | undefined;
/**
* Title of the HTML element those contents need to be printed
*
* @since 12.0.0
* @author Pavan Kumar Jadda
*/
printTitle: string | undefined;
/**
* If `true`, uses CSS of HTMl element, otherwise no CSS applied
*
* @since 12.0.0
* @author Pavan Kumar Jadda
*/
useExistingCss: boolean;
/**
* A delay in milliseconds to force the print dialog to wait before opened. Default: 0
*
* @since 12.0.0
* @author Pavan Kumar Jadda
*/
printDelay: number;
/**
* Instance of the Mat Table Data Source
*
* @since 12.0.0
* @author Pavan Kumar Jadda
*/
matTableDataSource: MatTableDataSource<T>;
/**
* Instance of the Mat Paginator
*
* @since 12.0.0
* @author Pavan Kumar Jadda
*/
paginator: MatPaginator;
/**
* ID of the Mat Paginator
*
* @since 12.0.0
* @author Pavan Kumar Jadda
*/
paginatorId: string;
/**
* HTML tag ID of the Mat-Table Input Filter
*
* @since 12.0.0
* @author Pavan Kumar Jadda
*/
inputFilterId: string;
/**
* If `true`, referenced table is Mat-Table
*
* @since 12.0.0
* @author Pavan Kumar Jadda
*/
isMatTable: boolean;
/**
* If `true` Mat-Table paginator will be hidden
*
* @since 12.0.0
* @author Pavan Kumar Jadda
*/
hideMatTablePaginator: boolean;
printStyleArray: string[];
printOptions: PrintOptions;
/**
* List of Style sheet files
*
* @since 12.0.0
* @author Pavan Kumar Jadda
*/
private styleSheetFileArray;
/**
* Prevents the print dialog from opening on the window
*
* @memberof NgxPrintDirective
*/
set previewOnly(value: boolean);
/**
* List of CSS properties that needs to be applied while printing the document
*
* @since 12.0.0
* @author Pavan Kumar Jadda
*/
set printStyle({ values }: PrintStyleParams);
/**
* Sets given style sheet files to print document
*
* @param cssList Comma separated value of CSS file names
*
* @since 12.0.0
* @author Pavan Kumar Jadda
*/
set styleSheetFile(cssList: string);
/**
* Build link HTMl tag based on given file name
*
* @since 12.0.0
* @author Pavan Kumar Jadda
*/
private static linkTagFn;
/**
* Gets HTML element by tag name
*
* @since 12.0.0
* @author Pavan Kumar Jadda
*/
private static getElementTag;
/**
* Print the element upon clicking the button
*
* @since 12.0.0
* @author Pavan Kumar Jadda
*/
print(): void;
/**
* Hide Mat Paginator before Printing
*
* @since 12.0.1
* @author Pavan Kumar Jadda
*/
private hideMatPaginatorBeforePrinting;
/**
* Show Mat Paginator after Printing
*
* @since 12.0.1
* @author Pavan Kumar Jadda
*/
private showMatPaginatorAfterPrinting;
/**
* @returns the string that create the stylesheet which will be injected later within <style></style> tag. Join/replace to transform an array objects to css-styled string
*
* @since 12.0.0
* @author Pavan Kumar Jadda
*/
private returnStyleValues;
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxPrintDirective<any>, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgxPrintDirective<any>, "button[ngxPrint], button[print]", never, { "printSectionId": { "alias": "printSectionId"; "required": false; }; "printTitle": { "alias": "printTitle"; "required": false; }; "useExistingCss": { "alias": "useExistingCss"; "required": false; }; "printDelay": { "alias": "printDelay"; "required": false; }; "matTableDataSource": { "alias": "matTableDataSource"; "required": false; }; "paginator": { "alias": "paginator"; "required": false; }; "paginatorId": { "alias": "paginatorId"; "required": false; }; "inputFilterId": { "alias": "inputFilterId"; "required": false; }; "isMatTable": { "alias": "isMatTable"; "required": false; }; "hideMatTablePaginator": { "alias": "hideMatTablePaginator"; "required": false; }; "previewOnly": { "alias": "previewOnly"; "required": false; }; "printStyle": { "alias": "printStyle"; "required": false; }; "styleSheetFile": { "alias": "styleSheetFile"; "required": false; }; }, {}, never, never, true, never>;
}
interface PrintStyleParams {
values: Record<string, Record<string, string>>;
}
declare class PreventMultipleClicksDirective implements OnInit, OnDestroy {
throttleTime: _angular_core.InputSignal<number>;
throttleClick: _angular_core.OutputEmitterRef<Event>;
private readonly clicks;
private subscription;
/**
* Intercepts click event and stops default navigation. After first click set {@link throttleTime} to 2000 to prevent duplicate clicks
*
* @param event DOM event
*
* @author Pavan Kumar Jadda
* @since 2.3.27
*/
clickEvent(event: Event): void;
ngOnInit(): void;
ngOnDestroy(): void;
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PreventMultipleClicksDirective, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<PreventMultipleClicksDirective, "[preventMultipleClicks]", never, { "throttleTime": { "alias": "throttleTime"; "required": false; "isSignal": true; }; }, { "throttleClick": "throttleClick"; }, never, never, true, never>;
}
declare abstract class BaseButtonDirective implements OnInit {
icon: _angular_core.InputSignal<string>;
label: _angular_core.InputSignal<string>;
loadingLabel: _angular_core.InputSignal<string>;
loading: _angular_core.InputSignal<boolean>;
elementRef: ElementRef<any>;
document: Document;
protected originalText: _angular_core.WritableSignal<string>;
protected iconSpan: _angular_core.WritableSignal<HTMLElement | null>;
constructor();
ngOnInit(): void;
protected createIcon(): void;
protected updateContent(): void;
protected showLoadingState(element: HTMLElement): void;
protected showNormalState(element: HTMLElement): void;
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BaseButtonDirective, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BaseButtonDirective, never, never, { "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "loadingLabel": { "alias": "loadingLabel"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
declare class BaseButtonComponent {
/**
* Is search in progress and loading the data
*/
loading: _angular_core.InputSignalWithTransform<boolean, boolean | undefined>;
/**
* Is button disabled
*/
disabled: _angular_core.InputSignal<boolean>;
/**
* Type of the button. Following values are supported. See BootStrap docs for more information
* <pre>
* 1. button
* 2. submit
* </pre>
*/
type: _angular_core.InputSignal<string>;
/**
* If set, shows when action in Progress
*/
loadingLabel: _angular_core.InputSignal<string>;
/**
* If set, shows when Delete is not in progress
*/
label: _angular_core.InputSignal<string>;
/**
* If set, shows the icon. Otherwise, shows delete icon
*/
icon: _angular_core.InputSignal<string>;
/**
* If set, shows material icon otherwise hides the icons
*/
showIcon: _angular_core.InputSignal<boolean>;
/**
* If set, sets the style of the button
*/
style: _angular_core.InputSignal<any>;
/**
* If set, sets the class of the button
*/
classes: _angular_core.InputSignal<string>;
/**
* If set, sets the data-cy attribute for the button
*/
dataCy: _angular_core.InputSignal<string>;
/**
* Output event when button is clicked
*/
onClick: _angular_core.OutputEmitterRef<MouseEvent>;
/**
* Output event when button is focused
*/
onFocus: _angular_core.OutputEmitterRef<FocusEvent>;
/**
* Output event when button is blurred
*/
onBlur: _angular_core.OutputEmitterRef<FocusEvent>;
/**
* Output event when key is pressed
*/
onKeyDown: _angular_core.OutputEmitterRef<KeyboardEvent>;
/**
* Output event when key is up
*/
onKeyUp: _angular_core.OutputEmitterRef<KeyboardEvent>;
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BaseButtonComponent, never>;
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BaseButtonComponent, "ng-component", never, { "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "loadingLabel": { "alias": "loadingLabel"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "showIcon": { "alias": "showIcon"; "required": false; "isSignal": true; }; "style": { "alias": "style"; "required": false; "isSignal": true; }; "classes": { "alias": "classes"; "required": false; "isSignal": true; }; "dataCy": { "alias": "dataCy"; "required": false; "isSignal": true; }; }, { "onClick": "onClick"; "onFocus": "onFocus"; "onBlur": "onBlur"; "onKeyDown": "onKeyDown"; "onKeyUp": "onKeyUp"; }, never, never, true, never>;
}
declare class BsLinkButtonComponent extends BaseButtonComponent {
label: _angular_core.InputSignal<string>;
icon: _angular_core.InputSignal<string>;
classes: _angular_core.InputSignal<string>;
constructor();
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BsLinkButtonComponent, never>;
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BsLinkButtonComponent, "bs-link-button", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "classes": { "alias": "classes"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
declare class BsLinkButtonDirective {
icon: _angular_core.InputSignal<string>;
elementRef: ElementRef<any>;
document: Document;
constructor();
private updateContent;
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BsLinkButtonDirective, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BsLinkButtonDirective, "[bsLinkButton]", never, { "icon": { "alias": "icon"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
declare class CloseButtonDirective {
elementRef: ElementRef<any>;
constructor();
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CloseButtonDirective, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CloseButtonDirective, "[closeButton]", never, {}, {}, never, never, true, never>;
}
declare class DeleteButtonComponent extends BaseButtonComponent {
loadingLabel: _angular_core.InputSignal<string>;
label: _angular_core.InputSignal<string>;
icon: _angular_core.InputSignal<string>;
classes: _angular_core.InputSignal<string>;
constructor();
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DeleteButtonComponent, never>;
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DeleteButtonComponent, "delete-button", never, { "loadingLabel": { "alias": "loadingLabel"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "classes": { "alias": "classes"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
declare class DeleteButtonDirective extends BaseButtonDirective {
icon: _angular_core.InputSignal<string>;
loadingLabel: _angular_core.InputSignal<string>;
constructor();
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DeleteButtonDirective, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DeleteButtonDirective, "[deleteButton]", never, { "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "loadingLabel": { "alias": "loadingLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
declare class EditBsButtonComponent extends BaseButtonComponent {
label: _angular_core.InputSignal<string>;
classes: _angular_core.InputSignal<string>;
constructor();
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EditBsButtonComponent, never>;
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EditBsButtonComponent, "edit-bs-button", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "classes": { "alias": "classes"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
declare class EditBsButtonDirective implements OnInit, OnDestroy {
elementRef: ElementRef<any>;
viewContainerRef: ViewContainerRef;
document: Document;
protected originalText: _angular_core.WritableSignal<string>;
private iconComponentRef;
ngOnInit(): void;
ngOnDestroy(): void;
private updateContent;
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EditBsButtonDirective, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<EditBsButtonDirective, "[editBsButton]", never, {}, {}, never, never, true, never>;
}
declare class EditButtonComponent extends BaseButtonComponent {
label: _angular_core.InputSignal<string>;
icon: _angular_core.InputSignal<string>;
classes: _angular_core.InputSignal<string>;
constructor();
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EditButtonComponent, never>;
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EditButtonComponent, "edit-button", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "classes": { "alias": "classes"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
declare class EditButtonDirective extends BaseButtonDirective {
icon: _angular_core.InputSignal<string>;
loadingLabel: _angular_core.InputSignal<string>;
constructor();
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EditButtonDirective, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<EditButtonDirective, "[editButton]", never, { "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "loadingLabel": { "alias": "loadingLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
declare class EditSvgIconButtonComponent extends BaseButtonComponent {
label: _angular_core.InputSignal<string>;
classes: _angular_core.InputSignal<string>;
constructor();
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EditSvgIconButtonComponent, never>;
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EditSvgIconButtonComponent, "edit-svg-icon-button", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "classes": { "alias": "classes"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
declare class EditSvgIconButtonDirective implements OnInit, OnDestroy {
elementRef: ElementRef<any>;
viewContainerRef: ViewContainerRef;
document: Document;
protected originalText: _angular_core.WritableSignal<string>;
private iconComponentRef;
ngOnInit(): void;
ngOnDestroy(): void;
private updateContent;
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EditSvgIconButtonDirective, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<EditSvgIconButtonDirective, "[editSvgIconButton]", never, {}, {}, never, never, true, never>;
}
declare class ExcelExportButtonComponent {
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ExcelExportButtonComponent, never>;
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ExcelExportButtonComponent, "excel-export-button", never, {}, {}, never, never, true, never>;
}
declare class ExcelExportButtonDirective extends BaseButtonDirective {
constructor();
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ExcelExportButtonDirective, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ExcelExportButtonDirective, "[excelExportButton]", never, {}, {}, never, never, true, never>;
}
declare class ManageButtonComponent extends BaseButtonComponent {
label: _angular_core.InputSignal<string>;
icon: _angular_core.InputSignal<string>;
classes: _angular_core.InputSignal<string>;
constructor();
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ManageButtonComponent, never>;
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ManageButtonComponent, "manage-button", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "classes": { "alias": "classes"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
declare class ManageButtonDirective extends BaseButtonDirective {
icon: _angular_core.InputSignal<string>;
constructor();
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ManageButtonDirective, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ManageButtonDirective, "[manageButton]", never, { "icon": { "alias": "icon"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
declare class PdfExportButtonComponent {
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PdfExportButtonComponent, never>;
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PdfExportButtonComponent, "pdf-export-button", never, {}, {}, never, never, true, never>;
}
declare class PdfExportButtonDirective extends BaseButtonDirective {
constructor();
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PdfExportButtonDirective, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<PdfExportButtonDirective, "[pdfExportButton]", never, {}, {}, never, never, true, never>;
}
declare class PrimaryButtonComponent extends BaseButtonComponent {
loadingLabel: _angular_core.InputSignal<string>;
label: _angular_core.InputSignal<string>;
icon: _angular_core.InputSignal<string>;
showIcon: _angular_core.InputSignal<boolean>;
classes: _angular_core.InputSignal<string>;
constructor();
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PrimaryButtonComponent, never>;
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PrimaryButtonComponent, "primary-button", never, { "loadingLabel": { "alias": "loadingLabel"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "showIcon": { "alias": "showIcon"; "required": false; "isSignal": true; }; "classes": { "alias": "classes"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
declare class PrimaryButtonDirective extends BaseButtonDirective {
icon: _angular_core.InputSignal<string>;
loadingLabel: _angular_core.InputSignal<string>;
constructor();
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PrimaryButtonDirective, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<PrimaryButtonDirective, "[primaryButton]", never, { "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "loadingLabel": { "alias": "loadingLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
declare class SavePrimaryButtonComponent extends BaseButtonComponent {
loadingLabel: _angular_core.InputSignal<string>;
label: _angular_core.InputSignal<string>;
icon: _angular_core.InputSignal<string>;
classes: _angular_core.InputSignal<string>;
constructor();
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SavePrimaryButtonComponent, never>;
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SavePrimaryButtonComponent, "save-primary-button", never, { "loadingLabel": { "alias": "loadingLabel"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "classes": { "alias": "classes"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
declare class SavePrimaryButtonDirective extends BaseButtonDirective {
icon: _angular_core.InputSignal<string>;
loadingLabel: _angular_core.InputSignal<string>;
constructor();
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SavePrimaryButtonDirective, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SavePrimaryButtonDirective, "[savePrimaryButton]", never, { "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "loadingLabel": { "alias": "loadingLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
declare class SearchButtonComponent extends BaseButtonComponent {
loadingLabel: _angular_core.InputSignal<string>;
label: _angular_core.InputSignal<string>;
icon: _angular_core.InputSignal<string>;
classes: _angular_core.InputSignal<string>;
constructor();
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SearchButtonComponent, never>;
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SearchButtonComponent, "search-button", never, { "loadingLabel": { "alias": "loadingLabel"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "classes": { "alias": "classes"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
declare class SuccessButtonComponent extends BaseButtonComponent {
loadingLabel: _angular_core.InputSignal<string>;
label: _angular_core.InputSignal<string>;
icon: _angular_core.InputSignal<string>;
classes: _angular_core.InputSignal<string>;
constructor();
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SuccessButtonComponent, never>;
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SuccessButtonComponent, "success-button", never, { "loadingLabel": { "alias": "loadingLabel"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "classes": { "alias": "classes"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
declare class SuccessButtonDirective extends BaseButtonDirective {
icon: _angular_core.InputSignal<string>;
label: _angular_core.InputSignal<string>;
loadingLabel: _angular_core.InputSignal<string>;
constructor();
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SuccessButtonDirective, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SuccessButtonDirective, "[successButton]", never, { "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "loadingLabel": { "alias": "loadingLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
declare class ViewButtonComponent extends BaseButtonComponent {
label: _angular_core.InputSignal<string>;
icon: _angular_core.InputSignal<string>;
constructor();
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ViewButtonComponent, never>;
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ViewButtonComponent, "view-button", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
declare class ViewButtonDirective extends BaseButtonDirective {
icon: _angular_core.InputSignal<string>;
loadingLabel: _angular_core.InputSignal<string>;
constructor();
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ViewButtonDirective, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ViewButtonDirective, "[viewButton]", never, { "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "loadingLabel": { "alias": "loadingLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
declare class ViewPrimaryButtonComponent extends BaseButtonComponent {
label: _angular_core.InputSignal<string>;
icon: _angular_core.InputSignal<string>;
classes: _angular_core.InputSignal<string>;
constructor();
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ViewPrimaryButtonComponent, never>;
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ViewPrimaryButtonComponent, "view-primary-button", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "classes": { "alias": "classes"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
declare class ViewPrimaryButtonDirective extends BaseButtonDirective {
icon: _angular_core.InputSignal<string>;
constructor();
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ViewPrimaryButtonDirective, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ViewPrimaryButtonDirective, "[viewPrimaryButton]", never, { "icon": { "alias": "icon"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
declare class ConfirmDialogComponent {
data: ConfirmDialogData;
dialogRef: MatDialogRef<ConfirmDialogComponent>;
title: string;
message: string;
constructor(data: ConfirmDialogData, dialogRef: MatDialogRef<ConfirmDialogComponent>);
onDismiss(): void;
onConfirm(): void;
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ConfirmDialogComponent, never>;
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ConfirmDialogComponent, "app-confirm-dialog", never, {}, {}, never, never, true, never>;
}
/**
* Class to represent confirm dialog model.
*/
interface ConfirmDialogData {
title: string;
message: string;
}
declare class EditSolidSvgComponent {
protected readonly svgIconName = "edit-solid";
iconClass: _angular_core.InputSignal<string>;
size: _angular_core.InputSignal<string>;
private readonly _;
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EditSolidSvgComponent, never>;
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EditSolidSvgComponent, "edit-solid-svg", never, { "iconClass": { "alias": "iconClass"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
declare class MatSnackBarService {
snackBar: MatSnackBar;
/**
* Duration (in milliseconds) of the Snack Bar to be open. Defaults to 5 seconds (5000 milliseconds)
*/
duration: number;
/**
* Horizontal Position of the MatSnackBar. Defaults to right side
*/
horizontalPosition: MatSnackBarHorizontalPosition;
/**
* Vertical Position of the MatSnackBar. Defaults to top of the page
*/
verticalPosition: MatSnackBarVerticalPosition;
/**
* Opens Success Snack Bar
*
* @param message Message to display on Snack Bar
* @param options Options of the Snack Bar
*
* @author Pavan Kumar Jadda
* @since 2.2.3
*/
success(message: string, options?: MatSnackBarOptions): void;
/**
* Opens Error Snack Bar
*
* @param message Message to display on Snack Bar
* @param options Options of the Snack Bar
*
* @author Pavan Kumar Jadda
* @since 2.2.3
*/
error(message: string, options?: MatSnackBarOptions): void;
/**
* Opens Generic Snack Bar
*
* @param message Message to display on Snack Bar
*
* @author Pavan Kumar Jadda
* @since 2.2.3
*/
open(message: string): void;
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MatSnackBarService, never>;
static ɵprov: _angular_core.ɵɵInjectableDeclaration<MatSnackBarService>;
}
/**
* MatSnackBarOptions for Snack Bar
*
* Available panelClass options:
* - 'success-snackbar': Green background (default for success)
* - 'error-snackbar': Red background (default for error)
* - 'light-success-snackbar': Light green background
* - 'light-error-snackbar': Light red background
* - 'primary-snackbar': Primary theme color
* - 'info-snackbar': Blue background
* - 'warning-snackbar': Yellow background
* - Custom CSS class names for additional styling
*
* @author Pavan Kumar Jadda
* @since 2.7.19
*/
interface MatSnackBarOptions {
duration?: number;
horizontalPosition?: MatSnackBarHorizontalPosition;
verticalPosition?: MatSnackBarVerticalPosition;
panelClass?: string | string[];
}
interface IdType {
id: number;
}
/**
* A core entity store class that stores a list of objects. This has list of methods to perform CRUD operations on the list of objects.
*
* @author Pavan Kumar Jadda
* @since 17.1.0
*/
declare class EntityStore<T extends IdType> {
_data: _angular_core.WritableSignal<T[]>;
data: _angular_core.Signal<T[]>;
/**
* Find an item in the store by id
*
* @param id The id of the item to be found
*
* @returns The item if found, undefined otherwise
*
* @author Pavan Kumar Jadda
* @since 17.1.0
*/
findById(id: number): T | undefined;
/**
* Set the list of items in the store with the new data
*
* @param data The new list of items to be stored
*
* @author Pavan Kumar Jadda
* @since 17.1.0
*/
setData(data: T[]): void;
/**
* Update an item in the store. If the item does not exist in new list, add it. Otherwise, update it.
*
* @param data The item to added or updated
*
* @author Pavan Kumar Jadda
* @since 17.1.0
*/
upsert(data: T): void;
/**
* Update or insert the given list of items in the store
*
* @param newData The list of items to be updated or inserted
*
* @author Pavan Kumar Jadda
* @since 17.1.0
*/
upsertMulti(newData: T[]): void;
/**
* Remove an item from the store
*
* @param id The id of the item to be removed
*
* @author Pavan Kumar Jadda
* @since 17.1.0
*/
remove(id: number): void;
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityStore<any>, never>;
static ɵprov: _angular_core.ɵɵInjectableDeclaration<EntityStore<any>>;
}
/**
* A core store class that can be used to store any object
*
* @author Pavan Kumar Jadda
* @since 17.1.0
*/
declare class Store<T extends object> {
_data: _angular_core.WritableSignal<T | null>;
data: _angular_core.Signal<T | null>;
initialize(initialData: T): void;
/**
* Update the data in the store with the new data
*
* @param newData The new data to be stored/updated
*
* @author Pavan Kumar Jadda
* @since 17.1.0
*/
update(newData: T): void;
clear(): void;
getData(): T | null;
static ɵfac: _angular_core.ɵɵFactoryDeclaration<Store<any>, never>;
static ɵprov: _angular_core.ɵɵInjectableDeclaration<Store<any>>;
}
/**
* Initialize Loading or Update ProgressState
*
* @return Updated State Object
*
* @author Pavan Kumar Jadda
* @since 2.7.16
*/
declare const initializeState: () => WritableSignal<ProgressState>;
/**
* Initialize Loading or Update ProgressState
*
* @param progressState Object to initialize
* @return ProgressState Updated State Object
*
* @author Pavan Kumar Jadda
* @since 2.7.16
*/
declare const markLoading: (progressState: WritableSignal<ProgressState>) => void;
/**
* Update state as isSuccess
*
* @return ProgressState Updated State Object
*
* @author Pavan Kumar Jadda
* @since 2.7.16
*/
declare const markSuccess: (progressState: WritableSignal<ProgressState>, message?: string) => void;
/**
* Update state as failure or isError
*
* @return ProgressState Updated State Object
*
* @author Pavan Kumar Jadda
* @since 2.7.16
*/
declare const markError: (progressState: WritableSignal<ProgressState>, message?: string) => void;
/**
* Return value from {@link injectMutation}.
*
* @template TData - The type of data returned by the mutation function
* @template TError - The type of error thrown by the mutation function
* @template TVariables - The type of variables passed to the mutation function
* @template TContext - The type of context returned by `onMutate`
*/
interface InjectMutationResult<TData, TError, TVariables, TContext> {
/**
* Reactive mutation state.
*/
result: Signal<MutationObserverResult<TData, TError, TVariables, TContext>>;
/**
* Triggers the mutation without returning a promise.
*
* Use `mutateAsync` when the caller needs to await success or handle errors directly.
*
* @param variables - Variables passed to the mutation function.
* @param options - Optional per-call mutation callbacks.
*/
mutate: (variables: TVariables, options?: MutateOptions<TData, TError, TVariables, TContext>) => void;
/**
* Triggers the mutation and returns a promise for imperative async flows.
*
* @param variables - Variables passed to the mutation function.
* @param options - Optional per-call mutation callbacks.
* @returns Promise resolving with mutation data or rejecting with the mutation error.
*/
mutateAsync: (variables: TVariables, options?: MutateOptions<TData, TError, TVariables, TContext>) => Promise<TData>;
/**
* Resets the mutation observer state.
*/
reset: () => void;
}
/**
* Angular adapter for TanStack Query's MutationObserver.
*
* Creates a mutation and returns a reactive {@link Signal} alongside `mutate` and
* `mutateAsync` functions. The signal updates whenever the mutation state changes
* (idle, pending, success, error).
*
* The `optionsFn` is re-evaluated inside an `effect`, so any Angular signals read
* inside it will automatically update the observer options when they change.
*
* @template TData - The type of data returned by the mutation function
* @template TError - The type of error thrown by the mutation function (defaults to `Error`)
* @template TVariables - The type of variables passed to the mutation function (defaults to `void`)
* @template TContext - The type of context returned by `onMutate` for optimistic updates (defaults to `unknown`)
*
* @param optionsFn - A function returning {@link MutationObserverOptions}. May read Angular signals.
* @returns An object containing:
* - `result` — a read-only {@link Signal} with the current {@link MutationObserverResult}
* - `mutate` — fire-and-forget trigger; does not return a Promise
* - `mutateAsync` — returns a `Promise<TData>` that resolves or rejects with the mutation outcome
*
* @example
* ```ts
* const mutation = injectMutation(() => ({
* mutationFn: (user: User) => saveUser(user),
* onSuccess: () => queryClient.invalidateQueries({ queryKey: ['users'] }),
* }));
*
* mutation.mutate(newUser);
* await mutation.mutateAsync(newUser);
* ```
*
* @author Pavan Kumar Jadda
* @since 22.0.0
*/
declare function injectMutation<TData, TError = Error, TVariables = void, TContext = unknown>(optionsFn: () => MutationObserverOptions<TData, TError, TVariables, TContext>): InjectMutationResult<TData, TError, TVariables, TContext>;
/**
* Angular adapter for TanStack Query's QueryObserver.
*
* Subscribes to a query and returns a reactive {@link Signal} that updates whenever
* the query state changes (loading, success, error, refetch, etc.).
*
* The `optionsFn` is re-evaluated inside an `effect`, so any Angular signals read
* inside it (e.g. a signal-based `queryKey`) will automatically trigger a re-fetch
* when they change.
*
* @template TQueryFnData - The type of data returned by the query function
* @template TError - The type of error thrown by the query function (defaults to `Error`)
* @template TData - The type of data returned after optional `select` transformation
* @template TQueryData - The type of data stored in the query cache
* @template TQueryKey - The type of the query key
*
* @param optionsFn - A function returning {@link QueryObserverOptions}. May read Angular signals.
* @returns A read-