Skip to content

Commit

Permalink
Merge branch 'types' of https://github.com/primefaces/primeng into types
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed May 19, 2023
2 parents a345811 + 4142c80 commit 0ce5eeb
Show file tree
Hide file tree
Showing 14 changed files with 415 additions and 7 deletions.
7 changes: 7 additions & 0 deletions src/app/components/api/blockableui.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Represents a blockable user interface element.
*/
export interface BlockableUI {
/**
* Retrieves the blockable element associated with the UI.
* @returns The HTML element that can be blocked.
*/
getBlockableElement(): HTMLElement;
}
86 changes: 86 additions & 0 deletions src/app/components/api/confirmation.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,111 @@
import { EventEmitter } from '@angular/core';

/**
* Represents a confirmation dialog configuration.
*/
export interface Confirmation {
/**
* The message to be displayed in the confirmation dialog.
*/
message?: string;

/**
* A unique key to identify the confirmation dialog.
*/
key?: string;

/**
* The name of the icon to be displayed in the confirmation dialog.
*/
icon?: string;

/**
* The header text of the confirmation dialog.
*/
header?: string;

/**
* The callback function to be executed when the accept button is clicked.
*/
accept?: Function;

/**
* The callback function to be executed when the reject button is clicked.
*/
reject?: Function;

/**
* The label text for the accept button.
*/
acceptLabel?: string;

/**
* The label text for the reject button.
*/
rejectLabel?: string;

/**
* The name of the icon to be displayed on the accept button.
*/
acceptIcon?: string;

/**
* The name of the icon to be displayed on the reject button.
*/
rejectIcon?: string;

/**
* Specifies whether the accept button should be visible.
*/
acceptVisible?: boolean;

/**
* Specifies whether the reject button should be visible.
*/
rejectVisible?: boolean;

/**
* Specifies whether to block scrolling on the page when the confirmation dialog is displayed.
*/
blockScroll?: boolean;

/**
* Specifies whether the confirmation dialog should be closed when the escape key is pressed.
*/
closeOnEscape?: boolean;

/**
* Specifies whether clicking outside the confirmation dialog should dismiss it.
*/
dismissableMask?: boolean;

/**
* The ID or class name of the element to receive focus by default when the confirmation dialog is opened.
*/
defaultFocus?: string;

/**
* The CSS class name to be applied to the accept button.
*/
acceptButtonStyleClass?: string;

/**
* The CSS class name to be applied to the reject button.
*/
rejectButtonStyleClass?: string;

/**
* The target event where the confirmation dialog is triggered from.
*/
target?: EventTarget;

/**
* An event emitter for the accept event.
*/
acceptEvent?: EventEmitter<any>;

/**
* An event emitter for the reject event.
*/
rejectEvent?: EventEmitter<any>;
}
14 changes: 14 additions & 0 deletions src/app/components/api/filtermetadata.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
/**
* Represents metadata for filtering a data set.
*/
export interface FilterMetadata {
/**
* The value used for filtering.
*/
value?: any;

/**
* The match mode for filtering.
*/
matchMode?: string;

/**
* The operator for filtering.
*/
operator?: string;
}
33 changes: 32 additions & 1 deletion src/app/components/api/lazyloadevent.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,45 @@
import { SortMeta } from './sortmeta';
import { FilterMetadata } from './filtermetadata';
import { SortMeta } from './sortmeta';

/**
* Represents an event object for lazy loading data.
*/
export interface LazyLoadEvent {
/**
* The index of the first record to be loaded.
*/
first?: number;
/**
* The index of the last record to be loaded.
*/
last?: number;
/**
* The number of rows to load.
*/
rows?: number;
/**
* The field to be used for sorting.
*/
sortField?: string;
/**
* The sort order for the field.
*/
sortOrder?: number;
/**
* An array of sort metadata objects for multiple column sorting.
*/
multiSortMeta?: SortMeta[];
/**
* An object containing filter metadata for filtering the data.
* The keys represent the field names, and the values represent the corresponding filter metadata.
*/
filters?: { [s: string]: FilterMetadata };
/**
* The global filter value for filtering across all columns.
*/
globalFilter?: any;
/**
* A function that can be called to force an update in the lazy loaded data.
*/
forceUpdate?: () => void;
}
89 changes: 89 additions & 0 deletions src/app/components/api/megamenuitem.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,123 @@
import { QueryParamsHandling } from '@angular/router';
import { MenuItem } from './menuitem';

/**
* MegaMenuItem API provides the following properties.
*/
export interface MegaMenuItem {
/**
* Text of the item.
*/
label?: string;
/**
* Icon of the item.
*/
icon?: string;
/**
* Callback to execute when item is clicked.
*/
command?: (event?: any) => void;
/**
* External link to navigate when item is clicked.
*/
url?: string;
/**
* An array of children menuitems.
*/
items?: MenuItem[][];
/**
* Specifies whether the mega menu item is expanded.
*/
expanded?: boolean;
/**
* When set as true, disables the menuitem.
*/
disabled?: boolean;
/**
* Whether the dom element of menuitem is created or not.
*/
visible?: boolean;
/**
* Specifies where to open the linked document.
*/
target?: string;
/**
* Configuration for active router link.
*/
routerLinkActiveOptions?: any;
/**
* Defines the item as a separator.
*/
separator?: boolean;
/**
* Value of the badge.
*/
badge?: string;
/**
* Style class of the badge.
*/
badgeStyleClass?: string;
/**
* Inline style of the menuitem.
*/
style?: any;
/**
* Style class of the menuitem.
*/
styleClass?: string;
/**
* Inline style of the item's icon.
*/
iconStyle?: any;
/**
* Tooltip text of the item.
*/
title?: string;
/**
* Identifier of the element.
*/
id?: string;
/**
* Value of HTML data-* attribute.
*/
automationId?: any;
/**
* Specifies tab order of the item.
*/
tabindex?: string;
/**
* RouterLink definition for internal navigation.
*/
routerLink?: any;
/**
* Query parameters for internal navigation via routerLink.
*/
queryParams?: { [k: string]: any };
/**
* Sets the hash fragment for the URL.
*/
fragment?: string;
/**
* How to handle query parameters in the router link for the next navigation. One of:
merge : Merge new with current parameters.
preserve : Preserve current parameters.k.
*/
queryParamsHandling?: QueryParamsHandling;
/**
* When true, preserves the URL fragment for the next navigation.
*/
preserveFragment?: boolean;
/**
* When true, navigates without pushing a new state into history.
*/
skipLocationChange?: boolean;
/**
* When true, navigates while replacing the current state in history.
*/
replaceUrl?: boolean;
/**
* Developer-defined state that can be passed to any navigation.
*/
state?: {
[k: string]: any;
};
Expand Down
Loading

0 comments on commit 0ce5eeb

Please sign in to comment.