ngx-opalbytes-components 1.4.0 → 1.6.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.
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { OnInit, EventEmitter } from '@angular/core';
|
|
2
|
+
import { OnInit, EventEmitter, AfterViewInit, OnDestroy, ElementRef, ChangeDetectorRef, Signal } from '@angular/core';
|
|
3
|
+
import { LiveAnnouncer } from '@angular/cdk/a11y';
|
|
4
|
+
import { SelectionModel } from '@angular/cdk/collections';
|
|
5
|
+
import { MatPaginatorIntl, PageEvent, MatPaginator } from '@angular/material/paginator';
|
|
6
|
+
import { MatSort, Sort } from '@angular/material/sort';
|
|
7
|
+
import { MatTableDataSource } from '@angular/material/table';
|
|
8
|
+
import { Observable } from 'rxjs';
|
|
9
|
+
import { ControlValueAccessor, AbstractControl, FormControl } from '@angular/forms';
|
|
10
|
+
import { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
|
|
11
|
+
import { MatDateRangeInput } from '@angular/material/datepicker';
|
|
12
|
+
import { Router, ActivatedRoute } from '@angular/router';
|
|
3
13
|
|
|
4
14
|
declare class BaseButton implements OnInit {
|
|
5
15
|
readonly buttonClick: EventEmitter<void>;
|
|
@@ -7,16 +17,16 @@ declare class BaseButton implements OnInit {
|
|
|
7
17
|
isDarkMode: boolean;
|
|
8
18
|
isDisabled: boolean;
|
|
9
19
|
isLoading: boolean;
|
|
10
|
-
useMaterialIcons: boolean;
|
|
11
20
|
btnClass: string;
|
|
12
21
|
tooltip?: string;
|
|
13
22
|
trailingIcon?: string;
|
|
14
23
|
leadingIcon?: string;
|
|
24
|
+
isLucideIcon: boolean;
|
|
15
25
|
dataCy?: string;
|
|
16
26
|
ngOnInit(): void;
|
|
17
27
|
onClick(): void;
|
|
18
28
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseButton, never>;
|
|
19
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<BaseButton, "cao-base-button", never, { "buttonText": { "alias": "buttonText"; "required": false; }; "isDarkMode": { "alias": "isDarkMode"; "required": false; }; "isDisabled": { "alias": "isDisabled"; "required": false; }; "isLoading": { "alias": "isLoading"; "required": false; }; "
|
|
29
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BaseButton, "cao-base-button", never, { "buttonText": { "alias": "buttonText"; "required": false; }; "isDarkMode": { "alias": "isDarkMode"; "required": false; }; "isDisabled": { "alias": "isDisabled"; "required": false; }; "isLoading": { "alias": "isLoading"; "required": false; }; "btnClass": { "alias": "btnClass"; "required": false; }; "tooltip": { "alias": "tooltip"; "required": false; }; "trailingIcon": { "alias": "trailingIcon"; "required": false; }; "leadingIcon": { "alias": "leadingIcon"; "required": false; }; "isLucideIcon": { "alias": "isLucideIcon"; "required": false; }; "dataCy": { "alias": "dataCy"; "required": false; }; }, { "buttonClick": "buttonClick"; }, never, never, true, never>;
|
|
20
30
|
}
|
|
21
31
|
|
|
22
32
|
type AlertType = "success" | "error" | "info" | "warning";
|
|
@@ -26,16 +36,17 @@ interface IAlertConfig {
|
|
|
26
36
|
message: string;
|
|
27
37
|
alertIcon?: string;
|
|
28
38
|
}
|
|
29
|
-
declare class BaseAlert {
|
|
39
|
+
declare class BaseAlert implements OnInit {
|
|
30
40
|
data: {
|
|
31
41
|
type: AlertType;
|
|
32
42
|
title: string;
|
|
33
43
|
message: string;
|
|
34
44
|
alertIcon?: string;
|
|
35
45
|
};
|
|
46
|
+
iconPath: string;
|
|
47
|
+
titleClass: string;
|
|
36
48
|
private iconPaths;
|
|
37
|
-
|
|
38
|
-
getTitleClass(type: AlertType): string;
|
|
49
|
+
ngOnInit(): void;
|
|
39
50
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseAlert, never>;
|
|
40
51
|
static ɵcmp: i0.ɵɵComponentDeclaration<BaseAlert, "cao-base-alert", never, {}, {}, never, never, true, never>;
|
|
41
52
|
}
|
|
@@ -63,5 +74,283 @@ declare class BaseDialog {
|
|
|
63
74
|
static ɵcmp: i0.ɵɵComponentDeclaration<BaseDialog, "cao-base-dialog", never, { "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
|
|
64
75
|
}
|
|
65
76
|
|
|
66
|
-
|
|
67
|
-
|
|
77
|
+
interface IColumnButton {
|
|
78
|
+
icon: string;
|
|
79
|
+
label: string;
|
|
80
|
+
onClick: (data: any) => void;
|
|
81
|
+
tooltip?: string;
|
|
82
|
+
}
|
|
83
|
+
interface IColumnConfig {
|
|
84
|
+
type: "STRING" | "BOOLEAN" | "SINGLE_BUTTON" | "DATE" | "NUMBER" | "text" | "number" | "boolean" | "date" | "actions";
|
|
85
|
+
element?: string;
|
|
86
|
+
key?: string;
|
|
87
|
+
header: string;
|
|
88
|
+
visible: boolean;
|
|
89
|
+
sortable?: boolean;
|
|
90
|
+
isDefaultSort?: boolean;
|
|
91
|
+
defaultSortDirection?: "asc" | "desc";
|
|
92
|
+
pipe?: any;
|
|
93
|
+
buttons?: IColumnButton[];
|
|
94
|
+
}
|
|
95
|
+
interface ITableConfig {
|
|
96
|
+
columns: string[];
|
|
97
|
+
subTitle?: string | null;
|
|
98
|
+
result?: {
|
|
99
|
+
noData: string;
|
|
100
|
+
defaultMessage: string;
|
|
101
|
+
};
|
|
102
|
+
data: any[];
|
|
103
|
+
columnData: Record<string, IColumnConfig>;
|
|
104
|
+
paginated?: boolean;
|
|
105
|
+
}
|
|
106
|
+
declare class FilterTableService {
|
|
107
|
+
private filterSubject;
|
|
108
|
+
filter$: Observable<string>;
|
|
109
|
+
updateFilter(filterValue: string): void;
|
|
110
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FilterTableService, never>;
|
|
111
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FilterTableService>;
|
|
112
|
+
}
|
|
113
|
+
declare class TableService {
|
|
114
|
+
private tableConfigSubject;
|
|
115
|
+
private dataSubject;
|
|
116
|
+
private columnsSubject;
|
|
117
|
+
tableConfig$: Observable<ITableConfig | null>;
|
|
118
|
+
columns$: Observable<IColumnConfig[]>;
|
|
119
|
+
data$: Observable<any[]>;
|
|
120
|
+
visibleColumns$: Observable<string[]>;
|
|
121
|
+
createTable(data: any[], columns?: IColumnConfig[], customConfig?: Partial<ITableConfig>): void;
|
|
122
|
+
private inferColumnType;
|
|
123
|
+
private isValidDate;
|
|
124
|
+
toggleColumnVisibility(columnKey: string): void;
|
|
125
|
+
getVisibleColumns(): IColumnConfig[];
|
|
126
|
+
setColumns(columns: IColumnConfig[]): void;
|
|
127
|
+
setData(data: any[]): void;
|
|
128
|
+
updateTableData(data: any[]): void;
|
|
129
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TableService, never>;
|
|
130
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TableService>;
|
|
131
|
+
}
|
|
132
|
+
declare function getPtBrPaginatorIntl(): MatPaginatorIntl;
|
|
133
|
+
declare class TableComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
134
|
+
protected tableService: TableService;
|
|
135
|
+
protected liveAnnouncer: LiveAnnouncer;
|
|
136
|
+
protected filterTableService: FilterTableService;
|
|
137
|
+
customClass: string;
|
|
138
|
+
pageSizeOptions: number[];
|
|
139
|
+
showFirstLastButtons: boolean;
|
|
140
|
+
isPaginatedByServer: boolean;
|
|
141
|
+
readonly pageChanged: EventEmitter<number>;
|
|
142
|
+
readonly pageSizeChanged: EventEmitter<number>;
|
|
143
|
+
readonly firstPageClicked: EventEmitter<void>;
|
|
144
|
+
readonly lastPageClicked: EventEmitter<void>;
|
|
145
|
+
readonly selectionChanged: EventEmitter<any[]>;
|
|
146
|
+
readonly pageEvent: EventEmitter<PageEvent>;
|
|
147
|
+
dataSource: MatTableDataSource<any, MatPaginator>;
|
|
148
|
+
selection: SelectionModel<any>;
|
|
149
|
+
allColumns: string[];
|
|
150
|
+
displayedColumns: string[];
|
|
151
|
+
filterValue: string;
|
|
152
|
+
private configSubscription;
|
|
153
|
+
private visibleColumnsSubscription;
|
|
154
|
+
private dataSubscription;
|
|
155
|
+
private filterSubscription;
|
|
156
|
+
tableConfig: ITableConfig | null;
|
|
157
|
+
sort: MatSort;
|
|
158
|
+
paginator: MatPaginator;
|
|
159
|
+
totalItems: number;
|
|
160
|
+
pageSize: number;
|
|
161
|
+
currentPage: number;
|
|
162
|
+
private previousPage;
|
|
163
|
+
getAllColumns(): string[];
|
|
164
|
+
constructor(tableService: TableService, liveAnnouncer: LiveAnnouncer, filterTableService: FilterTableService);
|
|
165
|
+
ngOnInit(): void;
|
|
166
|
+
ngAfterViewInit(): void;
|
|
167
|
+
ngOnDestroy(): void;
|
|
168
|
+
initializeSortingAccessor(): void;
|
|
169
|
+
initializeFilterPredicate(): void;
|
|
170
|
+
applyFilter(): void;
|
|
171
|
+
toggleColumnVisibility(columnKey: string): void;
|
|
172
|
+
isColumnVisible(column: string): boolean;
|
|
173
|
+
getColumnHeader(column: string): string;
|
|
174
|
+
getColumnType(column: string): IColumnConfig["type"];
|
|
175
|
+
getColumnElement(column: string): string;
|
|
176
|
+
getColumnButtons(column: string): any[];
|
|
177
|
+
isAllSelected(): boolean;
|
|
178
|
+
toggleAllRows(): void;
|
|
179
|
+
announceSortChange(sortState: Sort): void;
|
|
180
|
+
trackByFn(index: number, item: any): any;
|
|
181
|
+
onPageChanged(page: number): void;
|
|
182
|
+
onPageSizeChanged(pageSize: number): void;
|
|
183
|
+
/**
|
|
184
|
+
* Handle pagination events from Mat Paginator
|
|
185
|
+
*/
|
|
186
|
+
onPageEvent(event: PageEvent): void;
|
|
187
|
+
/**
|
|
188
|
+
* Navigate to first page programmatically
|
|
189
|
+
*/
|
|
190
|
+
goToFirstPage(): void;
|
|
191
|
+
/**
|
|
192
|
+
* Navigate to last page programmatically
|
|
193
|
+
*/
|
|
194
|
+
goToLastPage(): void;
|
|
195
|
+
/**
|
|
196
|
+
* Update total items when data changes
|
|
197
|
+
*/
|
|
198
|
+
updateTotalItems(): void;
|
|
199
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent, never>;
|
|
200
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent, "cao-base-table", never, { "customClass": { "alias": "customClass"; "required": false; }; "pageSizeOptions": { "alias": "pageSizeOptions"; "required": false; }; "showFirstLastButtons": { "alias": "showFirstLastButtons"; "required": false; }; "isPaginatedByServer": { "alias": "isPaginatedByServer"; "required": false; }; }, { "pageChanged": "pageChanged"; "pageSizeChanged": "pageSizeChanged"; "firstPageClicked": "firstPageClicked"; "lastPageClicked": "lastPageClicked"; "selectionChanged": "selectionChanged"; "pageEvent": "pageEvent"; }, never, never, true, never>;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
interface IAutoCompleteOption {
|
|
204
|
+
id?: string | number;
|
|
205
|
+
nome: string;
|
|
206
|
+
icon?: string;
|
|
207
|
+
iconPosition?: string;
|
|
208
|
+
}
|
|
209
|
+
declare class RnvAutocompleteComponent implements OnInit, ControlValueAccessor {
|
|
210
|
+
label: string;
|
|
211
|
+
placeholder: string;
|
|
212
|
+
options: IAutoCompleteOption[];
|
|
213
|
+
control: AbstractControl;
|
|
214
|
+
dataCy: string;
|
|
215
|
+
controlName: string;
|
|
216
|
+
internalControl: FormControl<string | null>;
|
|
217
|
+
filteredOptions$: Observable<IAutoCompleteOption[]>;
|
|
218
|
+
isFocused: boolean;
|
|
219
|
+
private onChange;
|
|
220
|
+
private onTouched;
|
|
221
|
+
ngOnInit(): void;
|
|
222
|
+
onFocus(): void;
|
|
223
|
+
onBlur(): void;
|
|
224
|
+
private filter;
|
|
225
|
+
displayFn(option: IAutoCompleteOption): string;
|
|
226
|
+
onOptionSelected(event: MatAutocompleteSelectedEvent): void;
|
|
227
|
+
get errorText(): string | null;
|
|
228
|
+
get controlNameValue(): string;
|
|
229
|
+
writeValue(value: IAutoCompleteOption | string): void;
|
|
230
|
+
registerOnChange(fn: (value: IAutoCompleteOption | string) => void): void;
|
|
231
|
+
registerOnTouched(fn: () => void): void;
|
|
232
|
+
setDisabledState?(isDisabled: boolean): void;
|
|
233
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RnvAutocompleteComponent, never>;
|
|
234
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RnvAutocompleteComponent, "cao-autocomplete", never, { "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "options": { "alias": "options"; "required": false; }; "control": { "alias": "control"; "required": false; }; "dataCy": { "alias": "dataCy"; "required": false; }; "controlName": { "alias": "controlName"; "required": false; }; }, {}, never, never, true, never>;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
declare class BaseTimeRange implements OnInit {
|
|
238
|
+
label: string;
|
|
239
|
+
max: Date | undefined;
|
|
240
|
+
minDate: Date | undefined;
|
|
241
|
+
maxDate: Date | undefined;
|
|
242
|
+
startDate: Date | undefined;
|
|
243
|
+
finalDate: Date | undefined;
|
|
244
|
+
dataCy?: string;
|
|
245
|
+
controlName: string;
|
|
246
|
+
readonly rangeSelected: EventEmitter<Date[]>;
|
|
247
|
+
dateRangeInput: MatDateRangeInput<Date>;
|
|
248
|
+
ngOnInit(): void;
|
|
249
|
+
onSelectStartDate(event: any): void;
|
|
250
|
+
onInputMaxDate(event: any): void;
|
|
251
|
+
clearInputs(): void;
|
|
252
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseTimeRange, never>;
|
|
253
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BaseTimeRange, "cao-base-time-range", never, { "label": { "alias": "label"; "required": false; }; "max": { "alias": "max"; "required": false; }; "minDate": { "alias": "minDate"; "required": false; }; "maxDate": { "alias": "maxDate"; "required": false; }; "startDate": { "alias": "startDate"; "required": false; }; "finalDate": { "alias": "finalDate"; "required": false; }; "dataCy": { "alias": "dataCy"; "required": false; }; "controlName": { "alias": "controlName"; "required": false; }; }, { "rangeSelected": "rangeSelected"; }, never, never, true, never>;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
interface IDropDownOption {
|
|
257
|
+
id?: string | number;
|
|
258
|
+
nome: string;
|
|
259
|
+
icon?: string;
|
|
260
|
+
iconPosition?: string;
|
|
261
|
+
dataCy?: string;
|
|
262
|
+
}
|
|
263
|
+
declare class DropDownComponent implements ControlValueAccessor, OnInit, OnDestroy {
|
|
264
|
+
private _eref;
|
|
265
|
+
private cdr;
|
|
266
|
+
textHeader: string;
|
|
267
|
+
options: IDropDownOption[];
|
|
268
|
+
dropDownClass: string;
|
|
269
|
+
styleDropDown: {
|
|
270
|
+
[klass: string]: unknown;
|
|
271
|
+
};
|
|
272
|
+
control?: AbstractControl | null;
|
|
273
|
+
controlName: string;
|
|
274
|
+
isDisabled: boolean;
|
|
275
|
+
readonly itemSelected: EventEmitter<IDropDownOption>;
|
|
276
|
+
tooltip: string;
|
|
277
|
+
dropDirectionInput: "up" | "down";
|
|
278
|
+
dataCy?: string;
|
|
279
|
+
trackByFn?: (index: number, item: IDropDownOption) => unknown;
|
|
280
|
+
compareWith?: (option: unknown, value: unknown) => boolean;
|
|
281
|
+
ariaLabel?: string;
|
|
282
|
+
ariaLabelledBy?: string;
|
|
283
|
+
listAriaLabel?: string;
|
|
284
|
+
isOpen: boolean;
|
|
285
|
+
selectedItem?: IDropDownOption;
|
|
286
|
+
filteredOptions: IDropDownOption[];
|
|
287
|
+
searchControl: FormControl<string | null>;
|
|
288
|
+
isTouched: boolean;
|
|
289
|
+
isFocused: boolean;
|
|
290
|
+
dropDirection: string | undefined;
|
|
291
|
+
removeValidBorder: boolean;
|
|
292
|
+
focusedIndex: number;
|
|
293
|
+
private _handleClickOutside;
|
|
294
|
+
constructor(_eref: ElementRef, cdr: ChangeDetectorRef);
|
|
295
|
+
ngOnInit(): void;
|
|
296
|
+
ngOnDestroy(): void;
|
|
297
|
+
get activeDescendant(): string | null;
|
|
298
|
+
toggleDropdown(): void;
|
|
299
|
+
selectItem(option: IDropDownOption): void;
|
|
300
|
+
clear(): void;
|
|
301
|
+
filterOptions(searchTerm: string): void;
|
|
302
|
+
trackBy(index: number, item: IDropDownOption): unknown;
|
|
303
|
+
private onClickOutside;
|
|
304
|
+
onArrowDown(event: Event): void;
|
|
305
|
+
onArrowUp(event: Event): void;
|
|
306
|
+
onSearchEnter(event: Event): void;
|
|
307
|
+
closeDropdown(): void;
|
|
308
|
+
private scrollIntoView;
|
|
309
|
+
checkAvailableSpace(): void;
|
|
310
|
+
writeValue(value: unknown): void;
|
|
311
|
+
registerOnChange(fn: (value: unknown) => void): void;
|
|
312
|
+
registerOnTouched(fn: () => void): void;
|
|
313
|
+
onChange: (value: unknown) => void;
|
|
314
|
+
onTouched: () => void;
|
|
315
|
+
get errorText(): string | null;
|
|
316
|
+
private markAsTouched;
|
|
317
|
+
get controlNameValue(): string;
|
|
318
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DropDownComponent, never>;
|
|
319
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DropDownComponent, "cao-drop-down", never, { "textHeader": { "alias": "textHeader"; "required": false; }; "options": { "alias": "options"; "required": false; }; "dropDownClass": { "alias": "dropDownClass"; "required": false; }; "styleDropDown": { "alias": "styleDropDown"; "required": false; }; "control": { "alias": "control"; "required": false; }; "controlName": { "alias": "controlName"; "required": false; }; "isDisabled": { "alias": "isDisabled"; "required": false; }; "tooltip": { "alias": "tooltip"; "required": false; }; "dropDirectionInput": { "alias": "dropDirectionInput"; "required": false; }; "dataCy": { "alias": "dataCy"; "required": false; }; "trackByFn": { "alias": "trackByFn"; "required": false; }; "compareWith": { "alias": "compareWith"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; }; "listAriaLabel": { "alias": "listAriaLabel"; "required": false; }; }, { "itemSelected": "itemSelected"; }, never, never, true, never>;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
interface INavContent {
|
|
323
|
+
title: string;
|
|
324
|
+
links: INavLink[];
|
|
325
|
+
permissions?: string[];
|
|
326
|
+
directRoute?: boolean;
|
|
327
|
+
}
|
|
328
|
+
interface INavLink {
|
|
329
|
+
text: string;
|
|
330
|
+
url: string;
|
|
331
|
+
disabled?: boolean;
|
|
332
|
+
isValidationRequired?: boolean;
|
|
333
|
+
dataCy?: string;
|
|
334
|
+
directRoute?: boolean;
|
|
335
|
+
}
|
|
336
|
+
declare class LinksButton {
|
|
337
|
+
navContent: Signal<INavContent>;
|
|
338
|
+
router: Router;
|
|
339
|
+
route: ActivatedRoute;
|
|
340
|
+
isValidationRequired(link: INavLink): void;
|
|
341
|
+
private navigateTo;
|
|
342
|
+
private directRoute;
|
|
343
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LinksButton, never>;
|
|
344
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LinksButton, "cao-links-button", never, { "navContent": { "alias": "navContent"; "required": true; }; }, {}, never, never, true, never>;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
declare class Footer {
|
|
348
|
+
currentYear: number;
|
|
349
|
+
currentRoute: string;
|
|
350
|
+
footerText: string;
|
|
351
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Footer, never>;
|
|
352
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Footer, "cao-footer", never, { "currentRoute": { "alias": "currentRoute"; "required": false; }; "footerText": { "alias": "footerText"; "required": false; }; }, {}, never, never, true, never>;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export { BaseAlert, BaseButton, BaseDialog, BaseTimeRange, DropDownComponent, FilterTableService, Footer, LinksButton, RnvAutocompleteComponent, TableComponent, TableService, getPtBrPaginatorIntl };
|
|
356
|
+
export type { AlertType, DialogType, IAlertConfig, IColumnButton, IColumnConfig, IDialogConfig, INavContent, INavLink, ITableConfig };
|