@alaarab/ogrid-angular 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.
- package/dist/esm/components/empty-state.component.js +39 -0
- package/dist/esm/components/grid-context-menu.component.js +117 -0
- package/dist/esm/components/marching-ants-overlay.component.js +155 -0
- package/dist/esm/components/ogrid-layout.component.js +96 -0
- package/dist/esm/components/sidebar.component.js +229 -0
- package/dist/esm/components/status-bar.component.js +48 -0
- package/dist/esm/index.js +13 -0
- package/dist/esm/services/datagrid-state.service.js +1268 -0
- package/dist/esm/services/ogrid.service.js +619 -0
- package/dist/esm/types/columnTypes.js +1 -0
- package/dist/esm/types/dataGridTypes.js +1 -0
- package/dist/esm/types/index.js +1 -0
- package/dist/types/components/empty-state.component.d.ts +6 -0
- package/dist/types/components/grid-context-menu.component.d.ts +32 -0
- package/dist/types/components/marching-ants-overlay.component.d.ts +23 -0
- package/dist/types/components/ogrid-layout.component.d.ts +9 -0
- package/dist/types/components/sidebar.component.d.ts +42 -0
- package/dist/types/components/status-bar.component.d.ts +21 -0
- package/dist/types/index.d.ts +16 -0
- package/dist/types/services/datagrid-state.service.d.ts +237 -0
- package/dist/types/services/ogrid.service.d.ts +191 -0
- package/dist/types/types/columnTypes.d.ts +27 -0
- package/dist/types/types/dataGridTypes.d.ts +126 -0
- package/dist/types/types/index.d.ts +3 -0
- package/package.json +42 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type { TemplateRef } from '@angular/core';
|
|
2
|
+
import type { IColumnDef, IColumnGroupDef, ICellValueChangedEvent } from './columnTypes';
|
|
3
|
+
export type { RowId, UserLike, UserLikeInput, FilterValue, IFilters, IFetchParams, IPageResult, IDataSource, IGridColumnState, RowSelectionMode, IRowSelectionChangeEvent, StatusBarPanel, IStatusBarProps, IActiveCell, ISelectionRange, SideBarPanelId, ISideBarDef, IOGridApi, } from '@alaarab/ogrid-core';
|
|
4
|
+
export { toUserLike, isInSelectionRange, normalizeSelectionRange } from '@alaarab/ogrid-core';
|
|
5
|
+
import type { RowId, UserLike, IFilters, FilterValue, RowSelectionMode, IRowSelectionChangeEvent, IStatusBarProps, IDataSource, ISideBarDef } from '@alaarab/ogrid-core';
|
|
6
|
+
/** Base props shared by both client-side and server-side OGrid modes. */
|
|
7
|
+
interface IOGridBaseProps<T> {
|
|
8
|
+
columns: (IColumnDef<T> | IColumnGroupDef<T>)[];
|
|
9
|
+
getRowId: (item: T) => RowId;
|
|
10
|
+
page?: number;
|
|
11
|
+
pageSize?: number;
|
|
12
|
+
sort?: {
|
|
13
|
+
field: string;
|
|
14
|
+
direction: 'asc' | 'desc';
|
|
15
|
+
};
|
|
16
|
+
filters?: IFilters;
|
|
17
|
+
visibleColumns?: Set<string>;
|
|
18
|
+
isLoading?: boolean;
|
|
19
|
+
onPageChange?: (page: number) => void;
|
|
20
|
+
onPageSizeChange?: (size: number) => void;
|
|
21
|
+
onSortChange?: (sort: {
|
|
22
|
+
field: string;
|
|
23
|
+
direction: 'asc' | 'desc';
|
|
24
|
+
}) => void;
|
|
25
|
+
onFiltersChange?: (filters: IFilters) => void;
|
|
26
|
+
onVisibleColumnsChange?: (cols: Set<string>) => void;
|
|
27
|
+
columnOrder?: string[];
|
|
28
|
+
onColumnOrderChange?: (order: string[]) => void;
|
|
29
|
+
onColumnResized?: (columnId: string, width: number) => void;
|
|
30
|
+
onColumnPinned?: (columnId: string, pinned: 'left' | 'right' | null) => void;
|
|
31
|
+
freezeRows?: number;
|
|
32
|
+
freezeCols?: number;
|
|
33
|
+
editable?: boolean;
|
|
34
|
+
cellSelection?: boolean;
|
|
35
|
+
onCellValueChanged?: (event: ICellValueChangedEvent<T>) => void;
|
|
36
|
+
onUndo?: () => void;
|
|
37
|
+
onRedo?: () => void;
|
|
38
|
+
canUndo?: boolean;
|
|
39
|
+
canRedo?: boolean;
|
|
40
|
+
rowSelection?: RowSelectionMode;
|
|
41
|
+
selectedRows?: Set<RowId>;
|
|
42
|
+
onSelectionChange?: (event: IRowSelectionChangeEvent<T>) => void;
|
|
43
|
+
statusBar?: boolean | IStatusBarProps;
|
|
44
|
+
defaultPageSize?: number;
|
|
45
|
+
defaultSortBy?: string;
|
|
46
|
+
defaultSortDirection?: 'asc' | 'desc';
|
|
47
|
+
toolbar?: TemplateRef<unknown>;
|
|
48
|
+
toolbarBelow?: TemplateRef<unknown>;
|
|
49
|
+
emptyState?: {
|
|
50
|
+
message?: string;
|
|
51
|
+
render?: TemplateRef<unknown>;
|
|
52
|
+
};
|
|
53
|
+
entityLabelPlural?: string;
|
|
54
|
+
className?: string;
|
|
55
|
+
columnChooser?: boolean | 'toolbar' | 'sidebar';
|
|
56
|
+
layoutMode?: 'content' | 'fill';
|
|
57
|
+
suppressHorizontalScroll?: boolean;
|
|
58
|
+
sideBar?: boolean | ISideBarDef;
|
|
59
|
+
pageSizeOptions?: number[];
|
|
60
|
+
onFirstDataRendered?: () => void;
|
|
61
|
+
onError?: (error: unknown) => void;
|
|
62
|
+
onCellError?: (error: Error) => void;
|
|
63
|
+
'aria-label'?: string;
|
|
64
|
+
'aria-labelledby'?: string;
|
|
65
|
+
}
|
|
66
|
+
/** Client-side mode: pass a data array. */
|
|
67
|
+
export interface IOGridClientProps<T> extends IOGridBaseProps<T> {
|
|
68
|
+
data: T[];
|
|
69
|
+
dataSource?: never;
|
|
70
|
+
}
|
|
71
|
+
/** Server-side mode: pass a dataSource. */
|
|
72
|
+
export interface IOGridServerProps<T> extends IOGridBaseProps<T> {
|
|
73
|
+
data?: never;
|
|
74
|
+
dataSource: IDataSource<T>;
|
|
75
|
+
}
|
|
76
|
+
/** Props for the OGrid wrapper (shared across Angular UI packages).
|
|
77
|
+
* Must provide either `data` (client-side) or `dataSource` (server-side), not both. */
|
|
78
|
+
export type IOGridProps<T> = IOGridClientProps<T> | IOGridServerProps<T>;
|
|
79
|
+
/** Props passed from OGridService to the framework-specific DataGridTable. */
|
|
80
|
+
export interface IOGridDataGridProps<T> {
|
|
81
|
+
items: T[];
|
|
82
|
+
columns: (IColumnDef<T> | IColumnGroupDef<T>)[];
|
|
83
|
+
getRowId: (item: T) => RowId;
|
|
84
|
+
sortBy?: string;
|
|
85
|
+
sortDirection: 'asc' | 'desc';
|
|
86
|
+
onColumnSort: (columnKey: string) => void;
|
|
87
|
+
visibleColumns: Set<string>;
|
|
88
|
+
columnOrder?: string[];
|
|
89
|
+
onColumnOrderChange?: (order: string[]) => void;
|
|
90
|
+
onColumnResized?: (columnId: string, width: number) => void;
|
|
91
|
+
onColumnPinned?: (columnId: string, pinned: 'left' | 'right' | null) => void;
|
|
92
|
+
pinnedColumns?: Record<string, 'left' | 'right'>;
|
|
93
|
+
initialColumnWidths?: Record<string, number>;
|
|
94
|
+
freezeRows?: number;
|
|
95
|
+
freezeCols?: number;
|
|
96
|
+
layoutMode?: 'content' | 'fill';
|
|
97
|
+
suppressHorizontalScroll?: boolean;
|
|
98
|
+
isLoading?: boolean;
|
|
99
|
+
loadingMessage?: string;
|
|
100
|
+
editable?: boolean;
|
|
101
|
+
cellSelection?: boolean;
|
|
102
|
+
onCellValueChanged?: (event: ICellValueChangedEvent<T>) => void;
|
|
103
|
+
onUndo?: () => void;
|
|
104
|
+
onRedo?: () => void;
|
|
105
|
+
canUndo?: boolean;
|
|
106
|
+
canRedo?: boolean;
|
|
107
|
+
rowSelection?: RowSelectionMode;
|
|
108
|
+
selectedRows?: Set<RowId>;
|
|
109
|
+
onSelectionChange?: (event: IRowSelectionChangeEvent<T>) => void;
|
|
110
|
+
statusBar?: IStatusBarProps;
|
|
111
|
+
filters: IFilters;
|
|
112
|
+
onFilterChange: (key: string, value: FilterValue | undefined) => void;
|
|
113
|
+
filterOptions: Record<string, string[]>;
|
|
114
|
+
loadingFilterOptions: Record<string, boolean>;
|
|
115
|
+
peopleSearch?: (query: string) => Promise<UserLike[]>;
|
|
116
|
+
getUserByEmail?: (email: string) => Promise<UserLike | undefined>;
|
|
117
|
+
emptyState?: {
|
|
118
|
+
onClearAll: () => void;
|
|
119
|
+
hasActiveFilters: boolean;
|
|
120
|
+
message?: string;
|
|
121
|
+
render?: TemplateRef<unknown>;
|
|
122
|
+
};
|
|
123
|
+
onCellError?: (error: Error) => void;
|
|
124
|
+
'aria-label'?: string;
|
|
125
|
+
'aria-labelledby'?: string;
|
|
126
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { ColumnFilterType, IColumnFilterDef, IColumnMeta, IColumnDef, IColumnGroupDef, IColumnDefinition, ICellValueChangedEvent, ICellEditorProps, CellEditorParams, IValueParserParams, IDateFilterValue, HeaderCell, HeaderRow, } from './columnTypes';
|
|
2
|
+
export type { RowId, UserLike, UserLikeInput, FilterValue, IFilters, IFetchParams, IPageResult, IDataSource, IGridColumnState, IOGridApi, IOGridProps, IOGridClientProps, IOGridServerProps, IOGridDataGridProps, RowSelectionMode, IRowSelectionChangeEvent, StatusBarPanel, IStatusBarProps, IActiveCell, ISelectionRange, SideBarPanelId, ISideBarDef, } from './dataGridTypes';
|
|
3
|
+
export { toUserLike, isInSelectionRange, normalizeSelectionRange } from './dataGridTypes';
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@alaarab/ogrid-angular",
|
|
3
|
+
"version": "2.0.2",
|
|
4
|
+
"description": "OGrid Angular – Angular services, signals, and headless components for OGrid data grids.",
|
|
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", "datatable", "typescript", "grid", "signals"],
|
|
20
|
+
"author": "Ala Arab",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"files": ["dist", "README.md", "LICENSE"],
|
|
23
|
+
"engines": { "node": ">=18" },
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@alaarab/ogrid-core": "2.0.2"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"@angular/core": "^21.0.0",
|
|
29
|
+
"@angular/common": "^21.0.0"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@angular/core": "^21.1.4",
|
|
33
|
+
"@angular/common": "^21.1.4",
|
|
34
|
+
"@angular/compiler": "^21.1.4",
|
|
35
|
+
"@angular/platform-browser": "^21.1.4",
|
|
36
|
+
"@angular/platform-browser-dynamic": "^21.1.4",
|
|
37
|
+
"rxjs": "^7.8.0",
|
|
38
|
+
"zone.js": "^0.15.0",
|
|
39
|
+
"typescript": "^5.7.3"
|
|
40
|
+
},
|
|
41
|
+
"publishConfig": { "access": "public" }
|
|
42
|
+
}
|