Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.

Commit 87caaa1

Browse files
Ghislain BeaulacGhislain Beaulac
authored andcommitted
Rename HeaderMenuOption & HeaderButtonOption to HeaderMenu, HeaderButton
1 parent b994f2c commit 87caaa1

14 files changed

+96
-37
lines changed

ng-package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"dest": "dist",
44
"workingDirectory": ".ng_build",
55
"lib": {
6-
"entryFile": "public_api.ts"
6+
"entryFile": "public_api.ts",
7+
"externals": {
8+
"flatpickr": "flatpickr"
9+
}
710
}
811
}

src/app/examples/grid-headerbutton.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class GridHeaderButtonComponent implements OnInit {
4747
},
4848
enableFiltering: false,
4949
enableCellNavigation: true,
50-
headerButtonOptions: {
50+
headerButton: {
5151
onCommand: (e, args) => {
5252
const column = args.column;
5353
const button = args.button;

src/app/examples/grid-headermenu.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export class GridHeaderMenuComponent implements OnInit {
8787
},
8888
enableFiltering: false,
8989
enableCellNavigation: true,
90-
headerMenuOptions: {
90+
headerMenu: {
9191
onCommand: (e, args) => {
9292
if (args.command === 'hide') {
9393
this.controlService.hideColumn(args.column);

src/app/modules/angular-slickgrid/models/column.interface.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Editor } from './editor.interface';
22
import { FieldType } from './fieldType';
33
import { Formatter } from './formatter.interface';
4-
import { HeaderButton } from './headerButton.interface';
5-
import { HeaderMenu } from './headerMenu.interface';
4+
import { HeaderButtonItem } from './headerButtonItem.interface';
5+
import { HeaderMenuItem } from './headerMenuItem.interface';
66
import { OnEventArgs } from './onEventArgs.interface';
77
import { Sorter } from './sorter.interface';
88

@@ -21,9 +21,9 @@ export interface Column {
2121
focusable?: boolean;
2222
formatter?: Formatter;
2323
header?: {
24-
buttons?: HeaderButton[];
24+
buttons?: HeaderButtonItem[];
2525
menu?: {
26-
items: HeaderMenu[];
26+
items: HeaderMenuItem[];
2727
};
2828
};
2929
headerCssClass?: string;

src/app/modules/angular-slickgrid/models/gridOption.interface.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { AutoResizeOption } from './autoResizeOption.interface';
22
import { BackendEventChanged } from './backendEventChanged.interface';
33
import { GridMenu } from './gridMenu.interface';
4+
import { HeaderButton } from './headerButton.interface';
5+
import { HeaderMenu } from './headerMenu.interface';
46
import { Pagination } from './pagination.interface';
57
import { PaginationChangedArgs } from './paginationChangedArgs.interface';
68
import { SortChangedArgs } from './sortChangedArgs.interface';
@@ -38,15 +40,8 @@ export interface GridOption {
3840
gridMenu?: GridMenu;
3941
gridId?: string;
4042
headerRowHeight?: number;
41-
headerButtonOptions?: {
42-
buttonCssClass?: string;
43-
onCommand?: (e: Event, args: any) => void;
44-
};
45-
headerMenuOptions?: {
46-
buttonCssClass?: string;
47-
buttonImage?: string;
48-
onCommand?: (e: Event, args: any) => void;
49-
};
43+
headerButton?: HeaderButton;
44+
headerMenu?: HeaderMenu;
5045
multiColumnSort?: boolean;
5146
onBackendEventApi?: BackendEventChanged;
5247
pagination?: Pagination;
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1+
import { HeaderButtonOnCommandArgs } from './headerButtonOnCommandArgs.interface';
2+
13
export interface HeaderButton {
2-
cssClass?: string; // CSS class to add to the button.
3-
image?: string; // Relative button image path.
4-
tooltip?: string; // Button tooltip.
5-
showOnHover?: boolean; // Only show the button on hover.
6-
handler?: (e: Event) => void; // Button click handler.
7-
command?: string; // A command identifier to be passed to the onCommand event handlers.
4+
buttonCssClass?: string;
5+
onCommand?: (e: Event, args: HeaderButtonOnCommandArgs) => void;
86
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export interface HeaderButtonItem {
2+
command?: string; // A command identifier to be passed to the onCommand event handlers.
3+
cssClass?: string; // CSS class to add to the button.
4+
handler?: (e: Event) => void; // Button click handler.
5+
image?: string; // Relative button image path.
6+
showOnHover?: boolean; // Only show the button on hover.
7+
tooltip?: string; // Button tooltip.
8+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Column } from './column.interface';
2+
import { HeaderButtonItem } from './headerButtonItem.interface';
3+
4+
export interface HeaderButtonOnCommandArgs {
5+
grid: any;
6+
column: Column;
7+
command: string;
8+
button: HeaderButtonItem;
9+
}
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
import { HeaderMenuOnBeforeMenuShowArgs } from './headerMenuOnBeforeMenuShowArgs.interface';
2+
import { HeaderButtonOnCommandArgs } from './headerButtonOnCommandArgs.interface';
3+
14
export interface HeaderMenu {
2-
title?: string; // Menu item text.
3-
disabled?: boolean; // Whether the item is disabled.
4-
tooltip?: string; // Item tooltip.
5-
command?: string; // A command identifier to be passed to the onCommand event handlers.
6-
iconCssClass?: string; // A CSS class to be added to the menu item icon.
7-
iconImage?: string; // A url to the icon image.
5+
buttonCssClass?: string;
6+
buttonImage?: string;
7+
onBeforeMenuShow?: (e: Event, args: HeaderMenuOnBeforeMenuShowArgs) => void;
8+
onCommand?: (e: Event, args: HeaderButtonOnCommandArgs) => void;
89
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export interface HeaderMenuItem {
2+
command?: string; // A command identifier to be passed to the onCommand event handlers.
3+
disabled?: boolean; // Whether the item is disabled.
4+
iconCssClass?: string; // A CSS class to be added to the menu item icon.
5+
iconImage?: string; // A url to the icon image.
6+
title?: string; // Menu item text.
7+
tooltip?: string; // Item tooltip.
8+
}

0 commit comments

Comments
 (0)