@alaarab/ogrid-angular 2.0.9 → 2.0.12
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/dist/esm/components/base-column-chooser.component.js +78 -0
- package/dist/esm/components/base-column-header-filter.component.js +266 -0
- package/dist/esm/components/base-datagrid-table.component.js +106 -6
- package/dist/esm/components/base-pagination-controls.component.js +72 -0
- package/dist/esm/components/empty-state.component.js +22 -10
- package/dist/esm/components/grid-context-menu.component.js +65 -26
- package/dist/esm/components/marching-ants-overlay.component.js +78 -69
- package/dist/esm/components/ogrid-layout.component.js +94 -35
- package/dist/esm/components/sidebar.component.js +58 -55
- package/dist/esm/components/status-bar.component.js +43 -23
- package/dist/esm/index.js +3 -0
- package/dist/esm/services/datagrid-state.service.js +1 -1
- package/dist/esm/services/ogrid.service.js +8 -8
- package/dist/types/components/base-column-chooser.component.d.ts +37 -0
- package/dist/types/components/base-column-header-filter.component.d.ts +90 -0
- package/dist/types/components/base-datagrid-table.component.d.ts +19 -1
- package/dist/types/components/base-pagination-controls.component.d.ts +34 -0
- package/dist/types/components/empty-state.component.d.ts +5 -4
- package/dist/types/components/grid-context-menu.component.d.ts +16 -16
- package/dist/types/components/marching-ants-overlay.component.d.ts +14 -14
- package/dist/types/components/ogrid-layout.component.d.ts +5 -5
- package/dist/types/components/sidebar.component.d.ts +1 -1
- package/dist/types/components/status-bar.component.d.ts +10 -10
- package/dist/types/index.d.ts +5 -0
- package/dist/types/services/datagrid-state.service.d.ts +1 -1
- package/dist/types/services/ogrid.service.d.ts +2 -1
- package/dist/types/types/dataGridTypes.d.ts +3 -1
- package/package.json +2 -2
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
/**
|
|
3
|
+
* Abstract base class containing all shared TypeScript logic for PaginationControls components.
|
|
4
|
+
* Framework-specific UI packages extend this with their templates and style overrides.
|
|
5
|
+
*
|
|
6
|
+
* Subclasses must:
|
|
7
|
+
* 1. Provide a @Component decorator with template and styles
|
|
8
|
+
*
|
|
9
|
+
* Uses @Input setter + signal pattern so computed() can track dependencies.
|
|
10
|
+
* (Plain @Input properties are NOT tracked by computed() — only signals are.)
|
|
11
|
+
*/
|
|
12
|
+
export declare abstract class BasePaginationControlsComponent {
|
|
13
|
+
private readonly _currentPage;
|
|
14
|
+
private readonly _pageSize;
|
|
15
|
+
private readonly _totalCount;
|
|
16
|
+
private readonly _pageSizeOptions;
|
|
17
|
+
private readonly _entityLabelPlural;
|
|
18
|
+
set currentPage(v: number);
|
|
19
|
+
get currentPage(): number;
|
|
20
|
+
set pageSize(v: number);
|
|
21
|
+
get pageSize(): number;
|
|
22
|
+
set totalCount(v: number);
|
|
23
|
+
get totalCount(): number;
|
|
24
|
+
set pageSizeOptions(v: number[] | undefined);
|
|
25
|
+
get pageSizeOptions(): number[] | undefined;
|
|
26
|
+
set entityLabelPlural(v: string);
|
|
27
|
+
get entityLabelPlural(): string;
|
|
28
|
+
pageChange: EventEmitter<number>;
|
|
29
|
+
pageSizeChange: EventEmitter<number>;
|
|
30
|
+
readonly labelPlural: import("@angular/core").Signal<string>;
|
|
31
|
+
readonly vm: import("@angular/core").Signal<import("@alaarab/ogrid-core").PaginationViewModel | null>;
|
|
32
|
+
onPageSizeSelect(event: Event): void;
|
|
33
|
+
onPageSizeChange(value: string): void;
|
|
34
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
1
2
|
export declare class EmptyStateComponent {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
message: string | undefined;
|
|
4
|
+
hasActiveFilters: boolean;
|
|
5
|
+
render: unknown;
|
|
6
|
+
clearAll: EventEmitter<void>;
|
|
6
7
|
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { ElementRef } from '@angular/core';
|
|
1
|
+
import { EventEmitter, ElementRef } from '@angular/core';
|
|
2
2
|
import { GRID_CONTEXT_MENU_ITEMS, formatShortcut } from '@alaarab/ogrid-core';
|
|
3
3
|
export declare class GridContextMenuComponent {
|
|
4
4
|
private destroyRef;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
hasSelection: boolean;
|
|
8
|
+
canUndoProp: boolean;
|
|
9
|
+
canRedoProp: boolean;
|
|
10
|
+
classNames: {
|
|
11
11
|
contextMenu?: string;
|
|
12
12
|
contextMenuItem?: string;
|
|
13
13
|
contextMenuItemLabel?: string;
|
|
14
14
|
contextMenuItemShortcut?: string;
|
|
15
15
|
contextMenuDivider?: string;
|
|
16
|
-
} | undefined
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
} | undefined;
|
|
17
|
+
copy: EventEmitter<void>;
|
|
18
|
+
cut: EventEmitter<void>;
|
|
19
|
+
paste: EventEmitter<void>;
|
|
20
|
+
selectAll: EventEmitter<void>;
|
|
21
|
+
undoAction: EventEmitter<void>;
|
|
22
|
+
redoAction: EventEmitter<void>;
|
|
23
|
+
close: EventEmitter<void>;
|
|
24
|
+
menuRef?: ElementRef<HTMLDivElement>;
|
|
25
25
|
readonly menuItems: import("@alaarab/ogrid-core").GridContextMenuItem[];
|
|
26
26
|
readonly formatShortcutFn: typeof formatShortcut;
|
|
27
27
|
private clickOutsideHandler;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
+
import { OnChanges, SimpleChanges } from '@angular/core';
|
|
1
2
|
import type { ISelectionRange } from '../types';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
left: number;
|
|
5
|
-
width: number;
|
|
6
|
-
height: number;
|
|
7
|
-
}
|
|
8
|
-
export declare class MarchingAntsOverlayComponent {
|
|
3
|
+
import { type OverlayRect } from '@alaarab/ogrid-core';
|
|
4
|
+
export declare class MarchingAntsOverlayComponent implements OnChanges {
|
|
9
5
|
private destroyRef;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
containerEl: HTMLElement | null;
|
|
7
|
+
selectionRange: ISelectionRange | null;
|
|
8
|
+
copyRange: ISelectionRange | null;
|
|
9
|
+
cutRange: ISelectionRange | null;
|
|
10
|
+
colOffset: number;
|
|
11
|
+
columnSizingVersion: number;
|
|
12
|
+
items: readonly unknown[];
|
|
13
|
+
visibleColumns: readonly string[] | undefined;
|
|
14
|
+
columnOrder: readonly string[] | undefined;
|
|
16
15
|
readonly selRect: import("@angular/core").WritableSignal<OverlayRect | null>;
|
|
17
16
|
readonly clipRect: import("@angular/core").WritableSignal<OverlayRect | null>;
|
|
18
17
|
private rafId;
|
|
19
18
|
private resizeObserver;
|
|
20
19
|
constructor();
|
|
20
|
+
ngOnChanges(_changes: SimpleChanges): void;
|
|
21
|
+
private recalculate;
|
|
21
22
|
clipRangeMatchesSel(): boolean;
|
|
22
23
|
max0(n: number): number;
|
|
23
24
|
}
|
|
24
|
-
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { SideBarProps } from './sidebar.component';
|
|
2
2
|
export declare class OGridLayoutComponent {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
className?: string;
|
|
4
|
+
hasToolbar: boolean;
|
|
5
|
+
hasToolbarBelow: boolean;
|
|
6
|
+
hasPagination: boolean;
|
|
7
|
+
sideBar: SideBarProps | null;
|
|
8
8
|
readonly borderRadius = 6;
|
|
9
9
|
}
|
|
@@ -21,7 +21,7 @@ export interface SideBarProps {
|
|
|
21
21
|
filterOptions: Record<string, string[]>;
|
|
22
22
|
}
|
|
23
23
|
export declare class SideBarComponent {
|
|
24
|
-
|
|
24
|
+
sideBarProps: SideBarProps | null;
|
|
25
25
|
readonly panelLabels: Record<SideBarPanelId, string>;
|
|
26
26
|
readonly tabWidth = 36;
|
|
27
27
|
readonly panelWidth = 240;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
export declare class StatusBarComponent {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
totalCount: number;
|
|
3
|
+
filteredCount: number | undefined;
|
|
4
|
+
selectedCount: number | undefined;
|
|
5
|
+
selectedCellCount: number | undefined;
|
|
6
|
+
aggregation: {
|
|
7
7
|
sum: number;
|
|
8
8
|
avg: number;
|
|
9
9
|
min: number;
|
|
10
10
|
max: number;
|
|
11
11
|
count: number;
|
|
12
|
-
} | null | undefined
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
} | null | undefined;
|
|
13
|
+
suppressRowCount: boolean | undefined;
|
|
14
|
+
classNames: {
|
|
15
15
|
statusBar?: string;
|
|
16
16
|
statusBarItem?: string;
|
|
17
17
|
statusBarLabel?: string;
|
|
18
18
|
statusBarValue?: string;
|
|
19
|
-
} | undefined
|
|
20
|
-
|
|
19
|
+
} | undefined;
|
|
20
|
+
getParts(): import("@alaarab/ogrid-core").StatusBarPart[];
|
|
21
21
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -18,5 +18,10 @@ export type { SideBarProps, SideBarFilterColumn } from './components/sidebar.com
|
|
|
18
18
|
export { MarchingAntsOverlayComponent } from './components/marching-ants-overlay.component';
|
|
19
19
|
export { EmptyStateComponent } from './components/empty-state.component';
|
|
20
20
|
export { BaseDataGridTableComponent } from './components/base-datagrid-table.component';
|
|
21
|
+
export { BaseColumnHeaderFilterComponent } from './components/base-column-header-filter.component';
|
|
22
|
+
export type { IColumnHeaderFilterProps } from './components/base-column-header-filter.component';
|
|
23
|
+
export { BaseColumnChooserComponent } from './components/base-column-chooser.component';
|
|
24
|
+
export type { IColumnChooserProps } from './components/base-column-chooser.component';
|
|
25
|
+
export { BasePaginationControlsComponent } from './components/base-pagination-controls.component';
|
|
21
26
|
export type { HeaderFilterConfigInput, HeaderFilterConfig, CellRenderDescriptorInput, CellRenderDescriptor, CellRenderMode, } from './utils';
|
|
22
27
|
export { getHeaderFilterConfig, getCellRenderDescriptor, resolveCellDisplayContent, resolveCellStyle, createDebouncedSignal, createDebouncedCallback, debounce, createLatestRef, createLatestCallback, } from './utils';
|
|
@@ -88,7 +88,7 @@ export interface DataGridViewModelState<T> {
|
|
|
88
88
|
headerFilterInput: {
|
|
89
89
|
sortBy?: string;
|
|
90
90
|
sortDirection: 'asc' | 'desc';
|
|
91
|
-
onColumnSort: (columnKey: string) => void;
|
|
91
|
+
onColumnSort: (columnKey: string, direction?: 'asc' | 'desc' | null) => void;
|
|
92
92
|
filters: IFilters;
|
|
93
93
|
onFilterChange: (key: string, value: FilterValue | undefined) => void;
|
|
94
94
|
filterOptions: Record<string, string[]>;
|
|
@@ -101,6 +101,7 @@ export declare class OGridService<T> {
|
|
|
101
101
|
readonly onFirstDataRendered: import("@angular/core").WritableSignal<(() => void) | undefined>;
|
|
102
102
|
readonly onError: import("@angular/core").WritableSignal<((error: unknown) => void) | undefined>;
|
|
103
103
|
readonly columnChooserProp: import("@angular/core").WritableSignal<boolean | "toolbar" | "sidebar" | undefined>;
|
|
104
|
+
readonly columnReorder: import("@angular/core").WritableSignal<boolean | undefined>;
|
|
104
105
|
readonly virtualScroll: import("@angular/core").WritableSignal<IVirtualScrollConfig | undefined>;
|
|
105
106
|
readonly ariaLabel: import("@angular/core").WritableSignal<string | undefined>;
|
|
106
107
|
readonly ariaLabelledBy: import("@angular/core").WritableSignal<string | undefined>;
|
|
@@ -179,7 +180,7 @@ export declare class OGridService<T> {
|
|
|
179
180
|
}): void;
|
|
180
181
|
setFilters(f: IFilters): void;
|
|
181
182
|
setVisibleColumns(cols: Set<string>): void;
|
|
182
|
-
handleSort(columnKey: string): void;
|
|
183
|
+
handleSort(columnKey: string, direction?: 'asc' | 'desc' | null): void;
|
|
183
184
|
handleFilterChange(key: string, value: FilterValue | undefined): void;
|
|
184
185
|
handleVisibilityChange(columnKey: string, isVisible: boolean): void;
|
|
185
186
|
handleSelectionChange(event: IRowSelectionChangeEvent<T>): void;
|
|
@@ -57,6 +57,7 @@ interface IOGridBaseProps<T> {
|
|
|
57
57
|
layoutMode?: 'content' | 'fill';
|
|
58
58
|
suppressHorizontalScroll?: boolean;
|
|
59
59
|
sideBar?: boolean | ISideBarDef;
|
|
60
|
+
columnReorder?: boolean;
|
|
60
61
|
virtualScroll?: IVirtualScrollConfig;
|
|
61
62
|
pageSizeOptions?: number[];
|
|
62
63
|
onFirstDataRendered?: () => void;
|
|
@@ -85,7 +86,7 @@ export interface IOGridDataGridProps<T> {
|
|
|
85
86
|
getRowId: (item: T) => RowId;
|
|
86
87
|
sortBy?: string;
|
|
87
88
|
sortDirection: 'asc' | 'desc';
|
|
88
|
-
onColumnSort: (columnKey: string) => void;
|
|
89
|
+
onColumnSort: (columnKey: string, direction?: 'asc' | 'desc' | null) => void;
|
|
89
90
|
visibleColumns: Set<string>;
|
|
90
91
|
columnOrder?: string[];
|
|
91
92
|
onColumnOrderChange?: (order: string[]) => void;
|
|
@@ -120,6 +121,7 @@ export interface IOGridDataGridProps<T> {
|
|
|
120
121
|
loadingFilterOptions: Record<string, boolean>;
|
|
121
122
|
peopleSearch?: (query: string) => Promise<UserLike[]>;
|
|
122
123
|
getUserByEmail?: (email: string) => Promise<UserLike | undefined>;
|
|
124
|
+
columnReorder?: boolean;
|
|
123
125
|
virtualScroll?: IVirtualScrollConfig;
|
|
124
126
|
emptyState?: {
|
|
125
127
|
onClearAll: () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alaarab/ogrid-angular",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.12",
|
|
4
4
|
"description": "OGrid Angular – Angular services, signals, and headless components for OGrid data grids.",
|
|
5
5
|
"main": "dist/esm/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"node": ">=18"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@alaarab/ogrid-core": "2.0.
|
|
38
|
+
"@alaarab/ogrid-core": "2.0.12"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@angular/core": "^21.0.0",
|