@avoraui/av-data-table 0.0.2 → 0.0.3

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.
Binary file
@@ -397,7 +397,7 @@ class AvDataTable {
397
397
  }
398
398
  }
399
399
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: AvDataTable, deps: [], target: i0.ɵɵFactoryTarget.Component });
400
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.2", type: AvDataTable, isStandalone: true, selector: "aur-data-table", inputs: { PageSize: "PageSize", PageSizeOptions: "PageSizeOptions", currentPage: "currentPage", TableHeaders: "TableHeaders", TableColumns: "TableColumns", Data: "Data", EnableActionColumn: "EnableActionColumn", EnableButtonDelete: "EnableButtonDelete", EnableButtonModify: "EnableButtonModify", DisableRemove: "DisableRemove", DisableModify: "DisableModify" }, outputs: { onModify: "onModify", onNewItemAdded: "onNewItemAdded", onItemRemoved: "onItemRemoved" }, providers: [
400
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.2", type: AvDataTable, isStandalone: true, selector: "av-data-table", inputs: { PageSize: "PageSize", PageSizeOptions: "PageSizeOptions", currentPage: "currentPage", TableHeaders: "TableHeaders", TableColumns: "TableColumns", Data: "Data", EnableActionColumn: "EnableActionColumn", EnableButtonDelete: "EnableButtonDelete", EnableButtonModify: "EnableButtonModify", DisableRemove: "DisableRemove", DisableModify: "DisableModify" }, outputs: { onModify: "onModify", onNewItemAdded: "onNewItemAdded", onItemRemoved: "onItemRemoved" }, providers: [
401
401
  {
402
402
  provide: NG_VALUE_ACCESSOR,
403
403
  useExisting: forwardRef(() => AvDataTable),
@@ -407,7 +407,7 @@ class AvDataTable {
407
407
  }
408
408
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: AvDataTable, decorators: [{
409
409
  type: Component,
410
- args: [{ selector: 'aur-data-table', providers: [
410
+ args: [{ selector: 'av-data-table', providers: [
411
411
  {
412
412
  provide: NG_VALUE_ACCESSOR,
413
413
  useExisting: forwardRef(() => AvDataTable),
@@ -1 +1 @@
1
- {"version":3,"file":"avoraui-av-data-table.mjs","sources":["../../../projects/av-data-table/src/lib/av-data-table.ts","../../../projects/av-data-table/src/lib/av-data-table.html","../../../projects/av-data-table/src/public-api.ts","../../../projects/av-data-table/src/avoraui-av-data-table.ts"],"sourcesContent":["import {Component, EventEmitter, forwardRef, Input, OnChanges, OnInit, Output, SimpleChanges} from '@angular/core';\r\nimport {MatCard, MatCardContent} from \"@angular/material/card\";\r\nimport {MatIcon} from \"@angular/material/icon\";\r\nimport {MatIconButton} from \"@angular/material/button\";\r\nimport {NgClass, NgStyle} from \"@angular/common\";\r\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from \"@angular/forms\";\r\nimport {MatPaginator, PageEvent} from \"@angular/material/paginator\";\r\nimport {Headers, Columns} from './table-prop';\r\n\r\n@Component({\r\n selector: 'aur-data-table',\r\n providers: [\r\n {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => AvDataTable),\r\n multi: true\r\n }\r\n ],\r\n imports: [\r\n MatCard,\r\n MatCardContent,\r\n MatIcon,\r\n MatIconButton,\r\n NgClass,\r\n NgStyle,\r\n MatPaginator,\r\n ],\r\n templateUrl: './av-data-table.html',\r\n styleUrl: './av-data-table.css',\r\n standalone: true\r\n})\r\nexport class AvDataTable implements OnInit, OnChanges, ControlValueAccessor {\r\n\r\n @Input() PageSize: number = 5;\r\n @Input() PageSizeOptions: Array<number> = [];\r\n @Input() currentPage: number = 0;\r\n @Input() TableHeaders: Headers[] = [];\r\n @Input() TableColumns: Columns[] = [];\r\n protected TableData: any[] = [];\r\n @Input() Data: any[] = [];\r\n @Input() EnableActionColumn: boolean = false;\r\n @Input() EnableButtonDelete: boolean = false;\r\n @Input() EnableButtonModify: boolean = false;\r\n @Output() onModify = new EventEmitter<{ index: number; modifiedItem: any, disabled: boolean }>();\r\n @Output() onNewItemAdded = new EventEmitter<{index: number, dataSize: number, removedItem: any}>();\r\n @Output() onItemRemoved = new EventEmitter<{index: number, dataSize: number, removedItem: any, disabled: boolean}>();\r\n @Input() DisableRemove: boolean = false;\r\n @Input() DisableModify: boolean = false;\r\n gridTemplateColumns: string = '';\r\n private onChange: (value: any) => void = () => {};\r\n private onTouched: () => void = () => {};\r\n\r\n constructor(\r\n ) {\r\n }\r\n\r\n /**\r\n * Lifecycle hook that is called after Angular has initialized all data-bound properties of a directive.\r\n * This method is used to perform initialization logic for the component.\r\n *\r\n * It executes the following:\r\n * - Initializes the paginator for managing paginated data display.\r\n * - Calculates the grid template for layout adjustments.\r\n * - Synchronizes data sources to ensure the component has up-to-date data.\r\n *\r\n * @return {void} This method does not return any value.\r\n */\r\n ngOnInit(): void {\r\n this.initializePaginator();\r\n this.calculateGridTemplate();\r\n this.syncDataSources();\r\n }\r\n\r\n /**\r\n * Initializes the paginator configuration. Sets default values for PageSize, PageSizeOptions,\r\n * and currentPage if they are undefined, null, or invalid. Ensures the PageSize is included\r\n * in the PageSizeOptions array and sorts the options in ascending order.\r\n *\r\n * @return {void} Does not return a value.\r\n */\r\n initializePaginator(): void {\r\n if (this.PageSize === undefined || this.PageSize === null || this.PageSize <= 0) {\r\n this.PageSize = 5;\r\n }\r\n if (this.PageSizeOptions === undefined || this.PageSizeOptions === null || this.PageSizeOptions.length === 0) {\r\n this.PageSizeOptions = [5, 10, 20, 50];\r\n }\r\n if (this.currentPage === undefined || this.currentPage === null || this.currentPage < 0) {\r\n this.currentPage = 0;\r\n }\r\n\r\n // Ensure PageSize is included in PageSizeOptions if not already present\r\n if (!this.PageSizeOptions.includes(this.PageSize)) {\r\n this.PageSizeOptions = [...this.PageSizeOptions, this.PageSize].sort((a, b) => a - b);\r\n }\r\n }\r\n\r\n /**\r\n * Handles changes to the component's input properties during the lifecycle of the component.\r\n *\r\n * This method is triggered whenever an input property bound to the component changes. It processes\r\n * updates to properties such as `Data`, `PageSize`, `PageSizeOptions`, and `currentPage`, and\r\n * ensures the internal state is kept in sync with the new inputs. Additionally, it updates the paginator\r\n * and adjusts the current page as necessary.\r\n *\r\n * @param {SimpleChanges} changes - A collection of SimpleChange objects representing the changed properties.\r\n * Each `SimpleChange` object provides information like the current and previous values as well as a flag\r\n * indicating if it is the first change to this input.\r\n * @return {void} - This method does not return any value.\r\n */\r\n ngOnChanges(changes: SimpleChanges): void {\r\n // Listen for changes in the external Data input\r\n if (changes['Data'] && !changes['Data'].firstChange) {\r\n this.syncDataSources();\r\n // Reset to first page when data changes\r\n this.currentPage = 0;\r\n }\r\n\r\n // Handle changes in pagination settings\r\n if (changes['PageSize'] || changes['PageSizeOptions'] || changes['currentPage']) {\r\n this.initializePaginator();\r\n\r\n // Validate current page doesn't exceed available pages\r\n const totalPages = Math.ceil(this.TableData.length / this.PageSize);\r\n if (this.currentPage >= totalPages && totalPages > 0) {\r\n this.currentPage = totalPages - 1;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Retrieves a subset of data from the full dataset based on the current page and page size.\r\n *\r\n * @return {Array} A portion of the TableData array corresponding to the current page.\r\n */\r\n getPaginatedData(): Array<any> {\r\n const startIndex = this.currentPage * this.PageSize;\r\n const endIndex = startIndex + this.PageSize;\r\n return this.TableData.slice(startIndex, endIndex);\r\n }\r\n\r\n /**\r\n * Handles changes in the pagination state, such as changing the current page or the page size.\r\n *\r\n * @param {PageEvent} event - The event triggered by a pagination action that contains the updated page index and page size.\r\n * @return {void} This method does not return anything.\r\n */\r\n pageChange(event: PageEvent): void {\r\n this.currentPage = event.pageIndex;\r\n this.PageSize = event.pageSize;\r\n }\r\n\r\n /**\r\n * Calculates the actual index in the dataset based on the paginated index.\r\n *\r\n * @param {number} paginatedIndex - The index within the current page of paginated data.\r\n * @return {number} The actual index in the entire dataset.\r\n */\r\n getActualIndex(paginatedIndex: number): number {\r\n return (this.currentPage * this.PageSize) + paginatedIndex;\r\n }\r\n\r\n /**\r\n * Synchronizes external data source with the internal TableData.\r\n * If the external Data differs from the current TableData, the TableData\r\n * is updated with the values from Data and a change notification is triggered.\r\n *\r\n * @return {void} This method does not return a value.\r\n */\r\n syncDataSources(): void {\r\n // If external Data is provided and differs from TableData, update TableData\r\n if (this.Data && this.Data.length > 0) {\r\n // Check if Data and TableData are different\r\n const dataString = JSON.stringify(this.Data);\r\n const tableDataString = JSON.stringify(this.TableData);\r\n\r\n if (dataString !== tableDataString) {\r\n this.TableData = [...this.Data];\r\n // console.log(\"Changed Data : \" + this.Data);\r\n // Notify the form about the change\r\n this.onChange(this.TableData);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Updates the form value by notifying changes and updating external data if available.\r\n * This method triggers the onChange callback with the current table data\r\n * and notifies that the form field has been touched. Additionally, it updates\r\n * the external data reference to ensure proper change detection in the parent components.\r\n *\r\n * @return {void} No return value.\r\n */\r\n updateFormValue(): void {\r\n // Notify the form about the change\r\n if (this.onChange) {\r\n this.onChange(this.TableData);\r\n this.onTouched();\r\n }\r\n\r\n // Also update the external Data if it exists\r\n if (this.Data) {\r\n // Create a new reference to trigger OnChanges in parent components\r\n this.Data = [...this.TableData];\r\n }\r\n }\r\n\r\n /**\r\n * Calculates and sets the grid template for a layout based on the number of displayed headers\r\n * and the presence of an action column. The grid template determines the column structure with\r\n * equal fractions for data columns and a fixed width for the action column if enabled.\r\n *\r\n * @return {void} Does not return a value. Sets the `gridTemplateColumns` property to the calculated template.\r\n */\r\n calculateGridTemplate(): void {\r\n // Calculate grid template based on columns count\r\n const displayedHeaders = this.getDisplayedHeaders();\r\n const columnsCount = displayedHeaders.length;\r\n\r\n if (columnsCount === 0) return;\r\n\r\n // Create grid template with equal fractions for data columns\r\n // and fixed width for action column if enabled\r\n if (this.EnableActionColumn) {\r\n const dataColumns = columnsCount - 1; // Subtract action column\r\n this.gridTemplateColumns = dataColumns > 0\r\n ? `repeat(${dataColumns}, 1fr) 100px`\r\n : '100px';\r\n } else {\r\n this.gridTemplateColumns = `repeat(${columnsCount}, 1fr)`;\r\n }\r\n }\r\n\r\n /**\r\n * Retrieves the headers that should be displayed in the table.\r\n * The method includes or excludes the \"action\" column based on the value of `EnableActionColumn`.\r\n *\r\n * @return {TableProp[]} An array of headers to be displayed in the table. If `EnableActionColumn` is false, the \"action\" column is excluded.\r\n */\r\n getDisplayedHeaders(): Headers[] {\r\n return this.EnableActionColumn\r\n ? this.TableHeaders\r\n : this.TableHeaders.filter(h => h.label.toLowerCase() !== 'action');\r\n }\r\n\r\n /**\r\n * Generates and returns an object representing CSS classes for a header based on its alignment property.\r\n *\r\n * @param {TableProp} header - An object containing header properties, including an alignment property ('center', 'right', or 'left').\r\n * @return {Object} An object mapping class names to a boolean indicating their applicability based on the alignment of the header.\r\n */\r\n getHeaderFieldClasses(header: Headers): object {\r\n return {\r\n 'header-text-center': header.align === 'center',\r\n 'header-text-right': header.align === 'right',\r\n 'header-text-left': header.align === 'left',\r\n };\r\n }\r\n\r\n /**\r\n * Generates a mapping of CSS classes for a data field based on the alignment property of the given column.\r\n *\r\n * @param {Columns} column - The column object containing alignment information.\r\n * @return {Object} An object where the keys are class names, and the values are booleans indicating whether each class applies.\r\n */\r\n getDataFieldClasses(column: Columns): object {\r\n return {\r\n 'text-center': column.align === 'center',\r\n 'text-right': column.align === 'right',\r\n 'text-left': column.align === 'left',\r\n };\r\n }\r\n\r\n /**\r\n * Retrieves the color property from the given column object.\r\n *\r\n * @param {Columns} column - The column object containing the color property.\r\n * @return {string} The color associated with the column.\r\n */\r\n getDataFiledColor(column: Columns): any {\r\n return column.color;\r\n }\r\n\r\n /**\r\n * Retrieves the value of a specified column from the given item.\r\n *\r\n * @param {any} item - The object containing the data to extract the value from.\r\n * @param {Columns} column - The column definition, including the field name or path.\r\n * @return {string} The value of the specified column for the given item. If the field is not found, an empty string is returned.\r\n */\r\n getValueForColumn(item: any, column: Columns): string {\r\n if (!item || !column || !column.field) return '';\r\n\r\n // Check if the field has dot notation (e.g., 'gender.name')\r\n if (column.field.includes('.')) {\r\n return this.getNestedValue(item, column.field);\r\n } else {\r\n // Handle standard fields\r\n return column.field in item ? item[column.field] : '';\r\n }\r\n }\r\n\r\n /**\r\n * Retrieves a nested value from a given object based on a dot-separated path string.\r\n * If the path does not exist or the value is undefined/null, it returns a placeholder '-'.\r\n * If accessing an array, it maps the values at the given key and processes them.\r\n *\r\n * @param {any} object - The object from which the nested value is extracted.\r\n * @param {string} path - The dot-separated string representing the path to the desired value.\r\n * @return {any} The value found at the given path, an array joined into a string, or '-' if not found.\r\n */\r\n getNestedValue(object: any, path: string): any {\r\n // Return early if object is null or undefined\r\n if (!object) return '-';\r\n\r\n // Split the path into individual keys (e.g., \"gender.name\" → [\"gender\", \"name\"])\r\n const keys = path.split('.');\r\n let value = object;\r\n\r\n // Navigate through the object hierarchy\r\n for (const key of keys) {\r\n if (value === null || value === undefined) {\r\n return '-';\r\n }\r\n\r\n if (Array.isArray(value)) {\r\n // If we encounter an array, map over its items to extract the property\r\n value = value.map(item => item[key]).filter(Boolean);\r\n } else {\r\n // Access the next property level\r\n value = value[key];\r\n }\r\n }\r\n\r\n // Format the final result\r\n if (Array.isArray(value)) {\r\n return value.length > 0 ? value.join(', ') : '-';\r\n }\r\n\r\n return value !== null && value !== undefined ? value : '-';\r\n }\r\n\r\n /**\r\n * Removes an item from the data table at the specified index.\r\n *\r\n * @param {number} actualIndex - The index of the item to remove from the data table.\r\n * @return {void} This method does not return a value.\r\n */\r\n removeItem(actualIndex: number): void {\r\n // Check disable condition FIRST - before touching any data\r\n if (this.DisableRemove) {\r\n // Don't remove from TableData, just emit event for parent to handle\r\n this.onItemRemoved.emit({\r\n index: actualIndex,\r\n dataSize: this.TableData.length,\r\n removedItem: this.TableData[actualIndex], // Get the item that would be removed\r\n disabled: true\r\n });\r\n return; // Exit early - don't modify TableData\r\n } else {\r\n // Only proceed with actual removal if not disabled\r\n const newData = [...this.TableData];\r\n const removedData = newData[actualIndex]; // Get the item being removed\r\n newData.splice(actualIndex, 1);\r\n this.TableData = newData;\r\n\r\n // Rest of your existing logic...\r\n const totalPages = Math.ceil(this.TableData.length / this.PageSize);\r\n if (this.currentPage >= totalPages && this.currentPage > 0) {\r\n this.currentPage = totalPages - 1;\r\n }\r\n\r\n if (this.TableData.length === 0) {\r\n this.onChange([removedData]);\r\n } else {\r\n this.updateFormValue();\r\n }\r\n\r\n this.onItemRemoved.emit({\r\n index: actualIndex,\r\n dataSize: this.TableData.length,\r\n removedItem: removedData,\r\n disabled: false\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Modifies an item at the specified index in the dataset. If the modification is disabled, emits an event without making any changes.\r\n *\r\n * @param {number} actualIndex - The index of the item to be modified in the dataset.\r\n * @return {void} This method does not return a value.\r\n */\r\n modifyItem(actualIndex: number): void {\r\n // Check disable condition FIRST - before any modification logic\r\n if (this.DisableModify) {\r\n // Emit event for parent to handle the disabled state\r\n this.onModify.emit({\r\n index: actualIndex,\r\n modifiedItem: this.TableData[actualIndex],\r\n disabled: true\r\n });\r\n return; // Exit early - don't proceed with modification\r\n }\r\n\r\n // Only proceed with modification if not disabled\r\n const modifiedItem = this.TableData[actualIndex];\r\n this.onModify.emit({\r\n index: actualIndex,\r\n modifiedItem,\r\n disabled: false\r\n });\r\n }\r\n\r\n // ControlValueAccessor interface implementation\r\n /**\r\n * Registers a callback function to be called whenever the value changes.\r\n *\r\n * @param {any} fn - The function to be executed on a value change.\r\n * @return {void} This method does not return a value.\r\n */\r\n registerOnChange(fn: any): void {\r\n this.onChange = fn;\r\n }\r\n\r\n /**\r\n * Registers a callback function that should be called when the control is touched.\r\n *\r\n * @param {any} fn - The callback function to execute when the control is touched.\r\n * @return {void} This method does not return a value.\r\n */\r\n registerOnTouched(fn: any): void {\r\n this.onTouched = fn;\r\n }\r\n\r\n /**\r\n * Writes a new value to the table data and resets to the first page.\r\n *\r\n * @param {any[]} value - The array of data to be written to the table.\r\n * @return {void} Does not return a value.\r\n */\r\n writeValue(value: any[]): void {\r\n if (value) {\r\n this.TableData = [...value];\r\n // Reset to first page when new data is written\r\n this.currentPage = 0;\r\n } else {\r\n this.TableData = [];\r\n this.currentPage = 0;\r\n }\r\n }\r\n\r\n}\r\n","@if (TableData.length > 0) {\r\n <div class=\"item-header-row\" [ngStyle]=\"{'grid-template-columns': gridTemplateColumns}\">\r\n @for (header of getDisplayedHeaders(); track $index) {\r\n <strong [ngClass]=\"getHeaderFieldClasses(header)\">\r\n {{ header.label }}\r\n </strong>\r\n }\r\n </div>\r\n\r\n <!-- Display only the paginated items -->\r\n @for (item of getPaginatedData(); track $index) {\r\n <mat-card>\r\n <mat-card-content>\r\n <div class=\"item-details\">\r\n <div class=\"item-row\" [ngStyle]=\"{'grid-template-columns': gridTemplateColumns}\">\r\n @for (column of TableColumns; track column) {\r\n <span [ngClass]=\"getDataFieldClasses(column)\"\r\n [ngStyle]=\"{ color: getDataFiledColor(column) }\"\r\n >{{ getValueForColumn(item, column) }}</span>\r\n }\r\n @if (EnableActionColumn) {\r\n <div class=\"action-buttons\">\r\n @if (EnableButtonModify) {\r\n <button\r\n class=\"item-action-edit\"\r\n mat-icon-button\r\n color=\"warn\"\r\n (click)=\"modifyItem(getActualIndex($index))\">\r\n <mat-icon style=\"color:#ffffff;\">edit</mat-icon>\r\n </button>\r\n }\r\n @if (EnableButtonDelete) {\r\n <button\r\n class=\"item-action-delete\"\r\n mat-icon-button\r\n color=\"warn\"\r\n (click)=\"removeItem(getActualIndex($index))\">\r\n <mat-icon style=\"color:#ffffff;\">delete</mat-icon>\r\n </button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n }\r\n\r\n <!-- Move paginator outside the loop -->\r\n <div class=\"paginator-container\">\r\n <mat-paginator\r\n [pageSize]=\"PageSize\"\r\n [length]=\"TableData.length\"\r\n [pageSizeOptions]=\"PageSizeOptions\"\r\n [pageIndex]=\"currentPage\"\r\n (page)=\"pageChange($event)\"\r\n showFirstLastButtons>\r\n </mat-paginator>\r\n </div>\r\n}\r\n","/*\r\n * Public API Surface of data-table\r\n */\r\n\r\nexport * from './lib/av-data-table';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MA+Ba,WAAW,CAAA;IAEb,QAAQ,GAAW,CAAC;IACpB,eAAe,GAAkB,EAAE;IACnC,WAAW,GAAW,CAAC;IACvB,YAAY,GAAc,EAAE;IAC5B,YAAY,GAAc,EAAE;IAC3B,SAAS,GAAU,EAAE;IACtB,IAAI,GAAU,EAAE;IAChB,kBAAkB,GAAY,KAAK;IACnC,kBAAkB,GAAY,KAAK;IACnC,kBAAkB,GAAY,KAAK;AAClC,IAAA,QAAQ,GAAG,IAAI,YAAY,EAA2D;AACtF,IAAA,cAAc,GAAG,IAAI,YAAY,EAAuD;AACxF,IAAA,aAAa,GAAG,IAAI,YAAY,EAA0E;IAC3G,aAAa,GAAY,KAAK;IAC9B,aAAa,GAAY,KAAK;IACvC,mBAAmB,GAAW,EAAE;AACxB,IAAA,QAAQ,GAAyB,MAAK,GAAG;AACzC,IAAA,SAAS,GAAe,MAAK,GAAG;AAExC,IAAA,WAAA,GAAA;;AAIA;;;;;;;;;;AAUG;IACH,QAAQ,GAAA;QACN,IAAI,CAAC,mBAAmB,EAAE;QAC1B,IAAI,CAAC,qBAAqB,EAAE;QAC5B,IAAI,CAAC,eAAe,EAAE;;AAGxB;;;;;;AAMG;IACH,mBAAmB,GAAA;AACjB,QAAA,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,EAAE;AAC/E,YAAA,IAAI,CAAC,QAAQ,GAAG,CAAC;;QAEnB,IAAI,IAAI,CAAC,eAAe,KAAK,SAAS,IAAI,IAAI,CAAC,eAAe,KAAK,IAAI,IAAI,IAAI,CAAC,eAAe,CAAC,MAAM,KAAK,CA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A,CAAA;sBAA1B;gBACQ,kBAAkB,EAAA,CAAA;sBAA1B;gBACS,QAAQ,EAAA,CAAA;sBAAjB;gBACS,cAAc,EAAA,CAAA;sBAAvB;gBACS,aAAa,EAAA,CAAA;sBAAtB;gBACQ,aAAa,EAAA,CAAA;sBAArB;gBACQ,aAAa,EAAA,CAAA;sBAArB;;;AE/CH;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"avoraui-av-data-table.mjs","sources":["../../../projects/av-data-table/src/lib/av-data-table.ts","../../../projects/av-data-table/src/lib/av-data-table.html","../../../projects/av-data-table/src/public-api.ts","../../../projects/av-data-table/src/avoraui-av-data-table.ts"],"sourcesContent":["import {Component, EventEmitter, forwardRef, Input, OnChanges, OnInit, Output, SimpleChanges} from '@angular/core';\r\nimport {MatCard, MatCardContent} from \"@angular/material/card\";\r\nimport {MatIcon} from \"@angular/material/icon\";\r\nimport {MatIconButton} from \"@angular/material/button\";\r\nimport {NgClass, NgStyle} from \"@angular/common\";\r\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from \"@angular/forms\";\r\nimport {MatPaginator, PageEvent} from \"@angular/material/paginator\";\r\nimport {Headers, Columns} from './table-prop';\r\n\r\n@Component({\r\n selector: 'av-data-table',\r\n providers: [\r\n {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => AvDataTable),\r\n multi: true\r\n }\r\n ],\r\n imports: [\r\n MatCard,\r\n MatCardContent,\r\n MatIcon,\r\n MatIconButton,\r\n NgClass,\r\n NgStyle,\r\n MatPaginator,\r\n ],\r\n templateUrl: './av-data-table.html',\r\n styleUrl: './av-data-table.css',\r\n standalone: true\r\n})\r\nexport class AvDataTable implements OnInit, OnChanges, ControlValueAccessor {\r\n\r\n @Input() PageSize: number = 5;\r\n @Input() PageSizeOptions: Array<number> = [];\r\n @Input() currentPage: number = 0;\r\n @Input() TableHeaders: Headers[] = [];\r\n @Input() TableColumns: Columns[] = [];\r\n protected TableData: any[] = [];\r\n @Input() Data: any[] = [];\r\n @Input() EnableActionColumn: boolean = false;\r\n @Input() EnableButtonDelete: boolean = false;\r\n @Input() EnableButtonModify: boolean = false;\r\n @Output() onModify = new EventEmitter<{ index: number; modifiedItem: any, disabled: boolean }>();\r\n @Output() onNewItemAdded = new EventEmitter<{index: number, dataSize: number, removedItem: any}>();\r\n @Output() onItemRemoved = new EventEmitter<{index: number, dataSize: number, removedItem: any, disabled: boolean}>();\r\n @Input() DisableRemove: boolean = false;\r\n @Input() DisableModify: boolean = false;\r\n gridTemplateColumns: string = '';\r\n private onChange: (value: any) => void = () => {};\r\n private onTouched: () => void = () => {};\r\n\r\n constructor(\r\n ) {\r\n }\r\n\r\n /**\r\n * Lifecycle hook that is called after Angular has initialized all data-bound properties of a directive.\r\n * This method is used to perform initialization logic for the component.\r\n *\r\n * It executes the following:\r\n * - Initializes the paginator for managing paginated data display.\r\n * - Calculates the grid template for layout adjustments.\r\n * - Synchronizes data sources to ensure the component has up-to-date data.\r\n *\r\n * @return {void} This method does not return any value.\r\n */\r\n ngOnInit(): void {\r\n this.initializePaginator();\r\n this.calculateGridTemplate();\r\n this.syncDataSources();\r\n }\r\n\r\n /**\r\n * Initializes the paginator configuration. Sets default values for PageSize, PageSizeOptions,\r\n * and currentPage if they are undefined, null, or invalid. Ensures the PageSize is included\r\n * in the PageSizeOptions array and sorts the options in ascending order.\r\n *\r\n * @return {void} Does not return a value.\r\n */\r\n initializePaginator(): void {\r\n if (this.PageSize === undefined || this.PageSize === null || this.PageSize <= 0) {\r\n this.PageSize = 5;\r\n }\r\n if (this.PageSizeOptions === undefined || this.PageSizeOptions === null || this.PageSizeOptions.length === 0) {\r\n this.PageSizeOptions = [5, 10, 20, 50];\r\n }\r\n if (this.currentPage === undefined || this.currentPage === null || this.currentPage < 0) {\r\n this.currentPage = 0;\r\n }\r\n\r\n // Ensure PageSize is included in PageSizeOptions if not already present\r\n if (!this.PageSizeOptions.includes(this.PageSize)) {\r\n this.PageSizeOptions = [...this.PageSizeOptions, this.PageSize].sort((a, b) => a - b);\r\n }\r\n }\r\n\r\n /**\r\n * Handles changes to the component's input properties during the lifecycle of the component.\r\n *\r\n * This method is triggered whenever an input property bound to the component changes. It processes\r\n * updates to properties such as `Data`, `PageSize`, `PageSizeOptions`, and `currentPage`, and\r\n * ensures the internal state is kept in sync with the new inputs. Additionally, it updates the paginator\r\n * and adjusts the current page as necessary.\r\n *\r\n * @param {SimpleChanges} changes - A collection of SimpleChange objects representing the changed properties.\r\n * Each `SimpleChange` object provides information like the current and previous values as well as a flag\r\n * indicating if it is the first change to this input.\r\n * @return {void} - This method does not return any value.\r\n */\r\n ngOnChanges(changes: SimpleChanges): void {\r\n // Listen for changes in the external Data input\r\n if (changes['Data'] && !changes['Data'].firstChange) {\r\n this.syncDataSources();\r\n // Reset to first page when data changes\r\n this.currentPage = 0;\r\n }\r\n\r\n // Handle changes in pagination settings\r\n if (changes['PageSize'] || changes['PageSizeOptions'] || changes['currentPage']) {\r\n this.initializePaginator();\r\n\r\n // Validate current page doesn't exceed available pages\r\n const totalPages = Math.ceil(this.TableData.length / this.PageSize);\r\n if (this.currentPage >= totalPages && totalPages > 0) {\r\n this.currentPage = totalPages - 1;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Retrieves a subset of data from the full dataset based on the current page and page size.\r\n *\r\n * @return {Array} A portion of the TableData array corresponding to the current page.\r\n */\r\n getPaginatedData(): Array<any> {\r\n const startIndex = this.currentPage * this.PageSize;\r\n const endIndex = startIndex + this.PageSize;\r\n return this.TableData.slice(startIndex, endIndex);\r\n }\r\n\r\n /**\r\n * Handles changes in the pagination state, such as changing the current page or the page size.\r\n *\r\n * @param {PageEvent} event - The event triggered by a pagination action that contains the updated page index and page size.\r\n * @return {void} This method does not return anything.\r\n */\r\n pageChange(event: PageEvent): void {\r\n this.currentPage = event.pageIndex;\r\n this.PageSize = event.pageSize;\r\n }\r\n\r\n /**\r\n * Calculates the actual index in the dataset based on the paginated index.\r\n *\r\n * @param {number} paginatedIndex - The index within the current page of paginated data.\r\n * @return {number} The actual index in the entire dataset.\r\n */\r\n getActualIndex(paginatedIndex: number): number {\r\n return (this.currentPage * this.PageSize) + paginatedIndex;\r\n }\r\n\r\n /**\r\n * Synchronizes external data source with the internal TableData.\r\n * If the external Data differs from the current TableData, the TableData\r\n * is updated with the values from Data and a change notification is triggered.\r\n *\r\n * @return {void} This method does not return a value.\r\n */\r\n syncDataSources(): void {\r\n // If external Data is provided and differs from TableData, update TableData\r\n if (this.Data && this.Data.length > 0) {\r\n // Check if Data and TableData are different\r\n const dataString = JSON.stringify(this.Data);\r\n const tableDataString = JSON.stringify(this.TableData);\r\n\r\n if (dataString !== tableDataString) {\r\n this.TableData = [...this.Data];\r\n // console.log(\"Changed Data : \" + this.Data);\r\n // Notify the form about the change\r\n this.onChange(this.TableData);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Updates the form value by notifying changes and updating external data if available.\r\n * This method triggers the onChange callback with the current table data\r\n * and notifies that the form field has been touched. Additionally, it updates\r\n * the external data reference to ensure proper change detection in the parent components.\r\n *\r\n * @return {void} No return value.\r\n */\r\n updateFormValue(): void {\r\n // Notify the form about the change\r\n if (this.onChange) {\r\n this.onChange(this.TableData);\r\n this.onTouched();\r\n }\r\n\r\n // Also update the external Data if it exists\r\n if (this.Data) {\r\n // Create a new reference to trigger OnChanges in parent components\r\n this.Data = [...this.TableData];\r\n }\r\n }\r\n\r\n /**\r\n * Calculates and sets the grid template for a layout based on the number of displayed headers\r\n * and the presence of an action column. The grid template determines the column structure with\r\n * equal fractions for data columns and a fixed width for the action column if enabled.\r\n *\r\n * @return {void} Does not return a value. Sets the `gridTemplateColumns` property to the calculated template.\r\n */\r\n calculateGridTemplate(): void {\r\n // Calculate grid template based on columns count\r\n const displayedHeaders = this.getDisplayedHeaders();\r\n const columnsCount = displayedHeaders.length;\r\n\r\n if (columnsCount === 0) return;\r\n\r\n // Create grid template with equal fractions for data columns\r\n // and fixed width for action column if enabled\r\n if (this.EnableActionColumn) {\r\n const dataColumns = columnsCount - 1; // Subtract action column\r\n this.gridTemplateColumns = dataColumns > 0\r\n ? `repeat(${dataColumns}, 1fr) 100px`\r\n : '100px';\r\n } else {\r\n this.gridTemplateColumns = `repeat(${columnsCount}, 1fr)`;\r\n }\r\n }\r\n\r\n /**\r\n * Retrieves the headers that should be displayed in the table.\r\n * The method includes or excludes the \"action\" column based on the value of `EnableActionColumn`.\r\n *\r\n * @return {TableProp[]} An array of headers to be displayed in the table. If `EnableActionColumn` is false, the \"action\" column is excluded.\r\n */\r\n getDisplayedHeaders(): Headers[] {\r\n return this.EnableActionColumn\r\n ? this.TableHeaders\r\n : this.TableHeaders.filter(h => h.label.toLowerCase() !== 'action');\r\n }\r\n\r\n /**\r\n * Generates and returns an object representing CSS classes for a header based on its alignment property.\r\n *\r\n * @param {TableProp} header - An object containing header properties, including an alignment property ('center', 'right', or 'left').\r\n * @return {Object} An object mapping class names to a boolean indicating their applicability based on the alignment of the header.\r\n */\r\n getHeaderFieldClasses(header: Headers): object {\r\n return {\r\n 'header-text-center': header.align === 'center',\r\n 'header-text-right': header.align === 'right',\r\n 'header-text-left': header.align === 'left',\r\n };\r\n }\r\n\r\n /**\r\n * Generates a mapping of CSS classes for a data field based on the alignment property of the given column.\r\n *\r\n * @param {Columns} column - The column object containing alignment information.\r\n * @return {Object} An object where the keys are class names, and the values are booleans indicating whether each class applies.\r\n */\r\n getDataFieldClasses(column: Columns): object {\r\n return {\r\n 'text-center': column.align === 'center',\r\n 'text-right': column.align === 'right',\r\n 'text-left': column.align === 'left',\r\n };\r\n }\r\n\r\n /**\r\n * Retrieves the color property from the given column object.\r\n *\r\n * @param {Columns} column - The column object containing the color property.\r\n * @return {string} The color associated with the column.\r\n */\r\n getDataFiledColor(column: Columns): any {\r\n return column.color;\r\n }\r\n\r\n /**\r\n * Retrieves the value of a specified column from the given item.\r\n *\r\n * @param {any} item - The object containing the data to extract the value from.\r\n * @param {Columns} column - The column definition, including the field name or path.\r\n * @return {string} The value of the specified column for the given item. If the field is not found, an empty string is returned.\r\n */\r\n getValueForColumn(item: any, column: Columns): string {\r\n if (!item || !column || !column.field) return '';\r\n\r\n // Check if the field has dot notation (e.g., 'gender.name')\r\n if (column.field.includes('.')) {\r\n return this.getNestedValue(item, column.field);\r\n } else {\r\n // Handle standard fields\r\n return column.field in item ? item[column.field] : '';\r\n }\r\n }\r\n\r\n /**\r\n * Retrieves a nested value from a given object based on a dot-separated path string.\r\n * If the path does not exist or the value is undefined/null, it returns a placeholder '-'.\r\n * If accessing an array, it maps the values at the given key and processes them.\r\n *\r\n * @param {any} object - The object from which the nested value is extracted.\r\n * @param {string} path - The dot-separated string representing the path to the desired value.\r\n * @return {any} The value found at the given path, an array joined into a string, or '-' if not found.\r\n */\r\n getNestedValue(object: any, path: string): any {\r\n // Return early if object is null or undefined\r\n if (!object) return '-';\r\n\r\n // Split the path into individual keys (e.g., \"gender.name\" → [\"gender\", \"name\"])\r\n const keys = path.split('.');\r\n let value = object;\r\n\r\n // Navigate through the object hierarchy\r\n for (const key of keys) {\r\n if (value === null || value === undefined) {\r\n return '-';\r\n }\r\n\r\n if (Array.isArray(value)) {\r\n // If we encounter an array, map over its items to extract the property\r\n value = value.map(item => item[key]).filter(Boolean);\r\n } else {\r\n // Access the next property level\r\n value = value[key];\r\n }\r\n }\r\n\r\n // Format the final result\r\n if (Array.isArray(value)) {\r\n return value.length > 0 ? value.join(', ') : '-';\r\n }\r\n\r\n return value !== null && value !== undefined ? value : '-';\r\n }\r\n\r\n /**\r\n * Removes an item from the data table at the specified index.\r\n *\r\n * @param {number} actualIndex - The index of the item to remove from the data table.\r\n * @return {void} This method does not return a value.\r\n */\r\n removeItem(actualIndex: number): void {\r\n // Check disable condition FIRST - before touching any data\r\n if (this.DisableRemove) {\r\n // Don't remove from TableData, just emit event for parent to handle\r\n this.onItemRemoved.emit({\r\n index: actualIndex,\r\n dataSize: this.TableData.length,\r\n removedItem: this.TableData[actualIndex], // Get the item that would be removed\r\n disabled: true\r\n });\r\n return; // Exit early - don't modify TableData\r\n } else {\r\n // Only proceed with actual removal if not disabled\r\n const newData = [...this.TableData];\r\n const removedData = newData[actualIndex]; // Get the item being removed\r\n newData.splice(actualIndex, 1);\r\n this.TableData = newData;\r\n\r\n // Rest of your existing logic...\r\n const totalPages = Math.ceil(this.TableData.length / this.PageSize);\r\n if (this.currentPage >= totalPages && this.currentPage > 0) {\r\n this.currentPage = totalPages - 1;\r\n }\r\n\r\n if (this.TableData.length === 0) {\r\n this.onChange([removedData]);\r\n } else {\r\n this.updateFormValue();\r\n }\r\n\r\n this.onItemRemoved.emit({\r\n index: actualIndex,\r\n dataSize: this.TableData.length,\r\n removedItem: removedData,\r\n disabled: false\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Modifies an item at the specified index in the dataset. If the modification is disabled, emits an event without making any changes.\r\n *\r\n * @param {number} actualIndex - The index of the item to be modified in the dataset.\r\n * @return {void} This method does not return a value.\r\n */\r\n modifyItem(actualIndex: number): void {\r\n // Check disable condition FIRST - before any modification logic\r\n if (this.DisableModify) {\r\n // Emit event for parent to handle the disabled state\r\n this.onModify.emit({\r\n index: actualIndex,\r\n modifiedItem: this.TableData[actualIndex],\r\n disabled: true\r\n });\r\n return; // Exit early - don't proceed with modification\r\n }\r\n\r\n // Only proceed with modification if not disabled\r\n const modifiedItem = this.TableData[actualIndex];\r\n this.onModify.emit({\r\n index: actualIndex,\r\n modifiedItem,\r\n disabled: false\r\n });\r\n }\r\n\r\n // ControlValueAccessor interface implementation\r\n /**\r\n * Registers a callback function to be called whenever the value changes.\r\n *\r\n * @param {any} fn - The function to be executed on a value change.\r\n * @return {void} This method does not return a value.\r\n */\r\n registerOnChange(fn: any): void {\r\n this.onChange = fn;\r\n }\r\n\r\n /**\r\n * Registers a callback function that should be called when the control is touched.\r\n *\r\n * @param {any} fn - The callback function to execute when the control is touched.\r\n * @return {void} This method does not return a value.\r\n */\r\n registerOnTouched(fn: any): void {\r\n this.onTouched = fn;\r\n }\r\n\r\n /**\r\n * Writes a new value to the table data and resets to the first page.\r\n *\r\n * @param {any[]} value - The array of data to be written to the table.\r\n * @return {void} Does not return a value.\r\n */\r\n writeValue(value: any[]): void {\r\n if (value) {\r\n this.TableData = [...value];\r\n // Reset to first page when new data is written\r\n this.currentPage = 0;\r\n } else {\r\n this.TableData = [];\r\n this.currentPage = 0;\r\n }\r\n }\r\n\r\n}\r\n","@if (TableData.length > 0) {\r\n <div class=\"item-header-row\" [ngStyle]=\"{'grid-template-columns': gridTemplateColumns}\">\r\n @for (header of getDisplayedHeaders(); track $index) {\r\n <strong [ngClass]=\"getHeaderFieldClasses(header)\">\r\n {{ header.label }}\r\n </strong>\r\n }\r\n </div>\r\n\r\n <!-- Display only the paginated items -->\r\n @for (item of getPaginatedData(); track $index) {\r\n <mat-card>\r\n <mat-card-content>\r\n <div class=\"item-details\">\r\n <div class=\"item-row\" [ngStyle]=\"{'grid-template-columns': gridTemplateColumns}\">\r\n @for (column of TableColumns; track column) {\r\n <span [ngClass]=\"getDataFieldClasses(column)\"\r\n [ngStyle]=\"{ color: getDataFiledColor(column) }\"\r\n >{{ getValueForColumn(item, column) }}</span>\r\n }\r\n @if (EnableActionColumn) {\r\n <div class=\"action-buttons\">\r\n @if (EnableButtonModify) {\r\n <button\r\n class=\"item-action-edit\"\r\n mat-icon-button\r\n color=\"warn\"\r\n (click)=\"modifyItem(getActualIndex($index))\">\r\n <mat-icon style=\"color:#ffffff;\">edit</mat-icon>\r\n </button>\r\n }\r\n @if (EnableButtonDelete) {\r\n <button\r\n class=\"item-action-delete\"\r\n mat-icon-button\r\n color=\"warn\"\r\n (click)=\"removeItem(getActualIndex($index))\">\r\n <mat-icon style=\"color:#ffffff;\">delete</mat-icon>\r\n </button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n }\r\n\r\n <!-- Move paginator outside the loop -->\r\n <div class=\"paginator-container\">\r\n <mat-paginator\r\n [pageSize]=\"PageSize\"\r\n [length]=\"TableData.length\"\r\n [pageSizeOptions]=\"PageSizeOptions\"\r\n [pageIndex]=\"currentPage\"\r\n (page)=\"pageChange($event)\"\r\n showFirstLastButtons>\r\n </mat-paginator>\r\n </div>\r\n}\r\n","/*\r\n * Public API Surface of data-table\r\n */\r\n\r\nexport * from './lib/av-data-table';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MA+Ba,WAAW,CAAA;IAEb,QAAQ,GAAW,CAAC;IACpB,eAAe,GAAkB,EAAE;IACnC,WAAW,GAAW,CAAC;IACvB,YAAY,GAAc,EAAE;IAC5B,YAAY,GAAc,EAAE;IAC3B,SAAS,GAAU,EAAE;IACtB,IAAI,GAAU,EAAE;IAChB,kBAAkB,GAAY,KAAK;IACnC,kBAAkB,GAAY,KAAK;IACnC,kBAAkB,GAAY,KAAK;AAClC,IAAA,QAAQ,GAAG,IAAI,YAAY,EAA2D;AACtF,IAAA,cAAc,GAAG,IAAI,YAAY,EAAuD;AACxF,IAAA,aAAa,GAAG,IAAI,YAAY,EAA0E;IAC3G,aAAa,GAAY,KAAK;IAC9B,aAAa,GAAY,KAAK;IACvC,mBAAmB,GAAW,EAAE;AACxB,IAAA,QAAQ,GAAyB,MAAK,GAAG;AACzC,IAAA,SAAS,GAAe,MAAK,GAAG;AAExC,IAAA,WAAA,GAAA;;AAIA;;;;;;;;;;AAUG;IACH,QAAQ,GAAA;QACN,IAAI,CAAC,mBAAmB,EAAE;QAC1B,IAAI,CAAC,qBAAqB,EAAE;QAC5B,IAAI,CAAC,eAAe,EAAE;;AAGxB;;;;;;AAMG;IACH,mBAAmB,GAAA;AACjB,QAAA,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,EAAE;AAC/E,YAAA,IAAI,CAAC,QAAQ,GAAG,CAAC;;QAE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,YAAY,EAAA,CAAA;sBAApB;gBAEQ,IAAI,EAAA,CAAA;sBAAZ;gBACQ,kBAAkB,EAAA,CAAA;sBAA1B;gBACQ,kBAAkB,EAAA,CAAA;sBAA1B;gBACQ,kBAAkB,EAAA,CAAA;sBAA1B;gBACS,QAAQ,EAAA,CAAA;sBAAjB;gBACS,cAAc,EAAA,CAAA;sBAAvB;gBACS,aAAa,EAAA,CAAA;sBAAtB;gBACQ,aAAa,EAAA,CAAA;sBAArB;gBACQ,aAAa,EAAA,CAAA;sBAArB;;;AE/CH;;AAEG;;ACFH;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -207,7 +207,7 @@ declare class AvDataTable implements OnInit, OnChanges, ControlValueAccessor {
207
207
  */
208
208
  writeValue(value: any[]): void;
209
209
  static ɵfac: i0.ɵɵFactoryDeclaration<AvDataTable, never>;
210
- static ɵcmp: i0.ɵɵComponentDeclaration<AvDataTable, "aur-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>;
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
211
  }
212
212
 
213
213
  export { AvDataTable };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avoraui/av-data-table",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "A customizable Angular Data Table component",
5
5
  "keywords": [
6
6
  "angular",
@@ -32,4 +32,4 @@
32
32
  "default": "./fesm2022/avoraui-av-data-table.mjs"
33
33
  }
34
34
  }
35
- }
35
+ }