@deephaven/iris-grid 0.38.1-beta.0 → 0.38.1-beta.11
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/README.md +4 -2
- package/dist/AdvancedFilterCreator.d.ts +4 -2
- package/dist/AdvancedFilterCreator.d.ts.map +1 -1
- package/dist/AdvancedFilterCreator.js +9 -4
- package/dist/AdvancedFilterCreator.js.map +1 -1
- package/dist/AdvancedFilterCreatorFilterItem.d.ts +4 -3
- package/dist/AdvancedFilterCreatorFilterItem.d.ts.map +1 -1
- package/dist/AdvancedFilterCreatorFilterItem.js +5 -4
- package/dist/AdvancedFilterCreatorFilterItem.js.map +1 -1
- package/dist/AdvancedFilterCreatorSelectValue.d.ts +4 -2
- package/dist/AdvancedFilterCreatorSelectValue.d.ts.map +1 -1
- package/dist/AdvancedFilterCreatorSelectValue.js +11 -3
- package/dist/AdvancedFilterCreatorSelectValue.js.map +1 -1
- package/dist/AdvancedFilterCreatorSelectValueList.d.ts +3 -1
- package/dist/AdvancedFilterCreatorSelectValueList.d.ts.map +1 -1
- package/dist/AdvancedFilterCreatorSelectValueList.js +7 -5
- package/dist/AdvancedFilterCreatorSelectValueList.js.map +1 -1
- package/dist/ColumnStatistics.css +1 -2
- package/dist/ColumnStatistics.css.map +1 -1
- package/dist/ColumnStatistics.d.ts +1 -1
- package/dist/ColumnStatistics.d.ts.map +1 -1
- package/dist/ColumnStatistics.js.map +1 -1
- package/dist/CommonTypes.d.ts +1 -1
- package/dist/CommonTypes.d.ts.map +1 -1
- package/dist/CommonTypes.js.map +1 -1
- package/dist/CrossColumnSearch.d.ts +2 -2
- package/dist/CrossColumnSearch.d.ts.map +1 -1
- package/dist/CrossColumnSearch.js +1 -2
- package/dist/CrossColumnSearch.js.map +1 -1
- package/dist/GotoRow.d.ts +3 -1
- package/dist/GotoRow.d.ts.map +1 -1
- package/dist/GotoRow.js +1 -0
- package/dist/GotoRow.js.map +1 -1
- package/dist/IrisGrid.css +3 -0
- package/dist/IrisGrid.css.map +1 -1
- package/dist/IrisGrid.d.ts +8 -6
- package/dist/IrisGrid.d.ts.map +1 -1
- package/dist/IrisGrid.js +74 -37
- package/dist/IrisGrid.js.map +1 -1
- package/dist/IrisGridCellRendererUtils.d.ts +7 -0
- package/dist/IrisGridCellRendererUtils.d.ts.map +1 -0
- package/dist/IrisGridCellRendererUtils.js +20 -0
- package/dist/IrisGridCellRendererUtils.js.map +1 -0
- package/dist/IrisGridCopyHandler.js.map +1 -1
- package/dist/IrisGridDataBarCellRenderer.d.ts +7 -0
- package/dist/IrisGridDataBarCellRenderer.d.ts.map +1 -0
- package/dist/IrisGridDataBarCellRenderer.js +10 -0
- package/dist/IrisGridDataBarCellRenderer.js.map +1 -0
- package/dist/IrisGridIcons.d.ts +4 -0
- package/dist/IrisGridIcons.d.ts.map +1 -0
- package/dist/IrisGridIcons.js +25 -0
- package/dist/IrisGridIcons.js.map +1 -0
- package/dist/IrisGridMetricCalculator.d.ts +1 -1
- package/dist/IrisGridMetricCalculator.d.ts.map +1 -1
- package/dist/IrisGridMetricCalculator.js.map +1 -1
- package/dist/IrisGridModel.d.ts +1 -1
- package/dist/IrisGridModel.d.ts.map +1 -1
- package/dist/IrisGridModel.js.map +1 -1
- package/dist/IrisGridModelFactory.d.ts +2 -2
- package/dist/IrisGridModelFactory.d.ts.map +1 -1
- package/dist/IrisGridModelFactory.js +3 -3
- package/dist/IrisGridModelFactory.js.map +1 -1
- package/dist/IrisGridModelUpdater.d.ts +3 -2
- package/dist/IrisGridModelUpdater.d.ts.map +1 -1
- package/dist/IrisGridModelUpdater.js +2 -2
- package/dist/IrisGridModelUpdater.js.map +1 -1
- package/dist/IrisGridPartitionSelector.d.ts +2 -1
- package/dist/IrisGridPartitionSelector.d.ts.map +1 -1
- package/dist/IrisGridPartitionSelector.js +2 -0
- package/dist/IrisGridPartitionSelector.js.map +1 -1
- package/dist/IrisGridProxyModel.d.ts +3 -2
- package/dist/IrisGridProxyModel.d.ts.map +1 -1
- package/dist/IrisGridProxyModel.js +11 -9
- package/dist/IrisGridProxyModel.js.map +1 -1
- package/dist/IrisGridRenderer.d.ts +19 -27
- package/dist/IrisGridRenderer.d.ts.map +1 -1
- package/dist/IrisGridRenderer.js +64 -205
- package/dist/IrisGridRenderer.js.map +1 -1
- package/dist/IrisGridTableModel.d.ts +2 -2
- package/dist/IrisGridTableModel.d.ts.map +1 -1
- package/dist/IrisGridTableModel.js +6 -6
- package/dist/IrisGridTableModel.js.map +1 -1
- package/dist/IrisGridTableModelTemplate.d.ts +8 -3
- package/dist/IrisGridTableModelTemplate.d.ts.map +1 -1
- package/dist/IrisGridTableModelTemplate.js +42 -15
- package/dist/IrisGridTableModelTemplate.js.map +1 -1
- package/dist/IrisGridTestUtils.d.ts +14 -13
- package/dist/IrisGridTestUtils.d.ts.map +1 -1
- package/dist/IrisGridTestUtils.js +33 -27
- package/dist/IrisGridTestUtils.js.map +1 -1
- package/dist/IrisGridTextCellRenderer.d.ts +20 -0
- package/dist/IrisGridTextCellRenderer.d.ts.map +1 -0
- package/dist/IrisGridTextCellRenderer.js +139 -0
- package/dist/IrisGridTextCellRenderer.js.map +1 -0
- package/dist/IrisGridTheme.d.ts.map +1 -1
- package/dist/IrisGridTheme.js +4 -1
- package/dist/IrisGridTheme.js.map +1 -1
- package/dist/IrisGridTheme.module.css +3 -0
- package/dist/IrisGridTheme.module.css.map +1 -1
- package/dist/IrisGridTreeTableModel.d.ts +1 -1
- package/dist/IrisGridTreeTableModel.d.ts.map +1 -1
- package/dist/IrisGridTreeTableModel.js.map +1 -1
- package/dist/IrisGridUtils.d.ts +88 -85
- package/dist/IrisGridUtils.d.ts.map +1 -1
- package/dist/IrisGridUtils.js +567 -556
- package/dist/IrisGridUtils.js.map +1 -1
- package/dist/PartitionSelectorSearch.d.ts +2 -1
- package/dist/PartitionSelectorSearch.d.ts.map +1 -1
- package/dist/PartitionSelectorSearch.js +3 -1
- package/dist/PartitionSelectorSearch.js.map +1 -1
- package/dist/TableViewportUpdater.d.ts +1 -1
- package/dist/TableViewportUpdater.d.ts.map +1 -1
- package/dist/TableViewportUpdater.js.map +1 -1
- package/dist/TreeTableViewportUpdater.d.ts +2 -1
- package/dist/TreeTableViewportUpdater.d.ts.map +1 -1
- package/dist/TreeTableViewportUpdater.js +1 -1
- package/dist/TreeTableViewportUpdater.js.map +1 -1
- package/dist/format-context-menus/DecimalFormatContextMenu.d.ts +3 -1
- package/dist/format-context-menus/DecimalFormatContextMenu.d.ts.map +1 -1
- package/dist/format-context-menus/DecimalFormatContextMenu.js +3 -2
- package/dist/format-context-menus/DecimalFormatContextMenu.js.map +1 -1
- package/dist/format-context-menus/IntegerFormatContextMenu.d.ts +3 -1
- package/dist/format-context-menus/IntegerFormatContextMenu.d.ts.map +1 -1
- package/dist/format-context-menus/IntegerFormatContextMenu.js +3 -2
- package/dist/format-context-menus/IntegerFormatContextMenu.js.map +1 -1
- package/dist/mousehandlers/IrisGridColumnSelectMouseHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridContextMenuHandler.d.ts +10 -9
- package/dist/mousehandlers/IrisGridContextMenuHandler.d.ts.map +1 -1
- package/dist/mousehandlers/IrisGridContextMenuHandler.js +49 -32
- package/dist/mousehandlers/IrisGridContextMenuHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridTokenMouseHandler.d.ts.map +1 -1
- package/dist/mousehandlers/IrisGridTokenMouseHandler.js +18 -3
- package/dist/mousehandlers/IrisGridTokenMouseHandler.js.map +1 -1
- package/dist/sidebar/ChartBuilder.d.ts +12 -11
- package/dist/sidebar/ChartBuilder.d.ts.map +1 -1
- package/dist/sidebar/ChartBuilder.js +98 -81
- package/dist/sidebar/ChartBuilder.js.map +1 -1
- package/dist/sidebar/RollupRows.d.ts +1 -1
- package/dist/sidebar/RollupRows.d.ts.map +1 -1
- package/dist/sidebar/RollupRows.js.map +1 -1
- package/dist/sidebar/SelectDistinctBuilder.d.ts +1 -1
- package/dist/sidebar/SelectDistinctBuilder.d.ts.map +1 -1
- package/dist/sidebar/SelectDistinctBuilder.js.map +1 -1
- package/dist/sidebar/TableCsvExporter.d.ts +3 -2
- package/dist/sidebar/TableCsvExporter.d.ts.map +1 -1
- package/dist/sidebar/TableCsvExporter.js +3 -3
- package/dist/sidebar/TableCsvExporter.js.map +1 -1
- package/dist/sidebar/TableSaver.d.ts +2 -1
- package/dist/sidebar/TableSaver.d.ts.map +1 -1
- package/dist/sidebar/TableSaver.js +4 -1
- package/dist/sidebar/TableSaver.js.map +1 -1
- package/dist/sidebar/aggregations/AggregationEdit.d.ts +1 -1
- package/dist/sidebar/aggregations/AggregationEdit.d.ts.map +1 -1
- package/dist/sidebar/aggregations/AggregationEdit.js.map +1 -1
- package/dist/sidebar/aggregations/AggregationUtils.d.ts +1 -1
- package/dist/sidebar/aggregations/AggregationUtils.d.ts.map +1 -1
- package/dist/sidebar/aggregations/AggregationUtils.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ColumnFormatEditor.d.ts +2 -0
- package/dist/sidebar/conditional-formatting/ColumnFormatEditor.d.ts.map +1 -1
- package/dist/sidebar/conditional-formatting/ColumnFormatEditor.js +2 -0
- package/dist/sidebar/conditional-formatting/ColumnFormatEditor.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionEditor.d.ts +2 -0
- package/dist/sidebar/conditional-formatting/ConditionEditor.d.ts.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionEditor.js +3 -2
- package/dist/sidebar/conditional-formatting/ConditionEditor.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormatEditor.d.ts +2 -0
- package/dist/sidebar/conditional-formatting/ConditionalFormatEditor.d.ts.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormatEditor.js +3 -0
- package/dist/sidebar/conditional-formatting/ConditionalFormatEditor.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingAPIUtils.d.ts +2 -2
- package/dist/sidebar/conditional-formatting/ConditionalFormattingAPIUtils.d.ts.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingAPIUtils.js +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingAPIUtils.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.d.ts +3 -3
- package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.d.ts.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.js +3 -3
- package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.js.map +1 -1
- package/dist/sidebar/conditional-formatting/RowFormatEditor.d.ts +2 -0
- package/dist/sidebar/conditional-formatting/RowFormatEditor.d.ts.map +1 -1
- package/dist/sidebar/conditional-formatting/RowFormatEditor.js +2 -0
- package/dist/sidebar/conditional-formatting/RowFormatEditor.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilder.d.ts +1 -1
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilder.d.ts.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilder.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/utilities.d.ts +1 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/utilities.d.ts.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/utilities.js.map +1 -1
- package/package.json +16 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PartitionSelectorSearch.js","names":["React","Component","PropTypes","debounce","dh","ItemList","LoadingSpinner","Log","CanceledPromiseError","log","module","DEBOUNCE_UPDATE_FILTER","PartitionSelectorSearch","handleError","error","constructor","props","updateFilter","handleFilterChange","bind","handleInputFocus","handleKeyDown","handleListKeydown","handleSelect","handleTableUpdate","handleTextChange","handleViewportChange","itemList","searchInput","timer","state","offset","itemCount","items","text","isLoading","componentDidMount","startListening","componentDidUpdate","prevProps","prevState","onListResized","componentWillUnmount","debounceUpdateFilter","cancel","stopListening","event","key","selectedValue","length","value","trim","onSelect","stopPropagation","preventDefault","focusItem","focus","debug2","table","size","setState","itemIndex","offsetIndex","data","detail","getFormattedString","column","columns","r","rows","row","get","displayValue","type","name","push","target","topRow","bottomRow","delta","Math","max","top","bottom","setViewport","initialPageSize","addEventListener","Table","EVENT_UPDATED","EVENT_FILTERCHANGED","removeEventListener","filterText","filters","filter","invoke","FilterValue","ofString","applyFilter","render","listHeight","min","MAX_VISIBLE_ITEMS","DEFAULT_ROW_HEIGHT","height","undefined","func","isRequired","shape","arrayOf","string","number"],"sources":["../src/PartitionSelectorSearch.tsx"],"sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport debounce from 'lodash.debounce';\nimport dh, { Table } from '@deephaven/jsapi-shim';\nimport { ItemList, LoadingSpinner } from '@deephaven/components';\nimport Log from '@deephaven/log';\nimport { CanceledPromiseError } from '@deephaven/utils';\nimport './PartitionSelectorSearch.scss';\nimport { ModelIndex } from '@deephaven/grid';\n\nconst log = Log.module('PartitionSelectorSearch');\nconst DEBOUNCE_UPDATE_FILTER = 150;\n\ninterface Item {\n value: string;\n displayValue: string;\n}\n\ninterface PartitionSelectorSearchProps<T> {\n getFormattedString: (value: T, type: string, name: string) => string;\n table: Table;\n initialPageSize: number;\n onSelect: (value: string) => void;\n onListResized: () => void;\n}\ninterface PartitionSelectorSearchState {\n offset: number;\n itemCount: number;\n items: Item[];\n text: string;\n isLoading: boolean;\n}\nclass PartitionSelectorSearch<T> extends Component<\n PartitionSelectorSearchProps<T>,\n PartitionSelectorSearchState\n> {\n static MAX_VISIBLE_ITEMS = 12;\n\n static defaultProps = {\n initialPageSize: 100,\n onSelect: (): void => undefined,\n onListResized: (): void => undefined,\n };\n\n static propTypes = {\n getFormattedString: PropTypes.func.isRequired,\n table: PropTypes.shape({\n addEventListener: PropTypes.func.isRequired,\n removeEventListener: PropTypes.func.isRequired,\n columns: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string.isRequired,\n type: PropTypes.string.isRequired,\n filter: PropTypes.func.isRequired,\n })\n ),\n size: PropTypes.number.isRequired,\n applyFilter: PropTypes.func.isRequired,\n setViewport: PropTypes.func.isRequired,\n }).isRequired,\n initialPageSize: PropTypes.number,\n onSelect: PropTypes.func,\n onListResized: PropTypes.func,\n };\n\n static handleError(error: unknown): void {\n if (!(error instanceof CanceledPromiseError)) {\n log.error(error);\n }\n }\n\n constructor(props: PartitionSelectorSearchProps<T>) {\n super(props);\n\n this.handleFilterChange = this.handleFilterChange.bind(this);\n this.handleInputFocus = this.handleInputFocus.bind(this);\n this.handleKeyDown = this.handleKeyDown.bind(this);\n this.handleListKeydown = this.handleListKeydown.bind(this);\n this.handleSelect = this.handleSelect.bind(this);\n this.handleTableUpdate = this.handleTableUpdate.bind(this);\n this.handleTextChange = this.handleTextChange.bind(this);\n this.handleViewportChange = this.handleViewportChange.bind(this);\n\n this.itemList = null;\n this.searchInput = null;\n this.timer = null;\n\n this.state = {\n offset: 0,\n itemCount: 0,\n items: [],\n text: '',\n isLoading: true,\n };\n }\n\n componentDidMount(): void {\n this.startListening();\n }\n\n componentDidUpdate(\n prevProps: PartitionSelectorSearchProps<T>,\n prevState: PartitionSelectorSearchState\n ): void {\n const { isLoading, itemCount } = this.state;\n const { onListResized } = this.props;\n if (\n itemCount !== prevState.itemCount ||\n isLoading !== prevState.isLoading\n ) {\n onListResized();\n }\n }\n\n componentWillUnmount(): void {\n this.debounceUpdateFilter.cancel();\n\n this.stopListening();\n }\n\n itemList: ItemList<Item> | null;\n\n searchInput: HTMLInputElement | null;\n\n timer: null;\n\n handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>): boolean {\n if (this.itemList == null) {\n return false;\n }\n\n const { items, itemCount } = this.state;\n switch (event.key) {\n case 'Enter': {\n let selectedValue = null;\n if (items.length > 0) {\n selectedValue = items[0].value;\n } else {\n const { text } = this.state;\n selectedValue = text.trim();\n }\n\n if (selectedValue.length > 0) {\n const { onSelect } = this.props;\n onSelect(selectedValue);\n }\n\n event.stopPropagation();\n event.preventDefault();\n return true;\n }\n case 'ArrowDown':\n if (itemCount > 0) {\n this.itemList.focusItem(1);\n }\n event.stopPropagation();\n event.preventDefault();\n return true;\n default:\n return false;\n }\n }\n\n handleListKeydown(event: React.KeyboardEvent<HTMLDivElement>): void {\n switch (event.key) {\n case 'Escape':\n // Do nothing\n break;\n default:\n this.focus();\n break;\n }\n }\n\n handleFilterChange(): void {\n log.debug2('handleFilterChange');\n\n const { table } = this.props;\n const itemCount = table.size;\n this.setState({ itemCount, isLoading: true });\n }\n\n handleInputFocus(): void {\n if (this.itemList) {\n this.itemList.focusItem(0);\n }\n }\n\n handleSelect(itemIndex: ModelIndex): void {\n log.debug2('handleSelect', itemIndex);\n\n const { onSelect } = this.props;\n const { offset, items } = this.state;\n const offsetIndex = itemIndex - offset;\n if (offsetIndex < 0 || items.length <= offsetIndex) {\n log.error('No data for item', itemIndex);\n return;\n }\n\n const { value } = items[offsetIndex];\n onSelect(value);\n }\n\n handleTableUpdate(event: CustomEvent): void {\n const data = event.detail;\n const { offset } = data;\n\n const items = [] as Item[];\n const { getFormattedString, table } = this.props;\n const column = table.columns[0];\n for (let r = 0; r < data.rows.length; r += 1) {\n const row = data.rows[r];\n const value = row.get(column);\n const displayValue = getFormattedString(value, column.type, column.name);\n items.push({\n displayValue,\n value,\n });\n }\n\n const itemCount = table.size;\n log.debug2('handleTableUpdate', itemCount, offset, items.length);\n this.setState({ itemCount, items, offset, isLoading: false });\n }\n\n handleTextChange(event: React.ChangeEvent<HTMLInputElement>): void {\n log.debug2('handleTextChange');\n\n const { value: text } = event.target;\n\n this.setState({ text });\n\n this.debounceUpdateFilter();\n }\n\n handleViewportChange(topRow: number, bottomRow: number): void {\n log.debug2('handleViewportChange', topRow, bottomRow);\n\n const delta = Math.max(1, bottomRow - topRow);\n const top = Math.max(0, topRow - delta);\n const bottom = bottomRow + delta;\n\n const { table } = this.props;\n table.setViewport(top, bottom);\n }\n\n debounceUpdateFilter = debounce((): void => {\n this.updateFilter();\n }, DEBOUNCE_UPDATE_FILTER);\n\n focus(): void {\n if (this.searchInput) {\n this.searchInput.focus();\n }\n }\n\n startListening(): void {\n const { initialPageSize, table } = this.props;\n table.addEventListener(dh.Table.EVENT_UPDATED, this.handleTableUpdate);\n table.addEventListener(\n dh.Table.EVENT_FILTERCHANGED,\n this.handleFilterChange\n );\n table.setViewport(0, initialPageSize);\n }\n\n stopListening(): void {\n const { table } = this.props;\n table.removeEventListener(dh.Table.EVENT_UPDATED, this.handleTableUpdate);\n table.removeEventListener(\n dh.Table.EVENT_FILTERCHANGED,\n this.handleFilterChange\n );\n }\n\n updateFilter(): void {\n const { initialPageSize, table } = this.props;\n const { text } = this.state;\n const filterText = text.trim();\n const filters = [];\n if (filterText.length > 0) {\n const column = table.columns[0];\n const filter = column\n .filter()\n .invoke(\n 'matches',\n dh.FilterValue.ofString(`(?s)(?i).*\\\\Q${filterText}\\\\E.*`)\n );\n filters.push(filter);\n }\n\n log.debug2('updateFilter', filters);\n\n table.applyFilter(filters);\n table.setViewport(0, initialPageSize);\n }\n\n render(): JSX.Element {\n const { isLoading, itemCount, items, offset, text } = this.state;\n const listHeight =\n Math.min(itemCount, PartitionSelectorSearch.MAX_VISIBLE_ITEMS) *\n ItemList.DEFAULT_ROW_HEIGHT +\n // Adjust for ListItem vertical padding - .375rem ~ 5.25px\n 11;\n return (\n <div className=\"iris-grid-partition-selector-search\">\n <div className=\"search-container\">\n <input\n type=\"text\"\n ref={searchInput => {\n this.searchInput = searchInput;\n }}\n value={text}\n placeholder=\"Available Partitions\"\n onChange={this.handleTextChange}\n onFocus={this.handleInputFocus}\n onKeyDown={this.handleKeyDown}\n className=\"form-control input-partition\"\n />\n </div>\n {!isLoading && itemCount > 0 && (\n <div\n className=\"iris-grid-partition-selector-search-list\"\n onKeyDown={this.handleListKeydown}\n role=\"presentation\"\n style={{ height: listHeight }}\n >\n <ItemList\n ref={itemList => {\n this.itemList = itemList;\n }}\n itemCount={itemCount}\n items={items}\n offset={offset}\n onSelect={this.handleSelect}\n onViewportChange={this.handleViewportChange}\n />\n </div>\n )}\n {!isLoading && itemCount === 0 && (\n <div className=\"iris-grid-partition-selector-search-empty\">\n No results\n </div>\n )}\n {isLoading && (\n <div className=\"iris-grid-partition-selector-loading\">\n <LoadingSpinner />\n Loading...\n </div>\n )}\n </div>\n );\n }\n}\n\nexport default PartitionSelectorSearch;\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,QAAQ,MAAM,iBAAiB;AACtC,OAAOC,EAAE,MAAiB,uBAAuB;AACjD,SAASC,QAAQ,EAAEC,cAAc,QAAQ,uBAAuB;AAChE,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,oBAAoB,QAAQ,kBAAkB;AAAC;AAIxD,IAAMC,GAAG,GAAGF,GAAG,CAACG,MAAM,CAAC,yBAAyB,CAAC;AACjD,IAAMC,sBAAsB,GAAG,GAAG;AAqBlC,MAAMC,uBAAuB,SAAYX,SAAS,CAGhD;EA8BA,OAAOY,WAAW,CAACC,KAAc,EAAQ;IACvC,IAAI,EAAEA,KAAK,YAAYN,oBAAoB,CAAC,EAAE;MAC5CC,GAAG,CAACK,KAAK,CAACA,KAAK,CAAC;IAClB;EACF;EAEAC,WAAW,CAACC,KAAsC,EAAE;IAClD,KAAK,CAACA,KAAK,CAAC;IAAC;IAAA;IAAA;IAAA,8CA8KQb,QAAQ,CAAC,MAAY;MAC1C,IAAI,CAACc,YAAY,EAAE;IACrB,CAAC,EAAEN,sBAAsB,CAAC;IA9KxB,IAAI,CAACO,kBAAkB,GAAG,IAAI,CAACA,kBAAkB,CAACC,IAAI,CAAC,IAAI,CAAC;IAC5D,IAAI,CAACC,gBAAgB,GAAG,IAAI,CAACA,gBAAgB,CAACD,IAAI,CAAC,IAAI,CAAC;IACxD,IAAI,CAACE,aAAa,GAAG,IAAI,CAACA,aAAa,CAACF,IAAI,CAAC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9B,CAAC,CAAC,CAACA,UAAU;EACbrB,eAAe,EAAEnF,SAAS,CAAC4G,MAAM;EACjC1D,QAAQ,EAAElD,SAAS,CAACuG,IAAI;EACxBhE,aAAa,EAAEvC,SAAS,CAACuG;AAC3B,CAAC;AAoSH,eAAe7F,uBAAuB"}
|
|
1
|
+
{"version":3,"file":"PartitionSelectorSearch.js","names":["React","Component","PropTypes","debounce","ItemList","LoadingSpinner","Log","CanceledPromiseError","log","module","DEBOUNCE_UPDATE_FILTER","PartitionSelectorSearch","handleError","error","constructor","props","updateFilter","handleFilterChange","bind","handleInputFocus","handleKeyDown","handleListKeydown","handleSelect","handleTableUpdate","handleTextChange","handleViewportChange","itemList","searchInput","timer","state","offset","itemCount","items","text","isLoading","componentDidMount","startListening","componentDidUpdate","prevProps","prevState","onListResized","componentWillUnmount","debounceUpdateFilter","cancel","stopListening","event","key","selectedValue","length","value","trim","onSelect","stopPropagation","preventDefault","focusItem","focus","debug2","table","size","setState","itemIndex","offsetIndex","data","detail","getFormattedString","column","columns","r","rows","row","get","displayValue","type","name","push","target","topRow","bottomRow","delta","Math","max","top","bottom","setViewport","dh","initialPageSize","addEventListener","Table","EVENT_UPDATED","EVENT_FILTERCHANGED","removeEventListener","filterText","filters","filter","invoke","FilterValue","ofString","applyFilter","render","listHeight","min","MAX_VISIBLE_ITEMS","DEFAULT_ROW_HEIGHT","height","undefined","func","isRequired","shape","arrayOf","string","number"],"sources":["../src/PartitionSelectorSearch.tsx"],"sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport debounce from 'lodash.debounce';\nimport type { dh as DhType, Table } from '@deephaven/jsapi-types';\nimport { ItemList, LoadingSpinner } from '@deephaven/components';\nimport Log from '@deephaven/log';\nimport { CanceledPromiseError } from '@deephaven/utils';\nimport './PartitionSelectorSearch.scss';\nimport { ModelIndex } from '@deephaven/grid';\n\nconst log = Log.module('PartitionSelectorSearch');\nconst DEBOUNCE_UPDATE_FILTER = 150;\n\ninterface Item {\n value: string;\n displayValue: string;\n}\n\ninterface PartitionSelectorSearchProps<T> {\n dh: DhType;\n getFormattedString: (value: T, type: string, name: string) => string;\n table: Table;\n initialPageSize: number;\n onSelect: (value: string) => void;\n onListResized: () => void;\n}\ninterface PartitionSelectorSearchState {\n offset: number;\n itemCount: number;\n items: Item[];\n text: string;\n isLoading: boolean;\n}\nclass PartitionSelectorSearch<T> extends Component<\n PartitionSelectorSearchProps<T>,\n PartitionSelectorSearchState\n> {\n static MAX_VISIBLE_ITEMS = 12;\n\n static defaultProps = {\n initialPageSize: 100,\n onSelect: (): void => undefined,\n onListResized: (): void => undefined,\n };\n\n static propTypes = {\n getFormattedString: PropTypes.func.isRequired,\n table: PropTypes.shape({\n addEventListener: PropTypes.func.isRequired,\n removeEventListener: PropTypes.func.isRequired,\n columns: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string.isRequired,\n type: PropTypes.string.isRequired,\n filter: PropTypes.func.isRequired,\n })\n ),\n size: PropTypes.number.isRequired,\n applyFilter: PropTypes.func.isRequired,\n setViewport: PropTypes.func.isRequired,\n }).isRequired,\n initialPageSize: PropTypes.number,\n onSelect: PropTypes.func,\n onListResized: PropTypes.func,\n };\n\n static handleError(error: unknown): void {\n if (!(error instanceof CanceledPromiseError)) {\n log.error(error);\n }\n }\n\n constructor(props: PartitionSelectorSearchProps<T>) {\n super(props);\n\n this.handleFilterChange = this.handleFilterChange.bind(this);\n this.handleInputFocus = this.handleInputFocus.bind(this);\n this.handleKeyDown = this.handleKeyDown.bind(this);\n this.handleListKeydown = this.handleListKeydown.bind(this);\n this.handleSelect = this.handleSelect.bind(this);\n this.handleTableUpdate = this.handleTableUpdate.bind(this);\n this.handleTextChange = this.handleTextChange.bind(this);\n this.handleViewportChange = this.handleViewportChange.bind(this);\n\n this.itemList = null;\n this.searchInput = null;\n this.timer = null;\n\n this.state = {\n offset: 0,\n itemCount: 0,\n items: [],\n text: '',\n isLoading: true,\n };\n }\n\n componentDidMount(): void {\n this.startListening();\n }\n\n componentDidUpdate(\n prevProps: PartitionSelectorSearchProps<T>,\n prevState: PartitionSelectorSearchState\n ): void {\n const { isLoading, itemCount } = this.state;\n const { onListResized } = this.props;\n if (\n itemCount !== prevState.itemCount ||\n isLoading !== prevState.isLoading\n ) {\n onListResized();\n }\n }\n\n componentWillUnmount(): void {\n this.debounceUpdateFilter.cancel();\n\n this.stopListening();\n }\n\n itemList: ItemList<Item> | null;\n\n searchInput: HTMLInputElement | null;\n\n timer: null;\n\n handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>): boolean {\n if (this.itemList == null) {\n return false;\n }\n\n const { items, itemCount } = this.state;\n switch (event.key) {\n case 'Enter': {\n let selectedValue = null;\n if (items.length > 0) {\n selectedValue = items[0].value;\n } else {\n const { text } = this.state;\n selectedValue = text.trim();\n }\n\n if (selectedValue.length > 0) {\n const { onSelect } = this.props;\n onSelect(selectedValue);\n }\n\n event.stopPropagation();\n event.preventDefault();\n return true;\n }\n case 'ArrowDown':\n if (itemCount > 0) {\n this.itemList.focusItem(1);\n }\n event.stopPropagation();\n event.preventDefault();\n return true;\n default:\n return false;\n }\n }\n\n handleListKeydown(event: React.KeyboardEvent<HTMLDivElement>): void {\n switch (event.key) {\n case 'Escape':\n // Do nothing\n break;\n default:\n this.focus();\n break;\n }\n }\n\n handleFilterChange(): void {\n log.debug2('handleFilterChange');\n\n const { table } = this.props;\n const itemCount = table.size;\n this.setState({ itemCount, isLoading: true });\n }\n\n handleInputFocus(): void {\n if (this.itemList) {\n this.itemList.focusItem(0);\n }\n }\n\n handleSelect(itemIndex: ModelIndex): void {\n log.debug2('handleSelect', itemIndex);\n\n const { onSelect } = this.props;\n const { offset, items } = this.state;\n const offsetIndex = itemIndex - offset;\n if (offsetIndex < 0 || items.length <= offsetIndex) {\n log.error('No data for item', itemIndex);\n return;\n }\n\n const { value } = items[offsetIndex];\n onSelect(value);\n }\n\n handleTableUpdate(event: CustomEvent): void {\n const data = event.detail;\n const { offset } = data;\n\n const items = [] as Item[];\n const { getFormattedString, table } = this.props;\n const column = table.columns[0];\n for (let r = 0; r < data.rows.length; r += 1) {\n const row = data.rows[r];\n const value = row.get(column);\n const displayValue = getFormattedString(value, column.type, column.name);\n items.push({\n displayValue,\n value,\n });\n }\n\n const itemCount = table.size;\n log.debug2('handleTableUpdate', itemCount, offset, items.length);\n this.setState({ itemCount, items, offset, isLoading: false });\n }\n\n handleTextChange(event: React.ChangeEvent<HTMLInputElement>): void {\n log.debug2('handleTextChange');\n\n const { value: text } = event.target;\n\n this.setState({ text });\n\n this.debounceUpdateFilter();\n }\n\n handleViewportChange(topRow: number, bottomRow: number): void {\n log.debug2('handleViewportChange', topRow, bottomRow);\n\n const delta = Math.max(1, bottomRow - topRow);\n const top = Math.max(0, topRow - delta);\n const bottom = bottomRow + delta;\n\n const { table } = this.props;\n table.setViewport(top, bottom);\n }\n\n debounceUpdateFilter = debounce((): void => {\n this.updateFilter();\n }, DEBOUNCE_UPDATE_FILTER);\n\n focus(): void {\n if (this.searchInput) {\n this.searchInput.focus();\n }\n }\n\n startListening(): void {\n const { dh, initialPageSize, table } = this.props;\n table.addEventListener(dh.Table.EVENT_UPDATED, this.handleTableUpdate);\n table.addEventListener(\n dh.Table.EVENT_FILTERCHANGED,\n this.handleFilterChange\n );\n table.setViewport(0, initialPageSize);\n }\n\n stopListening(): void {\n const { dh, table } = this.props;\n table.removeEventListener(dh.Table.EVENT_UPDATED, this.handleTableUpdate);\n table.removeEventListener(\n dh.Table.EVENT_FILTERCHANGED,\n this.handleFilterChange\n );\n }\n\n updateFilter(): void {\n const { dh, initialPageSize, table } = this.props;\n const { text } = this.state;\n const filterText = text.trim();\n const filters = [];\n if (filterText.length > 0) {\n const column = table.columns[0];\n const filter = column\n .filter()\n .invoke(\n 'matches',\n dh.FilterValue.ofString(`(?s)(?i).*\\\\Q${filterText}\\\\E.*`)\n );\n filters.push(filter);\n }\n\n log.debug2('updateFilter', filters);\n\n table.applyFilter(filters);\n table.setViewport(0, initialPageSize);\n }\n\n render(): JSX.Element {\n const { isLoading, itemCount, items, offset, text } = this.state;\n const listHeight =\n Math.min(itemCount, PartitionSelectorSearch.MAX_VISIBLE_ITEMS) *\n ItemList.DEFAULT_ROW_HEIGHT +\n // Adjust for ListItem vertical padding - .375rem ~ 5.25px\n 11;\n return (\n <div className=\"iris-grid-partition-selector-search\">\n <div className=\"search-container\">\n <input\n type=\"text\"\n ref={searchInput => {\n this.searchInput = searchInput;\n }}\n value={text}\n placeholder=\"Available Partitions\"\n onChange={this.handleTextChange}\n onFocus={this.handleInputFocus}\n onKeyDown={this.handleKeyDown}\n className=\"form-control input-partition\"\n />\n </div>\n {!isLoading && itemCount > 0 && (\n <div\n className=\"iris-grid-partition-selector-search-list\"\n onKeyDown={this.handleListKeydown}\n role=\"presentation\"\n style={{ height: listHeight }}\n >\n <ItemList\n ref={itemList => {\n this.itemList = itemList;\n }}\n itemCount={itemCount}\n items={items}\n offset={offset}\n onSelect={this.handleSelect}\n onViewportChange={this.handleViewportChange}\n />\n </div>\n )}\n {!isLoading && itemCount === 0 && (\n <div className=\"iris-grid-partition-selector-search-empty\">\n No results\n </div>\n )}\n {isLoading && (\n <div className=\"iris-grid-partition-selector-loading\">\n <LoadingSpinner />\n Loading...\n </div>\n )}\n </div>\n );\n }\n}\n\nexport default PartitionSelectorSearch;\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,QAAQ,MAAM,iBAAiB;AAEtC,SAASC,QAAQ,EAAEC,cAAc,QAAQ,uBAAuB;AAChE,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,oBAAoB,QAAQ,kBAAkB;AAAC;AAIxD,IAAMC,GAAG,GAAGF,GAAG,CAACG,MAAM,CAAC,yBAAyB,CAAC;AACjD,IAAMC,sBAAsB,GAAG,GAAG;AAsBlC,MAAMC,uBAAuB,SAAYV,SAAS,CAGhD;EA8BA,OA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C,UAAU;EAC7CjD,KAAK,EAAEvD,SAAS,CAACyG,KAAK,CAAC;IACrBrB,gBAAgB,EAAEpF,SAAS,CAACuG,IAAI,CAACC,UAAU;IAC3ChB,mBAAmB,EAAExF,SAAS,CAACuG,IAAI,CAACC,UAAU;IAC9CxC,OAAO,EAAEhE,SAAS,CAAC0G,OAAO,CACxB1G,SAAS,CAACyG,KAAK,CAAC;MACdlC,IAAI,EAAEvE,SAAS,CAAC2G,MAAM,CAACH,UAAU;MACjClC,IAAI,EAAEtE,SAAS,CAAC2G,MAAM,CAACH,UAAU;MACjCb,MAAM,EAAE3F,SAAS,CAACuG,IAAI,CAACC;IACzB,CAAC,CAAC,CACH;IACDhD,IAAI,EAAExD,SAAS,CAAC4G,MAAM,CAACJ,UAAU;IACjCT,WAAW,EAAE/F,SAAS,CAACuG,IAAI,CAACC,UAAU;IACtCvB,WAAW,EAAEjF,SAAS,CAACuG,IAAI,CAACC;EAC9B,CAAC,CAAC,CAACA,UAAU;EACbrB,eAAe,EAAEnF,SAAS,CAAC4G,MAAM;EACjC3D,QAAQ,EAAEjD,SAAS,CAACuG,IAAI;EACxBjE,aAAa,EAAEtC,SAAS,CAACuG;AAC3B,CAAC;AAoSH,eAAe9F,uBAAuB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PureComponent } from 'react';
|
|
2
2
|
import { MoveOperation } from '@deephaven/grid';
|
|
3
|
-
import { Column, FilterCondition, Sort, Table, TableViewportSubscription } from '@deephaven/jsapi-
|
|
3
|
+
import type { Column, FilterCondition, Sort, Table, TableViewportSubscription } from '@deephaven/jsapi-types';
|
|
4
4
|
import { ColumnName } from './CommonTypes';
|
|
5
5
|
/**
|
|
6
6
|
* Updates the viewport for an Iris table, for use in a scroll pane.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableViewportUpdater.d.ts","sourceRoot":"","sources":["../src/TableViewportUpdater.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EA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AyB,CAAC;IAGzC,mBAAmB,UAAmB,KAAK,OAAO,MAAM,UAAU,MAAM,cASrE;IAGH,kBAAkB,UAEP,KAAK,QACN,MAAM,SACL,MAAM,gBACC,aAAa,EAAE,qBAyB/B;IAEF,iBAAiB,IAAI,IAAI;IAazB,cAAc,uCAEL,MAAM,UACH,MAAM,QACR,MAAM,SACL,MAAM,eACA,MAAM,EAAE,KACpB,IAAI,EA4CP;IAEF,MAAM,IAAI,IAAI;CAGf;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableViewportUpdater.js","names":["PureComponent","memoize","throttle","GridUtils","Log","log","module","UPDATE_THROTTLE","TableViewportUpdater","table","top","bottom","viewHeight","viewportTop","Math","max","ROW_BUFFER_PAGES","viewportBottom","left","right","movedColumns","viewWidth","viewportLeft","COLUMN_BUFFER_PAGES","viewportRight","min","columns","length","i","modelIndex","getModelIndex","push","viewColumns","error","debug2","props","getViewportRowRange","getViewportColumns","subscription","setViewport","onSubscription","componentDidMount","filters","sorts","customColumns","applyFilter","applySort","applyCustomColumns","updateViewport","componentDidUpdate","prevProps","isFilterChanged","isSortChanged","isCustomColumnsChanged","isTableChanged","closeSubscription","debug","componentWillUnmount","close","undefined","cancel","render"],"sources":["../src/TableViewportUpdater.tsx"],"sourcesContent":["import { PureComponent } from 'react';\nimport memoize from 'memoize-one';\nimport throttle from 'lodash.throttle';\nimport { GridUtils, MoveOperation } from '@deephaven/grid';\nimport {\n Column,\n FilterCondition,\n Sort,\n Table,\n TableViewportSubscription,\n} from '@deephaven/jsapi-shim';\nimport Log from '@deephaven/log';\nimport { ColumnName } from './CommonTypes';\n\nconst log = Log.module('TableViewportUpdater');\n\nconst UPDATE_THROTTLE = 150;\n\n/**\n * Updates the viewport for an Iris table, for use in a scroll pane.\n * Automatically throttles the viewport requests and buffers above and below.\n */\n\ninterface TableViewportUpdaterProps {\n table: Table;\n top: number;\n bottom: number;\n left: number;\n right: number;\n columns: Column[];\n filters: FilterCondition[];\n sorts: Sort[];\n customColumns: ColumnName[];\n movedColumns: MoveOperation[];\n onSubscription: (subscription?: TableViewportSubscription) => void;\n}\n\nclass TableViewportUpdater extends PureComponent<\n TableViewportUpdaterProps,\n Record<string, never>\n> {\n // Number of pages to buffer for rows/columns\n static ROW_BUFFER_PAGES = 3;\n\n static COLUMN_BUFFER_PAGES = 1;\n\n static defaultProps = {\n top: 0,\n bottom: 0,\n left: null,\n right: null,\n columns: null,\n onSubscription: (): void => undefined,\n filters: [],\n sorts: [],\n customColumns: [],\n movedColumns: [],\n };\n\n componentDidMount(): void {\n const {\n top,\n bottom,\n left,\n right,\n table,\n filters,\n sorts,\n columns,\n customColumns,\n } = this.props;\n table.applyFilter(filters);\n table.applySort(sorts);\n table.applyCustomColumns(customColumns);\n this.updateViewport(top, bottom, left, right, columns);\n }\n\n componentDidUpdate(prevProps: TableViewportUpdaterProps): void {\n const {\n top,\n bottom,\n left,\n right,\n table,\n filters,\n sorts,\n customColumns,\n columns,\n } = this.props;\n const isFilterChanged = filters !== prevProps.filters;\n const isSortChanged = sorts !== prevProps.sorts;\n const isCustomColumnsChanged = customColumns !== prevProps.customColumns;\n const isTableChanged = table !== prevProps.table;\n if (\n isFilterChanged ||\n isSortChanged ||\n isCustomColumnsChanged ||\n isTableChanged\n ) {\n this.closeSubscription();\n }\n\n if (isFilterChanged || isTableChanged) {\n log.debug('update table filter', filters);\n table.applyFilter(filters);\n }\n\n if (isSortChanged || isTableChanged) {\n log.debug('update table sort', sorts);\n table.applySort(sorts);\n }\n\n if (isCustomColumnsChanged || isTableChanged) {\n log.debug('update table custom columns', customColumns);\n table.applyCustomColumns(customColumns);\n }\n\n this.updateViewport(top, bottom, left, right, columns);\n }\n\n componentWillUnmount(): void {\n this.closeSubscription();\n }\n\n subscription?: TableViewportSubscription;\n\n // eslint-disable-next-line class-methods-use-this\n getViewportRowRange = memoize((table: Table, top: number, bottom: number) => {\n const viewHeight = bottom - top;\n const viewportTop = Math.max(\n 0,\n top - viewHeight * TableViewportUpdater.ROW_BUFFER_PAGES\n );\n const viewportBottom =\n bottom + viewHeight * TableViewportUpdater.ROW_BUFFER_PAGES;\n return [viewportTop, viewportBottom];\n });\n\n // eslint-disable-next-line class-methods-use-this\n getViewportColumns = memoize(\n (\n table: Table,\n left: number,\n right: number,\n movedColumns: MoveOperation[]\n ) => {\n if (left == null || right == null) {\n return null;\n }\n\n const viewWidth = right - left;\n const viewportLeft = Math.max(\n 0,\n left - viewWidth * TableViewportUpdater.COLUMN_BUFFER_PAGES\n );\n const viewportRight = Math.min(\n right + viewWidth * TableViewportUpdater.COLUMN_BUFFER_PAGES,\n table.columns.length - 1\n );\n\n // Need to get all the columns from the table model now\n const columns = [];\n for (let i = viewportLeft; i <= viewportRight; i += 1) {\n const modelIndex = GridUtils.getModelIndex(i, movedColumns);\n columns.push(table.columns[modelIndex]);\n }\n\n return columns;\n }\n );\n\n closeSubscription(): void {\n log.debug2('closeSubscription', this.subscription);\n if (this.subscription) {\n this.subscription.close();\n this.subscription = undefined;\n\n const { onSubscription } = this.props;\n onSubscription();\n }\n\n this.updateViewport.cancel();\n }\n\n updateViewport = throttle(\n (\n top: number,\n bottom: number,\n left: number,\n right: number,\n viewColumns: Column[]\n ): void => {\n if (bottom < top) {\n log.error('Invalid viewport', top, bottom);\n return;\n }\n\n if (top === 0 && bottom === 0) {\n log.debug2('Ignoring 0-0 viewport');\n return;\n }\n\n const { movedColumns, table } = this.props;\n const [viewportTop, viewportBottom] = this.getViewportRowRange(\n table,\n top,\n bottom\n );\n const columns =\n viewColumns ??\n this.getViewportColumns(table, left, right, movedColumns);\n log.debug2(\n 'Setting Viewport Top:',\n viewportTop,\n 'Bottom:',\n viewportBottom,\n 'Columns:',\n columns\n );\n if (this.subscription == null) {\n log.debug2('updateViewport creating new subscription');\n this.subscription = table.setViewport(\n viewportTop,\n viewportBottom,\n columns\n );\n\n const { onSubscription } = this.props;\n onSubscription(this.subscription);\n } else {\n log.debug2('updateViewport using existing subscription');\n this.subscription.setViewport(viewportTop, viewportBottom, columns);\n }\n },\n UPDATE_THROTTLE\n );\n\n render(): null {\n return null;\n }\n}\n\nexport default TableViewportUpdater;\n"],"mappings":";;;AAAA,SAASA,aAAa,QAAQ,OAAO;AACrC,OAAOC,OAAO,MAAM,aAAa;AACjC,OAAOC,QAAQ,MAAM,iBAAiB;AACtC,SAASC,SAAS,QAAuB,iBAAiB;AAQ1D,OAAOC,GAAG,MAAM,gBAAgB;AAGhC,IAAMC,GAAG,GAAGD,GAAG,CAACE,MAAM,CAAC,sBAAsB,CAAC;AAE9C,IAAMC,eAAe,GAAG,GAAG;;AAE3B;AACA;AACA;AACA;;AAgBA,MAAMC,oBAAoB,SAASR,aAAa,CAG9C;EAAA;IAAA;IAAA;IAAA,6CAuFsBC,OAAO,CAAC,CAACQ,KAAY,EAAEC,GAAW,EAAEC,MAAc,KAAK;MAC3E,IAAMC,UAAU,GAAGD,MAAM,GAAGD,GAAG;MAC/B,IAAMG,WAAW,GAAGC,IAAI,CAACC,GAAG,CAC1B,CAAC,EACDL,GAAG,GAAGE,UAAU,GAAGJ,oBAAoB,CAACQ,gBAAgB,CACzD;MACD,IAAMC,cAAc,GAClBN,MAAM,GAAGC,UAAU,GAAGJ,oBAAoB,CAACQ,gBAAgB;MAC7D,OAAO,CAACH,WAAW,EAAEI,cAAc,CAAC;IACtC,CAAC,CAAC;IAAA,4CAGmBhB,OAAO,CAC1B,CACEQ,KAAY,EACZS,IAAY,EACZC,KAAa,EACbC,YAA6B,KAC1B;MACH,IAAIF,IAAI,IAAI,IAAI,IAAIC,KAAK,IAAI,IAAI,EAAE;QACjC,OAAO,IAAI;MACb;MAEA,IAAME,SAAS,GAAGF,KAAK,GAAGD,IAAI;MAC9B,IAAMI,YAAY,GAAGR,IAAI,CAACC,GAAG,CAC3B,CAAC,EACDG,IAAI,GAAGG,SAAS,GAAGb,oBAAoB,CAACe,mBAAmB,CAC5D;MACD,IAAMC,aAAa,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,IAAI;EACb;AACF;AAAC,gBA3MKrD,oBAAoB,sBAKE,CAAC;AAAA,gBALvBA,oBAAoB,yBAOK,CAAC;AAAA,gBAP1BA,oBAAoB,kBASF;EACpBE,GAAG,EAAE,CAAC;EACNC,MAAM,EAAE,CAAC;EACTO,IAAI,EAAE,IAAI;EACVC,KAAK,EAAE,IAAI;EACXO,OAAO,EAAE,IAAI;EACbc,cAAc,EAAE,MAAYmB,SAAS;EACrCjB,OAAO,EAAE,EAAE;EACXC,KAAK,EAAE,EAAE;EACTC,aAAa,EAAE,EAAE;EACjBxB,YAAY,EAAE;AAChB,CAAC;AAyLH,eAAeZ,oBAAoB"}
|
|
1
|
+
{"version":3,"file":"TableViewportUpdater.js","names":["PureComponent","memoize","throttle","GridUtils","Log","log","module","UPDATE_THROTTLE","TableViewportUpdater","table","top","bottom","viewHeight","viewportTop","Math","max","ROW_BUFFER_PAGES","viewportBottom","left","right","movedColumns","viewWidth","viewportLeft","COLUMN_BUFFER_PAGES","viewportRight","min","columns","length","i","modelIndex","getModelIndex","push","viewColumns","error","debug2","props","getViewportRowRange","getViewportColumns","subscription","setViewport","onSubscription","componentDidMount","filters","sorts","customColumns","applyFilter","applySort","applyCustomColumns","updateViewport","componentDidUpdate","prevProps","isFilterChanged","isSortChanged","isCustomColumnsChanged","isTableChanged","closeSubscription","debug","componentWillUnmount","close","undefined","cancel","render"],"sources":["../src/TableViewportUpdater.tsx"],"sourcesContent":["import { PureComponent } from 'react';\nimport memoize from 'memoize-one';\nimport throttle from 'lodash.throttle';\nimport { GridUtils, MoveOperation } from '@deephaven/grid';\nimport type {\n Column,\n FilterCondition,\n Sort,\n Table,\n TableViewportSubscription,\n} from '@deephaven/jsapi-types';\nimport Log from '@deephaven/log';\nimport { ColumnName } from './CommonTypes';\n\nconst log = Log.module('TableViewportUpdater');\n\nconst UPDATE_THROTTLE = 150;\n\n/**\n * Updates the viewport for an Iris table, for use in a scroll pane.\n * Automatically throttles the viewport requests and buffers above and below.\n */\n\ninterface TableViewportUpdaterProps {\n table: Table;\n top: number;\n bottom: number;\n left: number;\n right: number;\n columns: Column[];\n filters: FilterCondition[];\n sorts: Sort[];\n customColumns: ColumnName[];\n movedColumns: MoveOperation[];\n onSubscription: (subscription?: TableViewportSubscription) => void;\n}\n\nclass TableViewportUpdater extends PureComponent<\n TableViewportUpdaterProps,\n Record<string, never>\n> {\n // Number of pages to buffer for rows/columns\n static ROW_BUFFER_PAGES = 3;\n\n static COLUMN_BUFFER_PAGES = 1;\n\n static defaultProps = {\n top: 0,\n bottom: 0,\n left: null,\n right: null,\n columns: null,\n onSubscription: (): void => undefined,\n filters: [],\n sorts: [],\n customColumns: [],\n movedColumns: [],\n };\n\n componentDidMount(): void {\n const {\n top,\n bottom,\n left,\n right,\n table,\n filters,\n sorts,\n columns,\n customColumns,\n } = this.props;\n table.applyFilter(filters);\n table.applySort(sorts);\n table.applyCustomColumns(customColumns);\n this.updateViewport(top, bottom, left, right, columns);\n }\n\n componentDidUpdate(prevProps: TableViewportUpdaterProps): void {\n const {\n top,\n bottom,\n left,\n right,\n table,\n filters,\n sorts,\n customColumns,\n columns,\n } = this.props;\n const isFilterChanged = filters !== prevProps.filters;\n const isSortChanged = sorts !== prevProps.sorts;\n const isCustomColumnsChanged = customColumns !== prevProps.customColumns;\n const isTableChanged = table !== prevProps.table;\n if (\n isFilterChanged ||\n isSortChanged ||\n isCustomColumnsChanged ||\n isTableChanged\n ) {\n this.closeSubscription();\n }\n\n if (isFilterChanged || isTableChanged) {\n log.debug('update table filter', filters);\n table.applyFilter(filters);\n }\n\n if (isSortChanged || isTableChanged) {\n log.debug('update table sort', sorts);\n table.applySort(sorts);\n }\n\n if (isCustomColumnsChanged || isTableChanged) {\n log.debug('update table custom columns', customColumns);\n table.applyCustomColumns(customColumns);\n }\n\n this.updateViewport(top, bottom, left, right, columns);\n }\n\n componentWillUnmount(): void {\n this.closeSubscription();\n }\n\n subscription?: TableViewportSubscription;\n\n // eslint-disable-next-line class-methods-use-this\n getViewportRowRange = memoize((table: Table, top: number, bottom: number) => {\n const viewHeight = bottom - top;\n const viewportTop = Math.max(\n 0,\n top - viewHeight * TableViewportUpdater.ROW_BUFFER_PAGES\n );\n const viewportBottom =\n bottom + viewHeight * TableViewportUpdater.ROW_BUFFER_PAGES;\n return [viewportTop, viewportBottom];\n });\n\n // eslint-disable-next-line class-methods-use-this\n getViewportColumns = memoize(\n (\n table: Table,\n left: number,\n right: number,\n movedColumns: MoveOperation[]\n ) => {\n if (left == null || right == null) {\n return null;\n }\n\n const viewWidth = right - left;\n const viewportLeft = Math.max(\n 0,\n left - viewWidth * TableViewportUpdater.COLUMN_BUFFER_PAGES\n );\n const viewportRight = Math.min(\n right + viewWidth * TableViewportUpdater.COLUMN_BUFFER_PAGES,\n table.columns.length - 1\n );\n\n // Need to get all the columns from the table model now\n const columns = [];\n for (let i = viewportLeft; i <= viewportRight; i += 1) {\n const modelIndex = GridUtils.getModelIndex(i, movedColumns);\n columns.push(table.columns[modelIndex]);\n }\n\n return columns;\n }\n );\n\n closeSubscription(): void {\n log.debug2('closeSubscription', this.subscription);\n if (this.subscription) {\n this.subscription.close();\n this.subscription = undefined;\n\n const { onSubscription } = this.props;\n onSubscription();\n }\n\n this.updateViewport.cancel();\n }\n\n updateViewport = throttle(\n (\n top: number,\n bottom: number,\n left: number,\n right: number,\n viewColumns: Column[]\n ): void => {\n if (bottom < top) {\n log.error('Invalid viewport', top, bottom);\n return;\n }\n\n if (top === 0 && bottom === 0) {\n log.debug2('Ignoring 0-0 viewport');\n return;\n }\n\n const { movedColumns, table } = this.props;\n const [viewportTop, viewportBottom] = this.getViewportRowRange(\n table,\n top,\n bottom\n );\n const columns =\n viewColumns ??\n this.getViewportColumns(table, left, right, movedColumns);\n log.debug2(\n 'Setting Viewport Top:',\n viewportTop,\n 'Bottom:',\n viewportBottom,\n 'Columns:',\n columns\n );\n if (this.subscription == null) {\n log.debug2('updateViewport creating new subscription');\n this.subscription = table.setViewport(\n viewportTop,\n viewportBottom,\n columns\n );\n\n const { onSubscription } = this.props;\n onSubscription(this.subscription);\n } else {\n log.debug2('updateViewport using existing subscription');\n this.subscription.setViewport(viewportTop, viewportBottom, columns);\n }\n },\n UPDATE_THROTTLE\n );\n\n render(): null {\n return null;\n }\n}\n\nexport default TableViewportUpdater;\n"],"mappings":";;;AAAA,SAASA,aAAa,QAAQ,OAAO;AACrC,OAAOC,OAAO,MAAM,aAAa;AACjC,OAAOC,QAAQ,MAAM,iBAAiB;AACtC,SAASC,SAAS,QAAuB,iBAAiB;AAQ1D,OAAOC,GAAG,MAAM,gBAAgB;AAGhC,IAAMC,GAAG,GAAGD,GAAG,CAACE,MAAM,CAAC,sBAAsB,CAAC;AAE9C,IAAMC,eAAe,GAAG,GAAG;;AAE3B;AACA;AACA;AACA;;AAgBA,MAAMC,oBAAoB,SAASR,aAAa,CAG9C;EAAA;IAAA;IAAA;IAAA,6CAuFsBC,OAAO,CAAC,CAACQ,KAAY,EAAEC,GAAW,EAAEC,MAAc,KAAK;MAC3E,IAAMC,UAAU,GAAGD,MAAM,GAAGD,GAAG;MAC/B,IAAMG,WAAW,GAAGC,IAAI,CAACC,GAAG,CAC1B,CAAC,EACDL,GAAG,GAAGE,UAAU,GAAGJ,oBAAoB,CAACQ,gBAAgB,CACzD;MACD,IAAMC,cAAc,GAClBN,MAAM,GAAGC,UAAU,GAAGJ,oBAAoB,CAACQ,gBAAgB;MAC7D,OAAO,CAACH,WAAW,EAAEI,cAAc,CAAC;IACtC,CAAC,CAAC;IAAA,4CAGmBhB,OAAO,CAC1B,CACEQ,KAAY,EACZS,IAAY,EACZC,KAAa,EACbC,YAA6B,KAC1B;MACH,IAAIF,IAAI,IAAI,IAAI,IAAIC,KAAK,IAAI,IAAI,EAAE;QACjC,OAAO,IAAI;MACb;MAEA,IAAME,SAAS,GAAGF,KAAK,GAAGD,IAAI;MAC9B,IAAMI,YAAY,GAAGR,IAAI,CAACC,GAAG,CAC3B,CAAC,EACDG,IAAI,GAAG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,cAAc,CAACY,MAAM,EAAE;EAC9B;EAuDAC,MAAM,GAAS;IACb,OAAO,IAAI;EACb;AACF;AAAC,gBA3MKrD,oBAAoB,sBAKE,CAAC;AAAA,gBALvBA,oBAAoB,yBAOK,CAAC;AAAA,gBAP1BA,oBAAoB,kBASF;EACpBE,GAAG,EAAE,CAAC;EACNC,MAAM,EAAE,CAAC;EACTO,IAAI,EAAE,IAAI;EACVC,KAAK,EAAE,IAAI;EACXO,OAAO,EAAE,IAAI;EACbc,cAAc,EAAE,MAAYmB,SAAS;EACrCjB,OAAO,EAAE,EAAE;EACXC,KAAK,EAAE,EAAE;EACTC,aAAa,EAAE,EAAE;EACjBxB,YAAY,EAAE;AAChB,CAAC;AAyLH,eAAeZ,oBAAoB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PureComponent } from 'react';
|
|
2
|
-
import { EventListener, FilterCondition, RemoverFn, Sort, Table } from '@deephaven/jsapi-
|
|
2
|
+
import type { dh as DhType, EventListener, FilterCondition, RemoverFn, Sort, Table } from '@deephaven/jsapi-types';
|
|
3
3
|
interface TreeTableViewportUpdaterProps {
|
|
4
|
+
dh: DhType;
|
|
4
5
|
table: Table;
|
|
5
6
|
top: number;
|
|
6
7
|
bottom: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeTableViewportUpdater.d.ts","sourceRoot":"","sources":["../src/TreeTableViewportUpdater.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,
|
|
1
|
+
{"version":3,"file":"TreeTableViewportUpdater.d.ts","sourceRoot":"","sources":["../src/TreeTableViewportUpdater.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,KAAK,EACV,EAAE,IAAI,MAAM,EACZ,aAAa,EACb,eAAe,EACf,SAAS,EACT,IAAI,EACJ,KAAK,EACN,MAAM,wBAAwB,CAAC;AAOhC,UAAU,6BAA6B;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,aAAa,CAAC;CACjC;AAED;;;GAGG;AACH,cAAM,wBAAyB,SAAQ,aAAa,CAClD,6BAA6B,EAC7B,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CACtB;IACC,MAAM,CAAC,eAAe,SAAQ;IAE9B,MAAM,CAAC,YAAY;;;gCAGK,IAAI;;;;MAI1B;gBAEU,KAAK,EAAE,6BAA6B;IAMhD,iBAAiB,IAAI,IAAI;IAQzB,kBAAkB,CAAC,SAAS,EAAE,6BAA6B,GAAG,IAAI;IAelE,oBAAoB,IAAI,IAAI;IAO5B,eAAe,EAAE,SAAS,GAAG,IAAI,CAAC;IAElC,cAAc,uCAAkB,MAAM,UAAU,MAAM,KAAG,IAAI,EAgCzC;IAEpB,MAAM,IAAI,IAAI;CAGf;AAED,eAAe,wBAAwB,CAAC"}
|
|
@@ -3,7 +3,6 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typ
|
|
|
3
3
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
4
|
import { PureComponent } from 'react';
|
|
5
5
|
import throttle from 'lodash.throttle';
|
|
6
|
-
import dh from '@deephaven/jsapi-shim';
|
|
7
6
|
import Log from '@deephaven/log';
|
|
8
7
|
var log = Log.module('TreeTableViewportUpdater');
|
|
9
8
|
var UPDATE_THROTTLE = 150;
|
|
@@ -34,6 +33,7 @@ class TreeTableViewportUpdater extends PureComponent {
|
|
|
34
33
|
log.debug2('Setting Viewport Top:', viewportTop, 'Bottom:', viewportBottom, table);
|
|
35
34
|
if (!this.listenerCleanup) {
|
|
36
35
|
var {
|
|
36
|
+
dh,
|
|
37
37
|
onViewportUpdate
|
|
38
38
|
} = this.props;
|
|
39
39
|
this.listenerCleanup = table.addEventListener(dh.TreeTable.EVENT_UPDATED, onViewportUpdate);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeTableViewportUpdater.js","names":["PureComponent","throttle","
|
|
1
|
+
{"version":3,"file":"TreeTableViewportUpdater.js","names":["PureComponent","throttle","Log","log","module","UPDATE_THROTTLE","TreeTableViewportUpdater","constructor","props","top","bottom","error","debug2","table","updateInterval","viewSize","viewportTop","Math","max","viewportBottom","listenerCleanup","dh","onViewportUpdate","addEventListener","TreeTable","EVENT_UPDATED","setViewport","undefined","componentDidMount","filters","sorts","debug","applyFilter","applySort","updateViewport","componentDidUpdate","prevProps","componentWillUnmount","cancel","render","UPDATE_INTERVAL"],"sources":["../src/TreeTableViewportUpdater.tsx"],"sourcesContent":["import { PureComponent } from 'react';\nimport throttle from 'lodash.throttle';\nimport type {\n dh as DhType,\n EventListener,\n FilterCondition,\n RemoverFn,\n Sort,\n Table,\n} from '@deephaven/jsapi-types';\nimport Log from '@deephaven/log';\n\nconst log = Log.module('TreeTableViewportUpdater');\n\nconst UPDATE_THROTTLE = 150;\n\ninterface TreeTableViewportUpdaterProps {\n dh: DhType;\n table: Table;\n top: number;\n bottom: number;\n filters: FilterCondition[];\n sorts: Sort[];\n updateInterval: number;\n onViewportUpdate: EventListener;\n}\n\n/**\n * Updates the viewport of a TreeTable for use in a scroll pane.\n * Automatically throttles the viewport requests and buffers above and below.\n */\nclass TreeTableViewportUpdater extends PureComponent<\n TreeTableViewportUpdaterProps,\n Record<string, never>\n> {\n static UPDATE_INTERVAL = 1000;\n\n static defaultProps = {\n top: 0,\n bottom: 0,\n onViewportUpdate: (): void => undefined,\n filters: [],\n sorts: [],\n updateInterval: TreeTableViewportUpdater.UPDATE_INTERVAL,\n };\n\n constructor(props: TreeTableViewportUpdaterProps) {\n super(props);\n\n this.listenerCleanup = null;\n }\n\n componentDidMount(): void {\n const { top, bottom, table, filters, sorts } = this.props;\n log.debug('componentDidMount', this.props);\n table.applyFilter(filters);\n table.applySort(sorts);\n this.updateViewport(top, bottom);\n }\n\n componentDidUpdate(prevProps: TreeTableViewportUpdaterProps): void {\n const { top, bottom, table, filters, sorts } = this.props;\n if (filters !== prevProps.filters) {\n log.debug('update table filter', filters);\n table.applyFilter(filters);\n }\n\n if (sorts !== prevProps.sorts) {\n log.debug('update table sort', sorts);\n table.applySort(sorts);\n }\n\n this.updateViewport(top, bottom);\n }\n\n componentWillUnmount(): void {\n this.updateViewport.cancel();\n if (this.listenerCleanup) {\n this.listenerCleanup();\n }\n }\n\n listenerCleanup: RemoverFn | null;\n\n updateViewport = throttle((top: number, bottom: number): void => {\n if (bottom < top) {\n log.error('Invalid viewport', top, bottom);\n return;\n }\n\n if (top === 0 && bottom === 0) {\n log.debug2('Ignoring 0-0 viewport');\n return;\n }\n\n const { table, updateInterval } = this.props;\n const viewSize = bottom - top;\n const viewportTop = Math.max(0, top - viewSize * 3);\n const viewportBottom = bottom + viewSize * 3 + 1;\n log.debug2(\n 'Setting Viewport Top:',\n viewportTop,\n 'Bottom:',\n viewportBottom,\n table\n );\n\n if (!this.listenerCleanup) {\n const { dh, onViewportUpdate } = this.props;\n this.listenerCleanup = table.addEventListener(\n dh.TreeTable.EVENT_UPDATED,\n onViewportUpdate\n );\n }\n\n table.setViewport(viewportTop, viewportBottom, undefined, updateInterval);\n }, UPDATE_THROTTLE);\n\n render(): null {\n return null;\n }\n}\n\nexport default TreeTableViewportUpdater;\n"],"mappings":";;;AAAA,SAASA,aAAa,QAAQ,OAAO;AACrC,OAAOC,QAAQ,MAAM,iBAAiB;AAStC,OAAOC,GAAG,MAAM,gBAAgB;AAE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,kBAMN;EACpBG,GAAG,EAAE,CAAC;EACNC,MAAM,EAAE,CAAC;EACTY,gBAAgB,EAAE,MAAYK,SAAS;EACvCE,OAAO,EAAE,EAAE;EACXC,KAAK,EAAE,EAAE;EACThB,cAAc,EAAER,wBAAwB,CAACkC;AAC3C,CAAC;AA+EH,eAAelC,wBAAwB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DecimalColumnFormat } from '@deephaven/jsapi-utils';
|
|
2
|
+
import type { dh as DhType } from '@deephaven/jsapi-types';
|
|
2
3
|
import { FormatContextMenuOption } from './FormatContextMenuUtils';
|
|
3
4
|
declare class DecimalFormatContextMenu {
|
|
4
5
|
static defaultGroup: number;
|
|
@@ -7,11 +8,12 @@ declare class DecimalFormatContextMenu {
|
|
|
7
8
|
static customGroup: number;
|
|
8
9
|
/**
|
|
9
10
|
* Creates list of formatting options for Decimal context menu
|
|
11
|
+
* @param dh JSAPI instance
|
|
10
12
|
* @param selectedFormat Selected format object, null for no selected format
|
|
11
13
|
* @param onCustomFormatChange Callback to call when the custom format is changed
|
|
12
14
|
* @returns Array of formatting options for the context menu
|
|
13
15
|
*/
|
|
14
|
-
static getOptions(selectedFormat: DecimalColumnFormat, onCustomFormatChange: (value: DecimalColumnFormat | null) => void): FormatContextMenuOption[];
|
|
16
|
+
static getOptions(dh: DhType, selectedFormat: DecimalColumnFormat, onCustomFormatChange: (value: DecimalColumnFormat | null) => void): FormatContextMenuOption[];
|
|
15
17
|
}
|
|
16
18
|
export default DecimalFormatContextMenu;
|
|
17
19
|
//# sourceMappingURL=DecimalFormatContextMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecimalFormatContextMenu.d.ts","sourceRoot":"","sources":["../../src/format-context-menus/DecimalFormatContextMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAEpB,MAAM,wBAAwB,CAAC;AAChC,OAA+B,EAC7B,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAElC,cAAM,wBAAwB;IAC5B,MAAM,CAAC,YAAY,SAAM;IAEzB,MAAM,CAAC,WAAW,SAAM;IAExB,MAAM,CAAC,gBAAgB,SAAM;IAE7B,MAAM,CAAC,WAAW,SAAM;IAExB
|
|
1
|
+
{"version":3,"file":"DecimalFormatContextMenu.d.ts","sourceRoot":"","sources":["../../src/format-context-menus/DecimalFormatContextMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAEpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAA+B,EAC7B,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAElC,cAAM,wBAAwB;IAC5B,MAAM,CAAC,YAAY,SAAM;IAEzB,MAAM,CAAC,WAAW,SAAM;IAExB,MAAM,CAAC,gBAAgB,SAAM;IAE7B,MAAM,CAAC,WAAW,SAAM;IAExB;;;;;;OAMG;IACH,MAAM,CAAC,UAAU,CACf,EAAE,EAAE,MAAM,EACV,cAAc,EAAE,mBAAmB,EACnC,oBAAoB,EAAE,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,KAAK,IAAI,GAChE,uBAAuB,EAAE;CA6E7B;AAED,eAAe,wBAAwB,CAAC"}
|
|
@@ -6,11 +6,12 @@ import FormatContextMenuUtils from "./FormatContextMenuUtils.js";
|
|
|
6
6
|
class DecimalFormatContextMenu {
|
|
7
7
|
/**
|
|
8
8
|
* Creates list of formatting options for Decimal context menu
|
|
9
|
+
* @param dh JSAPI instance
|
|
9
10
|
* @param selectedFormat Selected format object, null for no selected format
|
|
10
11
|
* @param onCustomFormatChange Callback to call when the custom format is changed
|
|
11
12
|
* @returns Array of formatting options for the context menu
|
|
12
13
|
*/
|
|
13
|
-
static getOptions(selectedFormat, onCustomFormatChange) {
|
|
14
|
+
static getOptions(dh, selectedFormat, onCustomFormatChange) {
|
|
14
15
|
var formatItems = [{
|
|
15
16
|
format: DecimalColumnFormatter.FORMAT_PERCENT,
|
|
16
17
|
group: DecimalFormatContextMenu.presetGroup
|
|
@@ -40,7 +41,7 @@ class DecimalFormatContextMenu {
|
|
|
40
41
|
var customFormatOption = FormatContextMenuUtils.makeCustomFormatOption(customFormat, DecimalFormatContextMenu.customGroup, DecimalColumnFormatter.DEFAULT_FORMAT_STRING, isCustomSelected, formatString => {
|
|
41
42
|
if (formatString != null) {
|
|
42
43
|
var newCustomFormat = DecimalColumnFormatter.makeCustomFormat(formatString);
|
|
43
|
-
if (DecimalColumnFormatter.isValid(newCustomFormat)) {
|
|
44
|
+
if (DecimalColumnFormatter.isValid(dh, newCustomFormat)) {
|
|
44
45
|
onCustomFormatChange(newCustomFormat);
|
|
45
46
|
}
|
|
46
47
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecimalFormatContextMenu.js","names":["DecimalColumnFormatter","FormatContextMenuUtils","DecimalFormatContextMenu","getOptions","selectedFormat","onCustomFormatChange","formatItems","format","FORMAT_PERCENT","group","presetGroup","FORMAT_BASIS_POINTS","FORMAT_MILLIONS","FORMAT_SCIENTIFIC_NOTATION","FORMAT_ROUND","presetRoundGroup","FORMAT_ROUND_TWO_DECIMALS","FORMAT_ROUND_FOUR_DECIMALS","defaultFormatOption","makeOption","defaultGroup","isDefaultSelected","presetFormatOptions","map","item","label","isSameFormat","isCustomSelected","customFormat","makeCustomFormat","customFormatOption","makeCustomFormatOption","customGroup","DEFAULT_FORMAT_STRING","formatString","newCustomFormat","isValid"],"sources":["../../src/format-context-menus/DecimalFormatContextMenu.ts"],"sourcesContent":["import {\n DecimalColumnFormat,\n DecimalColumnFormatter,\n} from '@deephaven/jsapi-utils';\nimport FormatContextMenuUtils, {\n FormatContextMenuOption,\n} from './FormatContextMenuUtils';\n\nclass DecimalFormatContextMenu {\n static defaultGroup = 10;\n\n static presetGroup = 20;\n\n static presetRoundGroup = 30;\n\n static customGroup = 40;\n\n /**\n * Creates list of formatting options for Decimal context menu\n * @param selectedFormat Selected format object, null for no selected format\n * @param onCustomFormatChange Callback to call when the custom format is changed\n * @returns Array of formatting options for the context menu\n */\n static getOptions(\n selectedFormat: DecimalColumnFormat,\n onCustomFormatChange: (value: DecimalColumnFormat | null) => void\n ): FormatContextMenuOption[] {\n const formatItems = [\n {\n format: DecimalColumnFormatter.FORMAT_PERCENT,\n group: DecimalFormatContextMenu.presetGroup,\n },\n {\n format: DecimalColumnFormatter.FORMAT_BASIS_POINTS,\n group: DecimalFormatContextMenu.presetGroup,\n },\n {\n format: DecimalColumnFormatter.FORMAT_MILLIONS,\n group: DecimalFormatContextMenu.presetGroup,\n },\n {\n format: DecimalColumnFormatter.FORMAT_SCIENTIFIC_NOTATION,\n group: DecimalFormatContextMenu.presetGroup,\n },\n {\n format: DecimalColumnFormatter.FORMAT_ROUND,\n group: DecimalFormatContextMenu.presetRoundGroup,\n },\n {\n format: DecimalColumnFormatter.FORMAT_ROUND_TWO_DECIMALS,\n group: DecimalFormatContextMenu.presetRoundGroup,\n },\n {\n format: DecimalColumnFormatter.FORMAT_ROUND_FOUR_DECIMALS,\n group: DecimalFormatContextMenu.presetRoundGroup,\n },\n ];\n\n const defaultFormatOption = FormatContextMenuUtils.makeOption(\n 'Default',\n null,\n DecimalFormatContextMenu.defaultGroup,\n FormatContextMenuUtils.isDefaultSelected(selectedFormat)\n );\n\n const presetFormatOptions = formatItems.map(item =>\n FormatContextMenuUtils.makeOption(\n item.format.label,\n item.format,\n item.group,\n DecimalColumnFormatter.isSameFormat(item.format, selectedFormat)\n )\n );\n\n const isCustomSelected = FormatContextMenuUtils.isCustomSelected(\n selectedFormat\n );\n\n const customFormat = isCustomSelected\n ? selectedFormat\n : DecimalColumnFormatter.makeCustomFormat();\n\n const customFormatOption = FormatContextMenuUtils.makeCustomFormatOption(\n customFormat,\n DecimalFormatContextMenu.customGroup,\n DecimalColumnFormatter.DEFAULT_FORMAT_STRING,\n isCustomSelected,\n formatString => {\n if (formatString != null) {\n const newCustomFormat = DecimalColumnFormatter.makeCustomFormat(\n formatString\n );\n if (DecimalColumnFormatter.isValid(newCustomFormat)) {\n onCustomFormatChange(newCustomFormat);\n }\n } else {\n onCustomFormatChange(null);\n }\n }\n );\n\n return [defaultFormatOption, ...presetFormatOptions, customFormatOption];\n }\n}\n\nexport default DecimalFormatContextMenu;\n"],"mappings":";;;AAAA,SAEEA,sBAAsB,QACjB,wBAAwB;AAAC,
|
|
1
|
+
{"version":3,"file":"DecimalFormatContextMenu.js","names":["DecimalColumnFormatter","FormatContextMenuUtils","DecimalFormatContextMenu","getOptions","dh","selectedFormat","onCustomFormatChange","formatItems","format","FORMAT_PERCENT","group","presetGroup","FORMAT_BASIS_POINTS","FORMAT_MILLIONS","FORMAT_SCIENTIFIC_NOTATION","FORMAT_ROUND","presetRoundGroup","FORMAT_ROUND_TWO_DECIMALS","FORMAT_ROUND_FOUR_DECIMALS","defaultFormatOption","makeOption","defaultGroup","isDefaultSelected","presetFormatOptions","map","item","label","isSameFormat","isCustomSelected","customFormat","makeCustomFormat","customFormatOption","makeCustomFormatOption","customGroup","DEFAULT_FORMAT_STRING","formatString","newCustomFormat","isValid"],"sources":["../../src/format-context-menus/DecimalFormatContextMenu.ts"],"sourcesContent":["import {\n DecimalColumnFormat,\n DecimalColumnFormatter,\n} from '@deephaven/jsapi-utils';\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport FormatContextMenuUtils, {\n FormatContextMenuOption,\n} from './FormatContextMenuUtils';\n\nclass DecimalFormatContextMenu {\n static defaultGroup = 10;\n\n static presetGroup = 20;\n\n static presetRoundGroup = 30;\n\n static customGroup = 40;\n\n /**\n * Creates list of formatting options for Decimal context menu\n * @param dh JSAPI instance\n * @param selectedFormat Selected format object, null for no selected format\n * @param onCustomFormatChange Callback to call when the custom format is changed\n * @returns Array of formatting options for the context menu\n */\n static getOptions(\n dh: DhType,\n selectedFormat: DecimalColumnFormat,\n onCustomFormatChange: (value: DecimalColumnFormat | null) => void\n ): FormatContextMenuOption[] {\n const formatItems = [\n {\n format: DecimalColumnFormatter.FORMAT_PERCENT,\n group: DecimalFormatContextMenu.presetGroup,\n },\n {\n format: DecimalColumnFormatter.FORMAT_BASIS_POINTS,\n group: DecimalFormatContextMenu.presetGroup,\n },\n {\n format: DecimalColumnFormatter.FORMAT_MILLIONS,\n group: DecimalFormatContextMenu.presetGroup,\n },\n {\n format: DecimalColumnFormatter.FORMAT_SCIENTIFIC_NOTATION,\n group: DecimalFormatContextMenu.presetGroup,\n },\n {\n format: DecimalColumnFormatter.FORMAT_ROUND,\n group: DecimalFormatContextMenu.presetRoundGroup,\n },\n {\n format: DecimalColumnFormatter.FORMAT_ROUND_TWO_DECIMALS,\n group: DecimalFormatContextMenu.presetRoundGroup,\n },\n {\n format: DecimalColumnFormatter.FORMAT_ROUND_FOUR_DECIMALS,\n group: DecimalFormatContextMenu.presetRoundGroup,\n },\n ];\n\n const defaultFormatOption = FormatContextMenuUtils.makeOption(\n 'Default',\n null,\n DecimalFormatContextMenu.defaultGroup,\n FormatContextMenuUtils.isDefaultSelected(selectedFormat)\n );\n\n const presetFormatOptions = formatItems.map(item =>\n FormatContextMenuUtils.makeOption(\n item.format.label,\n item.format,\n item.group,\n DecimalColumnFormatter.isSameFormat(item.format, selectedFormat)\n )\n );\n\n const isCustomSelected = FormatContextMenuUtils.isCustomSelected(\n selectedFormat\n );\n\n const customFormat = isCustomSelected\n ? selectedFormat\n : DecimalColumnFormatter.makeCustomFormat();\n\n const customFormatOption = FormatContextMenuUtils.makeCustomFormatOption(\n customFormat,\n DecimalFormatContextMenu.customGroup,\n DecimalColumnFormatter.DEFAULT_FORMAT_STRING,\n isCustomSelected,\n formatString => {\n if (formatString != null) {\n const newCustomFormat = DecimalColumnFormatter.makeCustomFormat(\n formatString\n );\n if (DecimalColumnFormatter.isValid(dh, newCustomFormat)) {\n onCustomFormatChange(newCustomFormat);\n }\n } else {\n onCustomFormatChange(null);\n }\n }\n );\n\n return [defaultFormatOption, ...presetFormatOptions, customFormatOption];\n }\n}\n\nexport default DecimalFormatContextMenu;\n"],"mappings":";;;AAAA,SAEEA,sBAAsB,QACjB,wBAAwB;AAAC,OAEzBC,sBAAsB;AAI7B,MAAMC,wBAAwB,CAAC;EAS7B;AACF;AACA;AACA;AACA;AACA;AACA;EACE,OAAOC,UAAU,CACfC,EAAU,EACVC,cAAmC,EACnCC,oBAAiE,EACtC;IAC3B,IAAMC,WAAW,GAAG,CAClB;MACEC,MAAM,EAAER,sBAAsB,CAACS,cAAc;MAC7CC,KAAK,EAAER,wBAAwB,CAACS;IAClC,CAAC,EACD;MACEH,MAAM,EAAER,sBAAsB,CAACY,mBAAmB;MAClDF,KAAK,EAAER,wBAAwB,CAACS;IAClC,CAAC,EACD;MACEH,MAAM,EAAER,sBAAsB,CAACa,eAAe;MAC9CH,KAAK,EAAER,wBAAwB,CAACS;IAClC,CAAC,EACD;MACEH,MAAM,EAAER,sBAAsB,CAACc,0BAA0B;MACzDJ,KAAK,EAAER,wBAAwB,CAACS;IAClC,CAAC,EACD;MACEH,MAAM,EAAER,sBAAsB,CAACe,YAAY;MAC3CL,KAAK,EAAER,wBAAwB,CAACc;IAClC,CAAC,EACD;MACER,MAAM,EAAER,sBAAsB,CAACiB,yBAAyB;MACxDP,KAAK,EAAER,wBAAwB,CAACc;IAClC,CAAC,EACD;MACER,MAAM,EAAER,sBAAsB,CAACkB,0BAA0B;MACzDR,KAAK,EAAER,wBAAwB,CAACc;IAClC,CAAC,CACF;IAED,IAAMG,mBAAmB,GAAGlB,sBAAsB,CAACmB,UAAU,CAC3D,SAAS,EACT,IAAI,EACJlB,wBAAwB,CAACmB,YAAY,EACrCpB,sBAAsB,CAACqB,iBAAiB,CAACjB,cAAc,CAAC,CACzD;IAED,IAAMkB,mBAAmB,GAAGhB,WAAW,CAACiB,GAAG,CAACC,IAAI,IAC9CxB,sBAAsB,CAACmB,UAAU,CAC/BK,IAAI,CAACjB,MAAM,CAACkB,KAAK,EACjBD,IAAI,CAACjB,MAAM,EACXiB,IAAI,CAACf,KAAK,EACVV,sBAAsB,CAAC2B,YAAY,CAACF,IAAI,CAACjB,MAAM,EAAEH,cAAc,CAAC,CACjE,CACF;IAED,IAAMuB,gBAAgB,GAAG3B,sBAAsB,CAAC2B,gBAAgB,CAC9DvB,cAAc,CACf;IAED,IAAMwB,YAAY,GAAGD,gBAAgB,GACjCvB,cAAc,GACdL,sBAAsB,CAAC8B,gBAAgB,EAAE;IAE7C,IAAMC,kBAAkB,GAAG9B,sBAAsB,CAAC+B,sBAAsB,CACtEH,YAAY,EACZ3B,wBAAwB,CAAC+B,WAAW,EACpCjC,sBAAsB,CAACkC,qBAAqB,EAC5CN,gBAAgB,EAChBO,YAAY,IAAI;MACd,IAAIA,YAAY,IAAI,IAAI,EAAE;QACxB,IAAMC,eAAe,GAAGpC,sBAAsB,CAAC8B,gBAAgB,CAC7DK,YAAY,CACb;QACD,IAAInC,sBAAsB,CAACqC,OAAO,CAACjC,EAAE,EAAEgC,eAAe,CAAC,EAAE;UACvD9B,oBAAoB,CAAC8B,eAAe,CAAC;QACvC;MACF,CAAC,MAAM;QACL9B,oBAAoB,CAAC,IAAI,CAAC;MAC5B;IACF,CAAC,CACF;IAED,OAAO,CAACa,mBAAmB,EAAE,GAAGI,mBAAmB,EAAEQ,kBAAkB,CAAC;EAC1E;AACF;AAAC,gBAjGK7B,wBAAwB,kBACN,EAAE;AAAA,gBADpBA,wBAAwB,iBAGP,EAAE;AAAA,gBAHnBA,wBAAwB,sBAKF,EAAE;AAAA,gBALxBA,wBAAwB,iBAOP,EAAE;AA4FzB,eAAeA,wBAAwB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IntegerColumnFormat } from '@deephaven/jsapi-utils';
|
|
2
|
+
import type { dh as DhType } from '@deephaven/jsapi-types';
|
|
2
3
|
import { FormatContextMenuOption } from './FormatContextMenuUtils';
|
|
3
4
|
declare class IntegerFormatContextMenu {
|
|
4
5
|
static defaultGroup: number;
|
|
@@ -6,11 +7,12 @@ declare class IntegerFormatContextMenu {
|
|
|
6
7
|
static customGroup: number;
|
|
7
8
|
/**
|
|
8
9
|
* Creates list of formatting options for Integer context menu
|
|
10
|
+
* @param dh JSAPI instance
|
|
9
11
|
* @param selectedFormat Selected format object, null for no selected format
|
|
10
12
|
* @param onCustomFormatChange Callback to call when the custom format is changed
|
|
11
13
|
* @returns Array of formatting options for the context menu
|
|
12
14
|
*/
|
|
13
|
-
static getOptions(selectedFormat: IntegerColumnFormat, onCustomFormatChange: (value: IntegerColumnFormat | null) => void): FormatContextMenuOption[];
|
|
15
|
+
static getOptions(dh: DhType, selectedFormat: IntegerColumnFormat, onCustomFormatChange: (value: IntegerColumnFormat | null) => void): FormatContextMenuOption[];
|
|
14
16
|
}
|
|
15
17
|
export default IntegerFormatContextMenu;
|
|
16
18
|
//# sourceMappingURL=IntegerFormatContextMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegerFormatContextMenu.d.ts","sourceRoot":"","sources":["../../src/format-context-menus/IntegerFormatContextMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAEpB,MAAM,wBAAwB,CAAC;AAChC,OAA+B,EAC7B,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAElC,cAAM,wBAAwB;IAC5B,MAAM,CAAC,YAAY,SAAM;IAEzB,MAAM,CAAC,WAAW,SAAM;IAExB,MAAM,CAAC,WAAW,SAAM;IAExB
|
|
1
|
+
{"version":3,"file":"IntegerFormatContextMenu.d.ts","sourceRoot":"","sources":["../../src/format-context-menus/IntegerFormatContextMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAEpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAA+B,EAC7B,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAElC,cAAM,wBAAwB;IAC5B,MAAM,CAAC,YAAY,SAAM;IAEzB,MAAM,CAAC,WAAW,SAAM;IAExB,MAAM,CAAC,WAAW,SAAM;IAExB;;;;;;OAMG;IACH,MAAM,CAAC,UAAU,CACf,EAAE,EAAE,MAAM,EACV,cAAc,EAAE,mBAAmB,EACnC,oBAAoB,EAAE,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,KAAK,IAAI,GAChE,uBAAuB,EAAE;CAyD7B;AAED,eAAe,wBAAwB,CAAC"}
|
|
@@ -6,11 +6,12 @@ import FormatContextMenuUtils from "./FormatContextMenuUtils.js";
|
|
|
6
6
|
class IntegerFormatContextMenu {
|
|
7
7
|
/**
|
|
8
8
|
* Creates list of formatting options for Integer context menu
|
|
9
|
+
* @param dh JSAPI instance
|
|
9
10
|
* @param selectedFormat Selected format object, null for no selected format
|
|
10
11
|
* @param onCustomFormatChange Callback to call when the custom format is changed
|
|
11
12
|
* @returns Array of formatting options for the context menu
|
|
12
13
|
*/
|
|
13
|
-
static getOptions(selectedFormat, onCustomFormatChange) {
|
|
14
|
+
static getOptions(dh, selectedFormat, onCustomFormatChange) {
|
|
14
15
|
var formatItems = [{
|
|
15
16
|
format: IntegerColumnFormatter.FORMAT_MILLIONS,
|
|
16
17
|
group: IntegerFormatContextMenu.presetGroup
|
|
@@ -25,7 +26,7 @@ class IntegerFormatContextMenu {
|
|
|
25
26
|
var customFormatOption = FormatContextMenuUtils.makeCustomFormatOption(customFormat, IntegerFormatContextMenu.customGroup, IntegerColumnFormatter.DEFAULT_FORMAT_STRING, isCustomSelected, formatString => {
|
|
26
27
|
if (formatString != null) {
|
|
27
28
|
var newCustomFormat = IntegerColumnFormatter.makeCustomFormat(formatString);
|
|
28
|
-
if (IntegerColumnFormatter.isValid(newCustomFormat)) {
|
|
29
|
+
if (IntegerColumnFormatter.isValid(dh, newCustomFormat)) {
|
|
29
30
|
onCustomFormatChange(newCustomFormat);
|
|
30
31
|
}
|
|
31
32
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegerFormatContextMenu.js","names":["IntegerColumnFormatter","FormatContextMenuUtils","IntegerFormatContextMenu","getOptions","selectedFormat","onCustomFormatChange","formatItems","format","FORMAT_MILLIONS","group","presetGroup","FORMAT_SCIENTIFIC_NOTATION","defaultFormatOption","makeOption","defaultGroup","isDefaultSelected","presetFormatOptions","map","item","label","isSameFormat","isCustomSelected","customFormat","makeCustomFormat","customFormatOption","makeCustomFormatOption","customGroup","DEFAULT_FORMAT_STRING","formatString","newCustomFormat","isValid"],"sources":["../../src/format-context-menus/IntegerFormatContextMenu.ts"],"sourcesContent":["import {\n IntegerColumnFormat,\n IntegerColumnFormatter,\n} from '@deephaven/jsapi-utils';\nimport FormatContextMenuUtils, {\n FormatContextMenuOption,\n} from './FormatContextMenuUtils';\n\nclass IntegerFormatContextMenu {\n static defaultGroup = 10;\n\n static presetGroup = 20;\n\n static customGroup = 30;\n\n /**\n * Creates list of formatting options for Integer context menu\n * @param selectedFormat Selected format object, null for no selected format\n * @param onCustomFormatChange Callback to call when the custom format is changed\n * @returns Array of formatting options for the context menu\n */\n static getOptions(\n selectedFormat: IntegerColumnFormat,\n onCustomFormatChange: (value: IntegerColumnFormat | null) => void\n ): FormatContextMenuOption[] {\n const formatItems = [\n {\n format: IntegerColumnFormatter.FORMAT_MILLIONS,\n group: IntegerFormatContextMenu.presetGroup,\n },\n {\n format: IntegerColumnFormatter.FORMAT_SCIENTIFIC_NOTATION,\n group: IntegerFormatContextMenu.presetGroup,\n },\n ];\n\n const defaultFormatOption = FormatContextMenuUtils.makeOption(\n 'Default',\n null,\n IntegerFormatContextMenu.defaultGroup,\n FormatContextMenuUtils.isDefaultSelected(selectedFormat)\n );\n\n const presetFormatOptions = formatItems.map(item =>\n FormatContextMenuUtils.makeOption(\n item.format.label,\n item.format,\n item.group,\n IntegerColumnFormatter.isSameFormat(item.format, selectedFormat)\n )\n );\n\n const isCustomSelected = FormatContextMenuUtils.isCustomSelected(\n selectedFormat\n );\n\n const customFormat = isCustomSelected\n ? selectedFormat\n : IntegerColumnFormatter.makeCustomFormat();\n\n const customFormatOption = FormatContextMenuUtils.makeCustomFormatOption(\n customFormat,\n IntegerFormatContextMenu.customGroup,\n IntegerColumnFormatter.DEFAULT_FORMAT_STRING,\n isCustomSelected,\n formatString => {\n if (formatString != null) {\n const newCustomFormat = IntegerColumnFormatter.makeCustomFormat(\n formatString\n );\n if (IntegerColumnFormatter.isValid(newCustomFormat)) {\n onCustomFormatChange(newCustomFormat);\n }\n } else {\n onCustomFormatChange(null);\n }\n }\n );\n\n return [defaultFormatOption, ...presetFormatOptions, customFormatOption];\n }\n}\n\nexport default IntegerFormatContextMenu;\n"],"mappings":";;;AAAA,SAEEA,sBAAsB,QACjB,wBAAwB;AAAC,
|
|
1
|
+
{"version":3,"file":"IntegerFormatContextMenu.js","names":["IntegerColumnFormatter","FormatContextMenuUtils","IntegerFormatContextMenu","getOptions","dh","selectedFormat","onCustomFormatChange","formatItems","format","FORMAT_MILLIONS","group","presetGroup","FORMAT_SCIENTIFIC_NOTATION","defaultFormatOption","makeOption","defaultGroup","isDefaultSelected","presetFormatOptions","map","item","label","isSameFormat","isCustomSelected","customFormat","makeCustomFormat","customFormatOption","makeCustomFormatOption","customGroup","DEFAULT_FORMAT_STRING","formatString","newCustomFormat","isValid"],"sources":["../../src/format-context-menus/IntegerFormatContextMenu.ts"],"sourcesContent":["import {\n IntegerColumnFormat,\n IntegerColumnFormatter,\n} from '@deephaven/jsapi-utils';\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport FormatContextMenuUtils, {\n FormatContextMenuOption,\n} from './FormatContextMenuUtils';\n\nclass IntegerFormatContextMenu {\n static defaultGroup = 10;\n\n static presetGroup = 20;\n\n static customGroup = 30;\n\n /**\n * Creates list of formatting options for Integer context menu\n * @param dh JSAPI instance\n * @param selectedFormat Selected format object, null for no selected format\n * @param onCustomFormatChange Callback to call when the custom format is changed\n * @returns Array of formatting options for the context menu\n */\n static getOptions(\n dh: DhType,\n selectedFormat: IntegerColumnFormat,\n onCustomFormatChange: (value: IntegerColumnFormat | null) => void\n ): FormatContextMenuOption[] {\n const formatItems = [\n {\n format: IntegerColumnFormatter.FORMAT_MILLIONS,\n group: IntegerFormatContextMenu.presetGroup,\n },\n {\n format: IntegerColumnFormatter.FORMAT_SCIENTIFIC_NOTATION,\n group: IntegerFormatContextMenu.presetGroup,\n },\n ];\n\n const defaultFormatOption = FormatContextMenuUtils.makeOption(\n 'Default',\n null,\n IntegerFormatContextMenu.defaultGroup,\n FormatContextMenuUtils.isDefaultSelected(selectedFormat)\n );\n\n const presetFormatOptions = formatItems.map(item =>\n FormatContextMenuUtils.makeOption(\n item.format.label,\n item.format,\n item.group,\n IntegerColumnFormatter.isSameFormat(item.format, selectedFormat)\n )\n );\n\n const isCustomSelected = FormatContextMenuUtils.isCustomSelected(\n selectedFormat\n );\n\n const customFormat = isCustomSelected\n ? selectedFormat\n : IntegerColumnFormatter.makeCustomFormat();\n\n const customFormatOption = FormatContextMenuUtils.makeCustomFormatOption(\n customFormat,\n IntegerFormatContextMenu.customGroup,\n IntegerColumnFormatter.DEFAULT_FORMAT_STRING,\n isCustomSelected,\n formatString => {\n if (formatString != null) {\n const newCustomFormat = IntegerColumnFormatter.makeCustomFormat(\n formatString\n );\n if (IntegerColumnFormatter.isValid(dh, newCustomFormat)) {\n onCustomFormatChange(newCustomFormat);\n }\n } else {\n onCustomFormatChange(null);\n }\n }\n );\n\n return [defaultFormatOption, ...presetFormatOptions, customFormatOption];\n }\n}\n\nexport default IntegerFormatContextMenu;\n"],"mappings":";;;AAAA,SAEEA,sBAAsB,QACjB,wBAAwB;AAAC,OAEzBC,sBAAsB;AAI7B,MAAMC,wBAAwB,CAAC;EAO7B;AACF;AACA;AACA;AACA;AACA;AACA;EACE,OAAOC,UAAU,CACfC,EAAU,EACVC,cAAmC,EACnCC,oBAAiE,EACtC;IAC3B,IAAMC,WAAW,GAAG,CAClB;MACEC,MAAM,EAAER,sBA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AGI,mBAAmB,EAAEQ,kBAAkB,CAAC;EAC1E;AACF;AAAC,gBA3EKvB,wBAAwB,kBACN,EAAE;AAAA,gBADpBA,wBAAwB,iBAGP,EAAE;AAAA,gBAHnBA,wBAAwB,iBAKP,EAAE;AAwEzB,eAAeA,wBAAwB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IrisGridColumnSelectMouseHandler.js","names":["GridMouseHandler","IrisGridColumnSelectMouseHandler","constructor","irisGrid","cursor","isActive","isSelectingColumn","props","isValidColumn","tableColumn","columnSelectionValidator","updateColumnSelectionStatus","getTableColumn","columnIndex","model","modelColumn","getModelColumn","columns","onMove","gridPoint","columnAllowedCursor","columnNotAllowedCursor","column","setState","hoverSelectColumn","onWheel","preventDefault","stopPropagation","onLeave","onDown","onClick","selectColumn"],"sources":["../../src/mousehandlers/IrisGridColumnSelectMouseHandler.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\nimport {\n GridMouseHandler,\n GridPoint,\n EventHandlerResult,\n} from '@deephaven/grid';\nimport type { Column } from '@deephaven/jsapi-
|
|
1
|
+
{"version":3,"file":"IrisGridColumnSelectMouseHandler.js","names":["GridMouseHandler","IrisGridColumnSelectMouseHandler","constructor","irisGrid","cursor","isActive","isSelectingColumn","props","isValidColumn","tableColumn","columnSelectionValidator","updateColumnSelectionStatus","getTableColumn","columnIndex","model","modelColumn","getModelColumn","columns","onMove","gridPoint","columnAllowedCursor","columnNotAllowedCursor","column","setState","hoverSelectColumn","onWheel","preventDefault","stopPropagation","onLeave","onDown","onClick","selectColumn"],"sources":["../../src/mousehandlers/IrisGridColumnSelectMouseHandler.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\nimport {\n GridMouseHandler,\n GridPoint,\n EventHandlerResult,\n} from '@deephaven/grid';\nimport type { Column } from '@deephaven/jsapi-types';\nimport { IrisGrid } from '../IrisGrid';\n\n/**\n * Handles interaction with tables when the Linker tool is active\n */\nclass IrisGridColumnSelectMouseHandler extends GridMouseHandler {\n constructor(irisGrid: IrisGrid) {\n super();\n\n this.irisGrid = irisGrid;\n this.cursor = null;\n }\n\n private irisGrid: IrisGrid;\n\n private isActive(): boolean {\n const { isSelectingColumn } = this.irisGrid.props;\n return isSelectingColumn;\n }\n\n private isValidColumn(tableColumn: Column | null): boolean {\n if (tableColumn == null) {\n return false;\n }\n\n const { columnSelectionValidator } = this.irisGrid.props;\n if (columnSelectionValidator != null) {\n return columnSelectionValidator(tableColumn);\n }\n return true;\n }\n\n private updateColumnSelectionStatus(): void {\n const { columnSelectionValidator } = this.irisGrid.props;\n if (columnSelectionValidator != null) {\n columnSelectionValidator(null);\n }\n }\n\n private getTableColumn(columnIndex: number | null): Column | null {\n if (columnIndex == null) {\n return null;\n }\n\n const { model } = this.irisGrid.props;\n const modelColumn = this.irisGrid.getModelColumn(columnIndex);\n if (modelColumn == null) {\n return null;\n }\n\n return model.columns[modelColumn];\n }\n\n onMove(gridPoint: GridPoint): EventHandlerResult {\n if (!this.isActive()) {\n return false;\n }\n\n const { columnAllowedCursor, columnNotAllowedCursor } = this.irisGrid.props;\n const { column } = gridPoint;\n const tableColumn = this.getTableColumn(column);\n\n if (this.isValidColumn(tableColumn)) {\n this.cursor = columnAllowedCursor;\n this.irisGrid.setState({ hoverSelectColumn: column });\n } else {\n this.cursor = columnNotAllowedCursor;\n this.irisGrid.setState({ hoverSelectColumn: null });\n }\n\n return true;\n }\n\n // keeps linker cursor state during wheel event\n onWheel(gridPoint: GridPoint): EventHandlerResult {\n if (!this.isActive()) {\n return false;\n }\n\n const { columnAllowedCursor, columnNotAllowedCursor } = this.irisGrid.props;\n const { column } = gridPoint;\n const tableColumn = this.getTableColumn(column);\n\n if (this.isValidColumn(tableColumn)) {\n this.cursor = columnAllowedCursor;\n this.irisGrid.setState({ hoverSelectColumn: column });\n } else {\n this.cursor = columnNotAllowedCursor;\n this.irisGrid.setState({ hoverSelectColumn: null });\n }\n\n // don't block wheel event from scrolling\n return { preventDefault: false, stopPropagation: false };\n }\n\n onLeave(): EventHandlerResult {\n if (this.isActive()) {\n this.irisGrid.setState({ hoverSelectColumn: null });\n }\n\n this.updateColumnSelectionStatus();\n\n return false;\n }\n\n onDown(): EventHandlerResult {\n return this.isActive();\n }\n\n onClick(gridPoint: GridPoint): EventHandlerResult {\n if (!this.isActive()) {\n return false;\n }\n\n const { column } = gridPoint;\n const tableColumn = this.getTableColumn(column);\n if (tableColumn != null && this.isValidColumn(tableColumn)) {\n this.irisGrid.selectColumn(tableColumn);\n }\n\n return true;\n }\n}\n\nexport default IrisGridColumnSelectMouseHandler;\n"],"mappings":";;;AAAA;AACA,SACEA,gBAAgB,QAGX,iBAAiB;AAIxB;AACA;AACA;AACA,MAAMC,gCAAgC,SAASD,gBAAgB,CAAC;EAC9DE,WAAW,CAACC,QAAkB,EAAE;IAC9B,KAAK,EAAE;IAAC;IAER,IAAI,CAACA,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACC,MAAM,GAAG,IAAI;EACpB;EAIQC,QAAQ,GAAY;IAC1B,IAAM;MAAEC;IAAkB,CAAC,GAAG,IAAI,CAACH,QAAQ,CAACI,KAAK;IACjD,OAAOD,iBAAiB;EAC1B;EAEQE,aAAa,CAACC,WAA0B,EAAW;IACzD,IAAIA,WAAW,IAAI,IAAI,EAAE;MACvB,OAAO,KAAK;IACd;IAEA,IAAM;MAAEC;IAAyB,CAAC,GAAG,IAAI,CAACP,QAAQ,CAACI,KAAK;IACxD,IAAIG,wBAAwB,IAAI,IAAI,EAAE;MACpC,OAAOA,wBAAwB,CAACD,WAAW,CAAC;IAC9C;IACA,OAAO,IAAI;EACb;EAEQE,2BAA2B,GAAS;IAC1C,IAAM;MAAED;IAAyB,CAAC,GAAG,IAAI,CAACP,QAAQ,CAACI,KAAK;IACxD,IAAIG,wBAAwB,IAAI,IAAI,EAAE;MACpCA,wBAAwB,CAAC,IAAI,CAAC;IAChC;EACF;EAEQE,cAAc,CAACC,WAA0B,EAAiB;IAChE,IAA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@deephaven/components';
|
|
3
3
|
import { EventHandlerResult, Grid, GridMouseHandler, GridPoint, ModelIndex } from '@deephaven/grid';
|
|
4
|
-
import { Column, FilterCondition, FilterValue, Sort } from '@deephaven/jsapi-
|
|
4
|
+
import type { Column, dh as DhType, FilterCondition, FilterValue, Sort } from '@deephaven/jsapi-types';
|
|
5
5
|
import { TableColumnFormat, SortDirection } from '@deephaven/jsapi-utils';
|
|
6
6
|
import type { DebouncedFunc } from 'lodash';
|
|
7
7
|
import './IrisGridContextMenuHandler.scss';
|
|
@@ -43,20 +43,21 @@ declare class IrisGridContextMenuHandler extends GridMouseHandler {
|
|
|
43
43
|
* Converts operator to text string,
|
|
44
44
|
*/
|
|
45
45
|
static getOperatorAsText(operator: '&&' | '||'): 'And' | 'Or';
|
|
46
|
-
/**
|
|
47
|
-
* Gets an equality filter for the provided numeric value
|
|
48
|
-
* @param column The column to make the filter for
|
|
49
|
-
* @param value The value to get the equality filter for
|
|
50
|
-
*/
|
|
51
|
-
static getNumberValueEqualsFilter(column: Column, value: number): FilterCondition;
|
|
52
|
-
static getFilterValueForNumberOrChar(columnType: string, value: unknown): FilterValue;
|
|
53
46
|
static getRowOptionFormatted(command: string, cellValue: string, len?: number): string;
|
|
54
47
|
irisGrid: IrisGrid;
|
|
55
48
|
debouncedUpdateCustomFormat: DebouncedFunc<(modelIndex: number, selectedFormat: TableColumnFormat | null) => void>;
|
|
56
|
-
constructor(irisGrid: IrisGrid);
|
|
49
|
+
constructor(irisGrid: IrisGrid, dh: DhType);
|
|
57
50
|
componentWillUnmount(): void;
|
|
51
|
+
dh: DhType;
|
|
58
52
|
getHeaderActions(modelIndex: ModelIndex, gridPoint: GridPoint): ContextAction[];
|
|
59
53
|
getCellActions(modelColumn: number | undefined | null, grid: Grid, gridPoint: GridPoint): ContextAction[];
|
|
54
|
+
/**
|
|
55
|
+
* Gets an equality filter for the provided numeric value
|
|
56
|
+
* @param column The column to make the filter for
|
|
57
|
+
* @param value The value to get the equality filter for
|
|
58
|
+
*/
|
|
59
|
+
getNumberValueEqualsFilter(column: Column, value: number): FilterCondition;
|
|
60
|
+
getFilterValueForNumberOrChar(columnType: string, value: unknown): FilterValue;
|
|
60
61
|
onContextMenu(gridPoint: GridPoint, grid: Grid, event: React.MouseEvent<Element, MouseEvent>): EventHandlerResult;
|
|
61
62
|
dateFormatActions(column: Column): ContextAction[];
|
|
62
63
|
numberFormatActions(column: Column): ContextAction[] | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IrisGridContextMenuHandler.d.ts","sourceRoot":"","sources":["../../src/mousehandlers/IrisGridContextMenuHandler.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,OAAO,EACL,aAAa,EAId,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,IAAI,EACJ,gBAAgB,EAChB,SAAS,EAIT,UAAU,EACX,MAAM,iBAAiB,CAAC;AACzB,
|
|
1
|
+
{"version":3,"file":"IrisGridContextMenuHandler.d.ts","sourceRoot":"","sources":["../../src/mousehandlers/IrisGridContextMenuHandler.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,OAAO,EACL,aAAa,EAId,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,IAAI,EACJ,gBAAgB,EAChB,SAAS,EAIT,UAAU,EACX,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,MAAM,EACN,EAAE,IAAI,MAAM,EACZ,eAAe,EACf,WAAW,EACX,IAAI,EACL,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAIL,iBAAiB,EAEjB,aAAa,EACd,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAO5C,OAAO,mCAAmC,CAAC;AAE3C,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MA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