@alaarab/ogrid-react-fluent 2.0.0-beta

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.
Files changed (34) hide show
  1. package/README.md +85 -0
  2. package/dist/esm/ColumnChooser/ColumnChooser.js +152 -0
  3. package/dist/esm/ColumnChooser/ColumnChooser.module.css +15 -0
  4. package/dist/esm/ColumnHeaderFilter/ColumnHeaderFilter.js +49 -0
  5. package/dist/esm/ColumnHeaderFilter/ColumnHeaderFilter.module.css +374 -0
  6. package/dist/esm/ColumnHeaderFilter/MultiSelectFilterPopover.js +9 -0
  7. package/dist/esm/ColumnHeaderFilter/PeopleFilterPopover.js +9 -0
  8. package/dist/esm/ColumnHeaderFilter/TextFilterPopover.js +12 -0
  9. package/dist/esm/ColumnHeaderFilter/index.js +1 -0
  10. package/dist/esm/DataGridTable/DataGridTable.js +265 -0
  11. package/dist/esm/DataGridTable/DataGridTable.module.css +592 -0
  12. package/dist/esm/DataGridTable/GridContextMenu.js +35 -0
  13. package/dist/esm/DataGridTable/InlineCellEditor.js +6 -0
  14. package/dist/esm/DataGridTable/StatusBar.js +7 -0
  15. package/dist/esm/FluentDataTable/FluentDataTable.js +18 -0
  16. package/dist/esm/FluentDataTable/index.js +1 -0
  17. package/dist/esm/PaginationControls/PaginationControls.js +20 -0
  18. package/dist/esm/PaginationControls/PaginationControls.module.css +74 -0
  19. package/dist/esm/index.js +8 -0
  20. package/dist/types/ColumnChooser/ColumnChooser.d.ts +10 -0
  21. package/dist/types/ColumnHeaderFilter/ColumnHeaderFilter.d.ts +22 -0
  22. package/dist/types/ColumnHeaderFilter/MultiSelectFilterPopover.d.ts +19 -0
  23. package/dist/types/ColumnHeaderFilter/PeopleFilterPopover.d.ts +14 -0
  24. package/dist/types/ColumnHeaderFilter/TextFilterPopover.d.ts +13 -0
  25. package/dist/types/ColumnHeaderFilter/index.d.ts +1 -0
  26. package/dist/types/DataGridTable/DataGridTable.d.ts +5 -0
  27. package/dist/types/DataGridTable/GridContextMenu.d.ts +10 -0
  28. package/dist/types/DataGridTable/InlineCellEditor.d.ts +12 -0
  29. package/dist/types/DataGridTable/StatusBar.d.ts +16 -0
  30. package/dist/types/FluentDataTable/FluentDataTable.d.ts +7 -0
  31. package/dist/types/FluentDataTable/index.d.ts +1 -0
  32. package/dist/types/PaginationControls/PaginationControls.d.ts +12 -0
  33. package/dist/types/index.d.ts +6 -0
  34. package/package.json +64 -0
@@ -0,0 +1,74 @@
1
+ .pagination {
2
+ display: flex;
3
+ flex-wrap: wrap;
4
+ align-items: center;
5
+ justify-content: space-between;
6
+ gap: 14px 24px;
7
+ width: 100%;
8
+ min-width: 0;
9
+ box-sizing: border-box;
10
+ padding: 0;
11
+ }
12
+
13
+ .paginationInfo {
14
+ font-size: 13px;
15
+ color: var(--colorNeutralForeground2, #605e5c);
16
+ flex-shrink: 0;
17
+ font-variant-numeric: tabular-nums;
18
+ }
19
+
20
+ .paginationControls {
21
+ display: flex;
22
+ align-items: center;
23
+ gap: 4px;
24
+ flex-wrap: wrap;
25
+ flex: 1 1 auto;
26
+ justify-content: center;
27
+ min-width: 0;
28
+ }
29
+
30
+ .navBtn {
31
+ min-width: 28px;
32
+ min-height: 28px;
33
+ }
34
+
35
+ .pageNumbers {
36
+ display: inline-flex;
37
+ align-items: center;
38
+ gap: 4px;
39
+ margin: 0 8px;
40
+ }
41
+
42
+ .pageBtn {
43
+ min-width: 28px;
44
+ min-height: 28px;
45
+ font-variant-numeric: tabular-nums;
46
+ }
47
+
48
+ .ellipsis {
49
+ display: inline-flex;
50
+ align-items: center;
51
+ justify-content: center;
52
+ min-width: 24px;
53
+ font-size: 12px;
54
+ color: var(--colorNeutralForeground3, #8a8886);
55
+ user-select: none;
56
+ pointer-events: none;
57
+ letter-spacing: 0.02em;
58
+ }
59
+
60
+ .pageSizeSelector {
61
+ display: inline-flex;
62
+ align-items: center;
63
+ gap: 8px;
64
+ flex-shrink: 0;
65
+ }
66
+ .pageSizeSelector .pageSizeLabel {
67
+ font-size: 13px;
68
+ color: var(--colorNeutralForeground2, #605e5c);
69
+ user-select: none;
70
+ white-space: nowrap;
71
+ }
72
+ .pageSizeSelector .pageSizeSelect {
73
+ min-width: 72px;
74
+ }
@@ -0,0 +1,8 @@
1
+ // Components
2
+ export { OGrid, FluentDataTable } from './FluentDataTable';
3
+ export { DataGridTable } from './DataGridTable/DataGridTable';
4
+ export { ColumnChooser } from './ColumnChooser/ColumnChooser';
5
+ export { ColumnHeaderFilter } from './ColumnHeaderFilter/ColumnHeaderFilter';
6
+ export { PaginationControls } from './PaginationControls/PaginationControls';
7
+ // Re-export everything from core
8
+ export * from '@alaarab/ogrid-react';
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import type { IColumnDefinition } from '@alaarab/ogrid-react';
3
+ export type { IColumnDefinition };
4
+ export interface IColumnChooserProps {
5
+ columns: IColumnDefinition[];
6
+ visibleColumns: Set<string>;
7
+ onVisibilityChange: (columnKey: string, visible: boolean) => void;
8
+ className?: string;
9
+ }
10
+ export declare const ColumnChooser: React.FC<IColumnChooserProps>;
@@ -0,0 +1,22 @@
1
+ import * as React from 'react';
2
+ import type { UserLike, ColumnFilterType, IDateFilterValue } from '@alaarab/ogrid-react';
3
+ export interface IColumnHeaderFilterProps {
4
+ columnKey: string;
5
+ columnName: string;
6
+ filterType: ColumnFilterType;
7
+ isSorted?: boolean;
8
+ isSortedDescending?: boolean;
9
+ onSort?: () => void;
10
+ selectedValues?: string[];
11
+ onFilterChange?: (values: string[]) => void;
12
+ options?: string[];
13
+ isLoadingOptions?: boolean;
14
+ textValue?: string;
15
+ onTextChange?: (value: string) => void;
16
+ selectedUser?: UserLike;
17
+ onUserChange?: (user: UserLike | undefined) => void;
18
+ peopleSearch?: (query: string) => Promise<UserLike[]>;
19
+ dateValue?: IDateFilterValue;
20
+ onDateChange?: (value: IDateFilterValue | undefined) => void;
21
+ }
22
+ export declare const ColumnHeaderFilter: React.FC<IColumnHeaderFilterProps>;
@@ -0,0 +1,19 @@
1
+ import * as React from 'react';
2
+ export interface MultiSelectFilterPopoverProps {
3
+ searchText: string;
4
+ onSearchChange: (value: string) => void;
5
+ options: string[];
6
+ filteredOptions: string[];
7
+ selected: Set<string>;
8
+ onOptionToggle: (option: string, checked: boolean) => void;
9
+ onSelectAll: () => void;
10
+ onClearSelection: () => void;
11
+ onApply: () => void;
12
+ isLoading: boolean;
13
+ onPopoverClick: (e: React.MouseEvent) => void;
14
+ onInputFocus: (e: React.FocusEvent) => void;
15
+ onInputMouseDown: (e: React.MouseEvent) => void;
16
+ onInputClick: (e: React.MouseEvent) => void;
17
+ onInputKeyDown: (e: React.KeyboardEvent) => void;
18
+ }
19
+ export declare const MultiSelectFilterPopover: React.FC<MultiSelectFilterPopoverProps>;
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import type { UserLike } from '@alaarab/ogrid-react';
3
+ export interface PeopleFilterPopoverProps {
4
+ selectedUser: UserLike | undefined;
5
+ searchText: string;
6
+ onSearchChange: (value: string) => void;
7
+ suggestions: UserLike[];
8
+ isLoading: boolean;
9
+ onUserSelect: (user: UserLike) => void;
10
+ onClearUser: () => void;
11
+ onPopoverClick: (e: React.MouseEvent) => void;
12
+ inputRef?: React.Ref<HTMLInputElement>;
13
+ }
14
+ export declare const PeopleFilterPopover: React.FC<PeopleFilterPopoverProps>;
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ export interface TextFilterPopoverProps {
3
+ value: string;
4
+ onValueChange: (value: string) => void;
5
+ onApply: () => void;
6
+ onClear: () => void;
7
+ onPopoverClick: (e: React.MouseEvent) => void;
8
+ onInputFocus: (e: React.FocusEvent) => void;
9
+ onInputMouseDown: (e: React.MouseEvent) => void;
10
+ onInputClick: (e: React.MouseEvent) => void;
11
+ onInputKeyDown: (e: React.KeyboardEvent) => void;
12
+ }
13
+ export declare const TextFilterPopover: React.FC<TextFilterPopoverProps>;
@@ -0,0 +1 @@
1
+ export { ColumnHeaderFilter } from './ColumnHeaderFilter';
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ import type { IOGridDataGridProps } from '@alaarab/ogrid-react';
3
+ declare function DataGridTableInner<T>(props: IOGridDataGridProps<T>): React.ReactElement;
4
+ export declare const DataGridTable: typeof DataGridTableInner;
5
+ export {};
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import type { GridContextMenuHandlerProps } from '@alaarab/ogrid-react';
3
+ export interface GridContextMenuProps extends GridContextMenuHandlerProps {
4
+ x: number;
5
+ y: number;
6
+ hasSelection: boolean;
7
+ canUndo: boolean;
8
+ canRedo: boolean;
9
+ }
10
+ export declare function GridContextMenu(props: GridContextMenuProps): React.ReactElement;
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ import type { IColumnDef } from '@alaarab/ogrid-react';
3
+ export interface InlineCellEditorProps<T> {
4
+ value: unknown;
5
+ item: T;
6
+ column: IColumnDef<T>;
7
+ rowIndex: number;
8
+ editorType: 'text' | 'select' | 'checkbox' | 'richSelect' | 'date';
9
+ onCommit: (value: unknown) => void;
10
+ onCancel: () => void;
11
+ }
12
+ export declare function InlineCellEditor<T>(props: InlineCellEditorProps<T>): React.ReactElement;
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ export interface StatusBarProps {
3
+ totalCount: number;
4
+ filteredCount?: number;
5
+ selectedCount?: number;
6
+ selectedCellCount?: number;
7
+ aggregation?: {
8
+ sum: number;
9
+ avg: number;
10
+ min: number;
11
+ max: number;
12
+ count: number;
13
+ } | null;
14
+ suppressRowCount?: boolean;
15
+ }
16
+ export declare function StatusBar(props: StatusBarProps): React.ReactElement;
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import { type IOGridProps, type IOGridApi } from '@alaarab/ogrid-react';
3
+ export type { IOGridProps } from '@alaarab/ogrid-react';
4
+ declare const OGridInner: React.ForwardRefExoticComponent<IOGridProps<unknown> & React.RefAttributes<IOGridApi<unknown>>>;
5
+ export declare const OGrid: typeof OGridInner;
6
+ /** @deprecated Use `OGrid` instead. Backward-compat alias. */
7
+ export declare const FluentDataTable: React.ForwardRefExoticComponent<IOGridProps<unknown> & React.RefAttributes<IOGridApi<unknown>>>;
@@ -0,0 +1 @@
1
+ export { OGrid, FluentDataTable, type IOGridProps } from './FluentDataTable';
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ export interface IPaginationControlsProps {
3
+ currentPage: number;
4
+ pageSize: number;
5
+ totalCount: number;
6
+ onPageChange: (page: number) => void;
7
+ onPageSizeChange: (pageSize: number) => void;
8
+ pageSizeOptions?: number[];
9
+ entityLabelPlural?: string;
10
+ className?: string;
11
+ }
12
+ export declare const PaginationControls: React.FC<IPaginationControlsProps>;
@@ -0,0 +1,6 @@
1
+ export { OGrid, FluentDataTable, type IOGridProps } from './FluentDataTable';
2
+ export { DataGridTable } from './DataGridTable/DataGridTable';
3
+ export { ColumnChooser, type IColumnChooserProps } from './ColumnChooser/ColumnChooser';
4
+ export { ColumnHeaderFilter, type IColumnHeaderFilterProps } from './ColumnHeaderFilter/ColumnHeaderFilter';
5
+ export { PaginationControls, type IPaginationControlsProps } from './PaginationControls/PaginationControls';
6
+ export * from '@alaarab/ogrid-react';
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "@alaarab/ogrid-react-fluent",
3
+ "version": "2.0.0-beta",
4
+ "description": "OGrid Fluent UI implementation – DataGrid-powered data table 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 && node scripts/compile-styles.js",
17
+ "test": "jest",
18
+ "storybook": "storybook dev -p 6006 --no-open",
19
+ "build-storybook": "storybook build"
20
+ },
21
+ "keywords": [
22
+ "ogrid",
23
+ "fluentui",
24
+ "datatable",
25
+ "react",
26
+ "typescript",
27
+ "grid"
28
+ ],
29
+ "author": "Ala Arab",
30
+ "license": "MIT",
31
+ "files": [
32
+ "dist",
33
+ "README.md",
34
+ "LICENSE"
35
+ ],
36
+ "sideEffects": [
37
+ "**/*.css"
38
+ ],
39
+ "engines": {
40
+ "node": ">=18"
41
+ },
42
+ "dependencies": {
43
+ "@alaarab/ogrid-react": "2.0.0-beta"
44
+ },
45
+ "peerDependencies": {
46
+ "@fluentui/react-components": "^9.0.0",
47
+ "@fluentui/react-icons": "^2.0.0",
48
+ "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
49
+ "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
50
+ },
51
+ "devDependencies": {
52
+ "@fluentui/react-components": "^9.72.10",
53
+ "@fluentui/react-icons": "^2.0.317",
54
+ "@storybook/react-vite": "10.2.8",
55
+ "sass": "^1.83.4",
56
+ "scheduler": "^0.27.0",
57
+ "storybook": "10.2.8",
58
+ "eslint-plugin-storybook": "10.2.8",
59
+ "vite": "^7.0.0"
60
+ },
61
+ "publishConfig": {
62
+ "access": "public"
63
+ }
64
+ }