@pecb-ui/components 1.1.2
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 -0
- package/esm2022/lib/components/button/button.component.mjs +171 -0
- package/esm2022/lib/components/card/card.component.mjs +182 -0
- package/esm2022/lib/components/checkbox/checkbox.component.mjs +126 -0
- package/esm2022/lib/components/datepicker/datepicker.component.mjs +349 -0
- package/esm2022/lib/components/dropdown/dropdown.component.mjs +329 -0
- package/esm2022/lib/components/input/input.component.mjs +321 -0
- package/esm2022/lib/components/pagination/pagination.component.mjs +197 -0
- package/esm2022/lib/components/radio/radio.component.mjs +147 -0
- package/esm2022/lib/components/right-modal/right-modal.component.mjs +234 -0
- package/esm2022/lib/components/sidebar/sidebar.component.mjs +155 -0
- package/esm2022/lib/components/status/status.component.mjs +50 -0
- package/esm2022/lib/components/tab/tab.component.mjs +151 -0
- package/esm2022/lib/components/table/table.component.mjs +503 -0
- package/esm2022/lib/components/toggle/toggle.component.mjs +126 -0
- package/esm2022/lib/pecb-components.module.mjs +118 -0
- package/esm2022/lib/services/loading.service.mjs +182 -0
- package/esm2022/lib/services/notification.service.mjs +144 -0
- package/esm2022/lib/services/theme.service.mjs +232 -0
- package/esm2022/lib/shared/interfaces/component.interfaces.mjs +2 -0
- package/esm2022/lib/shared/types/common.types.mjs +6 -0
- package/esm2022/lib/shared/utils/accessibility.utils.mjs +223 -0
- package/esm2022/lib/shared/utils/dom.utils.mjs +240 -0
- package/esm2022/lib/shared/utils/error.utils.mjs +277 -0
- package/esm2022/lib/shared/utils/string.utils.mjs +204 -0
- package/esm2022/pecb-ui-components.mjs +5 -0
- package/esm2022/public-api.mjs +53 -0
- package/fesm2022/pecb-ui-components.mjs +4587 -0
- package/fesm2022/pecb-ui-components.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/button/button.component.d.ts +130 -0
- package/lib/components/card/card.component.d.ts +140 -0
- package/lib/components/checkbox/checkbox.component.d.ts +74 -0
- package/lib/components/datepicker/datepicker.component.d.ts +155 -0
- package/lib/components/dropdown/dropdown.component.d.ts +144 -0
- package/lib/components/input/input.component.d.ts +215 -0
- package/lib/components/pagination/pagination.component.d.ts +53 -0
- package/lib/components/radio/radio.component.d.ts +93 -0
- package/lib/components/right-modal/right-modal.component.d.ts +137 -0
- package/lib/components/sidebar/sidebar.component.d.ts +97 -0
- package/lib/components/status/status.component.d.ts +19 -0
- package/lib/components/tab/tab.component.d.ts +102 -0
- package/lib/components/table/table.component.d.ts +403 -0
- package/lib/components/toggle/toggle.component.d.ts +74 -0
- package/lib/pecb-components.module.d.ts +37 -0
- package/lib/services/loading.service.d.ts +129 -0
- package/lib/services/notification.service.d.ts +136 -0
- package/lib/services/theme.service.d.ts +142 -0
- package/lib/shared/interfaces/component.interfaces.d.ts +283 -0
- package/lib/shared/types/common.types.d.ts +86 -0
- package/lib/shared/utils/accessibility.utils.d.ts +167 -0
- package/lib/shared/utils/dom.utils.d.ts +108 -0
- package/lib/shared/utils/error.utils.d.ts +191 -0
- package/lib/shared/utils/string.utils.d.ts +144 -0
- package/package.json +61 -0
- package/public-api.d.ts +24 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export type TabStyle = 'rounded' | 'line';
|
|
4
|
+
export type TabSize = 'sm' | 'md';
|
|
5
|
+
/**
|
|
6
|
+
* A professional tab component with multiple styles and sizes.
|
|
7
|
+
* Fully accessible with WCAG 2.1 AA compliance.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```html
|
|
11
|
+
* <pecb-tab
|
|
12
|
+
* label="Tab Name"
|
|
13
|
+
* [active]="true"
|
|
14
|
+
* style="rounded"
|
|
15
|
+
* size="md"
|
|
16
|
+
* (clicked)="handleClick()"
|
|
17
|
+
* ></pecb-tab>
|
|
18
|
+
*
|
|
19
|
+
* <!-- With badge number and close button -->
|
|
20
|
+
* <pecb-tab
|
|
21
|
+
* label="Tab Name"
|
|
22
|
+
* [icon]="10"
|
|
23
|
+
* [closable]="true"
|
|
24
|
+
* [active]="true"
|
|
25
|
+
* (closed)="handleClose()"
|
|
26
|
+
* ></pecb-tab>
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @publicApi
|
|
30
|
+
*/
|
|
31
|
+
export declare class TabComponent {
|
|
32
|
+
/**
|
|
33
|
+
* Unique ID for the tab element
|
|
34
|
+
*/
|
|
35
|
+
id: string;
|
|
36
|
+
/**
|
|
37
|
+
* The visual style of the tab
|
|
38
|
+
*/
|
|
39
|
+
style: TabStyle;
|
|
40
|
+
/**
|
|
41
|
+
* The size of the tab
|
|
42
|
+
*/
|
|
43
|
+
size: TabSize;
|
|
44
|
+
/**
|
|
45
|
+
* Label text to display
|
|
46
|
+
*/
|
|
47
|
+
label: string;
|
|
48
|
+
/**
|
|
49
|
+
* Optional badge number to display after the label
|
|
50
|
+
*/
|
|
51
|
+
icon?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Whether the tab is in active state
|
|
54
|
+
*/
|
|
55
|
+
active: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Whether the tab is disabled
|
|
58
|
+
*/
|
|
59
|
+
disabled: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Whether to show close button
|
|
62
|
+
*/
|
|
63
|
+
closable: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Accessible label for the tab
|
|
66
|
+
*/
|
|
67
|
+
ariaLabel?: string;
|
|
68
|
+
/**
|
|
69
|
+
* ID of the tab panel this tab controls
|
|
70
|
+
*/
|
|
71
|
+
ariaControls?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Indicates if the tab panel is selected
|
|
74
|
+
*/
|
|
75
|
+
ariaSelected?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Event emitted when the tab is clicked
|
|
78
|
+
*/
|
|
79
|
+
clicked: EventEmitter<string>;
|
|
80
|
+
/**
|
|
81
|
+
* Event emitted when the close button is clicked
|
|
82
|
+
*/
|
|
83
|
+
closed: EventEmitter<string>;
|
|
84
|
+
/**
|
|
85
|
+
* Get CSS classes for the tab
|
|
86
|
+
*/
|
|
87
|
+
get tabClasses(): string[];
|
|
88
|
+
/**
|
|
89
|
+
* Handle tab click
|
|
90
|
+
*/
|
|
91
|
+
onClick(event: MouseEvent): void;
|
|
92
|
+
/**
|
|
93
|
+
* Handle close button click
|
|
94
|
+
*/
|
|
95
|
+
onClose(event: MouseEvent): void;
|
|
96
|
+
/**
|
|
97
|
+
* Handle keyboard events for accessibility
|
|
98
|
+
*/
|
|
99
|
+
onKeyDown(event: KeyboardEvent): void;
|
|
100
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TabComponent, never>;
|
|
101
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TabComponent, "pecb-tab", never, { "id": { "alias": "id"; "required": false; }; "style": { "alias": "style"; "required": false; }; "size": { "alias": "size"; "required": false; }; "label": { "alias": "label"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "active": { "alias": "active"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "closable": { "alias": "closable"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "ariaControls": { "alias": "ariaControls"; "required": false; }; "ariaSelected": { "alias": "ariaSelected"; "required": false; }; }, { "clicked": "clicked"; "closed": "closed"; }, never, never, true, never>;
|
|
102
|
+
}
|
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
import { EventEmitter, TemplateRef, Type } from '@angular/core';
|
|
2
|
+
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
|
3
|
+
import { PageChangeEvent } from '../pagination/pagination.component';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Defines the available table sizes
|
|
7
|
+
*/
|
|
8
|
+
export type TableSize = 'sm' | 'md' | 'lg';
|
|
9
|
+
/**
|
|
10
|
+
* Defines the available table variants
|
|
11
|
+
*/
|
|
12
|
+
export type TableVariant = 'default' | 'striped' | 'bordered';
|
|
13
|
+
/**
|
|
14
|
+
* Defines built-in column types
|
|
15
|
+
*/
|
|
16
|
+
export type PecbTableColumnType = 'text' | 'status' | 'action' | 'user' | 'custom';
|
|
17
|
+
/**
|
|
18
|
+
* Defines built-in component names for columns
|
|
19
|
+
*/
|
|
20
|
+
export type PecbTableColumnComponent = 'status' | 'action' | 'user';
|
|
21
|
+
/**
|
|
22
|
+
* Action button definition for action columns
|
|
23
|
+
*/
|
|
24
|
+
export interface TableAction {
|
|
25
|
+
/** Unique identifier for the action */
|
|
26
|
+
id: string;
|
|
27
|
+
/** Icon name or type */
|
|
28
|
+
icon: 'view' | 'edit' | 'delete' | 'download' | 'copy' | 'custom';
|
|
29
|
+
/** Tooltip/title text */
|
|
30
|
+
tooltip?: string;
|
|
31
|
+
/** Custom icon SVG (when icon is 'custom') */
|
|
32
|
+
customIcon?: string;
|
|
33
|
+
/** Whether the action is disabled */
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
/** Variant for styling (e.g., 'danger' for delete) */
|
|
36
|
+
variant?: 'default' | 'danger';
|
|
37
|
+
/** Click handler for this specific action */
|
|
38
|
+
action?: (row: any, index: number) => void;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Status mapping configuration
|
|
42
|
+
*/
|
|
43
|
+
export interface TableStatusConfig {
|
|
44
|
+
/** Map of value to status type */
|
|
45
|
+
typeMap?: Record<string, string>;
|
|
46
|
+
/** Status variant */
|
|
47
|
+
variant?: 'accent' | 'filled' | 'outline';
|
|
48
|
+
/** Status size */
|
|
49
|
+
size?: 'sm' | 'md' | 'lg';
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* User cell configuration
|
|
53
|
+
*/
|
|
54
|
+
export interface TableUserConfig {
|
|
55
|
+
/** Key for the avatar/image URL */
|
|
56
|
+
avatarKey?: string;
|
|
57
|
+
/** Key for the name */
|
|
58
|
+
nameKey?: string;
|
|
59
|
+
/** Key for the secondary text (e.g., email) */
|
|
60
|
+
secondaryKey?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Column definition for the table
|
|
64
|
+
*/
|
|
65
|
+
export interface PecbTableColumn {
|
|
66
|
+
/** Unique key for the column, used to access data */
|
|
67
|
+
key: string;
|
|
68
|
+
/** Display label for the column header */
|
|
69
|
+
label: string;
|
|
70
|
+
/** Width of the column (e.g., '200px', '20%', 'auto') */
|
|
71
|
+
width?: string;
|
|
72
|
+
/** Alignment of the column content */
|
|
73
|
+
align?: 'left' | 'center' | 'right';
|
|
74
|
+
/** Whether the column is sortable */
|
|
75
|
+
sortable?: boolean;
|
|
76
|
+
/** Custom template reference for cell content */
|
|
77
|
+
cellTemplate?: TemplateRef<any>;
|
|
78
|
+
/** Custom template reference for header content */
|
|
79
|
+
headerTemplate?: TemplateRef<any>;
|
|
80
|
+
/** CSS class to apply to the column */
|
|
81
|
+
cssClass?: string;
|
|
82
|
+
/** Built-in column type (deprecated, use 'component' instead) */
|
|
83
|
+
type?: PecbTableColumnType;
|
|
84
|
+
/** Built-in component to render: 'status', 'action', 'user' */
|
|
85
|
+
component?: PecbTableColumnComponent;
|
|
86
|
+
/** Dynamic component class to render in the cell (e.g., StatusComponent) */
|
|
87
|
+
dynamicComponent?: Type<any>;
|
|
88
|
+
/** Inputs to pass to the dynamic component */
|
|
89
|
+
componentInputs?: Record<string, any>;
|
|
90
|
+
/** Function to generate dynamic inputs based on row data */
|
|
91
|
+
componentInputsFn?: (row: any, value: any, index: number) => Record<string, any>;
|
|
92
|
+
/** Action buttons configuration (when component is 'action') */
|
|
93
|
+
actions?: TableAction[];
|
|
94
|
+
/** Status configuration (when component is 'status') */
|
|
95
|
+
statusConfig?: TableStatusConfig;
|
|
96
|
+
/** User cell configuration (when component is 'user') */
|
|
97
|
+
userConfig?: TableUserConfig;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Sort event emitted when a sortable column is clicked
|
|
101
|
+
*/
|
|
102
|
+
export interface TableSortEvent {
|
|
103
|
+
/** Column key that was sorted */
|
|
104
|
+
column: string;
|
|
105
|
+
/** Sort direction */
|
|
106
|
+
direction: 'asc' | 'desc' | null;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Row action event emitted when an action button is clicked
|
|
110
|
+
*/
|
|
111
|
+
export interface TableRowActionEvent {
|
|
112
|
+
/** Type of action performed */
|
|
113
|
+
action: string;
|
|
114
|
+
/** Row data for the action */
|
|
115
|
+
row: any;
|
|
116
|
+
/** Row index */
|
|
117
|
+
index: number;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Row selection event emitted when rows are selected/deselected
|
|
121
|
+
*/
|
|
122
|
+
export interface TableSelectionEvent {
|
|
123
|
+
/** Selected rows data */
|
|
124
|
+
selectedRows: any[];
|
|
125
|
+
/** Selected row indices */
|
|
126
|
+
selectedIndices: number[];
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Table component for displaying tabular data with pagination support.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```html
|
|
133
|
+
* <pecb-table
|
|
134
|
+
* [columns]="columns"
|
|
135
|
+
* [data]="tableData"
|
|
136
|
+
* [showPagination]="true"
|
|
137
|
+
* [totalItems]="500"
|
|
138
|
+
* [pageSize]="15"
|
|
139
|
+
* (pageChange)="onPageChange($event)"
|
|
140
|
+
* (rowAction)="onRowAction($event)">
|
|
141
|
+
* </pecb-table>
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
export declare class TableComponent {
|
|
145
|
+
private sanitizer;
|
|
146
|
+
constructor(sanitizer: DomSanitizer);
|
|
147
|
+
/**
|
|
148
|
+
* Column definitions for the table
|
|
149
|
+
*/
|
|
150
|
+
columns: PecbTableColumn[];
|
|
151
|
+
/**
|
|
152
|
+
* Data array to display in the table
|
|
153
|
+
*/
|
|
154
|
+
data: any[];
|
|
155
|
+
/**
|
|
156
|
+
* Size variant of the table
|
|
157
|
+
* @default 'md'
|
|
158
|
+
*/
|
|
159
|
+
size: TableSize;
|
|
160
|
+
/**
|
|
161
|
+
* Visual variant of the table
|
|
162
|
+
* @default 'default'
|
|
163
|
+
*/
|
|
164
|
+
variant: TableVariant;
|
|
165
|
+
/**
|
|
166
|
+
* Whether to show the table header
|
|
167
|
+
* @default true
|
|
168
|
+
*/
|
|
169
|
+
showHeader: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Whether to enable row hover effect
|
|
172
|
+
* @default true
|
|
173
|
+
*/
|
|
174
|
+
hoverable: boolean;
|
|
175
|
+
/**
|
|
176
|
+
* Whether to show pagination
|
|
177
|
+
* @default true
|
|
178
|
+
*/
|
|
179
|
+
showPagination: boolean;
|
|
180
|
+
/**
|
|
181
|
+
* Total number of items for pagination
|
|
182
|
+
*/
|
|
183
|
+
totalItems: number;
|
|
184
|
+
/**
|
|
185
|
+
* Current page number (1-based)
|
|
186
|
+
* @default 1
|
|
187
|
+
*/
|
|
188
|
+
currentPage: number;
|
|
189
|
+
/**
|
|
190
|
+
* Number of items per page
|
|
191
|
+
* @default 15
|
|
192
|
+
*/
|
|
193
|
+
pageSize: number;
|
|
194
|
+
/**
|
|
195
|
+
* Available page size options
|
|
196
|
+
*/
|
|
197
|
+
pageSizeOptions: number[];
|
|
198
|
+
/**
|
|
199
|
+
* Whether to show page size selector in pagination
|
|
200
|
+
* @default true
|
|
201
|
+
*/
|
|
202
|
+
showPageSizeSelector: boolean;
|
|
203
|
+
/**
|
|
204
|
+
* Pagination variant
|
|
205
|
+
* @default 'full'
|
|
206
|
+
*/
|
|
207
|
+
paginationVariant: 'full' | 'compact' | 'minimal' | 'centered';
|
|
208
|
+
/**
|
|
209
|
+
* Message to display when there is no data
|
|
210
|
+
*/
|
|
211
|
+
emptyMessage: string;
|
|
212
|
+
/**
|
|
213
|
+
* Whether to show loading state
|
|
214
|
+
* @default false
|
|
215
|
+
*/
|
|
216
|
+
loading: boolean;
|
|
217
|
+
/**
|
|
218
|
+
* Whether to enable row selection
|
|
219
|
+
* @default false
|
|
220
|
+
*/
|
|
221
|
+
selectable: boolean;
|
|
222
|
+
/**
|
|
223
|
+
* Currently selected row indices
|
|
224
|
+
*/
|
|
225
|
+
selectedIndices: number[];
|
|
226
|
+
/**
|
|
227
|
+
* Whether the table has a fixed header
|
|
228
|
+
* @default false
|
|
229
|
+
*/
|
|
230
|
+
stickyHeader: boolean;
|
|
231
|
+
/**
|
|
232
|
+
* Maximum height of the table body (enables scrolling)
|
|
233
|
+
*/
|
|
234
|
+
maxHeight?: string;
|
|
235
|
+
/**
|
|
236
|
+
* Column key currently being sorted
|
|
237
|
+
*/
|
|
238
|
+
sortColumn?: string;
|
|
239
|
+
/**
|
|
240
|
+
* Current sort direction
|
|
241
|
+
*/
|
|
242
|
+
sortDirection: 'asc' | 'desc' | null;
|
|
243
|
+
/**
|
|
244
|
+
* ARIA label for the table
|
|
245
|
+
*/
|
|
246
|
+
ariaLabel: string;
|
|
247
|
+
/**
|
|
248
|
+
* Emitted when a page change occurs
|
|
249
|
+
*/
|
|
250
|
+
pageChange: EventEmitter<PageChangeEvent>;
|
|
251
|
+
/**
|
|
252
|
+
* Emitted when page size changes
|
|
253
|
+
*/
|
|
254
|
+
pageSizeChange: EventEmitter<number>;
|
|
255
|
+
/**
|
|
256
|
+
* Emitted when a row is clicked
|
|
257
|
+
*/
|
|
258
|
+
rowClick: EventEmitter<{
|
|
259
|
+
row: any;
|
|
260
|
+
index: number;
|
|
261
|
+
}>;
|
|
262
|
+
/**
|
|
263
|
+
* Emitted when a row action is triggered
|
|
264
|
+
*/
|
|
265
|
+
rowAction: EventEmitter<TableRowActionEvent>;
|
|
266
|
+
/**
|
|
267
|
+
* Emitted when sorting changes
|
|
268
|
+
*/
|
|
269
|
+
sortChange: EventEmitter<TableSortEvent>;
|
|
270
|
+
/**
|
|
271
|
+
* Emitted when row selection changes
|
|
272
|
+
*/
|
|
273
|
+
selectionChange: EventEmitter<TableSelectionEvent>;
|
|
274
|
+
/**
|
|
275
|
+
* Custom template for empty state
|
|
276
|
+
*/
|
|
277
|
+
emptyTemplate?: TemplateRef<any>;
|
|
278
|
+
/**
|
|
279
|
+
* Custom template for loading state
|
|
280
|
+
*/
|
|
281
|
+
loadingTemplate?: TemplateRef<any>;
|
|
282
|
+
/**
|
|
283
|
+
* Gets the CSS classes for the table container
|
|
284
|
+
*/
|
|
285
|
+
get containerClasses(): string;
|
|
286
|
+
/**
|
|
287
|
+
* Gets the CSS classes for the pagination container
|
|
288
|
+
*/
|
|
289
|
+
get paginationClasses(): string;
|
|
290
|
+
/**
|
|
291
|
+
* Gets the CSS classes for the table element
|
|
292
|
+
*/
|
|
293
|
+
get tableClasses(): string;
|
|
294
|
+
/**
|
|
295
|
+
* Gets the value from a row for a given column key
|
|
296
|
+
* Supports nested keys like 'user.name'
|
|
297
|
+
*/
|
|
298
|
+
getCellValue(row: any, key: string): any;
|
|
299
|
+
/**
|
|
300
|
+
* Gets the alignment class for a column
|
|
301
|
+
*/
|
|
302
|
+
getAlignmentClass(column: PecbTableColumn): string;
|
|
303
|
+
/**
|
|
304
|
+
* Handles row click events
|
|
305
|
+
*/
|
|
306
|
+
onRowClick(row: any, index: number): void;
|
|
307
|
+
/**
|
|
308
|
+
* Handles row action button clicks
|
|
309
|
+
*/
|
|
310
|
+
onRowAction(action: string, row: any, index: number, event: Event): void;
|
|
311
|
+
/**
|
|
312
|
+
* Handles column header click for sorting
|
|
313
|
+
*/
|
|
314
|
+
onHeaderClick(column: PecbTableColumn): void;
|
|
315
|
+
/**
|
|
316
|
+
* Toggles row selection
|
|
317
|
+
*/
|
|
318
|
+
toggleRowSelection(index: number): void;
|
|
319
|
+
/**
|
|
320
|
+
* Toggles all rows selection
|
|
321
|
+
*/
|
|
322
|
+
toggleAllSelection(): void;
|
|
323
|
+
/**
|
|
324
|
+
* Checks if a row is selected
|
|
325
|
+
*/
|
|
326
|
+
isRowSelected(index: number): boolean;
|
|
327
|
+
/**
|
|
328
|
+
* Checks if all rows are selected
|
|
329
|
+
*/
|
|
330
|
+
isAllSelected(): boolean;
|
|
331
|
+
/**
|
|
332
|
+
* Checks if some rows are selected (for indeterminate state)
|
|
333
|
+
*/
|
|
334
|
+
isSomeSelected(): boolean;
|
|
335
|
+
/**
|
|
336
|
+
* Handles page change from pagination component
|
|
337
|
+
*/
|
|
338
|
+
onPageChange(event: PageChangeEvent): void;
|
|
339
|
+
/**
|
|
340
|
+
* Handles page size change from pagination component
|
|
341
|
+
*/
|
|
342
|
+
onPageSizeChange(newSize: number): void;
|
|
343
|
+
/**
|
|
344
|
+
* Gets the sort icon state for a column
|
|
345
|
+
*/
|
|
346
|
+
getSortState(column: PecbTableColumn): 'asc' | 'desc' | 'none';
|
|
347
|
+
/**
|
|
348
|
+
* Tracks rows by index for ngFor performance
|
|
349
|
+
*/
|
|
350
|
+
trackByIndex(index: number): number;
|
|
351
|
+
/**
|
|
352
|
+
* Tracks columns by key for ngFor performance
|
|
353
|
+
*/
|
|
354
|
+
trackByKey(_: number, column: PecbTableColumn): string;
|
|
355
|
+
/**
|
|
356
|
+
* Gets the effective column type (supports both 'type' and 'component' properties)
|
|
357
|
+
*/
|
|
358
|
+
getColumnType(column: PecbTableColumn): string;
|
|
359
|
+
/**
|
|
360
|
+
* Gets the status type for a value based on column config
|
|
361
|
+
*/
|
|
362
|
+
getStatusType(value: any, column: PecbTableColumn): any;
|
|
363
|
+
/**
|
|
364
|
+
* Gets the status variant for a column
|
|
365
|
+
*/
|
|
366
|
+
getStatusVariant(column: PecbTableColumn): any;
|
|
367
|
+
/**
|
|
368
|
+
* Gets the status size for a column
|
|
369
|
+
*/
|
|
370
|
+
getStatusSize(column: PecbTableColumn): any;
|
|
371
|
+
/**
|
|
372
|
+
* Gets user display data from row
|
|
373
|
+
*/
|
|
374
|
+
getUserData(row: any, column: PecbTableColumn): {
|
|
375
|
+
avatar: string;
|
|
376
|
+
name: string;
|
|
377
|
+
secondary: string;
|
|
378
|
+
};
|
|
379
|
+
/**
|
|
380
|
+
* Gets default actions if none specified
|
|
381
|
+
*/
|
|
382
|
+
getActions(column: PecbTableColumn): TableAction[];
|
|
383
|
+
/**
|
|
384
|
+
* Handles action button click
|
|
385
|
+
*/
|
|
386
|
+
onActionClick(action: TableAction, row: any, index: number, event: Event): void;
|
|
387
|
+
/**
|
|
388
|
+
* Gets the inputs for a dynamic component
|
|
389
|
+
* Combines static componentInputs with row-specific data from componentInputsFn
|
|
390
|
+
*/
|
|
391
|
+
getDynamicComponentInputs(row: any, column: PecbTableColumn, index: number): Record<string, any>;
|
|
392
|
+
/**
|
|
393
|
+
* Checks if column has a dynamic component
|
|
394
|
+
*/
|
|
395
|
+
hasDynamicComponent(column: PecbTableColumn): boolean;
|
|
396
|
+
/**
|
|
397
|
+
* Sanitizes custom icon SVG for safe rendering
|
|
398
|
+
*/
|
|
399
|
+
getSafeIcon(iconSvg: string | undefined): SafeHtml;
|
|
400
|
+
private emitSelectionChange;
|
|
401
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent, never>;
|
|
402
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent, "pecb-table", never, { "columns": { "alias": "columns"; "required": false; }; "data": { "alias": "data"; "required": false; }; "size": { "alias": "size"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "showHeader": { "alias": "showHeader"; "required": false; }; "hoverable": { "alias": "hoverable"; "required": false; }; "showPagination": { "alias": "showPagination"; "required": false; }; "totalItems": { "alias": "totalItems"; "required": false; }; "currentPage": { "alias": "currentPage"; "required": false; }; "pageSize": { "alias": "pageSize"; "required": false; }; "pageSizeOptions": { "alias": "pageSizeOptions"; "required": false; }; "showPageSizeSelector": { "alias": "showPageSizeSelector"; "required": false; }; "paginationVariant": { "alias": "paginationVariant"; "required": false; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "selectable": { "alias": "selectable"; "required": false; }; "selectedIndices": { "alias": "selectedIndices"; "required": false; }; "stickyHeader": { "alias": "stickyHeader"; "required": false; }; "maxHeight": { "alias": "maxHeight"; "required": false; }; "sortColumn": { "alias": "sortColumn"; "required": false; }; "sortDirection": { "alias": "sortDirection"; "required": false; }; "ariaLabel": { "alias": "aria-label"; "required": false; }; }, { "pageChange": "pageChange"; "pageSizeChange": "pageSizeChange"; "rowClick": "rowClick"; "rowAction": "rowAction"; "sortChange": "sortChange"; "selectionChange": "selectionChange"; }, ["emptyTemplate", "loadingTemplate"], never, true, never>;
|
|
403
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { EventEmitter, ChangeDetectorRef } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export type ToggleLabelPosition = 'right' | 'left';
|
|
5
|
+
/**
|
|
6
|
+
* A professional toggle/switch component with label and description support.
|
|
7
|
+
* Fully accessible with WCAG 2.1 AA compliance and reactive forms support.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```html
|
|
11
|
+
* <pecb-toggle
|
|
12
|
+
* label="Enable notifications"
|
|
13
|
+
* description="Receive email notifications"
|
|
14
|
+
* [(ngModel)]="notificationsEnabled"
|
|
15
|
+
* ></pecb-toggle>
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @publicApi
|
|
19
|
+
*/
|
|
20
|
+
export declare class ToggleComponent implements ControlValueAccessor {
|
|
21
|
+
private cdr;
|
|
22
|
+
/**
|
|
23
|
+
* Unique ID for the toggle element
|
|
24
|
+
*/
|
|
25
|
+
id: string;
|
|
26
|
+
/**
|
|
27
|
+
* Name attribute for the toggle
|
|
28
|
+
*/
|
|
29
|
+
name?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Label text to display
|
|
32
|
+
*/
|
|
33
|
+
label?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Description text to display below label
|
|
36
|
+
*/
|
|
37
|
+
description?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Position of the label relative to the toggle control.
|
|
40
|
+
* 'right' (default): [toggle] Title Description
|
|
41
|
+
* 'left': Title Description [toggle]
|
|
42
|
+
*/
|
|
43
|
+
labelPosition: ToggleLabelPosition;
|
|
44
|
+
/**
|
|
45
|
+
* Whether the toggle is disabled
|
|
46
|
+
*/
|
|
47
|
+
disabled: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Event emitted when toggle state changes
|
|
50
|
+
*/
|
|
51
|
+
toggleChange: EventEmitter<boolean>;
|
|
52
|
+
checked: boolean;
|
|
53
|
+
private onChange;
|
|
54
|
+
private onTouched;
|
|
55
|
+
constructor(cdr: ChangeDetectorRef);
|
|
56
|
+
/**
|
|
57
|
+
* Get CSS classes for the toggle wrapper
|
|
58
|
+
*/
|
|
59
|
+
get wrapperClasses(): string[];
|
|
60
|
+
/**
|
|
61
|
+
* Handle toggle change
|
|
62
|
+
*/
|
|
63
|
+
onToggleChange(event: Event): void;
|
|
64
|
+
/**
|
|
65
|
+
* Handle blur event
|
|
66
|
+
*/
|
|
67
|
+
onBlur(): void;
|
|
68
|
+
writeValue(value: boolean): void;
|
|
69
|
+
registerOnChange(fn: (value: boolean) => void): void;
|
|
70
|
+
registerOnTouched(fn: () => void): void;
|
|
71
|
+
setDisabledState(isDisabled: boolean): void;
|
|
72
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ToggleComponent, never>;
|
|
73
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ToggleComponent, "pecb-toggle", never, { "id": { "alias": "id"; "required": false; }; "name": { "alias": "name"; "required": false; }; "label": { "alias": "label"; "required": false; }; "description": { "alias": "description"; "required": false; }; "labelPosition": { "alias": "labelPosition"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "toggleChange": "toggleChange"; }, never, never, true, never>;
|
|
74
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "@angular/common";
|
|
3
|
+
import * as i2 from "./components/button/button.component";
|
|
4
|
+
import * as i3 from "./components/card/card.component";
|
|
5
|
+
import * as i4 from "./components/status/status.component";
|
|
6
|
+
import * as i5 from "./components/pagination/pagination.component";
|
|
7
|
+
import * as i6 from "./components/table/table.component";
|
|
8
|
+
import * as i7 from "./components/tab/tab.component";
|
|
9
|
+
import * as i8 from "./components/datepicker/datepicker.component";
|
|
10
|
+
import * as i9 from "./components/input/input.component";
|
|
11
|
+
import * as i10 from "./components/radio/radio.component";
|
|
12
|
+
import * as i11 from "./components/checkbox/checkbox.component";
|
|
13
|
+
import * as i12 from "./components/toggle/toggle.component";
|
|
14
|
+
import * as i13 from "./components/dropdown/dropdown.component";
|
|
15
|
+
import * as i14 from "./components/right-modal/right-modal.component";
|
|
16
|
+
import * as i15 from "./components/sidebar/sidebar.component";
|
|
17
|
+
/**
|
|
18
|
+
* PECB UI Components Module
|
|
19
|
+
*
|
|
20
|
+
* A professional Angular components library with TypeScript and SCSS.
|
|
21
|
+
* Import this module to use all PECB UI components in your application.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* import { PecbComponentsModule } from '@pecb-ui/components';
|
|
26
|
+
*
|
|
27
|
+
* @NgModule({
|
|
28
|
+
* imports: [PecbComponentsModule]
|
|
29
|
+
* })
|
|
30
|
+
* export class AppModule { }
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare class PecbComponentsModule {
|
|
34
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PecbComponentsModule, never>;
|
|
35
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<PecbComponentsModule, never, [typeof i1.CommonModule, typeof i2.ButtonComponent, typeof i3.CardComponent, typeof i3.CardHeaderComponent, typeof i3.CardBodyComponent, typeof i3.CardFooterComponent, typeof i4.StatusComponent, typeof i5.PaginationComponent, typeof i6.TableComponent, typeof i7.TabComponent, typeof i8.DatepickerComponent, typeof i9.InputComponent, typeof i10.RadioComponent, typeof i11.CheckboxComponent, typeof i12.ToggleComponent, typeof i13.DropdownComponent, typeof i14.RightModalComponent, typeof i14.RightModalHeaderDirective, typeof i14.RightModalContentDirective, typeof i14.RightModalFooterDirective, typeof i15.SidebarComponent], [typeof i2.ButtonComponent, typeof i3.CardComponent, typeof i3.CardHeaderComponent, typeof i3.CardBodyComponent, typeof i3.CardFooterComponent, typeof i4.StatusComponent, typeof i5.PaginationComponent, typeof i6.TableComponent, typeof i7.TabComponent, typeof i8.DatepickerComponent, typeof i9.InputComponent, typeof i10.RadioComponent, typeof i11.CheckboxComponent, typeof i12.ToggleComponent, typeof i13.DropdownComponent, typeof i14.RightModalComponent, typeof i14.RightModalHeaderDirective, typeof i14.RightModalContentDirective, typeof i14.RightModalFooterDirective, typeof i15.SidebarComponent]>;
|
|
36
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<PecbComponentsModule>;
|
|
37
|
+
}
|