@avoraui/av-data-table 0.0.5 → 0.0.6
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/CHANGELOG.md +12 -0
- package/README.md +76 -281
- package/ng-package.json +10 -0
- package/package.json +22 -34
- package/src/lib/av-data-table.css +568 -0
- package/src/lib/av-data-table.html +124 -0
- package/src/lib/av-data-table.spec.ts +23 -0
- package/src/lib/av-data-table.ts +666 -0
- package/src/lib/table-prop.ts +10 -0
- package/src/public-api.ts +6 -0
- package/tsconfig.lib.json +19 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.spec.json +14 -0
- package/avoraui-av-data-table-0.0.5.tgz +0 -0
- package/fesm2022/avoraui-av-data-table.mjs +0 -464
- package/fesm2022/avoraui-av-data-table.mjs.map +0 -1
- package/index.d.ts +0 -213
package/index.d.ts
DELETED
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { OnInit, OnChanges, EventEmitter, SimpleChanges } from '@angular/core';
|
|
3
|
-
import { ControlValueAccessor } from '@angular/forms';
|
|
4
|
-
import { PageEvent } from '@angular/material/paginator';
|
|
5
|
-
|
|
6
|
-
interface Headers {
|
|
7
|
-
label: string;
|
|
8
|
-
align: 'left' | 'center' | 'right';
|
|
9
|
-
}
|
|
10
|
-
interface Columns {
|
|
11
|
-
field: string;
|
|
12
|
-
align: 'left' | 'center' | 'right';
|
|
13
|
-
color?: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare class AvDataTable implements OnInit, OnChanges, ControlValueAccessor {
|
|
17
|
-
PageSize: number;
|
|
18
|
-
PageSizeOptions: Array<number>;
|
|
19
|
-
currentPage: number;
|
|
20
|
-
TableHeaders: Headers[];
|
|
21
|
-
TableColumns: Columns[];
|
|
22
|
-
protected TableData: any[];
|
|
23
|
-
Data: any[];
|
|
24
|
-
EnableActionColumn: boolean;
|
|
25
|
-
EnableButtonDelete: boolean;
|
|
26
|
-
EnableButtonModify: boolean;
|
|
27
|
-
onModify: EventEmitter<{
|
|
28
|
-
index: number;
|
|
29
|
-
modifiedItem: any;
|
|
30
|
-
disabled: boolean;
|
|
31
|
-
}>;
|
|
32
|
-
onNewItemAdded: EventEmitter<{
|
|
33
|
-
index: number;
|
|
34
|
-
dataSize: number;
|
|
35
|
-
removedItem: any;
|
|
36
|
-
}>;
|
|
37
|
-
onItemRemoved: EventEmitter<{
|
|
38
|
-
index: number;
|
|
39
|
-
dataSize: number;
|
|
40
|
-
removedItem: any;
|
|
41
|
-
disabled: boolean;
|
|
42
|
-
}>;
|
|
43
|
-
DisableRemove: boolean;
|
|
44
|
-
DisableModify: boolean;
|
|
45
|
-
gridTemplateColumns: string;
|
|
46
|
-
private onChange;
|
|
47
|
-
private onTouched;
|
|
48
|
-
constructor();
|
|
49
|
-
/**
|
|
50
|
-
* Lifecycle hook that is called after Angular has initialized all data-bound properties of a directive.
|
|
51
|
-
* This method is used to perform initialization logic for the component.
|
|
52
|
-
*
|
|
53
|
-
* It executes the following:
|
|
54
|
-
* - Initializes the paginator for managing paginated data display.
|
|
55
|
-
* - Calculates the grid template for layout adjustments.
|
|
56
|
-
* - Synchronizes data sources to ensure the component has up-to-date data.
|
|
57
|
-
*
|
|
58
|
-
* @return {void} This method does not return any value.
|
|
59
|
-
*/
|
|
60
|
-
ngOnInit(): void;
|
|
61
|
-
/**
|
|
62
|
-
* Initializes the paginator configuration. Sets default values for PageSize, PageSizeOptions,
|
|
63
|
-
* and currentPage if they are undefined, null, or invalid. Ensures the PageSize is included
|
|
64
|
-
* in the PageSizeOptions array and sorts the options in ascending order.
|
|
65
|
-
*
|
|
66
|
-
* @return {void} Does not return a value.
|
|
67
|
-
*/
|
|
68
|
-
initializePaginator(): void;
|
|
69
|
-
/**
|
|
70
|
-
* Handles changes to the component's input properties during the lifecycle of the component.
|
|
71
|
-
*
|
|
72
|
-
* This method is triggered whenever an input property bound to the component changes. It processes
|
|
73
|
-
* updates to properties such as `Data`, `PageSize`, `PageSizeOptions`, and `currentPage`, and
|
|
74
|
-
* ensures the internal state is kept in sync with the new inputs. Additionally, it updates the paginator
|
|
75
|
-
* and adjusts the current page as necessary.
|
|
76
|
-
*
|
|
77
|
-
* @param {SimpleChanges} changes - A collection of SimpleChange objects representing the changed properties.
|
|
78
|
-
* Each `SimpleChange` object provides information like the current and previous values as well as a flag
|
|
79
|
-
* indicating if it is the first change to this input.
|
|
80
|
-
* @return {void} - This method does not return any value.
|
|
81
|
-
*/
|
|
82
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
83
|
-
/**
|
|
84
|
-
* Retrieves a subset of data from the full dataset based on the current page and page size.
|
|
85
|
-
*
|
|
86
|
-
* @return {Array} A portion of the TableData array corresponding to the current page.
|
|
87
|
-
*/
|
|
88
|
-
getPaginatedData(): Array<any>;
|
|
89
|
-
/**
|
|
90
|
-
* Handles changes in the pagination state, such as changing the current page or the page size.
|
|
91
|
-
*
|
|
92
|
-
* @param {PageEvent} event - The event triggered by a pagination action that contains the updated page index and page size.
|
|
93
|
-
* @return {void} This method does not return anything.
|
|
94
|
-
*/
|
|
95
|
-
pageChange(event: PageEvent): void;
|
|
96
|
-
/**
|
|
97
|
-
* Calculates the actual index in the dataset based on the paginated index.
|
|
98
|
-
*
|
|
99
|
-
* @param {number} paginatedIndex - The index within the current page of paginated data.
|
|
100
|
-
* @return {number} The actual index in the entire dataset.
|
|
101
|
-
*/
|
|
102
|
-
getActualIndex(paginatedIndex: number): number;
|
|
103
|
-
/**
|
|
104
|
-
* Synchronizes external data source with the internal TableData.
|
|
105
|
-
* If the external Data differs from the current TableData, the TableData
|
|
106
|
-
* is updated with the values from Data and a change notification is triggered.
|
|
107
|
-
*
|
|
108
|
-
* @return {void} This method does not return a value.
|
|
109
|
-
*/
|
|
110
|
-
syncDataSources(): void;
|
|
111
|
-
/**
|
|
112
|
-
* Updates the form value by notifying changes and updating external data if available.
|
|
113
|
-
* This method triggers the onChange callback with the current table data
|
|
114
|
-
* and notifies that the form field has been touched. Additionally, it updates
|
|
115
|
-
* the external data reference to ensure proper change detection in the parent components.
|
|
116
|
-
*
|
|
117
|
-
* @return {void} No return value.
|
|
118
|
-
*/
|
|
119
|
-
updateFormValue(): void;
|
|
120
|
-
/**
|
|
121
|
-
* Calculates and sets the grid template for a layout based on the number of displayed headers
|
|
122
|
-
* and the presence of an action column. The grid template determines the column structure with
|
|
123
|
-
* equal fractions for data columns and a fixed width for the action column if enabled.
|
|
124
|
-
*
|
|
125
|
-
* @return {void} Does not return a value. Sets the `gridTemplateColumns` property to the calculated template.
|
|
126
|
-
*/
|
|
127
|
-
calculateGridTemplate(): void;
|
|
128
|
-
/**
|
|
129
|
-
* Retrieves the headers that should be displayed in the table.
|
|
130
|
-
* The method includes or excludes the "action" column based on the value of `EnableActionColumn`.
|
|
131
|
-
*
|
|
132
|
-
* @return {TableProp[]} An array of headers to be displayed in the table. If `EnableActionColumn` is false, the "action" column is excluded.
|
|
133
|
-
*/
|
|
134
|
-
getDisplayedHeaders(): Headers[];
|
|
135
|
-
/**
|
|
136
|
-
* Generates and returns an object representing CSS classes for a header based on its alignment property.
|
|
137
|
-
*
|
|
138
|
-
* @param {TableProp} header - An object containing header properties, including an alignment property ('center', 'right', or 'left').
|
|
139
|
-
* @return {Object} An object mapping class names to a boolean indicating their applicability based on the alignment of the header.
|
|
140
|
-
*/
|
|
141
|
-
getHeaderFieldClasses(header: Headers): object;
|
|
142
|
-
/**
|
|
143
|
-
* Generates a mapping of CSS classes for a data field based on the alignment property of the given column.
|
|
144
|
-
*
|
|
145
|
-
* @param {Columns} column - The column object containing alignment information.
|
|
146
|
-
* @return {Object} An object where the keys are class names, and the values are booleans indicating whether each class applies.
|
|
147
|
-
*/
|
|
148
|
-
getDataFieldClasses(column: Columns): object;
|
|
149
|
-
/**
|
|
150
|
-
* Retrieves the color property from the given column object.
|
|
151
|
-
*
|
|
152
|
-
* @param {Columns} column - The column object containing the color property.
|
|
153
|
-
* @return {string} The color associated with the column.
|
|
154
|
-
*/
|
|
155
|
-
getDataFiledColor(column: Columns): any;
|
|
156
|
-
/**
|
|
157
|
-
* Retrieves the value of a specified column from the given item.
|
|
158
|
-
*
|
|
159
|
-
* @param {any} item - The object containing the data to extract the value from.
|
|
160
|
-
* @param {Columns} column - The column definition, including the field name or path.
|
|
161
|
-
* @return {string} The value of the specified column for the given item. If the field is not found, an empty string is returned.
|
|
162
|
-
*/
|
|
163
|
-
getValueForColumn(item: any, column: Columns): string;
|
|
164
|
-
/**
|
|
165
|
-
* Retrieves a nested value from a given object based on a dot-separated path string.
|
|
166
|
-
* If the path does not exist or the value is undefined/null, it returns a placeholder '-'.
|
|
167
|
-
* If accessing an array, it maps the values at the given key and processes them.
|
|
168
|
-
*
|
|
169
|
-
* @param {any} object - The object from which the nested value is extracted.
|
|
170
|
-
* @param {string} path - The dot-separated string representing the path to the desired value.
|
|
171
|
-
* @return {any} The value found at the given path, an array joined into a string, or '-' if not found.
|
|
172
|
-
*/
|
|
173
|
-
getNestedValue(object: any, path: string): any;
|
|
174
|
-
/**
|
|
175
|
-
* Removes an item from the data table at the specified index.
|
|
176
|
-
*
|
|
177
|
-
* @param {number} actualIndex - The index of the item to remove from the data table.
|
|
178
|
-
* @return {void} This method does not return a value.
|
|
179
|
-
*/
|
|
180
|
-
removeItem(actualIndex: number): void;
|
|
181
|
-
/**
|
|
182
|
-
* Modifies an item at the specified index in the dataset. If the modification is disabled, emits an event without making any changes.
|
|
183
|
-
*
|
|
184
|
-
* @param {number} actualIndex - The index of the item to be modified in the dataset.
|
|
185
|
-
* @return {void} This method does not return a value.
|
|
186
|
-
*/
|
|
187
|
-
modifyItem(actualIndex: number): void;
|
|
188
|
-
/**
|
|
189
|
-
* Registers a callback function to be called whenever the value changes.
|
|
190
|
-
*
|
|
191
|
-
* @param {any} fn - The function to be executed on a value change.
|
|
192
|
-
* @return {void} This method does not return a value.
|
|
193
|
-
*/
|
|
194
|
-
registerOnChange(fn: any): void;
|
|
195
|
-
/**
|
|
196
|
-
* Registers a callback function that should be called when the control is touched.
|
|
197
|
-
*
|
|
198
|
-
* @param {any} fn - The callback function to execute when the control is touched.
|
|
199
|
-
* @return {void} This method does not return a value.
|
|
200
|
-
*/
|
|
201
|
-
registerOnTouched(fn: any): void;
|
|
202
|
-
/**
|
|
203
|
-
* Writes a new value to the table data and resets to the first page.
|
|
204
|
-
*
|
|
205
|
-
* @param {any[]} value - The array of data to be written to the table.
|
|
206
|
-
* @return {void} Does not return a value.
|
|
207
|
-
*/
|
|
208
|
-
writeValue(value: any[]): void;
|
|
209
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AvDataTable, never>;
|
|
210
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AvDataTable, "av-data-table", never, { "PageSize": { "alias": "PageSize"; "required": false; }; "PageSizeOptions": { "alias": "PageSizeOptions"; "required": false; }; "currentPage": { "alias": "currentPage"; "required": false; }; "TableHeaders": { "alias": "TableHeaders"; "required": false; }; "TableColumns": { "alias": "TableColumns"; "required": false; }; "Data": { "alias": "Data"; "required": false; }; "EnableActionColumn": { "alias": "EnableActionColumn"; "required": false; }; "EnableButtonDelete": { "alias": "EnableButtonDelete"; "required": false; }; "EnableButtonModify": { "alias": "EnableButtonModify"; "required": false; }; "DisableRemove": { "alias": "DisableRemove"; "required": false; }; "DisableModify": { "alias": "DisableModify"; "required": false; }; }, { "onModify": "onModify"; "onNewItemAdded": "onNewItemAdded"; "onItemRemoved": "onItemRemoved"; }, never, never, true, never>;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
export { AvDataTable };
|