@@ -43,23 +43,7 @@ import {
4343 isDeletableGridModel ,
4444 isExpandableColumnGridModel ,
4545} from '@deephaven/grid' ;
46- import {
47- dhEye ,
48- dhFilterFilled ,
49- dhGraphLineUp ,
50- dhTriangleDownSquare ,
51- vsClose ,
52- vsCloudDownload ,
53- vsEdit ,
54- vsFilter ,
55- vsMenu ,
56- vsReply ,
57- vsRuby ,
58- vsSearch ,
59- vsSplitHorizontal ,
60- vsSymbolOperator ,
61- vsTools ,
62- } from '@deephaven/icons' ;
46+ import { dhFilterFilled , vsClose , vsFilter , vsMenu } from '@deephaven/icons' ;
6347import type { dh as DhType } from '@deephaven/jsapi-types' ;
6448import {
6549 DateUtils ,
@@ -151,9 +135,7 @@ import {
151135} from './PartitionedGridModel' ;
152136import IrisGridPartitionSelector from './IrisGridPartitionSelector' ;
153137import AdvancedSettingsType from './sidebar/AdvancedSettingsType' ;
154- import {
155- type AdvancedSettingsMenuCallback ,
156- } from './sidebar/AdvancedSettingsMenu' ;
138+ import { type AdvancedSettingsMenuCallback } from './sidebar/AdvancedSettingsMenu' ;
157139import SHORTCUTS from './IrisGridShortcuts' ;
158140import IrisGridCellOverflowModal from './IrisGridCellOverflowModal' ;
159141import GotoRow , { type GotoRowElement } from './GotoRow' ;
@@ -173,7 +155,6 @@ import {
173155 type IrisGridStateOverride ,
174156 type OperationMap ,
175157 type OptionItem ,
176- type OptionItemsModifier ,
177158 type PendingDataErrorMap ,
178159 type PendingDataMap ,
179160 type QuickFilterMap ,
@@ -185,10 +166,6 @@ import {
185166import type ColumnHeaderGroup from './ColumnHeaderGroup' ;
186167import { IrisGridThemeContext } from './IrisGridThemeProvider' ;
187168import { TableOptionsWrapper } from './table-options/TableOptionsWrapper' ;
188- import {
189- TableOptionsHostContext ,
190- type TableOptionsHostContextValue ,
191- } from './table-options/TableOptionsHostContext' ;
192169import type {
193170 GridStateSnapshot ,
194171 GridDispatch ,
@@ -367,16 +344,6 @@ export interface IrisGridProps {
367344
368345 columnHeaderGroups ?: readonly ColumnHeaderGroup [ ] ;
369346
370- /** Additional menu options to append to the Table Options menu */
371- additionalMenuOptions ?: readonly OptionItem [ ] ;
372-
373- /**
374- * Optional function to modify the Table Options menu items.
375- * Receives all options (built-in + additional) and returns a modified list.
376- * Use this to reorder, hide, or modify existing options.
377- */
378- optionsModifier ?: OptionItemsModifier ;
379-
380347 // Optional key and mouse handlers
381348 keyHandlers : readonly KeyHandler [ ] ;
382349 mouseHandlers : MouseHandlersProp ;
@@ -566,7 +533,6 @@ class IrisGrid extends Component<IrisGridProps, IrisGridState> {
566533 // Do not set a default density prop since we need to know if it overrides the global density setting
567534 density : undefined ,
568535 canToggleSearch : true ,
569- additionalMenuOptions : EMPTY_ARRAY ,
570536 mouseHandlers : EMPTY_ARRAY ,
571537 keyHandlers : EMPTY_ARRAY ,
572538 getMetricCalculator : (
@@ -1150,122 +1116,6 @@ class IrisGrid extends Component<IrisGridProps, IrisGridState> {
11501116 { max : 50 }
11511117 ) ;
11521118
1153- getCachedOptionItems = memoize (
1154- (
1155- isChartBuilderAvailable : boolean ,
1156- isCustomColumnsAvailable : boolean ,
1157- isFormatColumnsAvailable : boolean ,
1158- isOrganizeColumnsAvailable : boolean ,
1159- isRollupAvailable : boolean ,
1160- isTotalsAvailable : boolean ,
1161- isSelectDistinctAvailable : boolean ,
1162- isExportAvailable : boolean ,
1163- toggleFilterBarAction : Action ,
1164- toggleSearchBarAction : Action ,
1165- toggleGotoRowAction : Action ,
1166- isFilterBarShown : boolean ,
1167- showSearchBar : boolean ,
1168- canDownloadCsv : boolean ,
1169- canToggleSearch : boolean ,
1170- showGotoRow : boolean ,
1171- hasAdvancedSettings : boolean
1172- ) : readonly OptionItem [ ] => {
1173- const optionItems : OptionItem [ ] = [ ] ;
1174- if ( isChartBuilderAvailable ) {
1175- optionItems . push ( {
1176- type : OptionType . CHART_BUILDER ,
1177- title : 'Chart Builder' ,
1178- icon : dhGraphLineUp ,
1179- } ) ;
1180- }
1181- if ( isOrganizeColumnsAvailable ) {
1182- optionItems . push ( {
1183- type : OptionType . VISIBILITY_ORDERING_BUILDER ,
1184- title : 'Organize Columns' ,
1185- icon : dhEye ,
1186- } ) ;
1187- }
1188- if ( isFormatColumnsAvailable ) {
1189- optionItems . push ( {
1190- type : OptionType . CONDITIONAL_FORMATTING ,
1191- title : 'Conditional Formatting' ,
1192- icon : vsEdit ,
1193- } ) ;
1194- }
1195- if ( isCustomColumnsAvailable ) {
1196- optionItems . push ( {
1197- type : OptionType . CUSTOM_COLUMN_BUILDER ,
1198- title : 'Custom Columns' ,
1199- icon : vsSplitHorizontal ,
1200- } ) ;
1201- }
1202- if ( isRollupAvailable ) {
1203- optionItems . push ( {
1204- type : OptionType . ROLLUP_ROWS ,
1205- title : 'Rollup Rows' ,
1206- icon : dhTriangleDownSquare ,
1207- } ) ;
1208- }
1209- if ( isTotalsAvailable ) {
1210- optionItems . push ( {
1211- type : OptionType . AGGREGATIONS ,
1212- title : 'Aggregate Columns' ,
1213- icon : vsSymbolOperator ,
1214- } ) ;
1215- }
1216- if ( isSelectDistinctAvailable ) {
1217- optionItems . push ( {
1218- type : OptionType . SELECT_DISTINCT ,
1219- title : 'Select Distinct Values' ,
1220- icon : vsRuby ,
1221- } ) ;
1222- }
1223- if ( isExportAvailable && canDownloadCsv ) {
1224- optionItems . push ( {
1225- type : OptionType . TABLE_EXPORTER ,
1226- title : 'Download CSV' ,
1227- icon : vsCloudDownload ,
1228- } ) ;
1229- }
1230- if ( hasAdvancedSettings ) {
1231- optionItems . push ( {
1232- type : OptionType . ADVANCED_SETTINGS ,
1233- title : 'Advanced Settings' ,
1234- icon : vsTools ,
1235- } ) ;
1236- }
1237- optionItems . push ( {
1238- type : OptionType . QUICK_FILTERS ,
1239- title : 'Quick Filters' ,
1240- subtitle : toggleFilterBarAction . shortcut . getDisplayText ( ) ,
1241- icon : vsFilter ,
1242- isOn : isFilterBarShown ,
1243- onChange : toggleFilterBarAction . action ,
1244- } ) ;
1245- if ( canToggleSearch ) {
1246- optionItems . push ( {
1247- type : OptionType . SEARCH_BAR ,
1248- title : 'Search Bar' ,
1249- subtitle : toggleSearchBarAction . shortcut . getDisplayText ( ) ,
1250- icon : vsSearch ,
1251- isOn : showSearchBar ,
1252- onChange : toggleSearchBarAction . action ,
1253- } ) ;
1254- }
1255- optionItems . push ( {
1256- type : OptionType . GOTO ,
1257- title : 'Go to' ,
1258- subtitle : toggleGotoRowAction . shortcut . getDisplayText ( ) ,
1259- icon : vsReply ,
1260- isOn : showGotoRow ,
1261- onChange : toggleGotoRowAction . action ,
1262- } ) ;
1263-
1264- return Object . freeze ( optionItems ) ;
1265- } ,
1266- { max : 1 }
1267- ) ;
1268-
12691119 /**
12701120 * Creates the GridStateSnapshot for TableOptionsHostContext.
12711121 */
@@ -5077,63 +4927,11 @@ class IrisGrid extends Component<IrisGridProps, IrisGridState> {
50774927 }
50784928 }
50794929
5080- const baseOptionItems = this . getCachedOptionItems (
5081- onCreateChart !== undefined && model . isChartBuilderAvailable ,
5082- model . isCustomColumnsAvailable ,
5083- model . isFormatColumnsAvailable ,
5084- model . isOrganizeColumnsAvailable ,
5085- model . isRollupAvailable ,
5086- model . isTotalsAvailable || isRollup ,
5087- model . isSelectDistinctAvailable ,
5088- model . isExportAvailable ,
5089- this . toggleFilterBarAction ,
5090- this . toggleSearchBarAction ,
5091- this . toggleGotoRowAction ,
5092- isFilterBarShown ,
5093- showSearchBar ,
5094- canDownloadCsv ,
5095- this . isTableSearchAvailable ( ) ,
5096- isGotoShown ,
5097- advancedSettings . size > 0
5098- ) ;
5099-
5100- const { additionalMenuOptions, optionsModifier } = this . props ;
5101- const mergedOptions =
5102- additionalMenuOptions != null && additionalMenuOptions . length > 0
5103- ? [ ...baseOptionItems , ...additionalMenuOptions ]
5104- : baseOptionItems ;
5105-
5106- // Apply the options modifier if provided
5107- const optionItems =
5108- optionsModifier != null ? optionsModifier ( mergedOptions ) : mergedOptions ;
5109-
51104930 const hiddenColumns = this . getCachedHiddenColumns (
51114931 metricCalculator ,
51124932 userColumnWidths
51134933 ) ;
51144934
5115- // Create the grid state snapshot and context value for Table Options panels
5116- const gridState = this . getGridStateSnapshot (
5117- model ,
5118- customColumns ,
5119- selectDistinctColumns ,
5120- aggregationSettings ,
5121- rollupConfig ,
5122- conditionalFormats ,
5123- movedColumns ,
5124- frozenColumns ,
5125- columnHeaderGroups ,
5126- hiddenColumns ,
5127- isRollup ,
5128- name ,
5129- userColumnWidths ,
5130- selectedRanges ,
5131- isTableDownloading ,
5132- tableDownloadStatus ,
5133- tableDownloadProgress ,
5134- tableDownloadEstimatedTime
5135- ) ;
5136-
51374935 return (
51384936 < div className = "iris-grid" role = "presentation" >
51394937 < div className = "iris-grid-column" >
0 commit comments