@pecb-ui/components 1.1.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +556 -556
- package/fesm2022/pecb-ui-components.mjs +998 -1907
- package/fesm2022/pecb-ui-components.mjs.map +1 -1
- package/index.d.ts +2439 -3
- package/package.json +6 -8
- package/esm2022/lib/components/button/button.component.mjs +0 -171
- package/esm2022/lib/components/card/card.component.mjs +0 -182
- package/esm2022/lib/components/checkbox/checkbox.component.mjs +0 -126
- package/esm2022/lib/components/datepicker/datepicker.component.mjs +0 -349
- package/esm2022/lib/components/dropdown/dropdown.component.mjs +0 -329
- package/esm2022/lib/components/input/input.component.mjs +0 -321
- package/esm2022/lib/components/pagination/pagination.component.mjs +0 -197
- package/esm2022/lib/components/radio/radio.component.mjs +0 -147
- package/esm2022/lib/components/right-modal/right-modal.component.mjs +0 -234
- package/esm2022/lib/components/sidebar/sidebar.component.mjs +0 -155
- package/esm2022/lib/components/status/status.component.mjs +0 -50
- package/esm2022/lib/components/tab/tab.component.mjs +0 -151
- package/esm2022/lib/components/table/table.component.mjs +0 -503
- package/esm2022/lib/components/toggle/toggle.component.mjs +0 -126
- package/esm2022/lib/pecb-components.module.mjs +0 -118
- package/esm2022/lib/services/loading.service.mjs +0 -182
- package/esm2022/lib/services/notification.service.mjs +0 -144
- package/esm2022/lib/services/theme.service.mjs +0 -232
- package/esm2022/lib/shared/interfaces/component.interfaces.mjs +0 -2
- package/esm2022/lib/shared/types/common.types.mjs +0 -6
- package/esm2022/lib/shared/utils/accessibility.utils.mjs +0 -223
- package/esm2022/lib/shared/utils/dom.utils.mjs +0 -240
- package/esm2022/lib/shared/utils/error.utils.mjs +0 -277
- package/esm2022/lib/shared/utils/string.utils.mjs +0 -204
- package/esm2022/pecb-ui-components.mjs +0 -5
- package/esm2022/public-api.mjs +0 -53
- package/lib/components/button/button.component.d.ts +0 -130
- package/lib/components/card/card.component.d.ts +0 -140
- package/lib/components/checkbox/checkbox.component.d.ts +0 -74
- package/lib/components/datepicker/datepicker.component.d.ts +0 -155
- package/lib/components/dropdown/dropdown.component.d.ts +0 -144
- package/lib/components/input/input.component.d.ts +0 -215
- package/lib/components/pagination/pagination.component.d.ts +0 -53
- package/lib/components/radio/radio.component.d.ts +0 -93
- package/lib/components/right-modal/right-modal.component.d.ts +0 -137
- package/lib/components/sidebar/sidebar.component.d.ts +0 -97
- package/lib/components/status/status.component.d.ts +0 -19
- package/lib/components/tab/tab.component.d.ts +0 -102
- package/lib/components/table/table.component.d.ts +0 -403
- package/lib/components/toggle/toggle.component.d.ts +0 -74
- package/lib/pecb-components.module.d.ts +0 -37
- package/lib/services/loading.service.d.ts +0 -129
- package/lib/services/notification.service.d.ts +0 -136
- package/lib/services/theme.service.d.ts +0 -142
- package/lib/shared/interfaces/component.interfaces.d.ts +0 -283
- package/lib/shared/types/common.types.d.ts +0 -86
- package/lib/shared/utils/accessibility.utils.d.ts +0 -167
- package/lib/shared/utils/dom.utils.d.ts +0 -108
- package/lib/shared/utils/error.utils.d.ts +0 -191
- package/lib/shared/utils/string.utils.d.ts +0 -144
- package/public-api.d.ts +0 -24
package/index.d.ts
CHANGED
|
@@ -1,5 +1,2441 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { ElementRef, ChangeDetectorRef, TemplateRef, Type, OnInit, OnDestroy, AfterViewInit } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { SafeHtml, DomSanitizer } from '@angular/platform-browser';
|
|
5
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
6
|
+
import { Observable } from 'rxjs';
|
|
7
|
+
|
|
8
|
+
type ButtonVariant = 'primary' | 'primary-outline' | 'primary-2' | 'primary-2-outline' | 'neutral' | 'neutral-outline' | 'secondary' | 'text' | 'text-muted' | 'text-brand' | 'destructive' | 'destructive-outline';
|
|
9
|
+
type ButtonSize = 'sm' | 'md' | 'lg';
|
|
10
|
+
type ButtonIconStyle = 'none' | 'leading' | 'trailing' | 'icon-only';
|
|
11
|
+
declare class ButtonComponent {
|
|
12
|
+
private readonly sanitizer;
|
|
13
|
+
id: _angular_core.InputSignal<string>;
|
|
14
|
+
/**
|
|
15
|
+
* The visual style variant of the button
|
|
16
|
+
*/
|
|
17
|
+
variant: _angular_core.InputSignal<ButtonVariant>;
|
|
18
|
+
/**
|
|
19
|
+
* The size of the button
|
|
20
|
+
*/
|
|
21
|
+
size: _angular_core.InputSignal<ButtonSize>;
|
|
22
|
+
/**
|
|
23
|
+
* Icon placement style
|
|
24
|
+
*/
|
|
25
|
+
iconStyle: _angular_core.InputSignal<ButtonIconStyle>;
|
|
26
|
+
/**
|
|
27
|
+
* Icon to display (used with iconStyle)
|
|
28
|
+
*/
|
|
29
|
+
icon: _angular_core.InputSignal<string | undefined>;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the button is disabled
|
|
32
|
+
*/
|
|
33
|
+
disabled: _angular_core.InputSignal<boolean>;
|
|
34
|
+
/**
|
|
35
|
+
* Whether the button should take full width
|
|
36
|
+
*/
|
|
37
|
+
fullWidth: _angular_core.InputSignal<boolean>;
|
|
38
|
+
/**
|
|
39
|
+
* Whether the button is in loading state
|
|
40
|
+
*/
|
|
41
|
+
loading: _angular_core.InputSignal<boolean>;
|
|
42
|
+
/**
|
|
43
|
+
* Button type attribute
|
|
44
|
+
*/
|
|
45
|
+
type: _angular_core.InputSignal<"button" | "submit" | "reset">;
|
|
46
|
+
/**
|
|
47
|
+
* Accessible label for the button (required for icon-only buttons)
|
|
48
|
+
*/
|
|
49
|
+
ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
50
|
+
/**
|
|
51
|
+
* ID of element that labels this button
|
|
52
|
+
*/
|
|
53
|
+
ariaLabelledBy: _angular_core.InputSignal<string | undefined>;
|
|
54
|
+
/**
|
|
55
|
+
* ID of element that describes this button
|
|
56
|
+
*/
|
|
57
|
+
ariaDescribedBy: _angular_core.InputSignal<string | undefined>;
|
|
58
|
+
/**
|
|
59
|
+
* Indicates the button controls an expandable element
|
|
60
|
+
*/
|
|
61
|
+
ariaExpanded: _angular_core.InputSignal<boolean | undefined>;
|
|
62
|
+
/**
|
|
63
|
+
* Indicates the pressed state for toggle buttons
|
|
64
|
+
*/
|
|
65
|
+
ariaPressed: _angular_core.InputSignal<boolean | undefined>;
|
|
66
|
+
/**
|
|
67
|
+
* Indicates the button opens a popup (menu, listbox, dialog, etc.)
|
|
68
|
+
*/
|
|
69
|
+
ariaHasPopup: _angular_core.InputSignal<boolean | "dialog" | "menu" | "listbox" | "tree" | "grid" | undefined>;
|
|
70
|
+
/**
|
|
71
|
+
* ID of the element controlled by this button
|
|
72
|
+
*/
|
|
73
|
+
ariaControls: _angular_core.InputSignal<string | undefined>;
|
|
74
|
+
/**
|
|
75
|
+
* Event emitted when the button is clicked
|
|
76
|
+
*/
|
|
77
|
+
clicked: _angular_core.OutputEmitterRef<MouseEvent>;
|
|
78
|
+
/**
|
|
79
|
+
* Host binding for the component's ID
|
|
80
|
+
*/
|
|
81
|
+
get hostId(): null;
|
|
82
|
+
/**
|
|
83
|
+
* Get CSS classes for the button
|
|
84
|
+
*/
|
|
85
|
+
get buttonClasses(): string[];
|
|
86
|
+
get showLeadingIcon(): boolean;
|
|
87
|
+
get showTrailingIcon(): boolean;
|
|
88
|
+
get isIconOnly(): boolean;
|
|
89
|
+
get loadingText(): string;
|
|
90
|
+
get isSvgIcon(): boolean;
|
|
91
|
+
get safeIconHtml(): SafeHtml;
|
|
92
|
+
onClick(event: MouseEvent): void;
|
|
93
|
+
onKeyDown(event: KeyboardEvent): void;
|
|
94
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ButtonComponent, never>;
|
|
95
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ButtonComponent, "pecb-button", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "iconStyle": { "alias": "iconStyle"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "fullWidth": { "alias": "fullWidth"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; "isSignal": true; }; "ariaDescribedBy": { "alias": "ariaDescribedBy"; "required": false; "isSignal": true; }; "ariaExpanded": { "alias": "ariaExpanded"; "required": false; "isSignal": true; }; "ariaPressed": { "alias": "ariaPressed"; "required": false; "isSignal": true; }; "ariaHasPopup": { "alias": "ariaHasPopup"; "required": false; "isSignal": true; }; "ariaControls": { "alias": "ariaControls"; "required": false; "isSignal": true; }; }, { "clicked": "clicked"; }, never, ["*"], true, never>;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
type CardElevation = 'none' | 'sm' | 'md' | 'lg' | 'xl';
|
|
99
|
+
type CardRadius = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'full';
|
|
1
100
|
/**
|
|
2
|
-
*
|
|
101
|
+
* Semantic role for the card component
|
|
3
102
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
103
|
+
type CardRole = 'article' | 'region' | 'group' | 'listitem' | 'none';
|
|
104
|
+
declare class CardComponent {
|
|
105
|
+
/**
|
|
106
|
+
* Unique ID for the card element
|
|
107
|
+
*/
|
|
108
|
+
id: _angular_core.InputSignal<string>;
|
|
109
|
+
/**
|
|
110
|
+
* The elevation level (shadow depth) of the card
|
|
111
|
+
*/
|
|
112
|
+
elevation: _angular_core.InputSignal<CardElevation>;
|
|
113
|
+
/**
|
|
114
|
+
* Whether the card should be hoverable with elevation change
|
|
115
|
+
*/
|
|
116
|
+
hoverable: _angular_core.InputSignal<boolean>;
|
|
117
|
+
/**
|
|
118
|
+
* Whether to add padding to the card
|
|
119
|
+
*/
|
|
120
|
+
noPadding: _angular_core.InputSignal<boolean>;
|
|
121
|
+
/**
|
|
122
|
+
* Border-radius: predefined token ('xs'|'sm'|'md'|'lg'|'none'|'full')
|
|
123
|
+
* or any CSS value e.g. '20px', '50%'
|
|
124
|
+
*/
|
|
125
|
+
radius: _angular_core.InputSignal<string>;
|
|
126
|
+
/**
|
|
127
|
+
* Semantic role for the card (article, region, group, listitem, or none)
|
|
128
|
+
* Use 'article' for self-contained content, 'region' for significant sections
|
|
129
|
+
*/
|
|
130
|
+
role: _angular_core.InputSignal<CardRole>;
|
|
131
|
+
/**
|
|
132
|
+
* Accessible label for the card
|
|
133
|
+
*/
|
|
134
|
+
ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
135
|
+
/**
|
|
136
|
+
* ID of element that labels this card
|
|
137
|
+
*/
|
|
138
|
+
ariaLabelledBy: _angular_core.InputSignal<string | undefined>;
|
|
139
|
+
/**
|
|
140
|
+
* ID of element that describes this card
|
|
141
|
+
*/
|
|
142
|
+
ariaDescribedBy: _angular_core.InputSignal<string | undefined>;
|
|
143
|
+
/**
|
|
144
|
+
* Get CSS classes for the card
|
|
145
|
+
*/
|
|
146
|
+
get cardClasses(): string[];
|
|
147
|
+
get borderRadiusStyle(): string;
|
|
148
|
+
get roleAttribute(): string | null;
|
|
149
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CardComponent, never>;
|
|
150
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CardComponent, "pecb-card", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "elevation": { "alias": "elevation"; "required": false; "isSignal": true; }; "hoverable": { "alias": "hoverable"; "required": false; "isSignal": true; }; "noPadding": { "alias": "noPadding"; "required": false; "isSignal": true; }; "radius": { "alias": "radius"; "required": false; "isSignal": true; }; "role": { "alias": "role"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; "isSignal": true; }; "ariaDescribedBy": { "alias": "ariaDescribedBy"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
151
|
+
}
|
|
152
|
+
declare class CardHeaderComponent {
|
|
153
|
+
headingLevel: _angular_core.InputSignal<number | null>;
|
|
154
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CardHeaderComponent, never>;
|
|
155
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CardHeaderComponent, "pecb-card-header", never, { "headingLevel": { "alias": "headingLevel"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
156
|
+
}
|
|
157
|
+
declare class CardBodyComponent {
|
|
158
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CardBodyComponent, never>;
|
|
159
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CardBodyComponent, "pecb-card-body", never, {}, {}, never, ["*"], true, never>;
|
|
160
|
+
}
|
|
161
|
+
declare class CardFooterComponent {
|
|
162
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CardFooterComponent, never>;
|
|
163
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CardFooterComponent, "pecb-card-footer", never, {}, {}, never, ["*"], true, never>;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
type StatusType = 'warning' | 'action' | 'success' | 'error' | 'different' | 'disabled' | 'neutral';
|
|
167
|
+
type StatusVariant = 'accent' | 'filled' | 'outline' | 'custom';
|
|
168
|
+
type StatusSize = 'sm' | 'md' | 'lg';
|
|
169
|
+
declare class StatusComponent {
|
|
170
|
+
private readonly _id;
|
|
171
|
+
type: _angular_core.InputSignal<StatusType>;
|
|
172
|
+
variant: _angular_core.InputSignal<StatusVariant>;
|
|
173
|
+
size: _angular_core.InputSignal<StatusSize>;
|
|
174
|
+
ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
175
|
+
text: _angular_core.InputSignal<string | undefined>;
|
|
176
|
+
customClass: _angular_core.InputSignal<string | undefined>;
|
|
177
|
+
get id(): string;
|
|
178
|
+
get statusClasses(): string[];
|
|
179
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<StatusComponent, never>;
|
|
180
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StatusComponent, "pecb-status", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "text": { "alias": "text"; "required": false; "isSignal": true; }; "customClass": { "alias": "customClass"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
type PaginationSize = 'sm' | 'md' | 'lg';
|
|
184
|
+
type PaginationVariant = 'full' | 'compact' | 'minimal' | 'centered';
|
|
185
|
+
interface PageChangeEvent {
|
|
186
|
+
page: number;
|
|
187
|
+
pageSize: number;
|
|
188
|
+
startIndex: number;
|
|
189
|
+
endIndex: number;
|
|
190
|
+
}
|
|
191
|
+
declare class PaginationComponent {
|
|
192
|
+
private elementRef;
|
|
193
|
+
private cdr;
|
|
194
|
+
totalItems: _angular_core.InputSignal<number>;
|
|
195
|
+
pageSize: _angular_core.ModelSignal<number>;
|
|
196
|
+
currentPage: _angular_core.ModelSignal<number>;
|
|
197
|
+
pageSizeOptions: _angular_core.InputSignal<number[]>;
|
|
198
|
+
size: _angular_core.InputSignal<PaginationSize>;
|
|
199
|
+
variant: _angular_core.InputSignal<PaginationVariant>;
|
|
200
|
+
showPageSizeSelector: _angular_core.InputSignal<boolean>;
|
|
201
|
+
showItemsInfo: _angular_core.InputSignal<boolean>;
|
|
202
|
+
maxVisiblePages: _angular_core.InputSignal<number>;
|
|
203
|
+
disabled: _angular_core.InputSignal<boolean>;
|
|
204
|
+
ariaLabel: _angular_core.InputSignal<string>;
|
|
205
|
+
pageChange: _angular_core.OutputEmitterRef<PageChangeEvent>;
|
|
206
|
+
pageSizeChange: _angular_core.OutputEmitterRef<number>;
|
|
207
|
+
readonly totalPages: _angular_core.Signal<number>;
|
|
208
|
+
readonly visiblePages: _angular_core.Signal<(string | number)[]>;
|
|
209
|
+
isDropdownOpen: _angular_core.WritableSignal<boolean>;
|
|
210
|
+
constructor(elementRef: ElementRef, cdr: ChangeDetectorRef);
|
|
211
|
+
onDocumentClick(event: MouseEvent): void;
|
|
212
|
+
get containerClasses(): string[];
|
|
213
|
+
get showPages(): boolean;
|
|
214
|
+
get showPageSize(): boolean;
|
|
215
|
+
get itemsInfoText(): string;
|
|
216
|
+
get startIndex(): number;
|
|
217
|
+
get endIndex(): number;
|
|
218
|
+
get canGoPrevious(): boolean;
|
|
219
|
+
get canGoNext(): boolean;
|
|
220
|
+
goToPage(page: number): void;
|
|
221
|
+
goToPrevious(): void;
|
|
222
|
+
goToNext(): void;
|
|
223
|
+
onPageSizeChange(newSize: number): void;
|
|
224
|
+
toggleDropdown(): void;
|
|
225
|
+
closeDropdown(): void;
|
|
226
|
+
isNumber(value: number | string): boolean;
|
|
227
|
+
trackByPage(index: number, page: number | string): number | string;
|
|
228
|
+
private emitPageChange;
|
|
229
|
+
private computeVisiblePages;
|
|
230
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PaginationComponent, never>;
|
|
231
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PaginationComponent, "pecb-pagination", never, { "totalItems": { "alias": "totalItems"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "currentPage": { "alias": "currentPage"; "required": false; "isSignal": true; }; "pageSizeOptions": { "alias": "pageSizeOptions"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "showPageSizeSelector": { "alias": "showPageSizeSelector"; "required": false; "isSignal": true; }; "showItemsInfo": { "alias": "showItemsInfo"; "required": false; "isSignal": true; }; "maxVisiblePages": { "alias": "maxVisiblePages"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; }, { "pageSize": "pageSizeChange"; "currentPage": "currentPageChange"; "pageChange": "pageChange"; "pageSizeChange": "pageSizeChange"; }, never, never, true, never>;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
type TableSize = 'sm' | 'md' | 'lg';
|
|
235
|
+
type TableVariant = 'default' | 'striped' | 'bordered';
|
|
236
|
+
/**
|
|
237
|
+
* Defines built-in column types
|
|
238
|
+
*/
|
|
239
|
+
type PecbTableColumnType = 'text' | 'link' | 'status' | 'action' | 'user' | 'custom';
|
|
240
|
+
/**
|
|
241
|
+
* Defines built-in component names for columns
|
|
242
|
+
*/
|
|
243
|
+
type PecbTableColumnComponent = 'status' | 'action' | 'user';
|
|
244
|
+
interface TableAction {
|
|
245
|
+
id: string;
|
|
246
|
+
icon: 'view' | 'edit' | 'delete' | 'download' | 'copy' | 'custom';
|
|
247
|
+
tooltip?: string;
|
|
248
|
+
customIcon?: string;
|
|
249
|
+
disabled?: boolean;
|
|
250
|
+
variant?: 'default' | 'danger';
|
|
251
|
+
/** Whether to show a vertical divider before this action */
|
|
252
|
+
dividerBefore?: boolean;
|
|
253
|
+
/** Click handler for this specific action */
|
|
254
|
+
action?: (row: any, index: number) => void;
|
|
255
|
+
}
|
|
256
|
+
interface TableStatusConfig {
|
|
257
|
+
typeMap?: Record<string, string>;
|
|
258
|
+
variant?: 'accent' | 'filled' | 'outline';
|
|
259
|
+
size?: 'sm' | 'md' | 'lg';
|
|
260
|
+
}
|
|
261
|
+
interface TableUserConfig {
|
|
262
|
+
avatarKey?: string;
|
|
263
|
+
nameKey?: string;
|
|
264
|
+
secondaryKey?: string;
|
|
265
|
+
}
|
|
266
|
+
interface PecbTableColumn {
|
|
267
|
+
key: string;
|
|
268
|
+
label: string;
|
|
269
|
+
width?: string;
|
|
270
|
+
align?: 'left' | 'center' | 'right';
|
|
271
|
+
sortable?: boolean;
|
|
272
|
+
cellTemplate?: TemplateRef<any>;
|
|
273
|
+
headerTemplate?: TemplateRef<any>;
|
|
274
|
+
cssClass?: string;
|
|
275
|
+
type?: PecbTableColumnType;
|
|
276
|
+
component?: PecbTableColumnComponent;
|
|
277
|
+
dynamicComponent?: Type<any>;
|
|
278
|
+
componentInputs?: Record<string, any>;
|
|
279
|
+
componentInputsFn?: (row: any, value: any, index: number) => Record<string, any>;
|
|
280
|
+
actions?: TableAction[];
|
|
281
|
+
statusConfig?: TableStatusConfig;
|
|
282
|
+
userConfig?: TableUserConfig;
|
|
283
|
+
}
|
|
284
|
+
interface TableSortEvent {
|
|
285
|
+
column: string;
|
|
286
|
+
direction: 'asc' | 'desc' | null;
|
|
287
|
+
}
|
|
288
|
+
interface TableRowActionEvent {
|
|
289
|
+
action: string;
|
|
290
|
+
row: any;
|
|
291
|
+
index: number;
|
|
292
|
+
}
|
|
293
|
+
interface TableSelectionEvent {
|
|
294
|
+
selectedRows: any[];
|
|
295
|
+
selectedIndices: number[];
|
|
296
|
+
}
|
|
297
|
+
declare class TableComponent {
|
|
298
|
+
private sanitizer;
|
|
299
|
+
private cdr;
|
|
300
|
+
constructor(sanitizer: DomSanitizer, cdr: ChangeDetectorRef);
|
|
301
|
+
/**
|
|
302
|
+
* Column definitions for the table
|
|
303
|
+
*/
|
|
304
|
+
columns: _angular_core.InputSignal<PecbTableColumn[]>;
|
|
305
|
+
/**
|
|
306
|
+
* Data array to display in the table
|
|
307
|
+
*/
|
|
308
|
+
data: _angular_core.InputSignal<any[]>;
|
|
309
|
+
/**
|
|
310
|
+
* Size variant of the table
|
|
311
|
+
* @default 'md'
|
|
312
|
+
*/
|
|
313
|
+
size: _angular_core.InputSignal<TableSize>;
|
|
314
|
+
/**
|
|
315
|
+
* Visual variant of the table
|
|
316
|
+
* @default 'default'
|
|
317
|
+
*/
|
|
318
|
+
variant: _angular_core.InputSignal<TableVariant>;
|
|
319
|
+
/**
|
|
320
|
+
* Whether to show the table header
|
|
321
|
+
* @default true
|
|
322
|
+
*/
|
|
323
|
+
showHeader: _angular_core.InputSignal<boolean>;
|
|
324
|
+
/**
|
|
325
|
+
* Whether to enable row hover effect
|
|
326
|
+
* @default true
|
|
327
|
+
*/
|
|
328
|
+
hoverable: _angular_core.InputSignal<boolean>;
|
|
329
|
+
/**
|
|
330
|
+
* Whether to show pagination
|
|
331
|
+
* @default true
|
|
332
|
+
*/
|
|
333
|
+
showPagination: _angular_core.InputSignal<boolean>;
|
|
334
|
+
/**
|
|
335
|
+
* Total number of items for pagination
|
|
336
|
+
*/
|
|
337
|
+
totalItems: _angular_core.InputSignal<number>;
|
|
338
|
+
/**
|
|
339
|
+
* Current page number (1-based)
|
|
340
|
+
* @default 1
|
|
341
|
+
*/
|
|
342
|
+
currentPage: _angular_core.ModelSignal<number>;
|
|
343
|
+
/**
|
|
344
|
+
* Number of items per page
|
|
345
|
+
* @default 15
|
|
346
|
+
*/
|
|
347
|
+
pageSize: _angular_core.ModelSignal<number>;
|
|
348
|
+
/**
|
|
349
|
+
* Available page size options
|
|
350
|
+
*/
|
|
351
|
+
pageSizeOptions: _angular_core.InputSignal<number[]>;
|
|
352
|
+
/**
|
|
353
|
+
* Whether to show page size selector in pagination
|
|
354
|
+
* @default true
|
|
355
|
+
*/
|
|
356
|
+
showPageSizeSelector: _angular_core.InputSignal<boolean>;
|
|
357
|
+
/**
|
|
358
|
+
* Pagination variant
|
|
359
|
+
* @default 'full'
|
|
360
|
+
*/
|
|
361
|
+
paginationVariant: _angular_core.InputSignal<"full" | "compact" | "minimal" | "centered">;
|
|
362
|
+
/**
|
|
363
|
+
* Message to display when there is no data
|
|
364
|
+
*/
|
|
365
|
+
emptyMessage: _angular_core.InputSignal<string>;
|
|
366
|
+
/**
|
|
367
|
+
* Whether to show loading state
|
|
368
|
+
* @default false
|
|
369
|
+
*/
|
|
370
|
+
loading: _angular_core.InputSignal<boolean>;
|
|
371
|
+
/**
|
|
372
|
+
* Whether to enable row selection
|
|
373
|
+
* @default false
|
|
374
|
+
*/
|
|
375
|
+
selectable: _angular_core.InputSignal<boolean>;
|
|
376
|
+
/**
|
|
377
|
+
* Currently selected row indices
|
|
378
|
+
*/
|
|
379
|
+
selectedIndices: _angular_core.ModelSignal<number[]>;
|
|
380
|
+
/**
|
|
381
|
+
* Whether the table has a fixed header
|
|
382
|
+
* @default false
|
|
383
|
+
*/
|
|
384
|
+
stickyHeader: _angular_core.InputSignal<boolean>;
|
|
385
|
+
/**
|
|
386
|
+
* Maximum height of the table body (enables scrolling)
|
|
387
|
+
*/
|
|
388
|
+
maxHeight: _angular_core.InputSignal<string | undefined>;
|
|
389
|
+
/**
|
|
390
|
+
* Column key currently being sorted
|
|
391
|
+
*/
|
|
392
|
+
sortColumn: _angular_core.ModelSignal<string | undefined>;
|
|
393
|
+
/**
|
|
394
|
+
* Current sort direction
|
|
395
|
+
*/
|
|
396
|
+
sortDirection: _angular_core.ModelSignal<"desc" | "asc" | null>;
|
|
397
|
+
/**
|
|
398
|
+
* ARIA label for the table
|
|
399
|
+
*/
|
|
400
|
+
ariaLabel: _angular_core.InputSignal<string>;
|
|
401
|
+
/**
|
|
402
|
+
* Emitted when a page change occurs
|
|
403
|
+
*/
|
|
404
|
+
pageChange: _angular_core.OutputEmitterRef<PageChangeEvent>;
|
|
405
|
+
/**
|
|
406
|
+
* Emitted when page size changes
|
|
407
|
+
*/
|
|
408
|
+
pageSizeChange: _angular_core.OutputEmitterRef<number>;
|
|
409
|
+
/**
|
|
410
|
+
* Emitted when a row is clicked
|
|
411
|
+
*/
|
|
412
|
+
rowClick: _angular_core.OutputEmitterRef<{
|
|
413
|
+
row: any;
|
|
414
|
+
index: number;
|
|
415
|
+
}>;
|
|
416
|
+
/**
|
|
417
|
+
* Emitted when a row action is triggered
|
|
418
|
+
*/
|
|
419
|
+
rowAction: _angular_core.OutputEmitterRef<TableRowActionEvent>;
|
|
420
|
+
/**
|
|
421
|
+
* Emitted when sorting changes
|
|
422
|
+
*/
|
|
423
|
+
sortChange: _angular_core.OutputEmitterRef<TableSortEvent>;
|
|
424
|
+
/**
|
|
425
|
+
* Emitted when row selection changes
|
|
426
|
+
*/
|
|
427
|
+
selectionChange: _angular_core.OutputEmitterRef<TableSelectionEvent>;
|
|
428
|
+
emptyTemplate?: TemplateRef<any>;
|
|
429
|
+
loadingTemplate?: TemplateRef<any>;
|
|
430
|
+
get containerClasses(): string;
|
|
431
|
+
get paginationClasses(): string;
|
|
432
|
+
get tableClasses(): string;
|
|
433
|
+
getCellValue(row: any, key: string): any;
|
|
434
|
+
getAlignmentClass(column: PecbTableColumn): string;
|
|
435
|
+
onRowClick(row: any, index: number): void;
|
|
436
|
+
onRowAction(action: string, row: any, index: number, event: Event): void;
|
|
437
|
+
onHeaderClick(column: PecbTableColumn): void;
|
|
438
|
+
toggleRowSelection(index: number): void;
|
|
439
|
+
toggleAllSelection(): void;
|
|
440
|
+
isRowSelected(index: number): boolean;
|
|
441
|
+
isAllSelected(): boolean;
|
|
442
|
+
isSomeSelected(): boolean;
|
|
443
|
+
onPageChange(event: PageChangeEvent): void;
|
|
444
|
+
onPageSizeChange(newSize: number): void;
|
|
445
|
+
getSortState(column: PecbTableColumn): 'asc' | 'desc' | 'none';
|
|
446
|
+
trackByIndex(index: number): number;
|
|
447
|
+
trackByKey(_: number, column: PecbTableColumn): string;
|
|
448
|
+
getColumnType(column: PecbTableColumn): string;
|
|
449
|
+
getStatusType(value: any, column: PecbTableColumn): any;
|
|
450
|
+
getStatusVariant(column: PecbTableColumn): any;
|
|
451
|
+
getStatusSize(column: PecbTableColumn): any;
|
|
452
|
+
getUserData(row: any, column: PecbTableColumn): {
|
|
453
|
+
avatar: string;
|
|
454
|
+
name: string;
|
|
455
|
+
secondary: string;
|
|
456
|
+
};
|
|
457
|
+
getActions(column: PecbTableColumn): TableAction[];
|
|
458
|
+
onActionClick(action: TableAction, row: any, index: number, event: Event): void;
|
|
459
|
+
getDynamicComponentInputs(row: any, column: PecbTableColumn, index: number): Record<string, any>;
|
|
460
|
+
hasDynamicComponent(column: PecbTableColumn): boolean;
|
|
461
|
+
getSafeIcon(iconSvg: string | undefined): SafeHtml;
|
|
462
|
+
/**
|
|
463
|
+
* Builds a safe href from a URL string, prepending https:// if missing
|
|
464
|
+
*/
|
|
465
|
+
getLinkHref(value: string): string;
|
|
466
|
+
private emitSelectionChange;
|
|
467
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TableComponent, never>;
|
|
468
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TableComponent, "pecb-table", never, { "columns": { "alias": "columns"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "showHeader": { "alias": "showHeader"; "required": false; "isSignal": true; }; "hoverable": { "alias": "hoverable"; "required": false; "isSignal": true; }; "showPagination": { "alias": "showPagination"; "required": false; "isSignal": true; }; "totalItems": { "alias": "totalItems"; "required": false; "isSignal": true; }; "currentPage": { "alias": "currentPage"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "pageSizeOptions": { "alias": "pageSizeOptions"; "required": false; "isSignal": true; }; "showPageSizeSelector": { "alias": "showPageSizeSelector"; "required": false; "isSignal": true; }; "paginationVariant": { "alias": "paginationVariant"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "selectedIndices": { "alias": "selectedIndices"; "required": false; "isSignal": true; }; "stickyHeader": { "alias": "stickyHeader"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; "sortColumn": { "alias": "sortColumn"; "required": false; "isSignal": true; }; "sortDirection": { "alias": "sortDirection"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; }, { "currentPage": "currentPageChange"; "pageSize": "pageSizeChange"; "selectedIndices": "selectedIndicesChange"; "sortColumn": "sortColumnChange"; "sortDirection": "sortDirectionChange"; "pageChange": "pageChange"; "pageSizeChange": "pageSizeChange"; "rowClick": "rowClick"; "rowAction": "rowAction"; "sortChange": "sortChange"; "selectionChange": "selectionChange"; }, ["emptyTemplate", "loadingTemplate"], never, true, never>;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
type TabStyle = 'rounded' | 'line';
|
|
472
|
+
type TabSize = 'sm' | 'md';
|
|
473
|
+
declare class TabComponent {
|
|
474
|
+
id: _angular_core.InputSignal<string>;
|
|
475
|
+
tabStyle: _angular_core.InputSignal<TabStyle>;
|
|
476
|
+
size: _angular_core.InputSignal<TabSize>;
|
|
477
|
+
label: _angular_core.InputSignal<string>;
|
|
478
|
+
icon: _angular_core.InputSignal<number | undefined>;
|
|
479
|
+
active: _angular_core.InputSignal<boolean>;
|
|
480
|
+
disabled: _angular_core.InputSignal<boolean>;
|
|
481
|
+
closable: _angular_core.InputSignal<boolean>;
|
|
482
|
+
ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
483
|
+
ariaControls: _angular_core.InputSignal<string | undefined>;
|
|
484
|
+
ariaSelected: _angular_core.InputSignal<boolean | undefined>;
|
|
485
|
+
clicked: _angular_core.OutputEmitterRef<string>;
|
|
486
|
+
closed: _angular_core.OutputEmitterRef<string>;
|
|
487
|
+
get tabClasses(): string[];
|
|
488
|
+
onClick(event: MouseEvent): void;
|
|
489
|
+
onClose(event: MouseEvent): void;
|
|
490
|
+
onKeyDown(event: KeyboardEvent): void;
|
|
491
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TabComponent, never>;
|
|
492
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TabComponent, "pecb-tab", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "tabStyle": { "alias": "tabStyle"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "active": { "alias": "active"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "closable": { "alias": "closable"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaControls": { "alias": "ariaControls"; "required": false; "isSignal": true; }; "ariaSelected": { "alias": "ariaSelected"; "required": false; "isSignal": true; }; }, { "clicked": "clicked"; "closed": "closed"; }, never, never, true, never>;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
type DatepickerSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
496
|
+
interface CalendarDay {
|
|
497
|
+
date: Date;
|
|
498
|
+
day: number;
|
|
499
|
+
isCurrentMonth: boolean;
|
|
500
|
+
isSelected: boolean;
|
|
501
|
+
isToday: boolean;
|
|
502
|
+
}
|
|
503
|
+
declare class DatepickerComponent implements ControlValueAccessor {
|
|
504
|
+
private readonly elementRef;
|
|
505
|
+
inputElement?: ElementRef<HTMLInputElement>;
|
|
506
|
+
/**
|
|
507
|
+
* Unique ID for the datepicker element
|
|
508
|
+
*/
|
|
509
|
+
id: _angular_core.InputSignal<string>;
|
|
510
|
+
/**
|
|
511
|
+
* Label text to display above the input
|
|
512
|
+
*/
|
|
513
|
+
label: _angular_core.InputSignal<string | undefined>;
|
|
514
|
+
/**
|
|
515
|
+
* Placeholder text for the input
|
|
516
|
+
*/
|
|
517
|
+
placeholder: _angular_core.InputSignal<string>;
|
|
518
|
+
/**
|
|
519
|
+
* The size of the datepicker
|
|
520
|
+
*/
|
|
521
|
+
size: _angular_core.InputSignal<DatepickerSize>;
|
|
522
|
+
/**
|
|
523
|
+
* Width of the datepicker (any valid CSS value, e.g. '300px', '50%', '100%')
|
|
524
|
+
* Defaults to 100% via CSS
|
|
525
|
+
*/
|
|
526
|
+
width: _angular_core.InputSignal<string | undefined>;
|
|
527
|
+
/**
|
|
528
|
+
* Whether the field is required
|
|
529
|
+
*/
|
|
530
|
+
required: _angular_core.InputSignal<boolean>;
|
|
531
|
+
/**
|
|
532
|
+
* Whether the datepicker is disabled
|
|
533
|
+
*/
|
|
534
|
+
disabled: _angular_core.ModelSignal<boolean>;
|
|
535
|
+
/**
|
|
536
|
+
* Date format for display (default: MM/DD/YYYY)
|
|
537
|
+
*/
|
|
538
|
+
dateFormat: _angular_core.InputSignal<string>;
|
|
539
|
+
/**
|
|
540
|
+
* Minimum selectable date
|
|
541
|
+
*/
|
|
542
|
+
minDate: _angular_core.InputSignal<Date | undefined>;
|
|
543
|
+
/**
|
|
544
|
+
* Maximum selectable date
|
|
545
|
+
*/
|
|
546
|
+
maxDate: _angular_core.InputSignal<Date | undefined>;
|
|
547
|
+
/**
|
|
548
|
+
* Event emitted when date is selected
|
|
549
|
+
*/
|
|
550
|
+
dateChange: _angular_core.OutputEmitterRef<Date | null>;
|
|
551
|
+
/**
|
|
552
|
+
* Event emitted when calendar is opened
|
|
553
|
+
*/
|
|
554
|
+
opened: _angular_core.OutputEmitterRef<void>;
|
|
555
|
+
/**
|
|
556
|
+
* Event emitted when calendar is closed
|
|
557
|
+
*/
|
|
558
|
+
closed: _angular_core.OutputEmitterRef<void>;
|
|
559
|
+
selectedDate: _angular_core.WritableSignal<Date | null>;
|
|
560
|
+
isCalendarOpen: _angular_core.WritableSignal<boolean>;
|
|
561
|
+
currentMonth: _angular_core.WritableSignal<Date>;
|
|
562
|
+
calendarDays: _angular_core.WritableSignal<CalendarDay[]>;
|
|
563
|
+
weekDays: string[];
|
|
564
|
+
monthNames: string[];
|
|
565
|
+
private onChange;
|
|
566
|
+
private onTouched;
|
|
567
|
+
constructor();
|
|
568
|
+
get wrapperClasses(): string[];
|
|
569
|
+
get displayValue(): string;
|
|
570
|
+
get monthYearDisplay(): string;
|
|
571
|
+
toggleCalendar(): void;
|
|
572
|
+
closeCalendar(): void;
|
|
573
|
+
previousMonth(): void;
|
|
574
|
+
nextMonth(): void;
|
|
575
|
+
selectDate(day: CalendarDay): void;
|
|
576
|
+
clearDate(event: MouseEvent): void;
|
|
577
|
+
onDocumentClick(event: MouseEvent): void;
|
|
578
|
+
onKeyDown(event: KeyboardEvent): void;
|
|
579
|
+
private generateCalendar;
|
|
580
|
+
private formatDate;
|
|
581
|
+
writeValue(value: Date | null): void;
|
|
582
|
+
registerOnChange(fn: (value: Date | null) => void): void;
|
|
583
|
+
registerOnTouched(fn: () => void): void;
|
|
584
|
+
setDisabledState(isDisabled: boolean): void;
|
|
585
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DatepickerComponent, never>;
|
|
586
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DatepickerComponent, "pecb-datepicker", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "dateFormat": { "alias": "dateFormat"; "required": false; "isSignal": true; }; "minDate": { "alias": "minDate"; "required": false; "isSignal": true; }; "maxDate": { "alias": "maxDate"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; "dateChange": "dateChange"; "opened": "opened"; "closed": "closed"; }, never, never, true, never>;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
type InputType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search';
|
|
590
|
+
type InputSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
591
|
+
/**
|
|
592
|
+
* A professional input component with floating label and multiple types.
|
|
593
|
+
* Fully accessible with WCAG 2.1 AA compliance and reactive forms support.
|
|
594
|
+
*
|
|
595
|
+
* @example
|
|
596
|
+
* ```html
|
|
597
|
+
* <pecb-input
|
|
598
|
+
* label="Email"
|
|
599
|
+
* type="email"
|
|
600
|
+
* placeholder="Enter your email"
|
|
601
|
+
* [(ngModel)]="email"
|
|
602
|
+
* ></pecb-input>
|
|
603
|
+
*
|
|
604
|
+
* <!-- With predefined icon -->
|
|
605
|
+
* <pecb-input
|
|
606
|
+
* label="Email"
|
|
607
|
+
* type="email"
|
|
608
|
+
* icon="email"
|
|
609
|
+
* iconPosition="left"
|
|
610
|
+
* ></pecb-input>
|
|
611
|
+
*
|
|
612
|
+
* <!-- With custom SVG icon -->
|
|
613
|
+
* <pecb-input
|
|
614
|
+
* label="Phone"
|
|
615
|
+
* type="tel"
|
|
616
|
+
* [icon]="'<svg>...</svg>'"
|
|
617
|
+
* iconPosition="left"
|
|
618
|
+
* ></pecb-input>
|
|
619
|
+
*
|
|
620
|
+
* <!-- With error state -->
|
|
621
|
+
* <pecb-input
|
|
622
|
+
* label="Password"
|
|
623
|
+
* type="password"
|
|
624
|
+
* [error]="true"
|
|
625
|
+
* errorMessage="Password is required"
|
|
626
|
+
* ></pecb-input>
|
|
627
|
+
* ```
|
|
628
|
+
*
|
|
629
|
+
* @publicApi
|
|
630
|
+
*/
|
|
631
|
+
declare class InputComponent implements ControlValueAccessor {
|
|
632
|
+
private readonly sanitizer;
|
|
633
|
+
inputElement?: ElementRef<HTMLInputElement>;
|
|
634
|
+
/**
|
|
635
|
+
* Unique ID for the input element
|
|
636
|
+
*/
|
|
637
|
+
id: _angular_core.InputSignal<string>;
|
|
638
|
+
/**
|
|
639
|
+
* Input type
|
|
640
|
+
*/
|
|
641
|
+
type: _angular_core.InputSignal<InputType>;
|
|
642
|
+
/**
|
|
643
|
+
* Label text to display
|
|
644
|
+
*/
|
|
645
|
+
label: _angular_core.InputSignal<string | undefined>;
|
|
646
|
+
/**
|
|
647
|
+
* Placeholder text (shown when label is not present)
|
|
648
|
+
*/
|
|
649
|
+
placeholder: _angular_core.InputSignal<string>;
|
|
650
|
+
/**
|
|
651
|
+
* The size of the input
|
|
652
|
+
*/
|
|
653
|
+
size: _angular_core.InputSignal<InputSize>;
|
|
654
|
+
/**
|
|
655
|
+
* Width of the input wrapper — any valid CSS value e.g. '300px', '50%', '100%'
|
|
656
|
+
* Defaults to 100% (full width of parent)
|
|
657
|
+
*/
|
|
658
|
+
width: _angular_core.InputSignal<string | undefined>;
|
|
659
|
+
/**
|
|
660
|
+
* Whether the field is required
|
|
661
|
+
*/
|
|
662
|
+
required: _angular_core.InputSignal<boolean>;
|
|
663
|
+
/**
|
|
664
|
+
* Whether the input is disabled
|
|
665
|
+
*/
|
|
666
|
+
disabled: _angular_core.ModelSignal<boolean>;
|
|
667
|
+
/**
|
|
668
|
+
* Whether the input is readonly
|
|
669
|
+
*/
|
|
670
|
+
readonly: _angular_core.InputSignal<boolean>;
|
|
671
|
+
/**
|
|
672
|
+
* Whether to show error state
|
|
673
|
+
*/
|
|
674
|
+
error: _angular_core.InputSignal<boolean>;
|
|
675
|
+
/**
|
|
676
|
+
* Error message to display
|
|
677
|
+
*/
|
|
678
|
+
errorMessage: _angular_core.InputSignal<string | undefined>;
|
|
679
|
+
/**
|
|
680
|
+
* Helper text to display below input
|
|
681
|
+
*/
|
|
682
|
+
helperText: _angular_core.InputSignal<string | undefined>;
|
|
683
|
+
/**
|
|
684
|
+
* Icon to display - can be a predefined name ('email', 'search', 'user') or custom SVG string
|
|
685
|
+
*/
|
|
686
|
+
icon: _angular_core.InputSignal<string | undefined>;
|
|
687
|
+
/**
|
|
688
|
+
* Icon position (left or right)
|
|
689
|
+
*/
|
|
690
|
+
iconPosition: _angular_core.InputSignal<"left" | "right">;
|
|
691
|
+
/**
|
|
692
|
+
* Left icon name or HTML (deprecated - use icon with iconPosition instead)
|
|
693
|
+
*/
|
|
694
|
+
leftIcon: _angular_core.InputSignal<string | undefined>;
|
|
695
|
+
/**
|
|
696
|
+
* Right icon name or HTML (deprecated - use icon with iconPosition instead)
|
|
697
|
+
*/
|
|
698
|
+
rightIcon: _angular_core.InputSignal<string | undefined>;
|
|
699
|
+
/**
|
|
700
|
+
* Whether to show clear button
|
|
701
|
+
*/
|
|
702
|
+
clearable: _angular_core.InputSignal<boolean>;
|
|
703
|
+
/**
|
|
704
|
+
* Maximum length of input
|
|
705
|
+
*/
|
|
706
|
+
maxLength: _angular_core.InputSignal<number | undefined>;
|
|
707
|
+
/**
|
|
708
|
+
* Minimum value (for number type)
|
|
709
|
+
*/
|
|
710
|
+
min: _angular_core.InputSignal<number | undefined>;
|
|
711
|
+
/**
|
|
712
|
+
* Maximum value (for number type)
|
|
713
|
+
*/
|
|
714
|
+
max: _angular_core.InputSignal<number | undefined>;
|
|
715
|
+
/**
|
|
716
|
+
* Step value (for number type)
|
|
717
|
+
*/
|
|
718
|
+
step: _angular_core.InputSignal<number | undefined>;
|
|
719
|
+
/**
|
|
720
|
+
* Autocomplete attribute
|
|
721
|
+
*/
|
|
722
|
+
autocomplete: _angular_core.InputSignal<string | undefined>;
|
|
723
|
+
/**
|
|
724
|
+
* Show info icon next to the label
|
|
725
|
+
*/
|
|
726
|
+
showInfoIcon: _angular_core.InputSignal<boolean>;
|
|
727
|
+
/**
|
|
728
|
+
* Event emitted when value changes
|
|
729
|
+
*/
|
|
730
|
+
valueChange: _angular_core.OutputEmitterRef<string>;
|
|
731
|
+
/**
|
|
732
|
+
* Event emitted on blur
|
|
733
|
+
*/
|
|
734
|
+
blurred: _angular_core.OutputEmitterRef<void>;
|
|
735
|
+
/**
|
|
736
|
+
* Event emitted on focus
|
|
737
|
+
*/
|
|
738
|
+
focused: _angular_core.OutputEmitterRef<void>;
|
|
739
|
+
/**
|
|
740
|
+
* Event emitted when clear button is clicked
|
|
741
|
+
*/
|
|
742
|
+
cleared: _angular_core.OutputEmitterRef<void>;
|
|
743
|
+
value: _angular_core.WritableSignal<string>;
|
|
744
|
+
isFocused: _angular_core.WritableSignal<boolean>;
|
|
745
|
+
showPassword: _angular_core.WritableSignal<boolean>;
|
|
746
|
+
private onChange;
|
|
747
|
+
private onTouched;
|
|
748
|
+
get wrapperClasses(): string[];
|
|
749
|
+
get inputType(): string;
|
|
750
|
+
get showClearButton(): boolean;
|
|
751
|
+
get showPasswordToggle(): boolean;
|
|
752
|
+
get computedLeftIcon(): string | undefined;
|
|
753
|
+
get computedRightIcon(): string | undefined;
|
|
754
|
+
onInput(event: Event): void;
|
|
755
|
+
onFocus(): void;
|
|
756
|
+
onBlur(): void;
|
|
757
|
+
clearValue(event: MouseEvent): void;
|
|
758
|
+
togglePasswordVisibility(event: MouseEvent): void;
|
|
759
|
+
focus(): void;
|
|
760
|
+
sanitizeIcon(icon: string | undefined): SafeHtml;
|
|
761
|
+
writeValue(value: string): void;
|
|
762
|
+
registerOnChange(fn: (value: string) => void): void;
|
|
763
|
+
registerOnTouched(fn: () => void): void;
|
|
764
|
+
setDisabledState(isDisabled: boolean): void;
|
|
765
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<InputComponent, never>;
|
|
766
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<InputComponent, "pecb-input", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "helperText": { "alias": "helperText"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "iconPosition": { "alias": "iconPosition"; "required": false; "isSignal": true; }; "leftIcon": { "alias": "leftIcon"; "required": false; "isSignal": true; }; "rightIcon": { "alias": "rightIcon"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "maxLength": { "alias": "maxLength"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "autocomplete": { "alias": "autocomplete"; "required": false; "isSignal": true; }; "showInfoIcon": { "alias": "showInfoIcon"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; "valueChange": "valueChange"; "blurred": "blurred"; "focused": "focused"; "cleared": "cleared"; }, never, never, true, never>;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
type RadioVariant = 'dot' | 'filled';
|
|
770
|
+
type RadioLabelPosition = 'right' | 'left';
|
|
771
|
+
declare class RadioComponent implements ControlValueAccessor {
|
|
772
|
+
id: _angular_core.InputSignal<string>;
|
|
773
|
+
name: _angular_core.InputSignal<string | undefined>;
|
|
774
|
+
value: _angular_core.InputSignal<unknown>;
|
|
775
|
+
variant: _angular_core.InputSignal<RadioVariant>;
|
|
776
|
+
label: _angular_core.InputSignal<string | undefined>;
|
|
777
|
+
description: _angular_core.InputSignal<string | undefined>;
|
|
778
|
+
labelPosition: _angular_core.InputSignal<RadioLabelPosition>;
|
|
779
|
+
disabled: _angular_core.ModelSignal<boolean>;
|
|
780
|
+
selectionChange: _angular_core.OutputEmitterRef<unknown>;
|
|
781
|
+
checked: _angular_core.WritableSignal<boolean>;
|
|
782
|
+
private onChange;
|
|
783
|
+
private onTouched;
|
|
784
|
+
get wrapperClasses(): string[];
|
|
785
|
+
onRadioChange(event: Event): void;
|
|
786
|
+
onBlur(): void;
|
|
787
|
+
writeValue(value: unknown): void;
|
|
788
|
+
registerOnChange(fn: (value: unknown) => void): void;
|
|
789
|
+
registerOnTouched(fn: () => void): void;
|
|
790
|
+
setDisabledState(isDisabled: boolean): void;
|
|
791
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RadioComponent, never>;
|
|
792
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<RadioComponent, "pecb-radio", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "labelPosition": { "alias": "labelPosition"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; "selectionChange": "selectionChange"; }, never, never, true, never>;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
type CheckboxLabelPosition = 'right' | 'left';
|
|
796
|
+
declare class CheckboxComponent implements ControlValueAccessor {
|
|
797
|
+
id: _angular_core.InputSignal<string>;
|
|
798
|
+
name: _angular_core.InputSignal<string | undefined>;
|
|
799
|
+
label: _angular_core.InputSignal<string | undefined>;
|
|
800
|
+
description: _angular_core.InputSignal<string | undefined>;
|
|
801
|
+
labelPosition: _angular_core.InputSignal<CheckboxLabelPosition>;
|
|
802
|
+
disabled: _angular_core.ModelSignal<boolean>;
|
|
803
|
+
checkedChange: _angular_core.OutputEmitterRef<boolean>;
|
|
804
|
+
checked: _angular_core.WritableSignal<boolean>;
|
|
805
|
+
private onChange;
|
|
806
|
+
private onTouched;
|
|
807
|
+
get wrapperClasses(): string[];
|
|
808
|
+
onCheckboxChange(event: Event): void;
|
|
809
|
+
onBlur(): void;
|
|
810
|
+
writeValue(value: boolean): void;
|
|
811
|
+
registerOnChange(fn: (value: boolean) => void): void;
|
|
812
|
+
registerOnTouched(fn: () => void): void;
|
|
813
|
+
setDisabledState(isDisabled: boolean): void;
|
|
814
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CheckboxComponent, never>;
|
|
815
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CheckboxComponent, "pecb-checkbox", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "labelPosition": { "alias": "labelPosition"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; "checkedChange": "checkedChange"; }, never, never, true, never>;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
type ToggleLabelPosition = 'right' | 'left';
|
|
819
|
+
declare class ToggleComponent implements ControlValueAccessor {
|
|
820
|
+
id: _angular_core.InputSignal<string>;
|
|
821
|
+
name: _angular_core.InputSignal<string | undefined>;
|
|
822
|
+
label: _angular_core.InputSignal<string | undefined>;
|
|
823
|
+
description: _angular_core.InputSignal<string | undefined>;
|
|
824
|
+
labelPosition: _angular_core.InputSignal<ToggleLabelPosition>;
|
|
825
|
+
disabled: _angular_core.ModelSignal<boolean>;
|
|
826
|
+
toggleChange: _angular_core.OutputEmitterRef<boolean>;
|
|
827
|
+
checked: _angular_core.WritableSignal<boolean>;
|
|
828
|
+
private onChange;
|
|
829
|
+
private onTouched;
|
|
830
|
+
get wrapperClasses(): string[];
|
|
831
|
+
onToggleChange(event: Event): void;
|
|
832
|
+
onBlur(): void;
|
|
833
|
+
writeValue(value: boolean): void;
|
|
834
|
+
registerOnChange(fn: (value: boolean) => void): void;
|
|
835
|
+
registerOnTouched(fn: () => void): void;
|
|
836
|
+
setDisabledState(isDisabled: boolean): void;
|
|
837
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ToggleComponent, never>;
|
|
838
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ToggleComponent, "pecb-toggle", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "labelPosition": { "alias": "labelPosition"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; "toggleChange": "toggleChange"; }, never, never, true, never>;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
interface DropdownOption {
|
|
842
|
+
label: string;
|
|
843
|
+
value: unknown;
|
|
844
|
+
disabled?: boolean;
|
|
845
|
+
}
|
|
846
|
+
type DropdownSize = 'sm' | 'md' | 'lg';
|
|
847
|
+
declare class DropdownComponent implements ControlValueAccessor {
|
|
848
|
+
searchInput?: ElementRef<HTMLInputElement>;
|
|
849
|
+
private readonly elementRef;
|
|
850
|
+
id: _angular_core.InputSignal<string>;
|
|
851
|
+
label: _angular_core.InputSignal<string | undefined>;
|
|
852
|
+
size: _angular_core.InputSignal<DropdownSize>;
|
|
853
|
+
options: _angular_core.InputSignal<DropdownOption[]>;
|
|
854
|
+
multiple: _angular_core.InputSignal<boolean>;
|
|
855
|
+
searchable: _angular_core.InputSignal<boolean>;
|
|
856
|
+
maxHeight: _angular_core.InputSignal<number>;
|
|
857
|
+
disabled: _angular_core.ModelSignal<boolean>;
|
|
858
|
+
required: _angular_core.InputSignal<boolean>;
|
|
859
|
+
error: _angular_core.InputSignal<boolean>;
|
|
860
|
+
errorMessage: _angular_core.InputSignal<string | undefined>;
|
|
861
|
+
helperText: _angular_core.InputSignal<string | undefined>;
|
|
862
|
+
selectionChange: _angular_core.OutputEmitterRef<unknown>;
|
|
863
|
+
isOpen: _angular_core.WritableSignal<boolean>;
|
|
864
|
+
searchQuery: _angular_core.WritableSignal<string>;
|
|
865
|
+
selectedValues: _angular_core.WritableSignal<unknown[]>;
|
|
866
|
+
focusedIndex: _angular_core.WritableSignal<number>;
|
|
867
|
+
private onChange;
|
|
868
|
+
private onTouched;
|
|
869
|
+
get wrapperClasses(): string[];
|
|
870
|
+
get hasValue(): boolean;
|
|
871
|
+
get filteredOptions(): DropdownOption[];
|
|
872
|
+
get displayText(): string;
|
|
873
|
+
clearAll(event: MouseEvent): void;
|
|
874
|
+
toggleDropdown(): void;
|
|
875
|
+
selectOption(option: DropdownOption): void;
|
|
876
|
+
isSelected(option: DropdownOption): boolean;
|
|
877
|
+
onSearchInput(event: Event): void;
|
|
878
|
+
onKeyDown(event: KeyboardEvent): void;
|
|
879
|
+
onDocumentClick(event: MouseEvent): void;
|
|
880
|
+
writeValue(value: unknown): void;
|
|
881
|
+
registerOnChange(fn: (value: unknown) => void): void;
|
|
882
|
+
registerOnTouched(fn: () => void): void;
|
|
883
|
+
setDisabledState(isDisabled: boolean): void;
|
|
884
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DropdownComponent, never>;
|
|
885
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DropdownComponent, "pecb-dropdown", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "searchable": { "alias": "searchable"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "helperText": { "alias": "helperText"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; "selectionChange": "selectionChange"; }, never, never, true, never>;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
type RightModalSize = 'sm' | 'md' | 'lg';
|
|
889
|
+
declare class RightModalComponent implements OnInit, OnDestroy, AfterViewInit {
|
|
890
|
+
id: _angular_core.InputSignal<string>;
|
|
891
|
+
isOpen: _angular_core.InputSignal<boolean>;
|
|
892
|
+
size: _angular_core.InputSignal<RightModalSize>;
|
|
893
|
+
closeOnBackdropClick: _angular_core.InputSignal<boolean>;
|
|
894
|
+
closeOnEscape: _angular_core.InputSignal<boolean>;
|
|
895
|
+
showCloseButton: _angular_core.InputSignal<boolean>;
|
|
896
|
+
ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
897
|
+
ariaLabelledBy: _angular_core.InputSignal<string | undefined>;
|
|
898
|
+
ariaDescribedBy: _angular_core.InputSignal<string | undefined>;
|
|
899
|
+
closed: _angular_core.OutputEmitterRef<void>;
|
|
900
|
+
opened: _angular_core.OutputEmitterRef<void>;
|
|
901
|
+
modalPanel: ElementRef<HTMLElement>;
|
|
902
|
+
private cleanupFocusTrap;
|
|
903
|
+
private cleanupBodyScroll;
|
|
904
|
+
private previousActiveElement;
|
|
905
|
+
ngOnInit(): void;
|
|
906
|
+
ngAfterViewInit(): void;
|
|
907
|
+
ngOnDestroy(): void;
|
|
908
|
+
get modalClasses(): string[];
|
|
909
|
+
get panelClasses(): string[];
|
|
910
|
+
onBackdropClick(event: MouseEvent): void;
|
|
911
|
+
onKeydown(event: KeyboardEvent): void;
|
|
912
|
+
close(): void;
|
|
913
|
+
private onOpen;
|
|
914
|
+
private setupFocusTrap;
|
|
915
|
+
private cleanup;
|
|
916
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RightModalComponent, never>;
|
|
917
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<RightModalComponent, "pecb-right-modal", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "isOpen": { "alias": "isOpen"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "closeOnBackdropClick": { "alias": "closeOnBackdropClick"; "required": false; "isSignal": true; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; "isSignal": true; }; "showCloseButton": { "alias": "showCloseButton"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; "isSignal": true; }; "ariaDescribedBy": { "alias": "ariaDescribedBy"; "required": false; "isSignal": true; }; }, { "closed": "closed"; "opened": "opened"; }, never, ["[pecbRightModalHeader]", "[pecbRightModalContent]", "*", "[pecbRightModalFooter]"], true, never>;
|
|
918
|
+
}
|
|
919
|
+
declare class RightModalHeaderDirective {
|
|
920
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RightModalHeaderDirective, never>;
|
|
921
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RightModalHeaderDirective, "[pecbRightModalHeader]", never, {}, {}, never, never, true, never>;
|
|
922
|
+
}
|
|
923
|
+
declare class RightModalContentDirective {
|
|
924
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RightModalContentDirective, never>;
|
|
925
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RightModalContentDirective, "[pecbRightModalContent]", never, {}, {}, never, never, true, never>;
|
|
926
|
+
}
|
|
927
|
+
declare class RightModalFooterDirective {
|
|
928
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RightModalFooterDirective, never>;
|
|
929
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RightModalFooterDirective, "[pecbRightModalFooter]", never, {}, {}, never, never, true, never>;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
interface SidebarMenuItem {
|
|
933
|
+
id: string;
|
|
934
|
+
label: string;
|
|
935
|
+
icon?: string;
|
|
936
|
+
route?: string;
|
|
937
|
+
active?: boolean;
|
|
938
|
+
children?: SidebarMenuItem[];
|
|
939
|
+
expanded?: boolean;
|
|
940
|
+
}
|
|
941
|
+
interface SidebarSection {
|
|
942
|
+
id: string;
|
|
943
|
+
title?: string;
|
|
944
|
+
items: SidebarMenuItem[];
|
|
945
|
+
}
|
|
946
|
+
declare class SidebarComponent {
|
|
947
|
+
private readonly sanitizer;
|
|
948
|
+
sections: _angular_core.InputSignal<SidebarSection[]>;
|
|
949
|
+
showHeader: _angular_core.InputSignal<boolean>;
|
|
950
|
+
logoSrc: _angular_core.InputSignal<string | undefined>;
|
|
951
|
+
sidebarLogo: _angular_core.InputSignal<string | undefined>;
|
|
952
|
+
collapsedLogo: _angular_core.InputSignal<string | undefined>;
|
|
953
|
+
showFooter: _angular_core.InputSignal<boolean>;
|
|
954
|
+
collapsed: _angular_core.ModelSignal<boolean>;
|
|
955
|
+
itemClick: _angular_core.OutputEmitterRef<SidebarMenuItem>;
|
|
956
|
+
collapseChange: _angular_core.OutputEmitterRef<boolean>;
|
|
957
|
+
activePopupItem: _angular_core.WritableSignal<SidebarMenuItem | null>;
|
|
958
|
+
popupTopPosition: _angular_core.WritableSignal<number>;
|
|
959
|
+
onItemClick(item: SidebarMenuItem, event: Event): void;
|
|
960
|
+
closePopup(): void;
|
|
961
|
+
onPopupItemClick(child: SidebarMenuItem, event: Event): void;
|
|
962
|
+
toggleCollapse(): void;
|
|
963
|
+
getSafeIcon(icon: string): SafeHtml;
|
|
964
|
+
trackBySection(_index: number, section: SidebarSection): string;
|
|
965
|
+
trackByItem(_index: number, item: SidebarMenuItem): string;
|
|
966
|
+
hasActiveDescendant(item: SidebarMenuItem): boolean;
|
|
967
|
+
getItemClasses(item: SidebarMenuItem, isChild?: boolean, isNested?: boolean): string[];
|
|
968
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarComponent, never>;
|
|
969
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SidebarComponent, "pecb-sidebar", never, { "sections": { "alias": "sections"; "required": false; "isSignal": true; }; "showHeader": { "alias": "showHeader"; "required": false; "isSignal": true; }; "logoSrc": { "alias": "logoSrc"; "required": false; "isSignal": true; }; "sidebarLogo": { "alias": "sidebarLogo"; "required": false; "isSignal": true; }; "collapsedLogo": { "alias": "collapsedLogo"; "required": false; "isSignal": true; }; "showFooter": { "alias": "showFooter"; "required": false; "isSignal": true; }; "collapsed": { "alias": "collapsed"; "required": false; "isSignal": true; }; }, { "collapsed": "collapsedChange"; "itemClick": "itemClick"; "collapseChange": "collapseChange"; }, never, ["[sidebar-header]", "[sidebar-footer]"], true, never>;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
type ConfirmationIconType = 'success' | 'warning' | 'error' | 'info';
|
|
973
|
+
declare class ConfirmationComponent implements OnInit, OnDestroy, AfterViewInit {
|
|
974
|
+
id: _angular_core.InputSignal<string>;
|
|
975
|
+
isOpen: _angular_core.InputSignal<boolean>;
|
|
976
|
+
title: _angular_core.InputSignal<string>;
|
|
977
|
+
message: _angular_core.InputSignal<string>;
|
|
978
|
+
confirmText: _angular_core.InputSignal<string>;
|
|
979
|
+
cancelText: _angular_core.InputSignal<string>;
|
|
980
|
+
iconType: _angular_core.InputSignal<ConfirmationIconType>;
|
|
981
|
+
showCloseButton: _angular_core.InputSignal<boolean>;
|
|
982
|
+
closeOnBackdropClick: _angular_core.InputSignal<boolean>;
|
|
983
|
+
closeOnEscape: _angular_core.InputSignal<boolean>;
|
|
984
|
+
ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
985
|
+
ariaDescribedBy: _angular_core.InputSignal<string | undefined>;
|
|
986
|
+
confirmed: _angular_core.OutputEmitterRef<void>;
|
|
987
|
+
cancelled: _angular_core.OutputEmitterRef<void>;
|
|
988
|
+
closed: _angular_core.OutputEmitterRef<void>;
|
|
989
|
+
dialogPanel: ElementRef<HTMLElement>;
|
|
990
|
+
private cleanupFocusTrap;
|
|
991
|
+
private cleanupBodyScroll;
|
|
992
|
+
private previousActiveElement;
|
|
993
|
+
ngOnInit(): void;
|
|
994
|
+
ngAfterViewInit(): void;
|
|
995
|
+
ngOnDestroy(): void;
|
|
996
|
+
get dialogClasses(): string[];
|
|
997
|
+
get iconContainerClass(): string;
|
|
998
|
+
get titleId(): string;
|
|
999
|
+
get messageId(): string;
|
|
1000
|
+
onBackdropClick(event: MouseEvent): void;
|
|
1001
|
+
onKeydown(event: KeyboardEvent): void;
|
|
1002
|
+
onConfirm(): void;
|
|
1003
|
+
onCancel(): void;
|
|
1004
|
+
close(): void;
|
|
1005
|
+
private onOpen;
|
|
1006
|
+
private setupFocusTrap;
|
|
1007
|
+
private cleanup;
|
|
1008
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ConfirmationComponent, never>;
|
|
1009
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ConfirmationComponent, "pecb-confirmation", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "isOpen": { "alias": "isOpen"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "message": { "alias": "message"; "required": false; "isSignal": true; }; "confirmText": { "alias": "confirmText"; "required": false; "isSignal": true; }; "cancelText": { "alias": "cancelText"; "required": false; "isSignal": true; }; "iconType": { "alias": "iconType"; "required": false; "isSignal": true; }; "showCloseButton": { "alias": "showCloseButton"; "required": false; "isSignal": true; }; "closeOnBackdropClick": { "alias": "closeOnBackdropClick"; "required": false; "isSignal": true; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaDescribedBy": { "alias": "ariaDescribedBy"; "required": false; "isSignal": true; }; }, { "confirmed": "confirmed"; "cancelled": "cancelled"; "closed": "closed"; }, never, never, true, never>;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
/**
|
|
1013
|
+
* PECB UI Components Module
|
|
1014
|
+
*
|
|
1015
|
+
* A professional Angular components library with TypeScript and SCSS.
|
|
1016
|
+
* Import this module to use all PECB UI components in your application.
|
|
1017
|
+
*
|
|
1018
|
+
* @example
|
|
1019
|
+
* ```typescript
|
|
1020
|
+
* import { PecbComponentsModule } from '@pecb-ui/components';
|
|
1021
|
+
*
|
|
1022
|
+
* @NgModule({
|
|
1023
|
+
* imports: [PecbComponentsModule]
|
|
1024
|
+
* })
|
|
1025
|
+
* export class AppModule { }
|
|
1026
|
+
* ```
|
|
1027
|
+
*/
|
|
1028
|
+
declare class PecbComponentsModule {
|
|
1029
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PecbComponentsModule, never>;
|
|
1030
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<PecbComponentsModule, never, [typeof i1.CommonModule, typeof ButtonComponent, typeof CardComponent, typeof CardHeaderComponent, typeof CardBodyComponent, typeof CardFooterComponent, typeof StatusComponent, typeof PaginationComponent, typeof TableComponent, typeof TabComponent, typeof DatepickerComponent, typeof InputComponent, typeof RadioComponent, typeof CheckboxComponent, typeof ToggleComponent, typeof DropdownComponent, typeof RightModalComponent, typeof RightModalHeaderDirective, typeof RightModalContentDirective, typeof RightModalFooterDirective, typeof SidebarComponent, typeof ConfirmationComponent], [typeof ButtonComponent, typeof CardComponent, typeof CardHeaderComponent, typeof CardBodyComponent, typeof CardFooterComponent, typeof StatusComponent, typeof PaginationComponent, typeof TableComponent, typeof TabComponent, typeof DatepickerComponent, typeof InputComponent, typeof RadioComponent, typeof CheckboxComponent, typeof ToggleComponent, typeof DropdownComponent, typeof RightModalComponent, typeof RightModalHeaderDirective, typeof RightModalContentDirective, typeof RightModalFooterDirective, typeof SidebarComponent, typeof ConfirmationComponent]>;
|
|
1031
|
+
static ɵinj: _angular_core.ɵɵInjectorDeclaration<PecbComponentsModule>;
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
type AlertType = 'info' | 'success' | 'warning' | 'error';
|
|
1035
|
+
type AlertVariant = 'banner' | 'filled';
|
|
1036
|
+
declare class AlertComponent {
|
|
1037
|
+
type: _angular_core.InputSignal<AlertType>;
|
|
1038
|
+
variant: _angular_core.InputSignal<AlertVariant>;
|
|
1039
|
+
title: _angular_core.InputSignal<string>;
|
|
1040
|
+
message: _angular_core.InputSignal<string>;
|
|
1041
|
+
dismissible: _angular_core.InputSignal<boolean>;
|
|
1042
|
+
primaryAction: _angular_core.InputSignal<string | undefined>;
|
|
1043
|
+
secondaryAction: _angular_core.InputSignal<string | undefined>;
|
|
1044
|
+
dismissed: _angular_core.OutputEmitterRef<void>;
|
|
1045
|
+
primaryActionClick: _angular_core.OutputEmitterRef<void>;
|
|
1046
|
+
secondaryActionClick: _angular_core.OutputEmitterRef<void>;
|
|
1047
|
+
get hasActions(): boolean;
|
|
1048
|
+
get hostClasses(): string;
|
|
1049
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AlertComponent, never>;
|
|
1050
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AlertComponent, "pecb-alert", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "message": { "alias": "message"; "required": false; "isSignal": true; }; "dismissible": { "alias": "dismissible"; "required": false; "isSignal": true; }; "primaryAction": { "alias": "primaryAction"; "required": false; "isSignal": true; }; "secondaryAction": { "alias": "secondaryAction"; "required": false; "isSignal": true; }; }, { "dismissed": "dismissed"; "primaryActionClick": "primaryActionClick"; "secondaryActionClick": "secondaryActionClick"; }, never, never, true, never>;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
/**
|
|
1054
|
+
* Notification types supported by the service
|
|
1055
|
+
*/
|
|
1056
|
+
type NotificationType = 'success' | 'error' | 'warning' | 'info';
|
|
1057
|
+
/**
|
|
1058
|
+
* Notification position on screen
|
|
1059
|
+
*/
|
|
1060
|
+
type NotificationPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center';
|
|
1061
|
+
/**
|
|
1062
|
+
* Notification configuration options
|
|
1063
|
+
*/
|
|
1064
|
+
interface NotificationConfig {
|
|
1065
|
+
/** Notification message */
|
|
1066
|
+
message: string;
|
|
1067
|
+
/** Notification title (optional) */
|
|
1068
|
+
title?: string;
|
|
1069
|
+
/** Type of notification */
|
|
1070
|
+
type: NotificationType;
|
|
1071
|
+
/** Duration in milliseconds (0 for persistent) */
|
|
1072
|
+
duration?: number;
|
|
1073
|
+
/** Whether the notification can be dismissed */
|
|
1074
|
+
dismissible?: boolean;
|
|
1075
|
+
/** Position on screen */
|
|
1076
|
+
position?: NotificationPosition;
|
|
1077
|
+
/** Custom CSS class */
|
|
1078
|
+
customClass?: string;
|
|
1079
|
+
/** Unique identifier */
|
|
1080
|
+
id?: string;
|
|
1081
|
+
}
|
|
1082
|
+
/**
|
|
1083
|
+
* Notification object with all properties
|
|
1084
|
+
*/
|
|
1085
|
+
interface Notification extends Required<Omit<NotificationConfig, 'title' | 'customClass'>> {
|
|
1086
|
+
title?: string;
|
|
1087
|
+
customClass?: string;
|
|
1088
|
+
timestamp: Date;
|
|
1089
|
+
}
|
|
1090
|
+
/**
|
|
1091
|
+
* A stateless, injectable notification service for displaying toast notifications.
|
|
1092
|
+
*
|
|
1093
|
+
* This service provides a reactive way to manage notifications across the application.
|
|
1094
|
+
* It uses RxJS Subjects to emit notification events that can be consumed by notification
|
|
1095
|
+
* display components.
|
|
1096
|
+
*
|
|
1097
|
+
* @example
|
|
1098
|
+
* ```typescript
|
|
1099
|
+
* import { NotificationService } from '@pecb-ui/components';
|
|
1100
|
+
*
|
|
1101
|
+
* @Component({...})
|
|
1102
|
+
* export class MyComponent {
|
|
1103
|
+
* constructor(private notificationService: NotificationService) {}
|
|
1104
|
+
*
|
|
1105
|
+
* showSuccess(): void {
|
|
1106
|
+
* this.notificationService.success('Operation completed successfully!');
|
|
1107
|
+
* }
|
|
1108
|
+
*
|
|
1109
|
+
* showError(): void {
|
|
1110
|
+
* this.notificationService.error('An error occurred', 'Error Title');
|
|
1111
|
+
* }
|
|
1112
|
+
* }
|
|
1113
|
+
* ```
|
|
1114
|
+
*
|
|
1115
|
+
* @publicApi
|
|
1116
|
+
*/
|
|
1117
|
+
declare class NotificationService {
|
|
1118
|
+
private readonly notificationSubject;
|
|
1119
|
+
private readonly dismissSubject;
|
|
1120
|
+
private readonly clearSubject;
|
|
1121
|
+
/** Default duration for notifications in milliseconds */
|
|
1122
|
+
private readonly defaultDuration;
|
|
1123
|
+
/** Default position for notifications */
|
|
1124
|
+
private readonly defaultPosition;
|
|
1125
|
+
/**
|
|
1126
|
+
* Observable stream of notifications
|
|
1127
|
+
*/
|
|
1128
|
+
get notifications$(): Observable<Notification>;
|
|
1129
|
+
/**
|
|
1130
|
+
* Observable stream of dismissed notification IDs
|
|
1131
|
+
*/
|
|
1132
|
+
get dismiss$(): Observable<string>;
|
|
1133
|
+
/**
|
|
1134
|
+
* Observable stream for clear all events
|
|
1135
|
+
*/
|
|
1136
|
+
get clear$(): Observable<void>;
|
|
1137
|
+
/**
|
|
1138
|
+
* Show a success notification
|
|
1139
|
+
* @param message - The notification message
|
|
1140
|
+
* @param title - Optional title
|
|
1141
|
+
* @param config - Optional additional configuration
|
|
1142
|
+
*/
|
|
1143
|
+
success(message: string, title?: string, config?: Partial<NotificationConfig>): string;
|
|
1144
|
+
/**
|
|
1145
|
+
* Show an error notification
|
|
1146
|
+
* @param message - The notification message
|
|
1147
|
+
* @param title - Optional title
|
|
1148
|
+
* @param config - Optional additional configuration
|
|
1149
|
+
*/
|
|
1150
|
+
error(message: string, title?: string, config?: Partial<NotificationConfig>): string;
|
|
1151
|
+
/**
|
|
1152
|
+
* Show a warning notification
|
|
1153
|
+
* @param message - The notification message
|
|
1154
|
+
* @param title - Optional title
|
|
1155
|
+
* @param config - Optional additional configuration
|
|
1156
|
+
*/
|
|
1157
|
+
warning(message: string, title?: string, config?: Partial<NotificationConfig>): string;
|
|
1158
|
+
/**
|
|
1159
|
+
* Show an info notification
|
|
1160
|
+
* @param message - The notification message
|
|
1161
|
+
* @param title - Optional title
|
|
1162
|
+
* @param config - Optional additional configuration
|
|
1163
|
+
*/
|
|
1164
|
+
info(message: string, title?: string, config?: Partial<NotificationConfig>): string;
|
|
1165
|
+
/**
|
|
1166
|
+
* Show a notification with custom configuration
|
|
1167
|
+
* @param config - Full notification configuration
|
|
1168
|
+
* @returns The notification ID
|
|
1169
|
+
*/
|
|
1170
|
+
show(config: NotificationConfig): string;
|
|
1171
|
+
/**
|
|
1172
|
+
* Dismiss a specific notification by ID
|
|
1173
|
+
* @param id - The notification ID to dismiss
|
|
1174
|
+
*/
|
|
1175
|
+
dismiss(id: string): void;
|
|
1176
|
+
/**
|
|
1177
|
+
* Clear all notifications
|
|
1178
|
+
*/
|
|
1179
|
+
clearAll(): void;
|
|
1180
|
+
/**
|
|
1181
|
+
* Generate a unique notification ID
|
|
1182
|
+
*/
|
|
1183
|
+
private generateId;
|
|
1184
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NotificationService, never>;
|
|
1185
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<NotificationService>;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
/**
|
|
1189
|
+
* Available theme modes
|
|
1190
|
+
*/
|
|
1191
|
+
type ThemeMode = 'light' | 'dark' | 'system';
|
|
1192
|
+
/**
|
|
1193
|
+
* Theme configuration interface
|
|
1194
|
+
*/
|
|
1195
|
+
interface ThemeConfig {
|
|
1196
|
+
/** Current theme mode */
|
|
1197
|
+
mode: ThemeMode;
|
|
1198
|
+
/** Resolved theme (light or dark, never system) */
|
|
1199
|
+
resolvedTheme: 'light' | 'dark';
|
|
1200
|
+
/** CSS class to apply to the document */
|
|
1201
|
+
cssClass: string;
|
|
1202
|
+
}
|
|
1203
|
+
/**
|
|
1204
|
+
* Custom theme variables that can be overridden
|
|
1205
|
+
*/
|
|
1206
|
+
interface ThemeVariables {
|
|
1207
|
+
/** Primary color */
|
|
1208
|
+
primaryColor?: string;
|
|
1209
|
+
/** Secondary color */
|
|
1210
|
+
secondaryColor?: string;
|
|
1211
|
+
/** Background color */
|
|
1212
|
+
backgroundColor?: string;
|
|
1213
|
+
/** Text color */
|
|
1214
|
+
textColor?: string;
|
|
1215
|
+
/** Border radius */
|
|
1216
|
+
borderRadius?: string;
|
|
1217
|
+
/** Font family */
|
|
1218
|
+
fontFamily?: string;
|
|
1219
|
+
/** Custom CSS variables */
|
|
1220
|
+
[key: string]: string | undefined;
|
|
1221
|
+
}
|
|
1222
|
+
/**
|
|
1223
|
+
* A stateless, injectable theme service for managing application themes.
|
|
1224
|
+
*
|
|
1225
|
+
* This service provides reactive theme management with support for light/dark modes,
|
|
1226
|
+
* system preference detection, and custom CSS variable overrides.
|
|
1227
|
+
*
|
|
1228
|
+
* @example
|
|
1229
|
+
* ```typescript
|
|
1230
|
+
* import { ThemeService } from '@pecb-ui/components';
|
|
1231
|
+
*
|
|
1232
|
+
* @Component({...})
|
|
1233
|
+
* export class MyComponent {
|
|
1234
|
+
* constructor(private themeService: ThemeService) {}
|
|
1235
|
+
*
|
|
1236
|
+
* toggleTheme(): void {
|
|
1237
|
+
* this.themeService.toggleTheme();
|
|
1238
|
+
* }
|
|
1239
|
+
*
|
|
1240
|
+
* setDarkMode(): void {
|
|
1241
|
+
* this.themeService.setTheme('dark');
|
|
1242
|
+
* }
|
|
1243
|
+
* }
|
|
1244
|
+
* ```
|
|
1245
|
+
*
|
|
1246
|
+
* @publicApi
|
|
1247
|
+
*/
|
|
1248
|
+
declare class ThemeService {
|
|
1249
|
+
private readonly themeSubject;
|
|
1250
|
+
private readonly isBrowser;
|
|
1251
|
+
private mediaQuery;
|
|
1252
|
+
constructor(platformId: object);
|
|
1253
|
+
/**
|
|
1254
|
+
* Observable stream of theme configuration changes
|
|
1255
|
+
*/
|
|
1256
|
+
get theme$(): Observable<ThemeConfig>;
|
|
1257
|
+
/**
|
|
1258
|
+
* Get the current theme configuration
|
|
1259
|
+
*/
|
|
1260
|
+
get currentTheme(): ThemeConfig;
|
|
1261
|
+
/**
|
|
1262
|
+
* Get the current theme mode
|
|
1263
|
+
*/
|
|
1264
|
+
get currentMode(): ThemeMode;
|
|
1265
|
+
/**
|
|
1266
|
+
* Check if the current resolved theme is dark
|
|
1267
|
+
*/
|
|
1268
|
+
get isDarkMode(): boolean;
|
|
1269
|
+
/**
|
|
1270
|
+
* Set the theme mode
|
|
1271
|
+
* @param mode - The theme mode to set (light, dark, or system)
|
|
1272
|
+
*/
|
|
1273
|
+
setTheme(mode: ThemeMode): void;
|
|
1274
|
+
/**
|
|
1275
|
+
* Toggle between light and dark themes
|
|
1276
|
+
* If currently using system preference, switches to the opposite of the resolved theme
|
|
1277
|
+
*/
|
|
1278
|
+
toggleTheme(): void;
|
|
1279
|
+
/**
|
|
1280
|
+
* Reset to system preference
|
|
1281
|
+
*/
|
|
1282
|
+
useSystemTheme(): void;
|
|
1283
|
+
/**
|
|
1284
|
+
* Apply custom CSS variables to the document
|
|
1285
|
+
* @param variables - Object containing CSS variable overrides
|
|
1286
|
+
*/
|
|
1287
|
+
setCustomVariables(variables: ThemeVariables): void;
|
|
1288
|
+
/**
|
|
1289
|
+
* Remove custom CSS variables from the document
|
|
1290
|
+
* @param variableNames - Array of variable names to remove
|
|
1291
|
+
*/
|
|
1292
|
+
removeCustomVariables(variableNames: string[]): void;
|
|
1293
|
+
/**
|
|
1294
|
+
* Get the initial theme from storage or system preference
|
|
1295
|
+
*/
|
|
1296
|
+
private getInitialTheme;
|
|
1297
|
+
/**
|
|
1298
|
+
* Create a theme configuration object
|
|
1299
|
+
*/
|
|
1300
|
+
private createThemeConfig;
|
|
1301
|
+
/**
|
|
1302
|
+
* Resolve the actual theme from mode (handles 'system' mode)
|
|
1303
|
+
*/
|
|
1304
|
+
private resolveTheme;
|
|
1305
|
+
/**
|
|
1306
|
+
* Get the system color scheme preference
|
|
1307
|
+
*/
|
|
1308
|
+
private getSystemPreference;
|
|
1309
|
+
/**
|
|
1310
|
+
* Setup listener for system theme changes
|
|
1311
|
+
*/
|
|
1312
|
+
private setupSystemThemeListener;
|
|
1313
|
+
/**
|
|
1314
|
+
* Apply the theme to the document
|
|
1315
|
+
*/
|
|
1316
|
+
private applyTheme;
|
|
1317
|
+
/**
|
|
1318
|
+
* Persist theme preference to storage
|
|
1319
|
+
*/
|
|
1320
|
+
private persistTheme;
|
|
1321
|
+
/**
|
|
1322
|
+
* Convert camelCase property name to CSS variable name
|
|
1323
|
+
*/
|
|
1324
|
+
private toCssVariableName;
|
|
1325
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ThemeService, never>;
|
|
1326
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ThemeService>;
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
/**
|
|
1330
|
+
* Loading state for a specific operation
|
|
1331
|
+
*/
|
|
1332
|
+
interface LoadingState {
|
|
1333
|
+
/** Unique identifier for the loading operation */
|
|
1334
|
+
id: string;
|
|
1335
|
+
/** Whether this operation is currently loading */
|
|
1336
|
+
isLoading: boolean;
|
|
1337
|
+
/** Optional message to display */
|
|
1338
|
+
message?: string;
|
|
1339
|
+
/** Optional progress percentage (0-100) */
|
|
1340
|
+
progress?: number;
|
|
1341
|
+
}
|
|
1342
|
+
/**
|
|
1343
|
+
* A stateless, injectable loading service for managing loading states.
|
|
1344
|
+
*
|
|
1345
|
+
* This service provides a centralized way to track loading states across
|
|
1346
|
+
* the application, supporting multiple concurrent loading operations with
|
|
1347
|
+
* individual tracking capabilities.
|
|
1348
|
+
*
|
|
1349
|
+
* @example
|
|
1350
|
+
* ```typescript
|
|
1351
|
+
* import { LoadingService } from '@pecb-ui/components';
|
|
1352
|
+
*
|
|
1353
|
+
* @Component({...})
|
|
1354
|
+
* export class MyComponent {
|
|
1355
|
+
* isLoading$ = this.loadingService.isLoading$('my-operation');
|
|
1356
|
+
*
|
|
1357
|
+
* constructor(private loadingService: LoadingService) {}
|
|
1358
|
+
*
|
|
1359
|
+
* async loadData(): Promise<void> {
|
|
1360
|
+
* this.loadingService.start('my-operation', 'Loading data...');
|
|
1361
|
+
* try {
|
|
1362
|
+
* await this.fetchData();
|
|
1363
|
+
* } finally {
|
|
1364
|
+
* this.loadingService.stop('my-operation');
|
|
1365
|
+
* }
|
|
1366
|
+
* }
|
|
1367
|
+
* }
|
|
1368
|
+
* ```
|
|
1369
|
+
*
|
|
1370
|
+
* @publicApi
|
|
1371
|
+
*/
|
|
1372
|
+
declare class LoadingService {
|
|
1373
|
+
private readonly loadingStates;
|
|
1374
|
+
private readonly statesSubject;
|
|
1375
|
+
/** Default loading operation ID */
|
|
1376
|
+
private readonly defaultId;
|
|
1377
|
+
/**
|
|
1378
|
+
* Observable of all loading states
|
|
1379
|
+
*/
|
|
1380
|
+
get states$(): Observable<Map<string, LoadingState>>;
|
|
1381
|
+
/**
|
|
1382
|
+
* Observable that emits true when any loading operation is active
|
|
1383
|
+
*/
|
|
1384
|
+
get isAnyLoading$(): Observable<boolean>;
|
|
1385
|
+
/**
|
|
1386
|
+
* Get observable for a specific loading operation
|
|
1387
|
+
* @param id - The loading operation identifier
|
|
1388
|
+
*/
|
|
1389
|
+
isLoading$(id?: string): Observable<boolean>;
|
|
1390
|
+
/**
|
|
1391
|
+
* Get observable for loading state with message
|
|
1392
|
+
* @param id - The loading operation identifier
|
|
1393
|
+
*/
|
|
1394
|
+
getState$(id?: string): Observable<LoadingState | undefined>;
|
|
1395
|
+
/**
|
|
1396
|
+
* Check if a specific operation is currently loading (synchronous)
|
|
1397
|
+
* @param id - The loading operation identifier
|
|
1398
|
+
*/
|
|
1399
|
+
isLoading(id?: string): boolean;
|
|
1400
|
+
/**
|
|
1401
|
+
* Check if any operation is currently loading (synchronous)
|
|
1402
|
+
*/
|
|
1403
|
+
isAnyLoading(): boolean;
|
|
1404
|
+
/**
|
|
1405
|
+
* Start a loading operation
|
|
1406
|
+
* @param id - The loading operation identifier
|
|
1407
|
+
* @param message - Optional message to display
|
|
1408
|
+
*/
|
|
1409
|
+
start(id?: string, message?: string): void;
|
|
1410
|
+
/**
|
|
1411
|
+
* Stop a loading operation
|
|
1412
|
+
* @param id - The loading operation identifier
|
|
1413
|
+
*/
|
|
1414
|
+
stop(id?: string): void;
|
|
1415
|
+
/**
|
|
1416
|
+
* Update progress for a loading operation
|
|
1417
|
+
* @param id - The loading operation identifier
|
|
1418
|
+
* @param progress - Progress percentage (0-100)
|
|
1419
|
+
* @param message - Optional updated message
|
|
1420
|
+
*/
|
|
1421
|
+
setProgress(id: string, progress: number, message?: string): void;
|
|
1422
|
+
/**
|
|
1423
|
+
* Update the message for a loading operation
|
|
1424
|
+
* @param id - The loading operation identifier
|
|
1425
|
+
* @param message - New message to display
|
|
1426
|
+
*/
|
|
1427
|
+
setMessage(id: string, message: string): void;
|
|
1428
|
+
/**
|
|
1429
|
+
* Stop all loading operations
|
|
1430
|
+
*/
|
|
1431
|
+
stopAll(): void;
|
|
1432
|
+
/**
|
|
1433
|
+
* Remove a loading state completely
|
|
1434
|
+
* @param id - The loading operation identifier
|
|
1435
|
+
*/
|
|
1436
|
+
remove(id: string): void;
|
|
1437
|
+
/**
|
|
1438
|
+
* Execute an async operation with automatic loading state management
|
|
1439
|
+
* @param id - The loading operation identifier
|
|
1440
|
+
* @param operation - The async operation to execute
|
|
1441
|
+
* @param message - Optional loading message
|
|
1442
|
+
* @returns The result of the operation
|
|
1443
|
+
*/
|
|
1444
|
+
withLoading<T>(id: string, operation: () => Promise<T>, message?: string): Promise<T>;
|
|
1445
|
+
/**
|
|
1446
|
+
* Update a loading state
|
|
1447
|
+
*/
|
|
1448
|
+
private updateState;
|
|
1449
|
+
/**
|
|
1450
|
+
* Emit current states to subscribers
|
|
1451
|
+
*/
|
|
1452
|
+
private emitStates;
|
|
1453
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<LoadingService, never>;
|
|
1454
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<LoadingService>;
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
/**
|
|
1458
|
+
* Common type definitions for PECB UI Components
|
|
1459
|
+
* @module types
|
|
1460
|
+
*/
|
|
1461
|
+
/**
|
|
1462
|
+
* Standard size variants used across components
|
|
1463
|
+
*/
|
|
1464
|
+
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
1465
|
+
/**
|
|
1466
|
+
* Standard component size mapping
|
|
1467
|
+
*/
|
|
1468
|
+
type ComponentSize = 'small' | 'medium' | 'large';
|
|
1469
|
+
/**
|
|
1470
|
+
* Semantic color variants
|
|
1471
|
+
*/
|
|
1472
|
+
type ColorVariant = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
|
|
1473
|
+
/**
|
|
1474
|
+
* Extended color variants including neutral options
|
|
1475
|
+
*/
|
|
1476
|
+
type ExtendedColorVariant = ColorVariant | 'neutral' | 'muted';
|
|
1477
|
+
/**
|
|
1478
|
+
* Component state variants
|
|
1479
|
+
*/
|
|
1480
|
+
type StateVariant = 'default' | 'hover' | 'active' | 'focus' | 'disabled';
|
|
1481
|
+
/**
|
|
1482
|
+
* Position options for overlays and popups
|
|
1483
|
+
*/
|
|
1484
|
+
type Position = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end';
|
|
1485
|
+
/**
|
|
1486
|
+
* Alignment options
|
|
1487
|
+
*/
|
|
1488
|
+
type Alignment = 'start' | 'center' | 'end' | 'stretch';
|
|
1489
|
+
/**
|
|
1490
|
+
* Direction options for layouts
|
|
1491
|
+
*/
|
|
1492
|
+
type Direction = 'horizontal' | 'vertical';
|
|
1493
|
+
/**
|
|
1494
|
+
* Orientation alias for direction
|
|
1495
|
+
*/
|
|
1496
|
+
type Orientation = 'horizontal' | 'vertical';
|
|
1497
|
+
/**
|
|
1498
|
+
* Spacing scale values
|
|
1499
|
+
*/
|
|
1500
|
+
type SpacingScale = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
1501
|
+
/**
|
|
1502
|
+
* Border radius scale values
|
|
1503
|
+
*/
|
|
1504
|
+
type RadiusScale = 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
1505
|
+
/**
|
|
1506
|
+
* Shadow elevation levels
|
|
1507
|
+
*/
|
|
1508
|
+
type ElevationLevel = 'none' | 'sm' | 'md' | 'lg' | 'xl';
|
|
1509
|
+
/**
|
|
1510
|
+
* Animation timing presets
|
|
1511
|
+
*/
|
|
1512
|
+
type AnimationTiming = 'instant' | 'fast' | 'normal' | 'slow';
|
|
1513
|
+
/**
|
|
1514
|
+
* Breakpoint names
|
|
1515
|
+
*/
|
|
1516
|
+
type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
1517
|
+
/**
|
|
1518
|
+
* Form validation state
|
|
1519
|
+
*/
|
|
1520
|
+
type ValidationState = 'valid' | 'invalid' | 'pending' | 'pristine';
|
|
1521
|
+
/**
|
|
1522
|
+
* Generic callback function type
|
|
1523
|
+
*/
|
|
1524
|
+
type Callback<T = void> = () => T;
|
|
1525
|
+
/**
|
|
1526
|
+
* Generic event handler type
|
|
1527
|
+
*/
|
|
1528
|
+
type EventHandler<T = Event> = (event: T) => void;
|
|
1529
|
+
/**
|
|
1530
|
+
* Make specific properties required
|
|
1531
|
+
*/
|
|
1532
|
+
type RequireProps<T, K extends keyof T> = T & Required<Pick<T, K>>;
|
|
1533
|
+
/**
|
|
1534
|
+
* Make specific properties optional
|
|
1535
|
+
*/
|
|
1536
|
+
type OptionalProps<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
1537
|
+
/**
|
|
1538
|
+
* Extract non-nullable type
|
|
1539
|
+
*/
|
|
1540
|
+
type NonNullableProps<T> = {
|
|
1541
|
+
[K in keyof T]: NonNullable<T[K]>;
|
|
1542
|
+
};
|
|
1543
|
+
|
|
1544
|
+
/**
|
|
1545
|
+
* Common interface for components that can be disabled
|
|
1546
|
+
*/
|
|
1547
|
+
interface Disableable {
|
|
1548
|
+
/** Whether the component is disabled */
|
|
1549
|
+
disabled: boolean;
|
|
1550
|
+
}
|
|
1551
|
+
/**
|
|
1552
|
+
* Common interface for components with loading state
|
|
1553
|
+
*/
|
|
1554
|
+
interface Loadable {
|
|
1555
|
+
/** Whether the component is in a loading state */
|
|
1556
|
+
loading: boolean;
|
|
1557
|
+
}
|
|
1558
|
+
/**
|
|
1559
|
+
* Common interface for components with size variants
|
|
1560
|
+
*/
|
|
1561
|
+
interface Sizeable {
|
|
1562
|
+
/** The size of the component */
|
|
1563
|
+
size: ComponentSize;
|
|
1564
|
+
}
|
|
1565
|
+
/**
|
|
1566
|
+
* Common interface for components with color variants
|
|
1567
|
+
*/
|
|
1568
|
+
interface Colorable {
|
|
1569
|
+
/** The color variant of the component */
|
|
1570
|
+
variant: ColorVariant;
|
|
1571
|
+
}
|
|
1572
|
+
/**
|
|
1573
|
+
* Common interface for focusable components
|
|
1574
|
+
*/
|
|
1575
|
+
interface Focusable {
|
|
1576
|
+
/** Focus the component programmatically */
|
|
1577
|
+
focus(): void;
|
|
1578
|
+
/** Blur the component programmatically */
|
|
1579
|
+
blur(): void;
|
|
1580
|
+
}
|
|
1581
|
+
/**
|
|
1582
|
+
* Base interface for form control components
|
|
1583
|
+
*/
|
|
1584
|
+
interface FormControlBase extends Disableable {
|
|
1585
|
+
/** Unique identifier for the control */
|
|
1586
|
+
id: string;
|
|
1587
|
+
/** Name attribute for form submission */
|
|
1588
|
+
name: string;
|
|
1589
|
+
/** Whether the field is required */
|
|
1590
|
+
required: boolean;
|
|
1591
|
+
/** Whether the field is readonly */
|
|
1592
|
+
readonly: boolean;
|
|
1593
|
+
/** Placeholder text */
|
|
1594
|
+
placeholder?: string;
|
|
1595
|
+
/** Accessible label */
|
|
1596
|
+
ariaLabel?: string;
|
|
1597
|
+
/** ID of element that labels this control */
|
|
1598
|
+
ariaLabelledBy?: string;
|
|
1599
|
+
/** ID of element that describes this control */
|
|
1600
|
+
ariaDescribedBy?: string;
|
|
1601
|
+
}
|
|
1602
|
+
/**
|
|
1603
|
+
* Interface for components with validation
|
|
1604
|
+
*/
|
|
1605
|
+
interface Validatable {
|
|
1606
|
+
/** Current validation state */
|
|
1607
|
+
validationState: ValidationState;
|
|
1608
|
+
/** Error message to display */
|
|
1609
|
+
errorMessage?: string;
|
|
1610
|
+
/** Success message to display */
|
|
1611
|
+
successMessage?: string;
|
|
1612
|
+
/** Helper text to display */
|
|
1613
|
+
helperText?: string;
|
|
1614
|
+
}
|
|
1615
|
+
/**
|
|
1616
|
+
* Interface for selectable items (dropdown, list, etc.)
|
|
1617
|
+
*/
|
|
1618
|
+
interface SelectableItem<T = unknown> {
|
|
1619
|
+
/** Unique value for the item */
|
|
1620
|
+
value: T;
|
|
1621
|
+
/** Display label */
|
|
1622
|
+
label: string;
|
|
1623
|
+
/** Whether the item is disabled */
|
|
1624
|
+
disabled?: boolean;
|
|
1625
|
+
/** Optional icon name */
|
|
1626
|
+
icon?: string;
|
|
1627
|
+
/** Optional description */
|
|
1628
|
+
description?: string;
|
|
1629
|
+
/** Optional group name for categorization */
|
|
1630
|
+
group?: string;
|
|
1631
|
+
/** Additional metadata */
|
|
1632
|
+
metadata?: Record<string, unknown>;
|
|
1633
|
+
}
|
|
1634
|
+
/**
|
|
1635
|
+
* Interface for components that support custom templates
|
|
1636
|
+
*/
|
|
1637
|
+
interface Templatable {
|
|
1638
|
+
/** Custom template for rendering */
|
|
1639
|
+
template?: TemplateRef<unknown>;
|
|
1640
|
+
}
|
|
1641
|
+
/**
|
|
1642
|
+
* Interface for overlay components (modal, popover, tooltip)
|
|
1643
|
+
*/
|
|
1644
|
+
interface OverlayComponent {
|
|
1645
|
+
/** Whether the overlay is currently visible */
|
|
1646
|
+
isOpen: boolean;
|
|
1647
|
+
/** Open the overlay */
|
|
1648
|
+
open(): void;
|
|
1649
|
+
/** Close the overlay */
|
|
1650
|
+
close(): void;
|
|
1651
|
+
/** Toggle the overlay state */
|
|
1652
|
+
toggle(): void;
|
|
1653
|
+
}
|
|
1654
|
+
/**
|
|
1655
|
+
* Interface for components with before/after close hooks
|
|
1656
|
+
*/
|
|
1657
|
+
interface ClosableWithHooks {
|
|
1658
|
+
/** Called before the component closes. Return false to prevent closing */
|
|
1659
|
+
beforeClose?: () => boolean | Promise<boolean>;
|
|
1660
|
+
/** Called after the component closes */
|
|
1661
|
+
afterClose?: () => void;
|
|
1662
|
+
}
|
|
1663
|
+
/**
|
|
1664
|
+
* Interface for table column definition
|
|
1665
|
+
*/
|
|
1666
|
+
interface TableColumn<T = unknown> {
|
|
1667
|
+
/** Unique column key */
|
|
1668
|
+
key: string;
|
|
1669
|
+
/** Column header label */
|
|
1670
|
+
label: string;
|
|
1671
|
+
/** Property path to access data (supports dot notation) */
|
|
1672
|
+
field?: keyof T | string;
|
|
1673
|
+
/** Whether the column is sortable */
|
|
1674
|
+
sortable?: boolean;
|
|
1675
|
+
/** Whether the column is filterable */
|
|
1676
|
+
filterable?: boolean;
|
|
1677
|
+
/** Column width (CSS value) */
|
|
1678
|
+
width?: string;
|
|
1679
|
+
/** Minimum column width */
|
|
1680
|
+
minWidth?: string;
|
|
1681
|
+
/** Maximum column width */
|
|
1682
|
+
maxWidth?: string;
|
|
1683
|
+
/** Text alignment */
|
|
1684
|
+
align?: 'left' | 'center' | 'right';
|
|
1685
|
+
/** Whether the column is visible */
|
|
1686
|
+
visible?: boolean;
|
|
1687
|
+
/** Whether the column is sticky */
|
|
1688
|
+
sticky?: 'start' | 'end';
|
|
1689
|
+
/** Custom cell template */
|
|
1690
|
+
cellTemplate?: TemplateRef<unknown>;
|
|
1691
|
+
/** Custom header template */
|
|
1692
|
+
headerTemplate?: TemplateRef<unknown>;
|
|
1693
|
+
/** Value formatter function */
|
|
1694
|
+
formatter?: (value: unknown, row: T) => string;
|
|
1695
|
+
}
|
|
1696
|
+
/**
|
|
1697
|
+
* Interface for pagination state
|
|
1698
|
+
*/
|
|
1699
|
+
interface PaginationState {
|
|
1700
|
+
/** Current page (1-indexed) */
|
|
1701
|
+
currentPage: number;
|
|
1702
|
+
/** Number of items per page */
|
|
1703
|
+
pageSize: number;
|
|
1704
|
+
/** Total number of items */
|
|
1705
|
+
totalItems: number;
|
|
1706
|
+
/** Total number of pages (calculated) */
|
|
1707
|
+
totalPages: number;
|
|
1708
|
+
}
|
|
1709
|
+
/**
|
|
1710
|
+
* Interface for sort state
|
|
1711
|
+
*/
|
|
1712
|
+
interface SortState {
|
|
1713
|
+
/** Column key to sort by */
|
|
1714
|
+
column: string;
|
|
1715
|
+
/** Sort direction */
|
|
1716
|
+
direction: 'asc' | 'desc' | null;
|
|
1717
|
+
}
|
|
1718
|
+
/**
|
|
1719
|
+
* Interface for filter state
|
|
1720
|
+
*/
|
|
1721
|
+
interface FilterState {
|
|
1722
|
+
/** Column key to filter */
|
|
1723
|
+
column: string;
|
|
1724
|
+
/** Filter operator */
|
|
1725
|
+
operator: 'equals' | 'contains' | 'startsWith' | 'endsWith' | 'gt' | 'lt' | 'gte' | 'lte' | 'between' | 'in';
|
|
1726
|
+
/** Filter value(s) */
|
|
1727
|
+
value: unknown;
|
|
1728
|
+
}
|
|
1729
|
+
/**
|
|
1730
|
+
* Interface for tree node structure
|
|
1731
|
+
*/
|
|
1732
|
+
interface TreeNode<T = unknown> {
|
|
1733
|
+
/** Unique node identifier */
|
|
1734
|
+
id: string | number;
|
|
1735
|
+
/** Node data */
|
|
1736
|
+
data: T;
|
|
1737
|
+
/** Child nodes */
|
|
1738
|
+
children?: TreeNode<T>[];
|
|
1739
|
+
/** Whether the node is expanded */
|
|
1740
|
+
expanded?: boolean;
|
|
1741
|
+
/** Whether the node is selected */
|
|
1742
|
+
selected?: boolean;
|
|
1743
|
+
/** Whether the node is disabled */
|
|
1744
|
+
disabled?: boolean;
|
|
1745
|
+
/** Whether the node is a leaf (no children) */
|
|
1746
|
+
leaf?: boolean;
|
|
1747
|
+
/** Parent node ID */
|
|
1748
|
+
parentId?: string | number;
|
|
1749
|
+
/** Node level in the tree (0-indexed) */
|
|
1750
|
+
level?: number;
|
|
1751
|
+
}
|
|
1752
|
+
/**
|
|
1753
|
+
* Interface for breadcrumb item
|
|
1754
|
+
*/
|
|
1755
|
+
interface BreadcrumbItem {
|
|
1756
|
+
/** Display label */
|
|
1757
|
+
label: string;
|
|
1758
|
+
/** Navigation URL or route */
|
|
1759
|
+
url?: string;
|
|
1760
|
+
/** Route path array for routerLink */
|
|
1761
|
+
routerLink?: string | string[];
|
|
1762
|
+
/** Query parameters */
|
|
1763
|
+
queryParams?: Record<string, string>;
|
|
1764
|
+
/** Icon name */
|
|
1765
|
+
icon?: string;
|
|
1766
|
+
/** Whether this is the active/current item */
|
|
1767
|
+
active?: boolean;
|
|
1768
|
+
/** Whether the item is disabled */
|
|
1769
|
+
disabled?: boolean;
|
|
1770
|
+
}
|
|
1771
|
+
/**
|
|
1772
|
+
* Interface for tab item
|
|
1773
|
+
*/
|
|
1774
|
+
interface TabItem {
|
|
1775
|
+
/** Unique tab identifier */
|
|
1776
|
+
id: string;
|
|
1777
|
+
/** Tab label */
|
|
1778
|
+
label: string;
|
|
1779
|
+
/** Tab icon */
|
|
1780
|
+
icon?: string;
|
|
1781
|
+
/** Whether the tab is disabled */
|
|
1782
|
+
disabled?: boolean;
|
|
1783
|
+
/** Whether the tab is closable */
|
|
1784
|
+
closable?: boolean;
|
|
1785
|
+
/** Badge content */
|
|
1786
|
+
badge?: string | number;
|
|
1787
|
+
/** Content template */
|
|
1788
|
+
content?: TemplateRef<unknown>;
|
|
1789
|
+
}
|
|
1790
|
+
/**
|
|
1791
|
+
* Interface for menu item
|
|
1792
|
+
*/
|
|
1793
|
+
interface MenuItem {
|
|
1794
|
+
/** Unique item identifier */
|
|
1795
|
+
id?: string;
|
|
1796
|
+
/** Display label */
|
|
1797
|
+
label: string;
|
|
1798
|
+
/** Icon name */
|
|
1799
|
+
icon?: string;
|
|
1800
|
+
/** Command to execute on click */
|
|
1801
|
+
command?: () => void;
|
|
1802
|
+
/** URL for navigation */
|
|
1803
|
+
url?: string;
|
|
1804
|
+
/** Router link */
|
|
1805
|
+
routerLink?: string | string[];
|
|
1806
|
+
/** Query parameters */
|
|
1807
|
+
queryParams?: Record<string, string>;
|
|
1808
|
+
/** Whether the item is disabled */
|
|
1809
|
+
disabled?: boolean;
|
|
1810
|
+
/** Whether the item is visible */
|
|
1811
|
+
visible?: boolean;
|
|
1812
|
+
/** Child items for submenu */
|
|
1813
|
+
items?: MenuItem[];
|
|
1814
|
+
/** Whether this is a separator */
|
|
1815
|
+
separator?: boolean;
|
|
1816
|
+
/** Additional CSS class */
|
|
1817
|
+
styleClass?: string;
|
|
1818
|
+
/** Tooltip text */
|
|
1819
|
+
tooltip?: string;
|
|
1820
|
+
/** Badge content */
|
|
1821
|
+
badge?: string | number;
|
|
1822
|
+
/** Badge color variant */
|
|
1823
|
+
badgeVariant?: ColorVariant;
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
/**
|
|
1827
|
+
* String utility functions for PECB UI Components
|
|
1828
|
+
* @module utils/string
|
|
1829
|
+
*/
|
|
1830
|
+
/**
|
|
1831
|
+
* Convert a string to kebab-case
|
|
1832
|
+
* @param str - The string to convert
|
|
1833
|
+
* @returns The kebab-case string
|
|
1834
|
+
*
|
|
1835
|
+
* @example
|
|
1836
|
+
* toKebabCase('myComponentName') // 'my-component-name'
|
|
1837
|
+
* toKebabCase('MyComponentName') // 'my-component-name'
|
|
1838
|
+
*/
|
|
1839
|
+
declare function toKebabCase(str: string): string;
|
|
1840
|
+
/**
|
|
1841
|
+
* Convert a string to camelCase
|
|
1842
|
+
* @param str - The string to convert
|
|
1843
|
+
* @returns The camelCase string
|
|
1844
|
+
*
|
|
1845
|
+
* @example
|
|
1846
|
+
* toCamelCase('my-component-name') // 'myComponentName'
|
|
1847
|
+
* toCamelCase('my_component_name') // 'myComponentName'
|
|
1848
|
+
*/
|
|
1849
|
+
declare function toCamelCase(str: string): string;
|
|
1850
|
+
/**
|
|
1851
|
+
* Convert a string to PascalCase
|
|
1852
|
+
* @param str - The string to convert
|
|
1853
|
+
* @returns The PascalCase string
|
|
1854
|
+
*
|
|
1855
|
+
* @example
|
|
1856
|
+
* toPascalCase('my-component-name') // 'MyComponentName'
|
|
1857
|
+
*/
|
|
1858
|
+
declare function toPascalCase(str: string): string;
|
|
1859
|
+
/**
|
|
1860
|
+
* Convert a string to snake_case
|
|
1861
|
+
* @param str - The string to convert
|
|
1862
|
+
* @returns The snake_case string
|
|
1863
|
+
*
|
|
1864
|
+
* @example
|
|
1865
|
+
* toSnakeCase('myComponentName') // 'my_component_name'
|
|
1866
|
+
*/
|
|
1867
|
+
declare function toSnakeCase(str: string): string;
|
|
1868
|
+
/**
|
|
1869
|
+
* Capitalize the first letter of a string
|
|
1870
|
+
* @param str - The string to capitalize
|
|
1871
|
+
* @returns The capitalized string
|
|
1872
|
+
*
|
|
1873
|
+
* @example
|
|
1874
|
+
* capitalize('hello world') // 'Hello world'
|
|
1875
|
+
*/
|
|
1876
|
+
declare function capitalize(str: string): string;
|
|
1877
|
+
/**
|
|
1878
|
+
* Truncate a string to a specified length
|
|
1879
|
+
* @param str - The string to truncate
|
|
1880
|
+
* @param maxLength - Maximum length
|
|
1881
|
+
* @param suffix - Suffix to append when truncated (default: '...')
|
|
1882
|
+
* @returns The truncated string
|
|
1883
|
+
*
|
|
1884
|
+
* @example
|
|
1885
|
+
* truncate('Hello World', 8) // 'Hello...'
|
|
1886
|
+
* truncate('Hello World', 8, '…') // 'Hello W…'
|
|
1887
|
+
*/
|
|
1888
|
+
declare function truncate(str: string, maxLength: number, suffix?: string): string;
|
|
1889
|
+
/**
|
|
1890
|
+
* Check if a string is empty or contains only whitespace
|
|
1891
|
+
* @param str - The string to check
|
|
1892
|
+
* @returns True if the string is empty or whitespace
|
|
1893
|
+
*
|
|
1894
|
+
* @example
|
|
1895
|
+
* isBlank('') // true
|
|
1896
|
+
* isBlank(' ') // true
|
|
1897
|
+
* isBlank('hello') // false
|
|
1898
|
+
*/
|
|
1899
|
+
declare function isBlank(str: string | null | undefined): boolean;
|
|
1900
|
+
/**
|
|
1901
|
+
* Check if a string is not empty and contains non-whitespace characters
|
|
1902
|
+
* @param str - The string to check
|
|
1903
|
+
* @returns True if the string is not empty
|
|
1904
|
+
*/
|
|
1905
|
+
declare function isNotBlank(str: string | null | undefined): str is string;
|
|
1906
|
+
/**
|
|
1907
|
+
* Generate a slug from a string (URL-friendly)
|
|
1908
|
+
* @param str - The string to convert
|
|
1909
|
+
* @returns URL-friendly slug
|
|
1910
|
+
*
|
|
1911
|
+
* @example
|
|
1912
|
+
* slugify('Hello World!') // 'hello-world'
|
|
1913
|
+
* slugify('Café Latte') // 'cafe-latte'
|
|
1914
|
+
*/
|
|
1915
|
+
declare function slugify(str: string): string;
|
|
1916
|
+
/**
|
|
1917
|
+
* Escape HTML special characters
|
|
1918
|
+
* @param str - The string to escape
|
|
1919
|
+
* @returns The escaped string
|
|
1920
|
+
*
|
|
1921
|
+
* @example
|
|
1922
|
+
* escapeHtml('<script>alert("XSS")</script>') // '<script>alert("XSS")</script>'
|
|
1923
|
+
*/
|
|
1924
|
+
declare function escapeHtml(str: string): string;
|
|
1925
|
+
/**
|
|
1926
|
+
* Strip HTML tags from a string
|
|
1927
|
+
* @param str - The string containing HTML
|
|
1928
|
+
* @returns The string without HTML tags
|
|
1929
|
+
*
|
|
1930
|
+
* @example
|
|
1931
|
+
* stripHtml('<p>Hello <strong>World</strong></p>') // 'Hello World'
|
|
1932
|
+
*/
|
|
1933
|
+
declare function stripHtml(str: string): string;
|
|
1934
|
+
/**
|
|
1935
|
+
* Generate initials from a name
|
|
1936
|
+
* @param name - The name to extract initials from
|
|
1937
|
+
* @param maxLength - Maximum number of initials (default: 2)
|
|
1938
|
+
* @returns The initials in uppercase
|
|
1939
|
+
*
|
|
1940
|
+
* @example
|
|
1941
|
+
* getInitials('John Doe') // 'JD'
|
|
1942
|
+
* getInitials('John Michael Doe', 3) // 'JMD'
|
|
1943
|
+
*/
|
|
1944
|
+
declare function getInitials(name: string, maxLength?: number): string;
|
|
1945
|
+
/**
|
|
1946
|
+
* Pluralize a word based on count
|
|
1947
|
+
* @param count - The count to check
|
|
1948
|
+
* @param singular - Singular form
|
|
1949
|
+
* @param plural - Plural form (optional, defaults to singular + 's')
|
|
1950
|
+
* @returns The appropriate form of the word
|
|
1951
|
+
*
|
|
1952
|
+
* @example
|
|
1953
|
+
* pluralize(1, 'item') // 'item'
|
|
1954
|
+
* pluralize(5, 'item') // 'items'
|
|
1955
|
+
* pluralize(2, 'child', 'children') // 'children'
|
|
1956
|
+
*/
|
|
1957
|
+
declare function pluralize(count: number, singular: string, plural?: string): string;
|
|
1958
|
+
/**
|
|
1959
|
+
* Format a number as a string with count and pluralized label
|
|
1960
|
+
* @param count - The count
|
|
1961
|
+
* @param singular - Singular form of the label
|
|
1962
|
+
* @param plural - Plural form (optional)
|
|
1963
|
+
* @returns Formatted string like "5 items"
|
|
1964
|
+
*
|
|
1965
|
+
* @example
|
|
1966
|
+
* formatCount(1, 'item') // '1 item'
|
|
1967
|
+
* formatCount(5, 'item') // '5 items'
|
|
1968
|
+
*/
|
|
1969
|
+
declare function formatCount(count: number, singular: string, plural?: string): string;
|
|
1970
|
+
|
|
1971
|
+
/**
|
|
1972
|
+
* DOM utility functions for PECB UI Components
|
|
1973
|
+
* @module utils/dom
|
|
1974
|
+
*/
|
|
1975
|
+
/**
|
|
1976
|
+
* Check if code is running in a browser environment
|
|
1977
|
+
* @returns True if running in browser
|
|
1978
|
+
*/
|
|
1979
|
+
declare function isBrowser(): boolean;
|
|
1980
|
+
/**
|
|
1981
|
+
* Generate a unique ID for DOM elements
|
|
1982
|
+
* @param prefix - Optional prefix for the ID
|
|
1983
|
+
* @returns A unique ID string
|
|
1984
|
+
*
|
|
1985
|
+
* @example
|
|
1986
|
+
* generateUniqueId('btn') // 'btn-a1b2c3d4'
|
|
1987
|
+
*/
|
|
1988
|
+
declare function generateUniqueId(prefix?: string): string;
|
|
1989
|
+
/**
|
|
1990
|
+
* Check if an element matches a CSS selector
|
|
1991
|
+
* @param element - The element to check
|
|
1992
|
+
* @param selector - The CSS selector
|
|
1993
|
+
* @returns True if the element matches
|
|
1994
|
+
*/
|
|
1995
|
+
declare function matchesSelector(element: Element, selector: string): boolean;
|
|
1996
|
+
/**
|
|
1997
|
+
* Find the closest ancestor matching a selector
|
|
1998
|
+
* @param element - Starting element
|
|
1999
|
+
* @param selector - CSS selector to match
|
|
2000
|
+
* @returns The matching ancestor or null
|
|
2001
|
+
*/
|
|
2002
|
+
declare function closestElement<T extends Element>(element: Element, selector: string): T | null;
|
|
2003
|
+
/**
|
|
2004
|
+
* Check if an element is visible in the viewport
|
|
2005
|
+
* @param element - The element to check
|
|
2006
|
+
* @param partial - Whether partial visibility counts
|
|
2007
|
+
* @returns True if visible
|
|
2008
|
+
*/
|
|
2009
|
+
declare function isElementVisible(element: Element, partial?: boolean): boolean;
|
|
2010
|
+
/**
|
|
2011
|
+
* Get all focusable elements within a container
|
|
2012
|
+
* @param container - The container element
|
|
2013
|
+
* @returns Array of focusable elements
|
|
2014
|
+
*/
|
|
2015
|
+
declare function getFocusableElements(container: Element): HTMLElement[];
|
|
2016
|
+
/**
|
|
2017
|
+
* Trap focus within a container (useful for modals)
|
|
2018
|
+
* @param container - The container to trap focus in
|
|
2019
|
+
* @returns Cleanup function to remove the trap
|
|
2020
|
+
*/
|
|
2021
|
+
declare function trapFocus(container: HTMLElement): () => void;
|
|
2022
|
+
/**
|
|
2023
|
+
* Scroll an element into view smoothly
|
|
2024
|
+
* @param element - The element to scroll to
|
|
2025
|
+
* @param options - Scroll options
|
|
2026
|
+
*/
|
|
2027
|
+
declare function scrollIntoView(element: Element, options?: ScrollIntoViewOptions): void;
|
|
2028
|
+
/**
|
|
2029
|
+
* Get the scroll parent of an element
|
|
2030
|
+
* @param element - The element to find scroll parent for
|
|
2031
|
+
* @returns The scroll parent element
|
|
2032
|
+
*/
|
|
2033
|
+
declare function getScrollParent(element: Element): Element | null;
|
|
2034
|
+
/**
|
|
2035
|
+
* Disable body scroll (useful for modals)
|
|
2036
|
+
* @returns Cleanup function to re-enable scroll
|
|
2037
|
+
*/
|
|
2038
|
+
declare function disableBodyScroll(): () => void;
|
|
2039
|
+
/**
|
|
2040
|
+
* Copy text to clipboard
|
|
2041
|
+
* @param text - The text to copy
|
|
2042
|
+
* @returns Promise that resolves when copied
|
|
2043
|
+
*/
|
|
2044
|
+
declare function copyToClipboard(text: string): Promise<void>;
|
|
2045
|
+
/**
|
|
2046
|
+
* Check if an element has a specific CSS class
|
|
2047
|
+
* @param element - The element to check
|
|
2048
|
+
* @param className - The class name
|
|
2049
|
+
* @returns True if the element has the class
|
|
2050
|
+
*/
|
|
2051
|
+
declare function hasClass(element: Element, className: string): boolean;
|
|
2052
|
+
/**
|
|
2053
|
+
* Add CSS class(es) to an element
|
|
2054
|
+
* @param element - The element to modify
|
|
2055
|
+
* @param classNames - Class name(s) to add
|
|
2056
|
+
*/
|
|
2057
|
+
declare function addClass(element: Element, ...classNames: string[]): void;
|
|
2058
|
+
/**
|
|
2059
|
+
* Remove CSS class(es) from an element
|
|
2060
|
+
* @param element - The element to modify
|
|
2061
|
+
* @param classNames - Class name(s) to remove
|
|
2062
|
+
*/
|
|
2063
|
+
declare function removeClass(element: Element, ...classNames: string[]): void;
|
|
2064
|
+
/**
|
|
2065
|
+
* Toggle a CSS class on an element
|
|
2066
|
+
* @param element - The element to modify
|
|
2067
|
+
* @param className - The class name to toggle
|
|
2068
|
+
* @param force - Optional force add (true) or remove (false)
|
|
2069
|
+
* @returns True if the class is now present
|
|
2070
|
+
*/
|
|
2071
|
+
declare function toggleClass(element: Element, className: string, force?: boolean): boolean;
|
|
2072
|
+
/**
|
|
2073
|
+
* Get computed CSS property value
|
|
2074
|
+
* @param element - The element to check
|
|
2075
|
+
* @param property - CSS property name
|
|
2076
|
+
* @returns The computed value
|
|
2077
|
+
*/
|
|
2078
|
+
declare function getComputedStyleValue(element: Element, property: string): string;
|
|
2079
|
+
|
|
2080
|
+
/**
|
|
2081
|
+
* Accessibility utility functions for PECB UI Components
|
|
2082
|
+
* Helps ensure WCAG 2.1 compliance
|
|
2083
|
+
* @module utils/accessibility
|
|
2084
|
+
*/
|
|
2085
|
+
/**
|
|
2086
|
+
* ARIA live region politeness levels
|
|
2087
|
+
*/
|
|
2088
|
+
type AriaLive = 'off' | 'polite' | 'assertive';
|
|
2089
|
+
/**
|
|
2090
|
+
* ARIA roles commonly used in components
|
|
2091
|
+
*/
|
|
2092
|
+
type AriaRole = 'alert' | 'alertdialog' | 'button' | 'checkbox' | 'combobox' | 'dialog' | 'grid' | 'gridcell' | 'link' | 'listbox' | 'menu' | 'menubar' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'option' | 'progressbar' | 'radio' | 'radiogroup' | 'scrollbar' | 'searchbox' | 'slider' | 'spinbutton' | 'status' | 'switch' | 'tab' | 'tablist' | 'tabpanel' | 'textbox' | 'tooltip' | 'tree' | 'treegrid' | 'treeitem';
|
|
2093
|
+
/**
|
|
2094
|
+
* Standard ARIA attributes interface for components
|
|
2095
|
+
*/
|
|
2096
|
+
interface AriaAttributes {
|
|
2097
|
+
role?: AriaRole;
|
|
2098
|
+
'aria-label'?: string;
|
|
2099
|
+
'aria-labelledby'?: string;
|
|
2100
|
+
'aria-describedby'?: string;
|
|
2101
|
+
'aria-expanded'?: boolean;
|
|
2102
|
+
'aria-selected'?: boolean;
|
|
2103
|
+
'aria-checked'?: boolean | 'mixed';
|
|
2104
|
+
'aria-disabled'?: boolean;
|
|
2105
|
+
'aria-hidden'?: boolean;
|
|
2106
|
+
'aria-invalid'?: boolean;
|
|
2107
|
+
'aria-required'?: boolean;
|
|
2108
|
+
'aria-readonly'?: boolean;
|
|
2109
|
+
'aria-pressed'?: boolean | 'mixed';
|
|
2110
|
+
'aria-current'?: boolean | 'page' | 'step' | 'location' | 'date' | 'time';
|
|
2111
|
+
'aria-haspopup'?: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
|
|
2112
|
+
'aria-controls'?: string;
|
|
2113
|
+
'aria-owns'?: string;
|
|
2114
|
+
'aria-live'?: AriaLive;
|
|
2115
|
+
'aria-atomic'?: boolean;
|
|
2116
|
+
'aria-busy'?: boolean;
|
|
2117
|
+
'aria-valuemin'?: number;
|
|
2118
|
+
'aria-valuemax'?: number;
|
|
2119
|
+
'aria-valuenow'?: number;
|
|
2120
|
+
'aria-valuetext'?: string;
|
|
2121
|
+
'aria-orientation'?: 'horizontal' | 'vertical';
|
|
2122
|
+
'aria-activedescendant'?: string;
|
|
2123
|
+
'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both';
|
|
2124
|
+
'aria-multiselectable'?: boolean;
|
|
2125
|
+
'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other';
|
|
2126
|
+
'aria-level'?: number;
|
|
2127
|
+
'aria-setsize'?: number;
|
|
2128
|
+
'aria-posinset'?: number;
|
|
2129
|
+
tabindex?: number;
|
|
2130
|
+
}
|
|
2131
|
+
/**
|
|
2132
|
+
* Generate ARIA attributes for a button component
|
|
2133
|
+
* @param options - Button accessibility options
|
|
2134
|
+
* @returns ARIA attributes object
|
|
2135
|
+
*/
|
|
2136
|
+
declare function getButtonAriaAttributes(options: {
|
|
2137
|
+
label?: string;
|
|
2138
|
+
pressed?: boolean;
|
|
2139
|
+
expanded?: boolean;
|
|
2140
|
+
disabled?: boolean;
|
|
2141
|
+
controls?: string;
|
|
2142
|
+
haspopup?: AriaAttributes['aria-haspopup'];
|
|
2143
|
+
describedby?: string;
|
|
2144
|
+
}): AriaAttributes;
|
|
2145
|
+
/**
|
|
2146
|
+
* Generate ARIA attributes for a dialog/modal component
|
|
2147
|
+
* @param options - Dialog accessibility options
|
|
2148
|
+
* @returns ARIA attributes object
|
|
2149
|
+
*/
|
|
2150
|
+
declare function getDialogAriaAttributes(options: {
|
|
2151
|
+
labelledby?: string;
|
|
2152
|
+
describedby?: string;
|
|
2153
|
+
modal?: boolean;
|
|
2154
|
+
}): AriaAttributes;
|
|
2155
|
+
/**
|
|
2156
|
+
* Generate ARIA attributes for a form input
|
|
2157
|
+
* @param options - Input accessibility options
|
|
2158
|
+
* @returns ARIA attributes object
|
|
2159
|
+
*/
|
|
2160
|
+
declare function getInputAriaAttributes(options: {
|
|
2161
|
+
label?: string;
|
|
2162
|
+
labelledby?: string;
|
|
2163
|
+
describedby?: string;
|
|
2164
|
+
invalid?: boolean;
|
|
2165
|
+
required?: boolean;
|
|
2166
|
+
readonly?: boolean;
|
|
2167
|
+
disabled?: boolean;
|
|
2168
|
+
errorId?: string;
|
|
2169
|
+
helperId?: string;
|
|
2170
|
+
}): AriaAttributes;
|
|
2171
|
+
/**
|
|
2172
|
+
* Generate ARIA attributes for a progress bar
|
|
2173
|
+
* @param options - Progress accessibility options
|
|
2174
|
+
* @returns ARIA attributes object
|
|
2175
|
+
*/
|
|
2176
|
+
declare function getProgressAriaAttributes(options: {
|
|
2177
|
+
value: number;
|
|
2178
|
+
min?: number;
|
|
2179
|
+
max?: number;
|
|
2180
|
+
label?: string;
|
|
2181
|
+
valueText?: string;
|
|
2182
|
+
}): AriaAttributes;
|
|
2183
|
+
/**
|
|
2184
|
+
* Generate ARIA attributes for a tab component
|
|
2185
|
+
* @param options - Tab accessibility options
|
|
2186
|
+
* @returns ARIA attributes for tab and tabpanel
|
|
2187
|
+
*/
|
|
2188
|
+
declare function getTabAriaAttributes(options: {
|
|
2189
|
+
tabId: string;
|
|
2190
|
+
panelId: string;
|
|
2191
|
+
selected: boolean;
|
|
2192
|
+
disabled?: boolean;
|
|
2193
|
+
}): {
|
|
2194
|
+
tab: AriaAttributes;
|
|
2195
|
+
panel: AriaAttributes;
|
|
2196
|
+
};
|
|
2197
|
+
/**
|
|
2198
|
+
* Generate ARIA attributes for a listbox option
|
|
2199
|
+
* @param options - Option accessibility options
|
|
2200
|
+
* @returns ARIA attributes object
|
|
2201
|
+
*/
|
|
2202
|
+
declare function getOptionAriaAttributes(options: {
|
|
2203
|
+
selected: boolean;
|
|
2204
|
+
disabled?: boolean;
|
|
2205
|
+
setsize?: number;
|
|
2206
|
+
posinset?: number;
|
|
2207
|
+
}): AriaAttributes;
|
|
2208
|
+
/**
|
|
2209
|
+
* Generate linked IDs for label and input association
|
|
2210
|
+
* @param baseName - Base name for generating IDs
|
|
2211
|
+
* @returns Object with inputId, labelId, errorId, and helperId
|
|
2212
|
+
*/
|
|
2213
|
+
declare function generateLinkedIds(baseName?: string): {
|
|
2214
|
+
inputId: string;
|
|
2215
|
+
labelId: string;
|
|
2216
|
+
errorId: string;
|
|
2217
|
+
helperId: string;
|
|
2218
|
+
};
|
|
2219
|
+
/**
|
|
2220
|
+
* Create a visually hidden element for screen readers
|
|
2221
|
+
* @returns CSS styles for visually hidden content
|
|
2222
|
+
*/
|
|
2223
|
+
declare function getVisuallyHiddenStyles(): Record<string, string>;
|
|
2224
|
+
/**
|
|
2225
|
+
* Check if the user has enabled reduced motion preference
|
|
2226
|
+
* @returns True if user prefers reduced motion
|
|
2227
|
+
*/
|
|
2228
|
+
declare function prefersReducedMotion(): boolean;
|
|
2229
|
+
/**
|
|
2230
|
+
* Check if the user has enabled high contrast mode
|
|
2231
|
+
* @returns True if high contrast mode is enabled
|
|
2232
|
+
*/
|
|
2233
|
+
declare function prefersHighContrast(): boolean;
|
|
2234
|
+
/**
|
|
2235
|
+
* Announce a message to screen readers using aria-live regions
|
|
2236
|
+
* @param message - The message to announce
|
|
2237
|
+
* @param politeness - The urgency level (polite or assertive)
|
|
2238
|
+
*/
|
|
2239
|
+
declare function announceToScreenReader(message: string, politeness?: 'polite' | 'assertive'): void;
|
|
2240
|
+
/**
|
|
2241
|
+
* Get the appropriate aria-current value for navigation items
|
|
2242
|
+
* @param isActive - Whether the item is active/current
|
|
2243
|
+
* @param type - The type of current indicator
|
|
2244
|
+
* @returns The aria-current value or undefined
|
|
2245
|
+
*/
|
|
2246
|
+
declare function getAriaCurrent(isActive: boolean, type?: 'page' | 'step' | 'location' | 'date' | 'time'): AriaAttributes['aria-current'];
|
|
2247
|
+
|
|
2248
|
+
/**
|
|
2249
|
+
* Error handling utility functions for PECB UI Components
|
|
2250
|
+
* Provides standardized error handling patterns
|
|
2251
|
+
* @module utils/error
|
|
2252
|
+
*/
|
|
2253
|
+
/**
|
|
2254
|
+
* Error severity levels
|
|
2255
|
+
*/
|
|
2256
|
+
type ErrorSeverity = 'info' | 'warning' | 'error' | 'critical';
|
|
2257
|
+
/**
|
|
2258
|
+
* Error categories for classification
|
|
2259
|
+
*/
|
|
2260
|
+
type ErrorCategory = 'validation' | 'network' | 'authentication' | 'authorization' | 'configuration' | 'runtime' | 'unknown';
|
|
2261
|
+
/**
|
|
2262
|
+
* Standard error interface for PECB components
|
|
2263
|
+
*/
|
|
2264
|
+
interface PecbError {
|
|
2265
|
+
/** Unique error code */
|
|
2266
|
+
code: string;
|
|
2267
|
+
/** Human-readable error message */
|
|
2268
|
+
message: string;
|
|
2269
|
+
/** Error severity level */
|
|
2270
|
+
severity: ErrorSeverity;
|
|
2271
|
+
/** Error category */
|
|
2272
|
+
category: ErrorCategory;
|
|
2273
|
+
/** Original error if wrapping another error */
|
|
2274
|
+
originalError?: Error;
|
|
2275
|
+
/** Additional context data */
|
|
2276
|
+
context?: Record<string, unknown>;
|
|
2277
|
+
/** Timestamp when error occurred */
|
|
2278
|
+
timestamp: Date;
|
|
2279
|
+
/** Suggested recovery action */
|
|
2280
|
+
recoveryAction?: string;
|
|
2281
|
+
/** Whether the error is recoverable */
|
|
2282
|
+
recoverable: boolean;
|
|
2283
|
+
}
|
|
2284
|
+
/**
|
|
2285
|
+
* Validation error details
|
|
2286
|
+
*/
|
|
2287
|
+
interface ValidationError {
|
|
2288
|
+
/** Field name that failed validation */
|
|
2289
|
+
field: string;
|
|
2290
|
+
/** Validation rule that failed */
|
|
2291
|
+
rule: string;
|
|
2292
|
+
/** Error message */
|
|
2293
|
+
message: string;
|
|
2294
|
+
/** Expected value or format */
|
|
2295
|
+
expected?: string;
|
|
2296
|
+
/** Actual value received */
|
|
2297
|
+
actual?: unknown;
|
|
2298
|
+
}
|
|
2299
|
+
/**
|
|
2300
|
+
* Error factory options
|
|
2301
|
+
*/
|
|
2302
|
+
interface ErrorOptions {
|
|
2303
|
+
code?: string;
|
|
2304
|
+
severity?: ErrorSeverity;
|
|
2305
|
+
category?: ErrorCategory;
|
|
2306
|
+
context?: Record<string, unknown>;
|
|
2307
|
+
recoveryAction?: string;
|
|
2308
|
+
recoverable?: boolean;
|
|
2309
|
+
originalError?: Error;
|
|
2310
|
+
}
|
|
2311
|
+
/**
|
|
2312
|
+
* Create a standardized PECB error
|
|
2313
|
+
* @param message - Error message
|
|
2314
|
+
* @param options - Additional error options
|
|
2315
|
+
* @returns A standardized PecbError object
|
|
2316
|
+
*
|
|
2317
|
+
* @example
|
|
2318
|
+
* const error = createError('Invalid input', {
|
|
2319
|
+
* code: 'VALIDATION_001',
|
|
2320
|
+
* category: 'validation',
|
|
2321
|
+
* severity: 'warning',
|
|
2322
|
+
* recoverable: true
|
|
2323
|
+
* });
|
|
2324
|
+
*/
|
|
2325
|
+
declare function createError(message: string, options?: ErrorOptions): PecbError;
|
|
2326
|
+
/**
|
|
2327
|
+
* Create a validation error
|
|
2328
|
+
* @param field - Field name that failed validation
|
|
2329
|
+
* @param rule - Validation rule that failed
|
|
2330
|
+
* @param message - Error message
|
|
2331
|
+
* @returns A ValidationError object
|
|
2332
|
+
*
|
|
2333
|
+
* @example
|
|
2334
|
+
* const error = createValidationError('email', 'format', 'Invalid email format');
|
|
2335
|
+
*/
|
|
2336
|
+
declare function createValidationError(field: string, rule: string, message: string, details?: {
|
|
2337
|
+
expected?: string;
|
|
2338
|
+
actual?: unknown;
|
|
2339
|
+
}): ValidationError;
|
|
2340
|
+
/**
|
|
2341
|
+
* Wrap an unknown error in a PecbError
|
|
2342
|
+
* @param error - The error to wrap
|
|
2343
|
+
* @param options - Additional options
|
|
2344
|
+
* @returns A standardized PecbError
|
|
2345
|
+
*
|
|
2346
|
+
* @example
|
|
2347
|
+
* try {
|
|
2348
|
+
* await riskyOperation();
|
|
2349
|
+
* } catch (e) {
|
|
2350
|
+
* const error = wrapError(e, { category: 'network' });
|
|
2351
|
+
* handleError(error);
|
|
2352
|
+
* }
|
|
2353
|
+
*/
|
|
2354
|
+
declare function wrapError(error: unknown, options?: ErrorOptions): PecbError;
|
|
2355
|
+
/**
|
|
2356
|
+
* Type guard to check if an object is a PecbError
|
|
2357
|
+
* @param error - The object to check
|
|
2358
|
+
* @returns True if the object is a PecbError
|
|
2359
|
+
*/
|
|
2360
|
+
declare function isPecbError(error: unknown): error is PecbError;
|
|
2361
|
+
/**
|
|
2362
|
+
* Type guard to check if an error is recoverable
|
|
2363
|
+
* @param error - The error to check
|
|
2364
|
+
* @returns True if the error is recoverable
|
|
2365
|
+
*/
|
|
2366
|
+
declare function isRecoverableError(error: PecbError): boolean;
|
|
2367
|
+
/**
|
|
2368
|
+
* Format an error for display to users
|
|
2369
|
+
* @param error - The error to format
|
|
2370
|
+
* @param includeCode - Whether to include the error code
|
|
2371
|
+
* @returns Formatted error message
|
|
2372
|
+
*/
|
|
2373
|
+
declare function formatErrorMessage(error: PecbError, includeCode?: boolean): string;
|
|
2374
|
+
/**
|
|
2375
|
+
* Format an error for logging
|
|
2376
|
+
* @param error - The error to format
|
|
2377
|
+
* @returns Formatted error string for logging
|
|
2378
|
+
*/
|
|
2379
|
+
declare function formatErrorForLog(error: PecbError): string;
|
|
2380
|
+
/**
|
|
2381
|
+
* Create a network error
|
|
2382
|
+
* @param message - Error message
|
|
2383
|
+
* @param statusCode - HTTP status code if applicable
|
|
2384
|
+
* @param originalError - Original error
|
|
2385
|
+
* @returns A network category PecbError
|
|
2386
|
+
*/
|
|
2387
|
+
declare function createNetworkError(message: string, statusCode?: number, originalError?: Error): PecbError;
|
|
2388
|
+
/**
|
|
2389
|
+
* Create an authentication error
|
|
2390
|
+
* @param message - Error message
|
|
2391
|
+
* @param originalError - Original error
|
|
2392
|
+
* @returns An authentication category PecbError
|
|
2393
|
+
*/
|
|
2394
|
+
declare function createAuthError(message: string, originalError?: Error): PecbError;
|
|
2395
|
+
/**
|
|
2396
|
+
* Create an authorization error
|
|
2397
|
+
* @param message - Error message
|
|
2398
|
+
* @param resource - The resource that access was denied to
|
|
2399
|
+
* @returns An authorization category PecbError
|
|
2400
|
+
*/
|
|
2401
|
+
declare function createAuthorizationError(message: string, resource?: string): PecbError;
|
|
2402
|
+
/**
|
|
2403
|
+
* Create a configuration error
|
|
2404
|
+
* @param message - Error message
|
|
2405
|
+
* @param configKey - The configuration key that is invalid
|
|
2406
|
+
* @returns A configuration category PecbError
|
|
2407
|
+
*/
|
|
2408
|
+
declare function createConfigError(message: string, configKey?: string): PecbError;
|
|
2409
|
+
/**
|
|
2410
|
+
* Error handler type
|
|
2411
|
+
*/
|
|
2412
|
+
type ErrorHandler = (error: PecbError) => void;
|
|
2413
|
+
/**
|
|
2414
|
+
* Register an error handler for a category
|
|
2415
|
+
* @param category - The error category to handle
|
|
2416
|
+
* @param handler - The handler function
|
|
2417
|
+
* @returns Cleanup function to unregister
|
|
2418
|
+
*/
|
|
2419
|
+
declare function registerErrorHandler(category: ErrorCategory, handler: ErrorHandler): () => void;
|
|
2420
|
+
/**
|
|
2421
|
+
* Handle an error by invoking registered handlers
|
|
2422
|
+
* @param error - The error to handle
|
|
2423
|
+
*/
|
|
2424
|
+
declare function handleError(error: PecbError): void;
|
|
2425
|
+
/**
|
|
2426
|
+
* Try to execute an operation and return a result or error
|
|
2427
|
+
* @param operation - The operation to execute
|
|
2428
|
+
* @param errorOptions - Options for error wrapping
|
|
2429
|
+
* @returns A tuple of [result, null] or [null, error]
|
|
2430
|
+
*/
|
|
2431
|
+
declare function tryAsync<T>(operation: () => Promise<T>, errorOptions?: ErrorOptions): Promise<[T, null] | [null, PecbError]>;
|
|
2432
|
+
/**
|
|
2433
|
+
* Synchronous version of tryAsync
|
|
2434
|
+
* @param operation - The operation to execute
|
|
2435
|
+
* @param errorOptions - Options for error wrapping
|
|
2436
|
+
* @returns A tuple of [result, null] or [null, error]
|
|
2437
|
+
*/
|
|
2438
|
+
declare function trySync<T>(operation: () => T, errorOptions?: ErrorOptions): [T, null] | [null, PecbError];
|
|
2439
|
+
|
|
2440
|
+
export { AlertComponent, ButtonComponent, CardBodyComponent, CardComponent, CardFooterComponent, CardHeaderComponent, CheckboxComponent, ConfirmationComponent, DatepickerComponent, DropdownComponent, InputComponent, LoadingService, NotificationService, PaginationComponent, PecbComponentsModule, RadioComponent, RightModalComponent, RightModalContentDirective, RightModalFooterDirective, RightModalHeaderDirective, SidebarComponent, StatusComponent, TabComponent, TableComponent, ThemeService, ToggleComponent, addClass, announceToScreenReader, capitalize, closestElement, copyToClipboard, createAuthError, createAuthorizationError, createConfigError, createError, createNetworkError, createValidationError, disableBodyScroll, escapeHtml, formatCount, formatErrorForLog, formatErrorMessage, generateLinkedIds, generateUniqueId, getAriaCurrent, getButtonAriaAttributes, getComputedStyleValue, getDialogAriaAttributes, getFocusableElements, getInitials, getInputAriaAttributes, getOptionAriaAttributes, getProgressAriaAttributes, getScrollParent, getTabAriaAttributes, getVisuallyHiddenStyles, handleError, hasClass, isBlank, isBrowser, isElementVisible, isNotBlank, isPecbError, isRecoverableError, matchesSelector, pluralize, prefersHighContrast, prefersReducedMotion, registerErrorHandler, removeClass, scrollIntoView, slugify, stripHtml, toCamelCase, toKebabCase, toPascalCase, toSnakeCase, toggleClass, trapFocus, truncate, tryAsync, trySync, wrapError };
|
|
2441
|
+
export type { AlertType, AlertVariant, Alignment, AnimationTiming, AriaAttributes, AriaLive, AriaRole, BreadcrumbItem, Breakpoint, ButtonIconStyle, ButtonSize, ButtonVariant, Callback, CardElevation, CardRadius, CardRole, CheckboxLabelPosition, ClosableWithHooks, ColorVariant, Colorable, ComponentSize, ConfirmationIconType, DatepickerSize, Direction, Disableable, DropdownOption, DropdownSize, ElevationLevel, ErrorCategory, ErrorHandler, ErrorOptions, ErrorSeverity, EventHandler, ExtendedColorVariant, FilterState, Focusable, FormControlBase, InputSize, InputType, Loadable, LoadingState, MenuItem, NonNullableProps, Notification, NotificationConfig, NotificationPosition, NotificationType, OptionalProps, Orientation, OverlayComponent, PageChangeEvent, PaginationSize, PaginationState, PaginationVariant, PecbError, PecbTableColumn, PecbTableColumnComponent, PecbTableColumnType, Position, RadioLabelPosition, RadioVariant, RadiusScale, RequireProps, RightModalSize, SelectableItem, SidebarMenuItem, SidebarSection, Size, Sizeable, SortState, SpacingScale, StateVariant, StatusSize, StatusType, StatusVariant, TabItem, TabSize, TabStyle, TableAction, TableColumn, TableRowActionEvent, TableSelectionEvent, TableSize, TableSortEvent, TableStatusConfig, TableUserConfig, TableVariant, Templatable, ThemeConfig, ThemeMode, ThemeVariables, ToggleLabelPosition, TreeNode, Validatable, ValidationError, ValidationState };
|