@alaarab/ogrid-angular-material 2.0.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.
@@ -0,0 +1,8 @@
1
+ // Re-export everything from angular adapter
2
+ export * from '@alaarab/ogrid-angular';
3
+ // Components
4
+ export { OGridComponent } from './ogrid/ogrid.component';
5
+ export { DataGridTableComponent } from './datagrid-table/datagrid-table.component';
6
+ export { ColumnHeaderFilterComponent } from './column-header-filter/column-header-filter.component';
7
+ export { ColumnChooserComponent } from './column-chooser/column-chooser.component';
8
+ export { PaginationControlsComponent } from './pagination-controls/pagination-controls.component';
@@ -0,0 +1,82 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { Component, input, computed, ChangeDetectionStrategy } from '@angular/core';
8
+ import { OGridService, OGridLayoutComponent, } from '@alaarab/ogrid-angular';
9
+ import { DataGridTableComponent } from '../datagrid-table/datagrid-table.component';
10
+ import { ColumnChooserComponent } from '../column-chooser/column-chooser.component';
11
+ import { PaginationControlsComponent } from '../pagination-controls/pagination-controls.component';
12
+ /**
13
+ * Top-level OGrid component for Angular Material.
14
+ * Equivalent to the React MaterialDataTable/OGrid component.
15
+ * Standalone component — provides OGridService and renders OGridLayout with all sub-components.
16
+ */
17
+ let OGridComponent = class OGridComponent {
18
+ constructor() {
19
+ this.props = input.required();
20
+ this.dataGridProps = computed(() => {
21
+ // Ensure service is configured before accessing dataGridProps
22
+ this.ogridService.configure(this.props());
23
+ return this.ogridService.dataGridProps();
24
+ });
25
+ // The OGridService is provided at the component level, so inject it here
26
+ // But since we can't use inject() with generics well, we use the providers array
27
+ // and the Angular DI system will handle it.
28
+ // Actually we need a slightly different approach for the generic service.
29
+ this.ogridService = new OGridService();
30
+ }
31
+ onPageSizeChange(size) {
32
+ this.ogridService.pagination().setPageSize(size);
33
+ this.ogridService.pagination().setPage(1);
34
+ }
35
+ };
36
+ OGridComponent = __decorate([
37
+ Component({
38
+ selector: 'ogrid',
39
+ standalone: true,
40
+ imports: [
41
+ OGridLayoutComponent,
42
+ DataGridTableComponent,
43
+ ColumnChooserComponent,
44
+ PaginationControlsComponent,
45
+ ],
46
+ providers: [OGridService],
47
+ changeDetection: ChangeDetectionStrategy.OnPush,
48
+ template: `
49
+ <ogrid-layout
50
+ [className]="ogridService.className()"
51
+ [sideBar]="ogridService.sideBarProps()"
52
+ [toolbar]="ogridService.toolbar()"
53
+ [toolbarBelow]="ogridService.toolbarBelow()"
54
+ >
55
+ <ng-container toolbar-end>
56
+ @if (ogridService.columnChooserPlacement() === 'toolbar') {
57
+ <ogrid-column-chooser
58
+ [columns]="ogridService.columnChooser().columns"
59
+ [visibleColumns]="ogridService.columnChooser().visibleColumns"
60
+ (visibilityChange)="ogridService.columnChooser().onVisibilityChange($event.columnKey, $event.visible)"
61
+ />
62
+ }
63
+ </ng-container>
64
+
65
+ <ogrid-datagrid-table [props]="dataGridProps()" />
66
+
67
+ <ng-container pagination>
68
+ <ogrid-pagination-controls
69
+ [currentPage]="ogridService.pagination().page"
70
+ [pageSize]="ogridService.pagination().pageSize"
71
+ [totalCount]="ogridService.pagination().displayTotalCount"
72
+ [pageSizeOptions]="ogridService.pagination().pageSizeOptions"
73
+ [entityLabelPlural]="ogridService.pagination().entityLabelPlural"
74
+ (pageChange)="ogridService.pagination().setPage($event)"
75
+ (pageSizeChange)="onPageSizeChange($event)"
76
+ />
77
+ </ng-container>
78
+ </ogrid-layout>
79
+ `,
80
+ })
81
+ ], OGridComponent);
82
+ export { OGridComponent };
@@ -0,0 +1,140 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { Component, input, output, computed, ChangeDetectionStrategy } from '@angular/core';
8
+ import { getPaginationViewModel } from '@alaarab/ogrid-angular';
9
+ /**
10
+ * Pagination controls component using Angular Material styling.
11
+ * Standalone component with inline template — no Angular Material dependency for pagination.
12
+ */
13
+ let PaginationControlsComponent = class PaginationControlsComponent {
14
+ constructor() {
15
+ this.currentPage = input.required();
16
+ this.pageSize = input.required();
17
+ this.totalCount = input.required();
18
+ this.pageSizeOptions = input(undefined);
19
+ this.entityLabelPlural = input('items');
20
+ this.pageChange = output();
21
+ this.pageSizeChange = output();
22
+ this.vm = computed(() => {
23
+ const opts = this.pageSizeOptions();
24
+ return getPaginationViewModel(this.currentPage(), this.pageSize(), this.totalCount(), opts ? { pageSizeOptions: opts } : undefined);
25
+ });
26
+ }
27
+ onPageSizeSelect(event) {
28
+ const value = Number(event.target.value);
29
+ this.pageSizeChange.emit(value);
30
+ }
31
+ };
32
+ PaginationControlsComponent = __decorate([
33
+ Component({
34
+ selector: 'ogrid-pagination-controls',
35
+ standalone: true,
36
+ changeDetection: ChangeDetectionStrategy.OnPush,
37
+ template: `
38
+ @if (vm(); as vm) {
39
+ <nav class="ogrid-pagination" role="navigation" aria-label="Pagination">
40
+ <span class="ogrid-pagination__info">
41
+ Showing {{ vm.startItem }} to {{ vm.endItem }} of {{ totalCount().toLocaleString() }} {{ entityLabelPlural() }}
42
+ </span>
43
+
44
+ <span class="ogrid-pagination__pages">
45
+ <button
46
+ class="ogrid-pagination__btn"
47
+ [disabled]="currentPage() === 1"
48
+ (click)="pageChange.emit(1)"
49
+ aria-label="First page"
50
+ >&laquo;</button>
51
+ <button
52
+ class="ogrid-pagination__btn"
53
+ [disabled]="currentPage() === 1"
54
+ (click)="pageChange.emit(currentPage() - 1)"
55
+ aria-label="Previous page"
56
+ >&lsaquo;</button>
57
+
58
+ @if (vm.showStartEllipsis) {
59
+ <button class="ogrid-pagination__btn" (click)="pageChange.emit(1)" aria-label="Page 1">1</button>
60
+ <span class="ogrid-pagination__ellipsis" aria-hidden="true">&hellip;</span>
61
+ }
62
+
63
+ @for (pageNum of vm.pageNumbers; track pageNum) {
64
+ <button
65
+ class="ogrid-pagination__btn"
66
+ [class.ogrid-pagination__btn--active]="currentPage() === pageNum"
67
+ (click)="pageChange.emit(pageNum)"
68
+ [attr.aria-label]="'Page ' + pageNum"
69
+ [attr.aria-current]="currentPage() === pageNum ? 'page' : null"
70
+ >{{ pageNum }}</button>
71
+ }
72
+
73
+ @if (vm.showEndEllipsis) {
74
+ <span class="ogrid-pagination__ellipsis" aria-hidden="true">&hellip;</span>
75
+ <button
76
+ class="ogrid-pagination__btn"
77
+ (click)="pageChange.emit(vm.totalPages)"
78
+ [attr.aria-label]="'Page ' + vm.totalPages"
79
+ >{{ vm.totalPages }}</button>
80
+ }
81
+
82
+ <button
83
+ class="ogrid-pagination__btn"
84
+ [disabled]="currentPage() >= vm.totalPages"
85
+ (click)="pageChange.emit(currentPage() + 1)"
86
+ aria-label="Next page"
87
+ >&rsaquo;</button>
88
+ <button
89
+ class="ogrid-pagination__btn"
90
+ [disabled]="currentPage() >= vm.totalPages"
91
+ (click)="pageChange.emit(vm.totalPages)"
92
+ aria-label="Last page"
93
+ >&raquo;</button>
94
+ </span>
95
+
96
+ <span class="ogrid-pagination__size">
97
+ <label>Rows
98
+ <select
99
+ [value]="pageSize()"
100
+ (change)="onPageSizeSelect($event)"
101
+ aria-label="Rows per page"
102
+ >
103
+ @for (n of vm.pageSizeOptions; track n) {
104
+ <option [value]="n" [selected]="pageSize() === n">{{ n }}</option>
105
+ }
106
+ </select>
107
+ </label>
108
+ </span>
109
+ </nav>
110
+ }
111
+ `,
112
+ styles: [`
113
+ :host { display: block; }
114
+ .ogrid-pagination {
115
+ display: flex; align-items: center; justify-content: space-between;
116
+ flex-wrap: wrap; gap: 8px; padding: 6px 12px; font-size: 14px;
117
+ }
118
+ .ogrid-pagination__info { color: rgba(0,0,0,0.6); }
119
+ .ogrid-pagination__pages { display: flex; align-items: center; gap: 2px; }
120
+ .ogrid-pagination__btn {
121
+ min-width: 32px; height: 32px; padding: 0 6px;
122
+ border: 1px solid rgba(0,0,0,0.23); border-radius: 4px;
123
+ background: transparent; cursor: pointer; font-size: 14px;
124
+ }
125
+ .ogrid-pagination__btn:disabled { opacity: 0.38; cursor: default; }
126
+ .ogrid-pagination__btn--active {
127
+ background: var(--mat-sys-primary, #1976d2); color: #fff;
128
+ border-color: var(--mat-sys-primary, #1976d2);
129
+ }
130
+ .ogrid-pagination__ellipsis { margin: 0 4px; color: rgba(0,0,0,0.6); }
131
+ .ogrid-pagination__size { display: flex; align-items: center; gap: 8px; }
132
+ .ogrid-pagination__size select {
133
+ min-width: 60px; height: 32px; padding: 4px 8px;
134
+ border: 1px solid rgba(0,0,0,0.23); border-radius: 4px;
135
+ font-size: 14px; margin-left: 8px;
136
+ }
137
+ `],
138
+ })
139
+ ], PaginationControlsComponent);
140
+ export { PaginationControlsComponent };
@@ -0,0 +1,26 @@
1
+ import type { IColumnDefinition } from '@alaarab/ogrid-angular';
2
+ export interface IColumnChooserProps {
3
+ columns: IColumnDefinition[];
4
+ visibleColumns: Set<string>;
5
+ onVisibilityChange: (columnKey: string, visible: boolean) => void;
6
+ }
7
+ /**
8
+ * Column visibility chooser dropdown using Angular Material styling.
9
+ * Standalone component with inline template.
10
+ */
11
+ export declare class ColumnChooserComponent {
12
+ readonly columns: import("@angular/core").InputSignal<IColumnDefinition[]>;
13
+ readonly visibleColumns: import("@angular/core").InputSignal<Set<string>>;
14
+ readonly visibilityChange: import("@angular/core").OutputEmitterRef<{
15
+ columnKey: string;
16
+ visible: boolean;
17
+ }>;
18
+ readonly isOpen: import("@angular/core").WritableSignal<boolean>;
19
+ readonly visibleCount: import("@angular/core").Signal<number>;
20
+ readonly totalCount: import("@angular/core").Signal<number>;
21
+ toggle(): void;
22
+ onCheckboxChange(columnKey: string, event: Event): void;
23
+ selectAll(): void;
24
+ clearAll(): void;
25
+ onDocumentClick(event: MouseEvent): void;
26
+ }
@@ -0,0 +1,73 @@
1
+ import type { ColumnFilterType, IDateFilterValue, UserLike } from '@alaarab/ogrid-angular';
2
+ export interface IColumnHeaderFilterProps {
3
+ columnKey: string;
4
+ columnName: string;
5
+ filterType: ColumnFilterType;
6
+ isSorted?: boolean;
7
+ isSortedDescending?: boolean;
8
+ onSort?: () => void;
9
+ selectedValues?: string[];
10
+ onFilterChange?: (values: string[]) => void;
11
+ options?: string[];
12
+ isLoadingOptions?: boolean;
13
+ textValue?: string;
14
+ onTextChange?: (value: string) => void;
15
+ selectedUser?: UserLike;
16
+ onUserChange?: (user: UserLike | undefined) => void;
17
+ peopleSearch?: (query: string) => Promise<UserLike[]>;
18
+ dateValue?: IDateFilterValue;
19
+ onDateChange?: (value: IDateFilterValue | undefined) => void;
20
+ }
21
+ /**
22
+ * Column header filter component with sort + filter icon + popover.
23
+ * Standalone component with inline template.
24
+ */
25
+ export declare class ColumnHeaderFilterComponent {
26
+ readonly columnKey: import("@angular/core").InputSignal<string>;
27
+ readonly columnName: import("@angular/core").InputSignal<string>;
28
+ readonly filterType: import("@angular/core").InputSignal<ColumnFilterType>;
29
+ readonly isSorted: import("@angular/core").InputSignal<boolean>;
30
+ readonly isSortedDescending: import("@angular/core").InputSignal<boolean>;
31
+ readonly onSort: import("@angular/core").InputSignal<(() => void) | undefined>;
32
+ readonly selectedValues: import("@angular/core").InputSignal<string[] | undefined>;
33
+ readonly onFilterChange: import("@angular/core").InputSignal<((values: string[]) => void) | undefined>;
34
+ readonly options: import("@angular/core").InputSignal<string[] | undefined>;
35
+ readonly isLoadingOptions: import("@angular/core").InputSignal<boolean>;
36
+ readonly textValue: import("@angular/core").InputSignal<string>;
37
+ readonly onTextChange: import("@angular/core").InputSignal<((value: string) => void) | undefined>;
38
+ readonly selectedUser: import("@angular/core").InputSignal<UserLike | undefined>;
39
+ readonly onUserChange: import("@angular/core").InputSignal<((user: UserLike | undefined) => void) | undefined>;
40
+ readonly peopleSearch: import("@angular/core").InputSignal<((query: string) => Promise<UserLike[]>) | undefined>;
41
+ readonly dateValue: import("@angular/core").InputSignal<IDateFilterValue | undefined>;
42
+ readonly onDateChange: import("@angular/core").InputSignal<((value: IDateFilterValue | undefined) => void) | undefined>;
43
+ private readonly headerEl;
44
+ readonly isFilterOpen: import("@angular/core").WritableSignal<boolean>;
45
+ readonly tempTextValue: import("@angular/core").WritableSignal<string>;
46
+ readonly searchText: import("@angular/core").WritableSignal<string>;
47
+ readonly tempSelected: import("@angular/core").WritableSignal<Set<string>>;
48
+ readonly peopleSearchText: import("@angular/core").WritableSignal<string>;
49
+ readonly peopleSuggestions: import("@angular/core").WritableSignal<UserLike[]>;
50
+ readonly isPeopleLoading: import("@angular/core").WritableSignal<boolean>;
51
+ readonly tempDateFrom: import("@angular/core").WritableSignal<string>;
52
+ readonly tempDateTo: import("@angular/core").WritableSignal<string>;
53
+ readonly popoverTop: import("@angular/core").WritableSignal<number>;
54
+ readonly popoverLeft: import("@angular/core").WritableSignal<number>;
55
+ private peopleDebounceTimer;
56
+ readonly hasActiveFilter: import("@angular/core").Signal<boolean>;
57
+ readonly filteredOptions: import("@angular/core").Signal<string[]>;
58
+ asInputValue(event: Event): string;
59
+ toggleFilter(event: MouseEvent): void;
60
+ onTextKeydown(event: KeyboardEvent): void;
61
+ handleTextApply(): void;
62
+ handleTextClear(): void;
63
+ handleCheckboxChange(option: string, event: Event): void;
64
+ handleSelectAllFiltered(): void;
65
+ handleClearSelection(): void;
66
+ handleApplyMultiSelect(): void;
67
+ onPeopleSearchInput(event: Event): void;
68
+ handleUserSelect(user: UserLike): void;
69
+ handleClearUser(): void;
70
+ handleDateApply(): void;
71
+ handleDateClear(): void;
72
+ onDocumentClick(event: MouseEvent): void;
73
+ }
@@ -0,0 +1,161 @@
1
+ import type { IOGridDataGridProps, IColumnDef, RowId, ColumnFilterType, IDateFilterValue, UserLike, IFilters, FilterValue } from '@alaarab/ogrid-angular';
2
+ type CellRenderMode = 'editing-inline' | 'editing-popover' | 'display';
3
+ interface CellRenderDescriptor {
4
+ mode: CellRenderMode;
5
+ editorType?: 'text' | 'select' | 'checkbox' | 'richSelect' | 'date';
6
+ value?: unknown;
7
+ isActive: boolean;
8
+ isInRange: boolean;
9
+ isInCutRange: boolean;
10
+ isSelectionEndCell: boolean;
11
+ canEditAny: boolean;
12
+ globalColIndex: number;
13
+ rowId: RowId;
14
+ rowIndex: number;
15
+ displayValue?: unknown;
16
+ }
17
+ interface HeaderFilterConfig {
18
+ columnKey: string;
19
+ columnName: string;
20
+ filterType: ColumnFilterType;
21
+ isSorted: boolean;
22
+ isSortedDescending: boolean;
23
+ onSort: (() => void) | undefined;
24
+ selectedValues?: string[];
25
+ onFilterChange?: (values: string[]) => void;
26
+ options?: string[];
27
+ isLoadingOptions?: boolean;
28
+ textValue?: string;
29
+ onTextChange?: (value: string) => void;
30
+ selectedUser?: UserLike;
31
+ onUserChange?: (user: UserLike | undefined) => void;
32
+ peopleSearch?: (query: string) => Promise<UserLike[]>;
33
+ dateValue?: IDateFilterValue;
34
+ onDateChange?: (value: IDateFilterValue | undefined) => void;
35
+ }
36
+ /**
37
+ * DataGridTable component using native HTML table with Material Design-inspired styling.
38
+ * Standalone component — this is the workhorse of the grid.
39
+ */
40
+ export declare class DataGridTableComponent<T> {
41
+ readonly propsInput: import("@angular/core").InputSignal<IOGridDataGridProps<T>>;
42
+ private readonly wrapperRef;
43
+ private readonly tableContainerRef;
44
+ private readonly stateService;
45
+ private lastMouseShift;
46
+ constructor();
47
+ private readonly state;
48
+ readonly items: import("@angular/core").Signal<T[]>;
49
+ readonly getRowId: import("@angular/core").Signal<(item: T) => RowId>;
50
+ readonly isLoading: import("@angular/core").Signal<boolean>;
51
+ readonly loadingMessage: import("@angular/core").Signal<string>;
52
+ readonly freezeRows: import("@angular/core").Signal<number | undefined>;
53
+ readonly freezeCols: import("@angular/core").Signal<number | undefined>;
54
+ readonly layoutModeFit: import("@angular/core").Signal<boolean>;
55
+ readonly ariaLabel: import("@angular/core").Signal<string>;
56
+ readonly ariaLabelledBy: import("@angular/core").Signal<string | undefined>;
57
+ readonly emptyState: import("@angular/core").Signal<{
58
+ onClearAll: () => void;
59
+ hasActiveFilters: boolean;
60
+ message?: string;
61
+ render?: import("@angular/core").TemplateRef<unknown>;
62
+ } | undefined>;
63
+ readonly visibleCols: import("@angular/core").Signal<IColumnDef<T>[]>;
64
+ readonly hasCheckboxCol: import("@angular/core").Signal<boolean>;
65
+ readonly colOffset: import("@angular/core").Signal<number>;
66
+ readonly containerWidth: import("@angular/core").Signal<number>;
67
+ readonly minTableWidth: import("@angular/core").Signal<number>;
68
+ readonly desiredTableWidth: import("@angular/core").Signal<number>;
69
+ readonly columnSizingOverrides: import("@angular/core").Signal<Record<string, {
70
+ widthPx: number;
71
+ }>>;
72
+ readonly selectedRowIds: import("@angular/core").Signal<Set<RowId>>;
73
+ readonly allSelected: import("@angular/core").Signal<boolean>;
74
+ readonly someSelected: import("@angular/core").Signal<boolean>;
75
+ readonly editingCell: import("@angular/core").Signal<{
76
+ rowId: RowId;
77
+ columnId: string;
78
+ } | null>;
79
+ readonly pendingEditorValue: import("@angular/core").Signal<unknown>;
80
+ readonly activeCell: import("@angular/core").Signal<import("@alaarab/ogrid-angular").IActiveCell | null>;
81
+ readonly selectionRange: import("@angular/core").Signal<import("@alaarab/ogrid-angular").ISelectionRange | null>;
82
+ readonly hasCellSelection: import("@angular/core").Signal<boolean>;
83
+ readonly cutRange: import("@angular/core").Signal<import("@alaarab/ogrid-angular").ISelectionRange | null>;
84
+ readonly copyRange: import("@angular/core").Signal<import("@alaarab/ogrid-angular").ISelectionRange | null>;
85
+ readonly canUndo: import("@angular/core").Signal<boolean>;
86
+ readonly canRedo: import("@angular/core").Signal<boolean>;
87
+ readonly isDragging: import("@angular/core").Signal<boolean>;
88
+ readonly menuPosition: import("@angular/core").Signal<{
89
+ x: number;
90
+ y: number;
91
+ } | null>;
92
+ readonly statusBarConfig: import("@angular/core").Signal<import("@alaarab/ogrid-angular").IStatusBarProps | null>;
93
+ readonly showEmptyInGrid: import("@angular/core").Signal<boolean>;
94
+ readonly headerFilterInput: import("@angular/core").Signal<{
95
+ sortBy?: string;
96
+ sortDirection: "asc" | "desc";
97
+ onColumnSort: (columnKey: string) => void;
98
+ filters: IFilters;
99
+ onFilterChange: (key: string, value: FilterValue | undefined) => void;
100
+ filterOptions: Record<string, string[]>;
101
+ loadingFilterOptions: Record<string, boolean>;
102
+ peopleSearch?: (query: string) => Promise<UserLike[]>;
103
+ }>;
104
+ readonly cellDescriptorInput: import("@angular/core").Signal<{
105
+ editingCell: {
106
+ rowId: RowId;
107
+ columnId: string;
108
+ } | null;
109
+ activeCell: import("@alaarab/ogrid-angular").IActiveCell | null;
110
+ selectionRange: import("@alaarab/ogrid-angular").ISelectionRange | null;
111
+ cutRange: import("@alaarab/ogrid-angular").ISelectionRange | null;
112
+ copyRange: import("@alaarab/ogrid-angular").ISelectionRange | null;
113
+ colOffset: number;
114
+ itemsLength: number;
115
+ getRowId: (item: T) => RowId;
116
+ editable?: boolean;
117
+ onCellValueChanged?: ((event: import("@alaarab/ogrid-angular").ICellValueChangedEvent<T>) => void) | undefined;
118
+ isDragging: boolean;
119
+ }>;
120
+ readonly allowOverflowX: import("@angular/core").Signal<boolean>;
121
+ readonly selectionCellCount: import("@angular/core").Signal<number | undefined>;
122
+ readonly headerRows: import("@angular/core").Signal<import("@alaarab/ogrid-angular").HeaderRow<T>[]>;
123
+ readonly columnLayouts: import("@angular/core").Signal<{
124
+ col: IColumnDef<T>;
125
+ pinnedLeft: boolean;
126
+ pinnedRight: boolean;
127
+ minWidth: number;
128
+ width: number;
129
+ }[]>;
130
+ asColumnDef(colDef: unknown): IColumnDef<T>;
131
+ visibleColIndex(col: IColumnDef<T>): number;
132
+ getColumnWidth(col: IColumnDef<T>): number;
133
+ getFilterConfig(col: IColumnDef<T>): HeaderFilterConfig;
134
+ getCellDescriptor(item: T, col: IColumnDef<T>, rowIndex: number, colIdx: number): CellRenderDescriptor;
135
+ resolveCellContent(col: IColumnDef<T>, item: T, displayValue: unknown): string;
136
+ resolveCellStyleFn(col: IColumnDef<T>, item: T): Record<string, string> | undefined;
137
+ getSelectValues(col: IColumnDef<T>): string[];
138
+ formatDateForInput(value: unknown): string;
139
+ onWrapperMouseDown(event: MouseEvent): void;
140
+ onGridKeyDown(event: KeyboardEvent): void;
141
+ onCellMouseDown(event: MouseEvent, rowIndex: number, globalColIndex: number): void;
142
+ onCellClick(rowIndex: number, globalColIndex: number): void;
143
+ onCellContextMenu(event: MouseEvent): void;
144
+ onCellDblClick(rowId: RowId, columnId: string): void;
145
+ onFillHandleMouseDown(event: MouseEvent): void;
146
+ onResizeStart(event: MouseEvent, col: IColumnDef<T>): void;
147
+ onSelectAllChange(event: Event): void;
148
+ onRowClick(event: MouseEvent, rowId: RowId): void;
149
+ onRowCheckboxChange(rowId: RowId, event: Event, rowIndex: number): void;
150
+ commitEdit(item: T, columnId: string, oldValue: unknown, newValue: unknown, rowIndex: number, globalColIndex: number): void;
151
+ cancelEdit(): void;
152
+ onEditorKeydown(event: KeyboardEvent, item: T, columnId: string, oldValue: unknown, rowIndex: number, globalColIndex: number): void;
153
+ closeContextMenu(): void;
154
+ handleCopy(): void;
155
+ handleCut(): void;
156
+ handlePaste(): void;
157
+ handleSelectAllCells(): void;
158
+ onUndo(): void;
159
+ onRedo(): void;
160
+ }
161
+ export {};
@@ -0,0 +1,8 @@
1
+ export * from '@alaarab/ogrid-angular';
2
+ export { OGridComponent } from './ogrid/ogrid.component';
3
+ export { DataGridTableComponent } from './datagrid-table/datagrid-table.component';
4
+ export { ColumnHeaderFilterComponent } from './column-header-filter/column-header-filter.component';
5
+ export type { IColumnHeaderFilterProps } from './column-header-filter/column-header-filter.component';
6
+ export { ColumnChooserComponent } from './column-chooser/column-chooser.component';
7
+ export type { IColumnChooserProps } from './column-chooser/column-chooser.component';
8
+ export { PaginationControlsComponent } from './pagination-controls/pagination-controls.component';
@@ -0,0 +1,14 @@
1
+ import { OGridService } from '@alaarab/ogrid-angular';
2
+ import type { IOGridProps, IOGridDataGridProps } from '@alaarab/ogrid-angular';
3
+ /**
4
+ * Top-level OGrid component for Angular Material.
5
+ * Equivalent to the React MaterialDataTable/OGrid component.
6
+ * Standalone component — provides OGridService and renders OGridLayout with all sub-components.
7
+ */
8
+ export declare class OGridComponent<T> {
9
+ readonly props: import("@angular/core").InputSignal<IOGridProps<T>>;
10
+ readonly ogridService: OGridService<T>;
11
+ readonly dataGridProps: import("@angular/core").Signal<IOGridDataGridProps<T>>;
12
+ constructor();
13
+ onPageSizeChange(size: number): void;
14
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Pagination controls component using Angular Material styling.
3
+ * Standalone component with inline template — no Angular Material dependency for pagination.
4
+ */
5
+ export declare class PaginationControlsComponent {
6
+ readonly currentPage: import("@angular/core").InputSignal<number>;
7
+ readonly pageSize: import("@angular/core").InputSignal<number>;
8
+ readonly totalCount: import("@angular/core").InputSignal<number>;
9
+ readonly pageSizeOptions: import("@angular/core").InputSignal<number[] | undefined>;
10
+ readonly entityLabelPlural: import("@angular/core").InputSignal<string>;
11
+ readonly pageChange: import("@angular/core").OutputEmitterRef<number>;
12
+ readonly pageSizeChange: import("@angular/core").OutputEmitterRef<number>;
13
+ readonly vm: import("@angular/core").Signal<import("@alaarab/ogrid-angular").PaginationViewModel | null>;
14
+ onPageSizeSelect(event: Event): void;
15
+ }
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@alaarab/ogrid-angular-material",
3
+ "version": "2.0.2",
4
+ "description": "OGrid Angular Material – MatTable-based data grid with sorting, filtering, pagination, column chooser, and CSV export.",
5
+ "main": "dist/esm/index.js",
6
+ "module": "dist/esm/index.js",
7
+ "types": "dist/types/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/types/index.d.ts",
11
+ "import": "./dist/esm/index.js",
12
+ "require": "./dist/esm/index.js"
13
+ }
14
+ },
15
+ "scripts": {
16
+ "build": "rimraf dist && tsc -p tsconfig.build.json",
17
+ "test": "jest --passWithNoTests"
18
+ },
19
+ "keywords": ["ogrid", "angular", "material", "datatable", "typescript", "grid"],
20
+ "author": "Ala Arab",
21
+ "license": "MIT",
22
+ "files": ["dist", "README.md", "LICENSE"],
23
+ "engines": { "node": ">=18" },
24
+ "dependencies": {
25
+ "@alaarab/ogrid-angular": "2.0.2"
26
+ },
27
+ "peerDependencies": {
28
+ "@angular/core": "^21.0.0",
29
+ "@angular/common": "^21.0.0",
30
+ "@angular/material": "^21.0.0",
31
+ "@angular/cdk": "^21.0.0"
32
+ },
33
+ "devDependencies": {
34
+ "@angular/core": "^21.1.4",
35
+ "@angular/common": "^21.1.4",
36
+ "@angular/compiler": "^21.1.4",
37
+ "@angular/platform-browser": "^21.1.4",
38
+ "@angular/platform-browser-dynamic": "^21.1.4",
39
+ "@angular/material": "^21.1.4",
40
+ "@angular/cdk": "^21.1.4",
41
+ "@angular/animations": "^21.1.4",
42
+ "rxjs": "^7.8.0",
43
+ "zone.js": "^0.15.0",
44
+ "typescript": "^5.7.3"
45
+ },
46
+ "publishConfig": { "access": "public" }
47
+ }