@genesislcap/grid-pro 15.71.0 → 15.72.0-FUI-2629.7
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/custom-elements.json +209 -3
- package/dist/dts/cell-renderers/actions-menu.renderer.d.ts +39 -3
- package/dist/dts/cell-renderers/actions-menu.renderer.d.ts.map +1 -1
- package/dist/dts/context-menu/context-menu.d.ts +69 -0
- package/dist/dts/context-menu/context-menu.d.ts.map +1 -0
- package/dist/dts/context-menu/index.d.ts +2 -0
- package/dist/dts/context-menu/index.d.ts.map +1 -0
- package/dist/dts/grid-pro.d.ts +39 -2
- package/dist/dts/grid-pro.d.ts.map +1 -1
- package/dist/dts/index.d.ts +1 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/esm/cell-renderers/actions-menu.renderer.js +61 -2
- package/dist/esm/context-menu/context-menu.js +347 -0
- package/dist/esm/context-menu/index.js +1 -0
- package/dist/esm/grid-pro.js +81 -3
- package/dist/esm/index.js +1 -0
- package/dist/grid-pro.api.json +532 -20
- package/dist/grid-pro.d.ts +120 -6
- package/package.json +12 -12
|
@@ -2205,6 +2205,38 @@
|
|
|
2205
2205
|
"privacy": "private",
|
|
2206
2206
|
"default": "false"
|
|
2207
2207
|
},
|
|
2208
|
+
{
|
|
2209
|
+
"kind": "field",
|
|
2210
|
+
"name": "contextMenuItems",
|
|
2211
|
+
"type": {
|
|
2212
|
+
"text": "GridProContextMenuItems | undefined"
|
|
2213
|
+
},
|
|
2214
|
+
"description": "Opts the grid into its own right-click menu, built from these items for each cell. It needs no\nAG Grid Enterprise module, and replaces AG Grid's context menu while set. Assign\ndefaultGridContextMenuItems for a CSV Export menu, or return an empty list to show the\nbrowser's menu for that cell.\n\nUnset, right-click is left alone: AG Grid's menu when its `ContextMenu` module is registered,\notherwise the browser's.",
|
|
2215
|
+
"privacy": "public"
|
|
2216
|
+
},
|
|
2217
|
+
{
|
|
2218
|
+
"kind": "method",
|
|
2219
|
+
"name": "contextMenuItemsChanged"
|
|
2220
|
+
},
|
|
2221
|
+
{
|
|
2222
|
+
"kind": "field",
|
|
2223
|
+
"name": "closeContextMenu",
|
|
2224
|
+
"type": {
|
|
2225
|
+
"text": "() => void | undefined"
|
|
2226
|
+
},
|
|
2227
|
+
"privacy": "private",
|
|
2228
|
+
"description": "Removes the open right-click menu, if there is one."
|
|
2229
|
+
},
|
|
2230
|
+
{
|
|
2231
|
+
"kind": "field",
|
|
2232
|
+
"name": "gridCreatedWithMenuSuppressed",
|
|
2233
|
+
"type": {
|
|
2234
|
+
"text": "boolean"
|
|
2235
|
+
},
|
|
2236
|
+
"privacy": "private",
|
|
2237
|
+
"default": "false",
|
|
2238
|
+
"description": "Whether the AG grid instance was created with its own context menu suppressed."
|
|
2239
|
+
},
|
|
2208
2240
|
{
|
|
2209
2241
|
"kind": "field",
|
|
2210
2242
|
"name": "enableColumnSelection",
|
|
@@ -2368,6 +2400,13 @@
|
|
|
2368
2400
|
"privacy": "private",
|
|
2369
2401
|
"readonly": true
|
|
2370
2402
|
},
|
|
2403
|
+
{
|
|
2404
|
+
"kind": "field",
|
|
2405
|
+
"name": "boundContextMenuListener",
|
|
2406
|
+
"privacy": "private",
|
|
2407
|
+
"readonly": true,
|
|
2408
|
+
"description": "`globalListener` runs on a timeout, which is too late to cancel the browser menu.\nThis one runs inside the right-click event."
|
|
2409
|
+
},
|
|
2371
2410
|
{
|
|
2372
2411
|
"kind": "field",
|
|
2373
2412
|
"name": "_filterConfig",
|
|
@@ -3489,6 +3528,14 @@
|
|
|
3489
3528
|
"package": "./column-filters"
|
|
3490
3529
|
}
|
|
3491
3530
|
},
|
|
3531
|
+
{
|
|
3532
|
+
"kind": "js",
|
|
3533
|
+
"name": "*",
|
|
3534
|
+
"declaration": {
|
|
3535
|
+
"name": "*",
|
|
3536
|
+
"package": "./context-menu"
|
|
3537
|
+
}
|
|
3538
|
+
},
|
|
3492
3539
|
{
|
|
3493
3540
|
"kind": "js",
|
|
3494
3541
|
"name": "*",
|
|
@@ -5744,7 +5791,8 @@
|
|
|
5744
5791
|
"text": "ICellRendererParams"
|
|
5745
5792
|
}
|
|
5746
5793
|
}
|
|
5747
|
-
]
|
|
5794
|
+
],
|
|
5795
|
+
"description": "Hands the latest row data to the menu, so per-row actions and disabled states stay current."
|
|
5748
5796
|
},
|
|
5749
5797
|
{
|
|
5750
5798
|
"kind": "field",
|
|
@@ -5883,9 +5931,9 @@
|
|
|
5883
5931
|
{
|
|
5884
5932
|
"name": "actions",
|
|
5885
5933
|
"type": {
|
|
5886
|
-
"text": "
|
|
5934
|
+
"text": "ActionMenuItems"
|
|
5887
5935
|
},
|
|
5888
|
-
"description": "Array of `ActionMenuItem` to be displayed in the menu."
|
|
5936
|
+
"description": "Array of `ActionMenuItem` to be displayed in the menu, or a function of the row data\nreturning that array (for row-scoped eligibility/permission filtering)."
|
|
5889
5937
|
},
|
|
5890
5938
|
{
|
|
5891
5939
|
"name": "overrideDef",
|
|
@@ -5922,6 +5970,58 @@
|
|
|
5922
5970
|
],
|
|
5923
5971
|
"description": "Helper function to get ColDef https://www.ag-grid.com/javascript-data-grid/column-properties/ for Actions Menu Renderer.\nWill take the parameter values for a base ColDef and merge them with the overrideDef (if specified).",
|
|
5924
5972
|
"privacy": "public"
|
|
5973
|
+
},
|
|
5974
|
+
{
|
|
5975
|
+
"kind": "function",
|
|
5976
|
+
"name": "getVerticalDropdownMenuDef",
|
|
5977
|
+
"return": {
|
|
5978
|
+
"type": {
|
|
5979
|
+
"text": ""
|
|
5980
|
+
}
|
|
5981
|
+
},
|
|
5982
|
+
"parameters": [
|
|
5983
|
+
{
|
|
5984
|
+
"name": "actions",
|
|
5985
|
+
"type": {
|
|
5986
|
+
"text": "ActionMenuItems"
|
|
5987
|
+
},
|
|
5988
|
+
"description": "Array of `ActionMenuItem` to be displayed in the menu, or a function of the row data\nreturning that array (for row-scoped eligibility/permission filtering)."
|
|
5989
|
+
},
|
|
5990
|
+
{
|
|
5991
|
+
"name": "overrideDef",
|
|
5992
|
+
"default": "{}",
|
|
5993
|
+
"type": {
|
|
5994
|
+
"text": "ColDef & { suppressHeaderMenuButton?: boolean }"
|
|
5995
|
+
},
|
|
5996
|
+
"description": "Optional override for the ColDef. Will override any of the default values. Default is an empty object."
|
|
5997
|
+
},
|
|
5998
|
+
{
|
|
5999
|
+
"name": "iconName",
|
|
6000
|
+
"default": "'ellipsis'",
|
|
6001
|
+
"type": {
|
|
6002
|
+
"text": "string"
|
|
6003
|
+
},
|
|
6004
|
+
"description": "Optional icon name for the opener. Default is `'ellipsis'` (horizontal dots); pass `'ellipsis-vertical'` for vertical ones."
|
|
6005
|
+
},
|
|
6006
|
+
{
|
|
6007
|
+
"name": "buttonAppearance",
|
|
6008
|
+
"optional": true,
|
|
6009
|
+
"type": {
|
|
6010
|
+
"text": "string"
|
|
6011
|
+
},
|
|
6012
|
+
"description": "Optional appearance for the button that opens the menu."
|
|
6013
|
+
},
|
|
6014
|
+
{
|
|
6015
|
+
"name": "hideDisabled",
|
|
6016
|
+
"default": "false",
|
|
6017
|
+
"type": {
|
|
6018
|
+
"text": "boolean"
|
|
6019
|
+
},
|
|
6020
|
+
"description": "Optional flag to hide disabled actions instead of greying them out. Default is false.\nWhen every action for a row is hidden, the opener hides too."
|
|
6021
|
+
}
|
|
6022
|
+
],
|
|
6023
|
+
"description": "Helper function to get ColDef https://www.ag-grid.com/javascript-data-grid/column-properties/ for a\nvertical Actions Menu behind an icon-only \"kebab\" opener, for a pinned column of per-row actions.\nWill take the parameter values for a base ColDef and merge them with the overrideDef (if specified).",
|
|
6024
|
+
"privacy": "public"
|
|
5925
6025
|
}
|
|
5926
6026
|
],
|
|
5927
6027
|
"exports": [
|
|
@@ -5948,6 +6048,14 @@
|
|
|
5948
6048
|
"name": "getActionsMenuDef",
|
|
5949
6049
|
"module": "src/cell-renderers/actions-menu.renderer.ts"
|
|
5950
6050
|
}
|
|
6051
|
+
},
|
|
6052
|
+
{
|
|
6053
|
+
"kind": "js",
|
|
6054
|
+
"name": "getVerticalDropdownMenuDef",
|
|
6055
|
+
"declaration": {
|
|
6056
|
+
"name": "getVerticalDropdownMenuDef",
|
|
6057
|
+
"module": "src/cell-renderers/actions-menu.renderer.ts"
|
|
6058
|
+
}
|
|
5951
6059
|
}
|
|
5952
6060
|
]
|
|
5953
6061
|
},
|
|
@@ -10371,6 +10479,104 @@
|
|
|
10371
10479
|
}
|
|
10372
10480
|
]
|
|
10373
10481
|
},
|
|
10482
|
+
{
|
|
10483
|
+
"kind": "javascript-module",
|
|
10484
|
+
"path": "src/context-menu/context-menu.ts",
|
|
10485
|
+
"declarations": [
|
|
10486
|
+
{
|
|
10487
|
+
"kind": "function",
|
|
10488
|
+
"name": "defaultGridContextMenuItems",
|
|
10489
|
+
"return": {
|
|
10490
|
+
"type": {
|
|
10491
|
+
"text": "GridProContextMenuItem[]"
|
|
10492
|
+
}
|
|
10493
|
+
},
|
|
10494
|
+
"parameters": [
|
|
10495
|
+
{
|
|
10496
|
+
"name": "event",
|
|
10497
|
+
"type": {
|
|
10498
|
+
"text": "CellContextMenuEvent"
|
|
10499
|
+
}
|
|
10500
|
+
}
|
|
10501
|
+
],
|
|
10502
|
+
"description": "A CSV Export item, using AG Grid's community CSV export. Assign it to `contextMenuItems` as the\nwhole menu, or spread its result into a menu of your own. Empty when the grid sets\n`suppressCsvExport`.",
|
|
10503
|
+
"privacy": "public"
|
|
10504
|
+
}
|
|
10505
|
+
],
|
|
10506
|
+
"exports": [
|
|
10507
|
+
{
|
|
10508
|
+
"kind": "js",
|
|
10509
|
+
"name": "defaultGridContextMenuItems",
|
|
10510
|
+
"declaration": {
|
|
10511
|
+
"name": "defaultGridContextMenuItems",
|
|
10512
|
+
"module": "src/context-menu/context-menu.ts"
|
|
10513
|
+
}
|
|
10514
|
+
}
|
|
10515
|
+
]
|
|
10516
|
+
},
|
|
10517
|
+
{
|
|
10518
|
+
"kind": "javascript-module",
|
|
10519
|
+
"path": "src/context-menu/index.ts",
|
|
10520
|
+
"declarations": [],
|
|
10521
|
+
"exports": [
|
|
10522
|
+
{
|
|
10523
|
+
"kind": "js",
|
|
10524
|
+
"name": "defaultGridContextMenuItems",
|
|
10525
|
+
"declaration": {
|
|
10526
|
+
"name": "defaultGridContextMenuItems",
|
|
10527
|
+
"module": "./context-menu"
|
|
10528
|
+
}
|
|
10529
|
+
},
|
|
10530
|
+
{
|
|
10531
|
+
"kind": "js",
|
|
10532
|
+
"name": "type",
|
|
10533
|
+
"declaration": {
|
|
10534
|
+
"name": "type",
|
|
10535
|
+
"module": "./context-menu"
|
|
10536
|
+
}
|
|
10537
|
+
},
|
|
10538
|
+
{
|
|
10539
|
+
"kind": "js",
|
|
10540
|
+
"name": "GridProContextMenuEntry",
|
|
10541
|
+
"declaration": {
|
|
10542
|
+
"name": "GridProContextMenuEntry",
|
|
10543
|
+
"module": "./context-menu"
|
|
10544
|
+
}
|
|
10545
|
+
},
|
|
10546
|
+
{
|
|
10547
|
+
"kind": "js",
|
|
10548
|
+
"name": "type",
|
|
10549
|
+
"declaration": {
|
|
10550
|
+
"name": "type",
|
|
10551
|
+
"module": "./context-menu"
|
|
10552
|
+
}
|
|
10553
|
+
},
|
|
10554
|
+
{
|
|
10555
|
+
"kind": "js",
|
|
10556
|
+
"name": "GridProContextMenuItem",
|
|
10557
|
+
"declaration": {
|
|
10558
|
+
"name": "GridProContextMenuItem",
|
|
10559
|
+
"module": "./context-menu"
|
|
10560
|
+
}
|
|
10561
|
+
},
|
|
10562
|
+
{
|
|
10563
|
+
"kind": "js",
|
|
10564
|
+
"name": "type",
|
|
10565
|
+
"declaration": {
|
|
10566
|
+
"name": "type",
|
|
10567
|
+
"module": "./context-menu"
|
|
10568
|
+
}
|
|
10569
|
+
},
|
|
10570
|
+
{
|
|
10571
|
+
"kind": "js",
|
|
10572
|
+
"name": "GridProContextMenuItems",
|
|
10573
|
+
"declaration": {
|
|
10574
|
+
"name": "GridProContextMenuItems",
|
|
10575
|
+
"module": "./context-menu"
|
|
10576
|
+
}
|
|
10577
|
+
}
|
|
10578
|
+
]
|
|
10579
|
+
},
|
|
10374
10580
|
{
|
|
10375
10581
|
"kind": "javascript-module",
|
|
10376
10582
|
"path": "src/datasource/base.datasource.ts",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ColDef, ICellRendererComp, ICellRendererParams } from '@ag-grid-community/core';
|
|
2
|
-
import {
|
|
2
|
+
import type { ActionMenuItems } from '@genesislcap/foundation-ui';
|
|
3
3
|
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
4
4
|
/**
|
|
5
5
|
* The Actions Menu Renderer element.
|
|
@@ -11,6 +11,7 @@ export declare class ActionsMenuRenderer extends FoundationElement implements IC
|
|
|
11
11
|
params: ICellRendererParams;
|
|
12
12
|
init(params: ICellRendererParams): void;
|
|
13
13
|
getGui(): HTMLElement;
|
|
14
|
+
/** Hands the latest row data to the menu, so per-row actions and disabled states stay current. */
|
|
14
15
|
refresh(params: ICellRendererParams): boolean;
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
@@ -30,7 +31,8 @@ export declare const foundationGridProActionsMenuRenderer: (overrideDefinition?:
|
|
|
30
31
|
/**
|
|
31
32
|
* Helper function to get ColDef {@link https://www.ag-grid.com/javascript-data-grid/column-properties/} for Actions Menu Renderer.
|
|
32
33
|
* Will take the parameter values for a base ColDef and merge them with the overrideDef (if specified).
|
|
33
|
-
* @param actions - Array of `ActionMenuItem` to be displayed in the menu
|
|
34
|
+
* @param actions - Array of `ActionMenuItem` to be displayed in the menu, or a function of the row data
|
|
35
|
+
* returning that array (for row-scoped eligibility/permission filtering).
|
|
34
36
|
* @param overrideDef - Optional override for the ColDef. Will override any of the default values. Default is an empty object.
|
|
35
37
|
* @param customActionsOpenerName - Optional custom name for the button that opens the menu. Default is '⋮'.
|
|
36
38
|
* @param isVertical - Optional flag to display the menu vertically. Default is false (displays the menu horizontally, follow the rowHeight).
|
|
@@ -60,5 +62,39 @@ export declare const foundationGridProActionsMenuRenderer: (overrideDefinition?:
|
|
|
60
62
|
* ```
|
|
61
63
|
* @public
|
|
62
64
|
*/
|
|
63
|
-
export declare const getActionsMenuDef: (actions:
|
|
65
|
+
export declare const getActionsMenuDef: (actions: ActionMenuItems, overrideDef?: ColDef, customActionsOpenerName?: string, isVertical?: boolean, buttonAppearance?: string) => ColDef;
|
|
66
|
+
/**
|
|
67
|
+
* Helper function to get ColDef {@link https://www.ag-grid.com/javascript-data-grid/column-properties/} for a
|
|
68
|
+
* vertical Actions Menu behind an icon-only "kebab" opener, for a pinned column of per-row actions.
|
|
69
|
+
* Will take the parameter values for a base ColDef and merge them with the overrideDef (if specified).
|
|
70
|
+
* @remarks The opener hides itself on rows with no actions, so it never opens an empty menu. The
|
|
71
|
+
* column has a `colId` but no `field`: AG Grid only refreshes a cell with a field when its value
|
|
72
|
+
* changes, and this column has no value, so a row update would leave stale actions. Having no value,
|
|
73
|
+
* the column is also not sortable, filterable, resizable or flashed, and shows no header menu
|
|
74
|
+
* button — pass any of these in `overrideDef` to turn them back on.
|
|
75
|
+
* @param actions - Array of `ActionMenuItem` to be displayed in the menu, or a function of the row data
|
|
76
|
+
* returning that array (for row-scoped eligibility/permission filtering).
|
|
77
|
+
* @param overrideDef - Optional override for the ColDef. Will override any of the default values. Default is an empty object.
|
|
78
|
+
* @param iconName - Optional icon name for the opener. Default is `'ellipsis'` (horizontal dots); pass `'ellipsis-vertical'` for vertical ones.
|
|
79
|
+
* @param buttonAppearance - Optional appearance for the button that opens the menu.
|
|
80
|
+
* @param hideDisabled - Optional flag to hide disabled actions instead of greying them out. Default is false.
|
|
81
|
+
* When every action for a row is hidden, the opener hides too.
|
|
82
|
+
* @returns Merged ColDef (base ColDef created from the parameters + overrideDef) for Actions Menu Renderer.
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* public exampleMoreColumnDef: ColDef = getVerticalDropdownMenuDef(
|
|
86
|
+
* (rowData) => [
|
|
87
|
+
* { name: 'Ping Trader', icon: { name: 'paper-plane' }, callback: (rowData) => pingTrader(rowData) },
|
|
88
|
+
* { name: 'Assign', icon: { name: 'user' }, callback: (rowData) => assign(rowData) },
|
|
89
|
+
* ],
|
|
90
|
+
* { headerName: '', pinned: 'right' },
|
|
91
|
+
* );
|
|
92
|
+
* ```
|
|
93
|
+
* @public
|
|
94
|
+
*/
|
|
95
|
+
export declare const getVerticalDropdownMenuDef: (actions: ActionMenuItems, overrideDef?: ColDef & {
|
|
96
|
+
suppressHeaderMenuButton?: boolean;
|
|
97
|
+
}, iconName?: string, buttonAppearance?: string, hideDisabled?: boolean) => ColDef & {
|
|
98
|
+
suppressHeaderMenuButton?: boolean;
|
|
99
|
+
};
|
|
64
100
|
//# sourceMappingURL=actions-menu.renderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions-menu.renderer.d.ts","sourceRoot":"","sources":["../../../src/cell-renderers/actions-menu.renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9F,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"actions-menu.renderer.d.ts","sourceRoot":"","sources":["../../../src/cell-renderers/actions-menu.renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAI/D;;;;;GAKG;AACH,qBAAa,mBAAoB,SAAQ,iBAAkB,YAAW,iBAAiB;IAClE,MAAM,EAAE,mBAAmB,CAAC;IAExC,IAAI,CAAC,MAAM,EAAE,mBAAmB;IAKhC,MAAM,IAAI,WAAW;IAI5B,kGAAkG;IAC3F,OAAO,CAAC,MAAM,EAAE,mBAAmB;CAI3C;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oCAAoC;;;;;;8BAQ/C,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,iBAAiB,GAC5B,SAAS,eAAe,EACxB,cAAa,MAAW,EACxB,0BAAyB,MAAY,EACrC,aAAY,OAAe,EAC3B,mBAAmB,MAAM,KACxB,MAqBF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,0BAA0B,GACrC,SAAS,eAAe,EACxB,cAAa,MAAM,GAAG;IAAE,wBAAwB,CAAC,EAAE,OAAO,CAAA;CAAO,EACjE,WAAU,MAAmB,EAC7B,mBAAmB,MAAM,EACzB,eAAc,OAAe,KAC5B,MAAM,GAAG;IAAE,wBAAwB,CAAC,EAAE,OAAO,CAAA;CA2B/C,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { CellContextMenuEvent } from 'ag-grid-community';
|
|
2
|
+
/**
|
|
3
|
+
* One entry in grid-pro's right-click menu.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface GridProContextMenuItem {
|
|
8
|
+
name: string;
|
|
9
|
+
/** Drawn to the right of the name, for example a key combination. */
|
|
10
|
+
shortcut?: string;
|
|
11
|
+
/** Shown on hover, including while the item is disabled — say why it cannot be chosen. */
|
|
12
|
+
tooltip?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
/** Set to `true` or `false` to make the item a checkbox; leave unset for a plain item. */
|
|
15
|
+
checked?: boolean;
|
|
16
|
+
action?: () => void;
|
|
17
|
+
subMenu?: GridProContextMenuEntry[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* An item, or `'separator'` for a dividing line between groups of items.
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export type GridProContextMenuEntry = GridProContextMenuItem | 'separator';
|
|
25
|
+
/**
|
|
26
|
+
* Builds the right-click menu for one cell. Return an empty list to show the browser's menu.
|
|
27
|
+
*
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
export type GridProContextMenuItems = (event: CellContextMenuEvent) => GridProContextMenuEntry[];
|
|
31
|
+
/**
|
|
32
|
+
* A CSV Export item, using AG Grid's community CSV export. Assign it to `contextMenuItems` as the
|
|
33
|
+
* whole menu, or spread its result into a menu of your own. Empty when the grid sets
|
|
34
|
+
* `suppressCsvExport`.
|
|
35
|
+
*
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
38
|
+
export declare function defaultGridContextMenuItems(event: CellContextMenuEvent): GridProContextMenuItem[];
|
|
39
|
+
/**
|
|
40
|
+
* Where and how {@link openGridContextMenu} draws the menu.
|
|
41
|
+
*
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
export interface GridContextMenuOptions {
|
|
45
|
+
/** Design-system prefix: the menu is built from `${prefix}-menu` and `${prefix}-menu-item`. */
|
|
46
|
+
prefix: string;
|
|
47
|
+
/** Viewport coordinates of the pointer. */
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
items: readonly GridProContextMenuEntry[];
|
|
51
|
+
/**
|
|
52
|
+
* Node the menu is attached to. Use one inside the grid's own tree, so a grid in a modal dialog
|
|
53
|
+
* does not render its menu inert. Defaults to `document.body`.
|
|
54
|
+
*/
|
|
55
|
+
container?: Node;
|
|
56
|
+
/** Element the theme variables are read from, and focus returns to on keyboard close. */
|
|
57
|
+
themeSource?: Element | null;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Opens a design-system menu at the pointer and returns a function that removes it, or
|
|
61
|
+
* `undefined` when the design system has not registered the menu components.
|
|
62
|
+
*
|
|
63
|
+
* A pointer press outside, a scroll outside, a window resize, Escape or Tab closes it. Choosing an item runs its
|
|
64
|
+
* action and closes it; an item with a submenu opens the submenu instead.
|
|
65
|
+
*
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
export declare function openGridContextMenu(options: GridContextMenuOptions): (() => void) | undefined;
|
|
69
|
+
//# sourceMappingURL=context-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../../src/context-menu/context-menu.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AA6J9D;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0FAA0F;IAC1F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0FAA0F;IAC1F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,uBAAuB,EAAE,CAAC;CACrC;AAED;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,sBAAsB,GAAG,WAAW,CAAC;AAE3E;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,KAAK,EAAE,oBAAoB,KAAK,uBAAuB,EAAE,CAAC;AAEjG;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,oBAAoB,GAAG,sBAAsB,EAAE,CAUjG;AAmBD;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,+FAA+F;IAC/F,MAAM,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,SAAS,uBAAuB,EAAE,CAAC;IAC1C;;;OAGG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,yFAAyF;IACzF,WAAW,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,sBAAsB,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CA4E7F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/context-menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,GAC7B,MAAM,gBAAgB,CAAC"}
|
package/dist/dts/grid-pro.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ViewTemplate } from '@microsoft/fast-element';
|
|
2
2
|
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
3
|
-
import type { ColDef, ColumnState, GridApi, GridOptions, GridParams, IStatusPanelComp } from 'ag-grid-community';
|
|
3
|
+
import type { CellContextMenuEvent, ColDef, ColumnState, GridApi, GridOptions, GridParams, IStatusPanelComp } from 'ag-grid-community';
|
|
4
4
|
import { type GridProColumnDragBridge } from './column-selection/grid-pro-column-drag-bridge';
|
|
5
|
+
import { type GridProContextMenuItems } from './context-menu/context-menu';
|
|
5
6
|
import { GridProBaseDatasource } from './datasource/base.datasource';
|
|
6
7
|
import type { GridComponents, GridProCaseType, GridProErrorEvent, GridProErrorItem, GridProEventsAndCallbacks } from './grid-pro.types';
|
|
7
8
|
import { GridOptionsConfig, GridProStatusBarConfig, GridProStatusBarLabelConfig } from './grid-pro.types';
|
|
@@ -503,6 +504,23 @@ export declare class GridPro extends GridPro_base {
|
|
|
503
504
|
* @internal
|
|
504
505
|
*/
|
|
505
506
|
get statusBar(): GridProStatusBar | undefined;
|
|
507
|
+
/**
|
|
508
|
+
* Opts the grid into its own right-click menu, built from these items for each cell. It needs no
|
|
509
|
+
* AG Grid Enterprise module, and replaces AG Grid's context menu while set. Assign
|
|
510
|
+
* {@link defaultGridContextMenuItems} for a CSV Export menu, or return an empty list to show the
|
|
511
|
+
* browser's menu for that cell.
|
|
512
|
+
*
|
|
513
|
+
* Unset, right-click is left alone: AG Grid's menu when its `ContextMenu` module is registered,
|
|
514
|
+
* otherwise the browser's.
|
|
515
|
+
*
|
|
516
|
+
* @public
|
|
517
|
+
*/
|
|
518
|
+
contextMenuItems?: GridProContextMenuItems;
|
|
519
|
+
contextMenuItemsChanged(): void;
|
|
520
|
+
/** Removes the open right-click menu, if there is one. */
|
|
521
|
+
private closeContextMenu?;
|
|
522
|
+
/** Whether the AG grid instance was created with its own context menu suppressed. */
|
|
523
|
+
private gridCreatedWithMenuSuppressed;
|
|
506
524
|
/**
|
|
507
525
|
* Shows a Columns side panel on the trailing edge of the grid.
|
|
508
526
|
* @public
|
|
@@ -536,6 +554,11 @@ export declare class GridPro extends GridPro_base {
|
|
|
536
554
|
private luminanceSubscription?;
|
|
537
555
|
private visibilityObserverCleanup?;
|
|
538
556
|
private readonly boundGlobalEventListener;
|
|
557
|
+
/**
|
|
558
|
+
* `globalListener` runs on a timeout, which is too late to cancel the browser menu.
|
|
559
|
+
* This one runs inside the right-click event.
|
|
560
|
+
*/
|
|
561
|
+
private readonly boundContextMenuListener;
|
|
539
562
|
private _filterConfig;
|
|
540
563
|
getfilterModel(): Promise<{
|
|
541
564
|
[key: string]: any;
|
|
@@ -878,7 +901,7 @@ export declare class GridPro extends GridPro_base {
|
|
|
878
901
|
onCellValueChanged?: ((event: import("@ag-grid-community/core").NewValueParams<any>) => void) | ((event: import("ag-grid-community").NewValueParams<any, any, any>) => void);
|
|
879
902
|
onCellClicked?: ((event: import("@ag-grid-community/core").CellClickedEvent<any, any>) => void) | ((event: import("ag-grid-community").CellClickedEvent<any, any, any>) => void);
|
|
880
903
|
onCellDoubleClicked?: ((event: import("@ag-grid-community/core").CellDoubleClickedEvent<any, any>) => void) | ((event: import("ag-grid-community").CellDoubleClickedEvent<any, any, any>) => void);
|
|
881
|
-
onCellContextMenu?: ((event: import("@ag-grid-community/core").CellContextMenuEvent<any, any>) => void) | ((event:
|
|
904
|
+
onCellContextMenu?: ((event: import("@ag-grid-community/core").CellContextMenuEvent<any, any>) => void) | ((event: CellContextMenuEvent<any, any, any>) => void);
|
|
882
905
|
getQuickFilterText?: ((params: import("@ag-grid-community/core").GetQuickFilterTextParams<any, any>) => string) | import("ag-grid-community").GetQuickFilterText<any, any, any>;
|
|
883
906
|
filterValueGetter?: string | import("@ag-grid-community/core").ValueGetterFunc<any> | import("ag-grid-community").ValueGetterFunc<any, any, any>;
|
|
884
907
|
floatingFilter?: boolean;
|
|
@@ -1019,6 +1042,20 @@ export declare class GridPro extends GridPro_base {
|
|
|
1019
1042
|
protected setupStatusBar(gridOptions: GridOptions): void;
|
|
1020
1043
|
get observedAttributes(): string[];
|
|
1021
1044
|
agAttributeChangedCallback(attName: any, oldValue: any, newValue: any): void;
|
|
1045
|
+
/**
|
|
1046
|
+
* AG Grid draws its own menu when `ContextMenu` is registered, so it is suppressed while
|
|
1047
|
+
* `contextMenuItems` is set and the app's own `suppressContextMenu` restored when it is cleared.
|
|
1048
|
+
* The suppression goes to AG Grid only, never into `agGridOptions`: that object is what the
|
|
1049
|
+
* `gridOptions` getter returns, and an app re-applying it would otherwise adopt the setting.
|
|
1050
|
+
* @internal
|
|
1051
|
+
*/
|
|
1052
|
+
private syncContextMenuSuppression;
|
|
1053
|
+
/**
|
|
1054
|
+
* Opens the grid's right-click menu for a cell. Called from the synchronous grid listener so
|
|
1055
|
+
* `preventDefault` still cancels the browser menu.
|
|
1056
|
+
* @internal
|
|
1057
|
+
*/
|
|
1058
|
+
private showContextMenu;
|
|
1022
1059
|
globalEventListener(eventType: any, event: any): void;
|
|
1023
1060
|
}
|
|
1024
1061
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid-pro.d.ts","sourceRoot":"","sources":["../../src/grid-pro.ts"],"names":[],"mappings":"AAMA,OAAO,EAA8B,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,EAAE,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dist/dts/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
|
|
@@ -18,8 +18,10 @@ export class ActionsMenuRenderer extends FoundationElement {
|
|
|
18
18
|
getGui() {
|
|
19
19
|
return this;
|
|
20
20
|
}
|
|
21
|
+
/** Hands the latest row data to the menu, so per-row actions and disabled states stay current. */
|
|
21
22
|
refresh(params) {
|
|
22
|
-
|
|
23
|
+
this.params = params;
|
|
24
|
+
return true;
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
27
|
__decorate([
|
|
@@ -44,7 +46,8 @@ export const foundationGridProActionsMenuRenderer = ActionsMenuRenderer.compose(
|
|
|
44
46
|
/**
|
|
45
47
|
* Helper function to get ColDef {@link https://www.ag-grid.com/javascript-data-grid/column-properties/} for Actions Menu Renderer.
|
|
46
48
|
* Will take the parameter values for a base ColDef and merge them with the overrideDef (if specified).
|
|
47
|
-
* @param actions - Array of `ActionMenuItem` to be displayed in the menu
|
|
49
|
+
* @param actions - Array of `ActionMenuItem` to be displayed in the menu, or a function of the row data
|
|
50
|
+
* returning that array (for row-scoped eligibility/permission filtering).
|
|
48
51
|
* @param overrideDef - Optional override for the ColDef. Will override any of the default values. Default is an empty object.
|
|
49
52
|
* @param customActionsOpenerName - Optional custom name for the button that opens the menu. Default is '⋮'.
|
|
50
53
|
* @param isVertical - Optional flag to display the menu vertically. Default is false (displays the menu horizontally, follow the rowHeight).
|
|
@@ -95,3 +98,59 @@ export const getActionsMenuDef = (actions, overrideDef = {}, customActionsOpener
|
|
|
95
98
|
};
|
|
96
99
|
return Object.assign(Object.assign({}, actionsMenuDef), overrideDef);
|
|
97
100
|
};
|
|
101
|
+
/**
|
|
102
|
+
* Helper function to get ColDef {@link https://www.ag-grid.com/javascript-data-grid/column-properties/} for a
|
|
103
|
+
* vertical Actions Menu behind an icon-only "kebab" opener, for a pinned column of per-row actions.
|
|
104
|
+
* Will take the parameter values for a base ColDef and merge them with the overrideDef (if specified).
|
|
105
|
+
* @remarks The opener hides itself on rows with no actions, so it never opens an empty menu. The
|
|
106
|
+
* column has a `colId` but no `field`: AG Grid only refreshes a cell with a field when its value
|
|
107
|
+
* changes, and this column has no value, so a row update would leave stale actions. Having no value,
|
|
108
|
+
* the column is also not sortable, filterable, resizable or flashed, and shows no header menu
|
|
109
|
+
* button — pass any of these in `overrideDef` to turn them back on.
|
|
110
|
+
* @param actions - Array of `ActionMenuItem` to be displayed in the menu, or a function of the row data
|
|
111
|
+
* returning that array (for row-scoped eligibility/permission filtering).
|
|
112
|
+
* @param overrideDef - Optional override for the ColDef. Will override any of the default values. Default is an empty object.
|
|
113
|
+
* @param iconName - Optional icon name for the opener. Default is `'ellipsis'` (horizontal dots); pass `'ellipsis-vertical'` for vertical ones.
|
|
114
|
+
* @param buttonAppearance - Optional appearance for the button that opens the menu.
|
|
115
|
+
* @param hideDisabled - Optional flag to hide disabled actions instead of greying them out. Default is false.
|
|
116
|
+
* When every action for a row is hidden, the opener hides too.
|
|
117
|
+
* @returns Merged ColDef (base ColDef created from the parameters + overrideDef) for Actions Menu Renderer.
|
|
118
|
+
* @example
|
|
119
|
+
* ```ts
|
|
120
|
+
* public exampleMoreColumnDef: ColDef = getVerticalDropdownMenuDef(
|
|
121
|
+
* (rowData) => [
|
|
122
|
+
* { name: 'Ping Trader', icon: { name: 'paper-plane' }, callback: (rowData) => pingTrader(rowData) },
|
|
123
|
+
* { name: 'Assign', icon: { name: 'user' }, callback: (rowData) => assign(rowData) },
|
|
124
|
+
* ],
|
|
125
|
+
* { headerName: '', pinned: 'right' },
|
|
126
|
+
* );
|
|
127
|
+
* ```
|
|
128
|
+
* @public
|
|
129
|
+
*/
|
|
130
|
+
export const getVerticalDropdownMenuDef = (actions, overrideDef = {}, iconName = 'ellipsis', buttonAppearance, hideDisabled = false) => {
|
|
131
|
+
// `suppressHeaderMenuButton` is AG Grid v31+; the v29 `ColDef` used across grid-pro's public helpers lacks it.
|
|
132
|
+
const verticalDropdownMenuDef = {
|
|
133
|
+
cellRenderer: GridProRendererTypes.actionsMenu,
|
|
134
|
+
cellRendererParams: {
|
|
135
|
+
actions,
|
|
136
|
+
addDefaultActions: false,
|
|
137
|
+
buttonAppearance,
|
|
138
|
+
hideDisabled,
|
|
139
|
+
iconName,
|
|
140
|
+
isVertical: true,
|
|
141
|
+
},
|
|
142
|
+
cellStyle: { border: 'none', overflow: 'visible' },
|
|
143
|
+
colId: overrideDef.headerName
|
|
144
|
+
? convertToKebabCase(overrideDef.headerName)
|
|
145
|
+
: 'vertical-dropdown-menu',
|
|
146
|
+
// A column with no value can't be usefully sorted, filtered or flashed; and with no field it is
|
|
147
|
+
// force-refreshed on every row update, so cell flashing would flash it on every tick.
|
|
148
|
+
enableCellChangeFlash: false,
|
|
149
|
+
filter: false,
|
|
150
|
+
resizable: false,
|
|
151
|
+
sortable: false,
|
|
152
|
+
suppressHeaderMenuButton: true,
|
|
153
|
+
width: 40,
|
|
154
|
+
};
|
|
155
|
+
return Object.assign(Object.assign({}, verticalDropdownMenuDef), overrideDef);
|
|
156
|
+
};
|