@deephaven/iris-grid 0.37.4-logout.17 → 0.37.4-logout.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AdvancedFilterCreator.js.map +1 -1
- package/dist/AdvancedFilterCreatorFilterItem.js.map +1 -1
- package/dist/AdvancedFilterCreatorSelectValue.js.map +1 -1
- package/dist/AdvancedFilterCreatorSelectValueList.js.map +1 -1
- package/dist/ColumnHeaderGroup.js.map +1 -1
- package/dist/ColumnStatistics.js +2 -1
- package/dist/ColumnStatistics.js.map +1 -1
- package/dist/CrossColumnSearch.js.map +1 -1
- package/dist/FilterInputField.js.map +1 -1
- package/dist/GotoRow.js.map +1 -1
- package/dist/IrisGrid.css +3 -1
- package/dist/IrisGrid.css.map +1 -1
- package/dist/IrisGrid.js +3 -10
- package/dist/IrisGrid.js.map +1 -1
- package/dist/IrisGridBottomBar.js.map +1 -1
- package/dist/IrisGridCellOverflowModal.js.map +1 -1
- package/dist/IrisGridCopyHandler.js +4 -3
- package/dist/IrisGridCopyHandler.js.map +1 -1
- package/dist/IrisGridMetricCalculator.js.map +1 -1
- package/dist/IrisGridModel.js +0 -138
- package/dist/IrisGridModel.js.map +1 -1
- package/dist/IrisGridModelFactory.js.map +1 -1
- package/dist/IrisGridModelUpdater.js.map +1 -1
- package/dist/IrisGridPartitionSelector.js.map +1 -1
- package/dist/IrisGridProxyModel.js +6 -5
- package/dist/IrisGridProxyModel.js.map +1 -1
- package/dist/IrisGridRenderer.js.map +1 -1
- package/dist/IrisGridTableModel.js.map +1 -1
- package/dist/IrisGridTableModelTemplate.js +0 -6
- package/dist/IrisGridTableModelTemplate.js.map +1 -1
- package/dist/IrisGridTestUtils.js.map +1 -1
- package/dist/IrisGridTheme.module.css +2 -1
- package/dist/IrisGridTheme.module.css.map +1 -1
- package/dist/IrisGridTreeTableModel.js.map +1 -1
- package/dist/IrisGridUtils.js +0 -3
- package/dist/IrisGridUtils.js.map +1 -1
- package/dist/MissingKeyError.js.map +1 -1
- package/dist/PartitionSelectorSearch.js.map +1 -1
- package/dist/PendingDataBottomBar.js.map +1 -1
- package/dist/TableViewportUpdater.js +0 -3
- package/dist/TableViewportUpdater.js.map +1 -1
- package/dist/ToastBottomBar.js.map +1 -1
- package/dist/TreeTableViewportUpdater.js.map +1 -1
- package/dist/format-context-menus/CustomFormatAction.js.map +1 -1
- package/dist/format-context-menus/DateTimeFormatContextMenu.js.map +1 -1
- package/dist/format-context-menus/DecimalFormatContextMenu.js.map +1 -1
- package/dist/format-context-menus/FormatContextMenuUtils.js.map +1 -1
- package/dist/format-context-menus/IntegerFormatContextMenu.js.map +1 -1
- package/dist/key-handlers/ClearFilterKeyHandler.js.map +1 -1
- package/dist/key-handlers/CopyKeyHandler.js.map +1 -1
- package/dist/key-handlers/ReverseKeyHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridCellOverflowMouseHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridColumnSelectMouseHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridColumnTooltipMouseHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridContextMenuHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridDataSelectMouseHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridFilterMouseHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridRowTreeMouseHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridSortMouseHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridTokenMouseHandler.js +2 -1
- package/dist/mousehandlers/IrisGridTokenMouseHandler.js.map +1 -1
- package/dist/mousehandlers/PendingMouseHandler.js +0 -5
- package/dist/mousehandlers/PendingMouseHandler.js.map +1 -1
- package/dist/sidebar/AdvancedSettings.js.map +1 -1
- package/dist/sidebar/AdvancedSettingsMenu.js.map +1 -1
- package/dist/sidebar/AdvancedSettingsType.js +3 -3
- package/dist/sidebar/AdvancedSettingsType.js.map +1 -1
- package/dist/sidebar/ChartBuilder.js.map +1 -1
- package/dist/sidebar/CustomColumnBuilder.js.map +1 -1
- package/dist/sidebar/CustomColumnInput.js.map +1 -1
- package/dist/sidebar/InputEditor.js.map +1 -1
- package/dist/sidebar/OptionType.js +3 -3
- package/dist/sidebar/OptionType.js.map +1 -1
- package/dist/sidebar/RollupRows.js.map +1 -1
- package/dist/sidebar/SelectDistinctBuilder.js.map +1 -1
- package/dist/sidebar/TableCsvExporter.js.map +1 -1
- package/dist/sidebar/TableSaver.js +0 -4
- package/dist/sidebar/TableSaver.js.map +1 -1
- package/dist/sidebar/aggregations/AggregationEdit.js +3 -3
- package/dist/sidebar/aggregations/AggregationEdit.js.map +1 -1
- package/dist/sidebar/aggregations/AggregationOperation.js +3 -3
- package/dist/sidebar/aggregations/AggregationOperation.js.map +1 -1
- package/dist/sidebar/aggregations/AggregationUtils.js.map +1 -1
- package/dist/sidebar/aggregations/Aggregations.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ColumnFormatEditor.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionEditor.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormatEditor.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingAPIUtils.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingMenu.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.js +21 -21
- package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.js.map +1 -1
- package/dist/sidebar/conditional-formatting/RowFormatEditor.js.map +1 -1
- package/dist/sidebar/conditional-formatting/StyleEditor.js.map +1 -1
- package/dist/sidebar/icons/BarIcon.js.map +1 -1
- package/dist/sidebar/icons/FormatColumnWhereIcon.js.map +1 -1
- package/dist/sidebar/icons/FormatRowWhereIcon.js.map +1 -1
- package/dist/sidebar/icons/HistogramIcon.js.map +1 -1
- package/dist/sidebar/icons/LineIcon.js.map +1 -1
- package/dist/sidebar/icons/PieIcon.js.map +1 -1
- package/dist/sidebar/icons/ScatterIcon.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilder.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilderUtils.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingGroup.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingItem.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/PointerSensorWithInteraction.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTree.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTreeInner.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTreeItem.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/TreeItem.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/keyboardCoordinates.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/types.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/utilities.js.map +1 -1
- package/package.json +15 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PendingDataBottomBar.js","names":["React","useEffect","useMemo","useRef","useState","FontAwesomeIcon","vsPass","vsWarning","Button","LoadingSpinner","usePrevious","IrisGridBottomBar","HIDE_TIMEOUT","MAX_NUMBER_ROWS_SHOWN","PendingDataBottomBar","
|
|
1
|
+
{"version":3,"file":"PendingDataBottomBar.js","names":["React","useEffect","useMemo","useRef","useState","FontAwesomeIcon","vsPass","vsWarning","Button","LoadingSpinner","usePrevious","IrisGridBottomBar","HIDE_TIMEOUT","MAX_NUMBER_ROWS_SHOWN","PendingDataBottomBar","isSaving","onSave","onDiscard","discardTooltip","saveTooltip","error","pendingDataErrors","pendingDataMap","onEntering","onEntered","onExiting","onExited","isSuccessShown","setIsSuccessShown","wasSuccessShown","setWasSuccessShown","successTimeout","prevIsSaving","errorMessage","size","Array","from","keys","join","trim","showSuccessMessage","current","setTimeout","hideSuccessMessage","clearTimeout","cleanupTimeout","undefined","pendingRowCount","commitIcon"],"sources":["../src/PendingDataBottomBar.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useRef, useState } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { vsPass, vsWarning } from '@deephaven/icons';\nimport { Button, LoadingSpinner } from '@deephaven/components';\nimport { usePrevious } from '@deephaven/react-hooks';\nimport IrisGridBottomBar from './IrisGridBottomBar';\nimport './PendingDataBottomBar.scss';\nimport { PendingDataErrorMap, PendingDataMap } from './CommonTypes';\n\nconst HIDE_TIMEOUT = 3000;\n\nconst MAX_NUMBER_ROWS_SHOWN = 5;\n\nexport type PendingDataBottomBarProps = {\n onSave: () => Promise<void>;\n onDiscard: () => Promise<void>;\n discardTooltip?: string;\n saveTooltip?: string;\n isSaving?: boolean;\n error?: string | null;\n pendingDataErrors: PendingDataErrorMap;\n pendingDataMap: PendingDataMap;\n onEntering?: () => void;\n onEntered?: () => void;\n onExiting?: () => void;\n onExited?: () => void;\n};\n\nexport function PendingDataBottomBar({\n isSaving = false,\n onSave,\n onDiscard,\n discardTooltip,\n saveTooltip,\n error,\n pendingDataErrors,\n pendingDataMap,\n onEntering,\n onEntered,\n onExiting,\n onExited,\n}: PendingDataBottomBarProps): JSX.Element {\n const [isSuccessShown, setIsSuccessShown] = useState(false);\n const [wasSuccessShown, setWasSuccessShown] = useState(false);\n const successTimeout = useRef<ReturnType<typeof setTimeout>>();\n const prevIsSaving = usePrevious(isSaving);\n const errorMessage = useMemo(() => {\n if (pendingDataErrors.size === 0) {\n return error;\n }\n if (pendingDataErrors.size <= MAX_NUMBER_ROWS_SHOWN) {\n return `Key can't be empty (on pending row${\n pendingDataErrors.size > 1 ? 's' : ''\n } ${Array.from(pendingDataErrors.keys()).join(', ').trim()})`;\n }\n return `Key can't be empty (on ${pendingDataErrors.size} rows)`;\n }, [error, pendingDataErrors]);\n\n useEffect(\n function showSuccessMessage() {\n if (\n prevIsSaving != null &&\n prevIsSaving &&\n !isSaving &&\n errorMessage == null\n ) {\n setIsSuccessShown(true);\n setWasSuccessShown(true);\n successTimeout.current = setTimeout(() => {\n setIsSuccessShown(false);\n }, HIDE_TIMEOUT);\n }\n },\n [errorMessage, isSaving, prevIsSaving]\n );\n\n useEffect(\n function hideSuccessMessage() {\n if (successTimeout.current && pendingDataMap.size > 0) {\n // A change just occurred while the success message was still being shown, just hide the success message\n clearTimeout(successTimeout.current);\n setIsSuccessShown(false);\n setWasSuccessShown(false);\n }\n },\n [pendingDataMap]\n );\n\n useEffect(function cleanupTimeout() {\n return () =>\n successTimeout.current ? clearTimeout(successTimeout.current) : undefined;\n }, []);\n\n const pendingRowCount = pendingDataMap.size;\n let commitIcon;\n if (isSaving) {\n commitIcon = <LoadingSpinner />;\n } else if (wasSuccessShown) {\n commitIcon = vsPass;\n }\n\n return (\n <IrisGridBottomBar\n className=\"pending-data-bottom-bar\"\n isShown={pendingRowCount > 0 || isSuccessShown || errorMessage != null}\n onEntering={onEntering}\n onEntered={onEntered}\n onExiting={onExiting}\n onExited={() => {\n setWasSuccessShown(false);\n if (onExited) {\n onExited();\n }\n }}\n >\n {errorMessage != null && errorMessage !== '' && (\n <div className=\"error-message\">\n <FontAwesomeIcon icon={vsWarning} />\n <span>{`${errorMessage}`}</span>\n </div>\n )}\n {(errorMessage == null || errorMessage === '') && (\n <div className=\"status-message\">\n {pendingRowCount > 0 && (\n <span>{`${pendingRowCount} row${\n pendingRowCount > 1 ? 's' : ''\n } pending`}</span>\n )}\n </div>\n )}\n <div className=\"buttons-container\">\n {!isSaving && !wasSuccessShown && (\n <Button kind=\"secondary\" onClick={onDiscard} tooltip={discardTooltip}>\n Discard\n </Button>\n )}\n <Button\n kind={wasSuccessShown ? 'success' : 'primary'}\n onClick={onSave}\n icon={commitIcon}\n disabled={isSaving || wasSuccessShown || errorMessage != null}\n tooltip={saveTooltip}\n >\n {isSaving && `Committing...`}\n {!isSaving && wasSuccessShown && `Success`}\n {!isSaving && !wasSuccessShown && `Commit`}\n </Button>\n </div>\n </IrisGridBottomBar>\n );\n}\n\nexport default PendingDataBottomBar;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACnE,SAASC,eAAe,QAAQ,gCAAgC;AAChE,SAASC,MAAM,EAAEC,SAAS,QAAQ,kBAAkB;AACpD,SAASC,MAAM,EAAEC,cAAc,QAAQ,uBAAuB;AAC9D,SAASC,WAAW,QAAQ,wBAAwB;AAAC,OAC9CC,iBAAiB;AAAA;AAIxB,IAAMC,YAAY,GAAG,IAAI;AAEzB,IAAMC,qBAAqB,GAAG,CAAC;AAiB/B,OAAO,SAASC,oBAAoB,OAaO;EAAA,IAbN;IACnCC,QAAQ,GAAG,KAAK;IAChBC,MAAM;IACNC,SAAS;IACTC,cAAc;IACdC,WAAW;IACXC,KAAK;IACLC,iBAAiB;IACjBC,cAAc;IACdC,UAAU;IACVC,SAAS;IACTC,SAAS;IACTC,QAAQ,EAARA;EACyB,CAAC;EAC1B,IAAM,CAACC,cAAc,EAAEC,iBAAiB,CAAC,GAAGxB,QAAQ,CAAC,KAAK,CAAC;EAC3D,IAAM,CAACyB,eAAe,EAAEC,kBAAkB,CAAC,GAAG1B,QAAQ,CAAC,KAAK,CAAC;EAC7D,IAAM2B,cAAc,GAAG5B,MAAM,EAAiC;EAC9D,IAAM6B,YAAY,GAAGtB,WAAW,CAACK,QAAQ,CAAC;EAC1C,IAAMkB,YAAY,GAAG/B,OAAO,CAAC,MAAM;IACjC,IAAImB,iBAAiB,CAACa,IAAI,KAAK,CAAC,EAAE;MAChC,OAAOd,KAAK;IACd;IACA,IAAIC,iBAAiB,CAACa,IAAI,IAAIrB,qBAAqB,EAAE;MACnD,mDACEQ,iBAAiB,CAACa,IAAI,GAAG,CAAC,GAAG,GAAG,GAAG,EAAE,cACnCC,KAAK,CAAC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CACY;AAExB;AAEA,eAAef,oBAAoB"}
|
|
@@ -18,14 +18,12 @@ class TableViewportUpdater extends PureComponent {
|
|
|
18
18
|
constructor() {
|
|
19
19
|
super(...arguments);
|
|
20
20
|
_defineProperty(this, "subscription", void 0);
|
|
21
|
-
// eslint-disable-next-line class-methods-use-this
|
|
22
21
|
_defineProperty(this, "getViewportRowRange", memoize((table, top, bottom) => {
|
|
23
22
|
var viewHeight = bottom - top;
|
|
24
23
|
var viewportTop = Math.max(0, top - viewHeight * TableViewportUpdater.ROW_BUFFER_PAGES);
|
|
25
24
|
var viewportBottom = bottom + viewHeight * TableViewportUpdater.ROW_BUFFER_PAGES;
|
|
26
25
|
return [viewportTop, viewportBottom];
|
|
27
26
|
}));
|
|
28
|
-
// eslint-disable-next-line class-methods-use-this
|
|
29
27
|
_defineProperty(this, "getViewportColumns", memoize((table, left, right, movedColumns) => {
|
|
30
28
|
if (left == null || right == null) {
|
|
31
29
|
return null;
|
|
@@ -140,7 +138,6 @@ class TableViewportUpdater extends PureComponent {
|
|
|
140
138
|
return null;
|
|
141
139
|
}
|
|
142
140
|
}
|
|
143
|
-
// Number of pages to buffer for rows/columns
|
|
144
141
|
_defineProperty(TableViewportUpdater, "ROW_BUFFER_PAGES", 3);
|
|
145
142
|
_defineProperty(TableViewportUpdater, "COLUMN_BUFFER_PAGES", 1);
|
|
146
143
|
_defineProperty(TableViewportUpdater, "defaultProps", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableViewportUpdater.js","names":["PureComponent","memoize","throttle","GridUtils","Log","log","module","UPDATE_THROTTLE","TableViewportUpdater","constructor","arguments","_defineProperty","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;EAAAS,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA;IAsFA;IAAAA,eAAA,8BACsBV,OAAO,CAAC,CAACW,KAAY,EAAEC,GAAW,EAAEC,MAAc,KAAK;MAC3E,IAAMC,UAAU,GAAGD,MAAM,GAAGD,GAAG;MAC/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AK,CAAC,6BAA6B,EAAEZ,aAAa,CAAC;MACvDnC,KAAK,CAACsC,kBAAkB,CAACH,aAAa,CAAC;IACzC;IAEA,IAAI,CAACI,cAAc,CAACtC,GAAG,EAAEC,MAAM,EAAEO,IAAI,EAAEC,KAAK,EAAEO,OAAO,CAAC;EACxD;EAEA+B,oBAAoBA,CAAA,EAAS;IAC3B,IAAI,CAACF,iBAAiB,CAAC,CAAC;EAC1B;EAiDAA,iBAAiBA,CAAA,EAAS;IACxBrD,GAAG,CAACgC,MAAM,CAAC,mBAAmB,EAAE,IAAI,CAACI,YAAY,CAAC;IAClD,IAAI,IAAI,CAACA,YAAY,EAAE;MACrB,IAAI,CAACA,YAAY,CAACoB,KAAK,CAAC,CAAC;MACzB,IAAI,CAACpB,YAAY,GAAGqB,SAAS;MAE7B,IAAM;QAAEnB;MAAe,CAAC,GAAG,IAAI,CAACL,KAAK;MACrCK,cAAc,CAAC,CAAC;IAClB;IAEA,IAAI,CAACQ,cAAc,CAACY,MAAM,CAAC,CAAC;EAC9B;EAuDAC,MAAMA,CAAA,EAAS;IACb,OAAO,IAAI;EACb;AACF;AAvME;AAAArD,eAAA,CAJIH,oBAAoB,sBAKE,CAAC;AAAAG,eAAA,CALvBH,oBAAoB,yBAOK,CAAC;AAAAG,eAAA,CAP1BH,oBAAoB,kBASF;EACpBK,GAAG,EAAE,CAAC;EACNC,MAAM,EAAE,CAAC;EACTO,IAAI,EAAE,IAAI;EACVC,KAAK,EAAE,IAAI;EACXO,OAAO,EAAE,IAAI;EACbc,cAAc,EAAEA,CAAA,KAAYmB,SAAS;EACrCjB,OAAO,EAAE,EAAE;EACXC,KAAK,EAAE,EAAE;EACTC,aAAa,EAAE,EAAE;EACjBxB,YAAY,EAAE;AAChB,CAAC;AAyLH,eAAef,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 {\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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ottomBar.js","names":["React","useCallback","useEffect","useRef","useState","usePrevious","IrisGridBottomBar","HIDE_TIMEOUT","ToastBottomBar","
|
|
1
|
+
{"version":3,"file":"ToastBottomBar.js","names":["React","useCallback","useEffect","useRef","useState","usePrevious","IrisGridBottomBar","HIDE_TIMEOUT","ToastBottomBar","children","onEntering","onEntered","onExiting","onExited","isShown","setIsShown","timeout","prevChildren","startTimer","current","clearTimeout","setTimeout","undefined"],"sources":["../src/ToastBottomBar.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { usePrevious } from '@deephaven/react-hooks';\nimport IrisGridBottomBar from './IrisGridBottomBar';\nimport './PendingDataBottomBar.scss';\n\nconst HIDE_TIMEOUT = 3000;\n\nexport type ToastBottomBarProps = {\n children?: React.ReactNode;\n onEntering?: () => void;\n onEntered?: () => void;\n onExiting?: () => void;\n onExited?: () => void;\n};\n\nexport function ToastBottomBar({\n children = null,\n onEntering,\n onEntered,\n onExiting,\n onExited,\n}: ToastBottomBarProps): JSX.Element {\n const [isShown, setIsShown] = useState(false);\n const timeout = useRef<ReturnType<typeof setTimeout>>();\n const prevChildren = usePrevious(children);\n\n const startTimer = useCallback(() => {\n setIsShown(true);\n if (timeout.current) {\n clearTimeout(timeout.current);\n }\n timeout.current = setTimeout(() => {\n setIsShown(false);\n }, HIDE_TIMEOUT);\n }, [setIsShown, timeout]);\n\n useEffect(() => {\n if (prevChildren !== children && children != null) {\n startTimer();\n }\n }, [children, prevChildren, setIsShown, startTimer]);\n\n useEffect(\n () => () => (timeout.current ? clearTimeout(timeout.current) : undefined),\n []\n );\n\n return (\n <IrisGridBottomBar\n className=\"toast-bottom-bar\"\n isShown={isShown}\n onEntering={onEntering}\n onEntered={onEntered}\n onExiting={onExiting}\n onExited={onExited}\n >\n {children}\n </IrisGridBottomBar>\n );\n}\n\nexport default ToastBottomBar;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAE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,QAAQ,EAAEC;EAAS,GAElBJ,QAAQ,CACS;AAExB;AAEA,eAAeD,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeTableViewportUpdater.js","names":["PureComponent","throttle","dh","Log","log","module","UPDATE_THROTTLE","TreeTableViewportUpdater","constructor","props","
|
|
1
|
+
{"version":3,"file":"TreeTableViewportUpdater.js","names":["PureComponent","throttle","dh","Log","log","module","UPDATE_THROTTLE","TreeTableViewportUpdater","constructor","props","top","bottom","error","debug2","table","updateInterval","viewSize","viewportTop","Math","max","viewportBottom","listenerCleanup","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 dh, {\n EventListener,\n FilterCondition,\n RemoverFn,\n Sort,\n Table,\n} from '@deephaven/jsapi-shim';\nimport Log from '@deephaven/log';\n\nconst log = Log.module('TreeTableViewportUpdater');\n\nconst UPDATE_THROTTLE = 150;\n\ninterface TreeTableViewportUpdaterProps {\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 { 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;AACtC,OAAOC,EAAE,MAMF,uBAAuB;AAC9B,OAAOC,GAAG,MAAM,gBAAgB;AAEhC,IAAMC,GAAG,GAAGD,GAAG,CAACE,MAAM,CAAC,0BAA0B,CAAC;AAElD,IAAMC,eAAe,GAAG,GAAG;AAY3B;AACA;AACA;AACA;AACA,MAAMC,wBAAwB,SA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,wBAAwB,CAACiC;AAC3C,CAAC;AA+EH,eAAejC,wBAAwB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomFormatAction.js","names":["React","Component","Tooltip","DOMUtils","CustomFormatAction","constructor","props","
|
|
1
|
+
{"version":3,"file":"CustomFormatAction.js","names":["React","Component","Tooltip","DOMUtils","CustomFormatAction","constructor","props","defaultProps","handleInputChange","bind","handleKeyDown","inputRef","createRef","onChange","current","value","closeContextMenu","forwardedProps","closeMenu","revertToDefault","returnFocusToContextMenu","parentContextMenu","getClosestByClassName","HTMLElement","focus","event","key","stopPropagation","render","formatString","placeholder","title","menuItem","description","iconElement","focusInput"],"sources":["../../src/format-context-menus/CustomFormatAction.tsx"],"sourcesContent":["import React, { Component } from 'react';\nimport { Tooltip } from '@deephaven/components';\nimport { DOMUtils } from '@deephaven/utils';\n\nimport './CustomFormatAction.scss';\n\ntype CustomFormatActionProps = typeof CustomFormatAction.defaultProps & {\n forwardedProps: {\n menuItem: {\n title?: string;\n description?: string;\n };\n };\n};\n\n/**\n * Renders menuElement option with custom format input for use in formatting context menus\n *\n * TODO:\n * - capture focus when this menu action is selected via ArrowUp/ArrowDown keys\n * - dynamically update selected menu item when clicking on the input box\n */\nclass CustomFormatAction extends Component<CustomFormatActionProps> {\n static defaultProps = {\n formatString: '',\n forwardedProps: {\n menuItem: {},\n closeMenu(focusInput: boolean): void {\n // no-op\n },\n iconElement: null,\n },\n placeholder: '',\n title: '',\n onChange(value: string | null): void {\n // no-op\n },\n };\n\n constructor(\n props: CustomFormatActionProps = CustomFormatAction.defaultProps\n ) {\n super(props);\n\n this.handleInputChange = this.handleInputChange.bind(this);\n this.handleKeyDown = this.handleKeyDown.bind(this);\n\n this.inputRef = React.createRef();\n }\n\n inputRef: React.RefObject<HTMLInputElement>;\n\n handleInputChange(): void {\n const { onChange } = this.props;\n if (this.inputRef.current) {\n onChange(this.inputRef.current.value);\n }\n }\n\n closeContextMenu(): void {\n const { forwardedProps } = this.props;\n const { closeMenu } = forwardedProps;\n closeMenu(true);\n }\n\n revertToDefault(): void {\n const { onChange } = this.props;\n onChange(null);\n }\n\n returnFocusToContextMenu(): void {\n const parentContextMenu = DOMUtils.getClosestByClassName(\n this.inputRef.current,\n 'context-menu-container'\n );\n if (parentContextMenu instanceof HTMLElement) {\n parentContextMenu.focus();\n }\n }\n\n handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n switch (event.key) {\n case 'Enter':\n event.stopPropagation();\n this.closeContextMenu();\n break;\n case 'Escape':\n event.stopPropagation();\n this.revertToDefault();\n this.closeContextMenu();\n break;\n case 'ArrowRight':\n case 'ArrowLeft':\n event.stopPropagation();\n break;\n case 'ArrowUp':\n case 'ArrowDown':\n this.returnFocusToContextMenu();\n break;\n default:\n event.stopPropagation();\n }\n }\n\n render(): JSX.Element {\n const { formatString, forwardedProps, placeholder, title } = this.props;\n const {\n menuItem: { description },\n iconElement,\n } = forwardedProps;\n return (\n <div className=\"form-group flex-grow mb-0\">\n <div className=\"custom-format-title\">\n <span className=\"icon\">{iconElement}</span>\n <label className=\"title mb-0\" htmlFor=\"custom-format-input\">\n {title}\n {description != null && <Tooltip>{description}</Tooltip>}\n </label>\n </div>\n <div className=\"pl-2 pr-2 pb-2\">\n <input\n id=\"custom-format-input\"\n className=\"form-control text-right mb-0\"\n type=\"text\"\n defaultValue={formatString}\n ref={this.inputRef}\n placeholder={placeholder}\n onKeyDown={this.handleKeyDown}\n onChange={this.handleInputChange}\n autoComplete=\"off\"\n autoCorrect=\"off\"\n autoCapitalize=\"off\"\n spellCheck=\"false\"\n />\n </div>\n </div>\n );\n }\n}\n\nexport default CustomFormatAction;\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,QAAQ,QAAQ,kBAAkB;AAAC;AAa5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,kBAAkB,SAASH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,QAAQ,EAAE,CAAC,CAAC;IACZd,SAAS,CAACiB,UAAmB,EAAQ;MACnC;IAAA,CACD;IACDD,WAAW,EAAE;EACf,CAAC;EACDJ,WAAW,EAAE,EAAE;EACfC,KAAK,EAAE,EAAE;EACTlB,QAAQ,CAACE,KAAoB,EAAQ;IACnC;EAAA;AAEJ,CAAC;AAuGH,eAAeX,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeFormatContextMenu.js","names":["DateTimeColumnFormatter","TableUtils","FormatContextMenuUtils","DateTimeFormatContextMenu","getOptions","formatter","selectedFormat","currentTime","Date","formatItems","group","dateGroup","formatString","timeGroup","dateTimeGroup","presetFormatOptions","map","item","format","makeFormat","TYPE_CONTEXT_PRESET","title","getFormattedString","dataType","DATETIME","makeOption","isSameFormat","defaultOption","isDefaultSelected"
|
|
1
|
+
{"version":3,"file":"DateTimeFormatContextMenu.js","names":["DateTimeColumnFormatter","TableUtils","FormatContextMenuUtils","DateTimeFormatContextMenu","getOptions","formatter","selectedFormat","currentTime","Date","formatItems","group","dateGroup","formatString","timeGroup","dateTimeGroup","presetFormatOptions","map","item","format","makeFormat","TYPE_CONTEXT_PRESET","title","getFormattedString","dataType","DATETIME","makeOption","isSameFormat","defaultOption","isDefaultSelected"],"sources":["../../src/format-context-menus/DateTimeFormatContextMenu.ts"],"sourcesContent":["import {\n DateTimeColumnFormatter,\n Formatter,\n TableColumnFormat,\n TableUtils,\n} from '@deephaven/jsapi-utils';\nimport FormatContextMenuUtils, {\n FormatContextMenuOption,\n} from './FormatContextMenuUtils';\n\nclass DateTimeFormatContextMenu {\n static dateGroup = 10;\n\n static timeGroup = 20;\n\n static dateTimeGroup = 30;\n\n /**\n * Creates list of formatting options for DateTime context menu\n * @param formatter Formatter instance\n * @param selectedFormat Selected format object, null for no selected format\n * @returns Array of formatting options for the context menu\n */\n static getOptions(\n formatter: Formatter,\n selectedFormat: TableColumnFormat | null\n ): FormatContextMenuOption[] {\n const currentTime = new Date();\n const formatItems = [\n {\n group: DateTimeFormatContextMenu.dateGroup,\n formatString: 'yyyy-MM-dd',\n },\n {\n group: DateTimeFormatContextMenu.dateGroup,\n formatString: 'MM-dd-yyyy',\n },\n\n {\n group: DateTimeFormatContextMenu.timeGroup,\n formatString: 'HH:mm:ss',\n },\n {\n group: DateTimeFormatContextMenu.timeGroup,\n formatString: 'HH:mm:ss.SSS',\n },\n {\n group: DateTimeFormatContextMenu.timeGroup,\n formatString: 'HH:mm:ss.SSSSSSSSS',\n },\n\n {\n group: DateTimeFormatContextMenu.dateTimeGroup,\n formatString: `yyyy-MM-dd HH:mm:ss`,\n },\n {\n group: DateTimeFormatContextMenu.dateTimeGroup,\n formatString: `yyyy-MM-dd HH:mm:ss.SSS`,\n },\n {\n group: DateTimeFormatContextMenu.dateTimeGroup,\n formatString: `yyyy-MM-dd HH:mm:ss.SSSSSSSSS`,\n },\n ];\n\n const presetFormatOptions = formatItems.map(item => {\n const format = DateTimeColumnFormatter.makeFormat(\n '',\n item.formatString,\n DateTimeColumnFormatter.TYPE_CONTEXT_PRESET\n );\n const title = formatter.getFormattedString(\n currentTime,\n TableUtils.dataType.DATETIME,\n '',\n format\n );\n\n return FormatContextMenuUtils.makeOption(\n title,\n format,\n item.group,\n DateTimeColumnFormatter.isSameFormat(format, selectedFormat)\n );\n });\n\n const defaultOption = FormatContextMenuUtils.makeOption(\n 'Default',\n null,\n DateTimeFormatContextMenu.dateGroup,\n FormatContextMenuUtils.isDefaultSelected(selectedFormat)\n );\n\n return [defaultOption, ...presetFormatOptions];\n }\n}\n\nexport default DateTimeFormatContextMenu;\n"],"mappings":";;;AAAA,SACEA,uBAAuB,EAGvBC,UAAU,QACL,wBAAwB;AAAC,OACzBC,sBAAsB;AAI7B,MAAMC,yBAAyB,CAAC;EAO9B;AACF;AACA;AACA;AACA;AACA;EACE,OAAOC,UAAU,CACfC,SAAoB,EACpBC,cAAwC,EACb;IAC3B,IAAMC,WAAW,GAAG,IAAI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AAS,EACnCT,sBAAsB,CAAC0B,iBAAiB,CAACtB,cAAc,CAAC,CACzD;IAED,OAAO,CAACqB,aAAa,EAAE,GAAGZ,mBAAmB,CAAC;EAChD;AACF;AAAC,gBArFKZ,yBAAyB,eACV,EAAE;AAAA,gBADjBA,yBAAyB,eAGV,EAAE;AAAA,gBAHjBA,yBAAyB,mBAKN,EAAE;AAkF3B,eAAeA,yBAAyB"}
|
|
@@ -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"
|
|
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,OACzBC,sBAAsB;AAI7B,MAAMC,wBAAwB,CAAC;EAS7B;AACF;AACA;AACA;AACA;AACA;EACE,OAAOC,UAAU,CACfC,cAAmC,EACnCC,oBAAiE,EACtC;IAC3B,IAAMC,WAAW,GAAG,CAClB;MACEC,MAAM,EAAEP,sBAAsB,CAACQ,cAAc;MAC7CC,KAAK,EAAEP,wBAAwB,CAACQ;IAClC,CAAC,EACD;MACEH,MAAM,EAAEP,sBAAsB,CAACW,mBAAmB;MAClDF,KAAK,EAAEP,wBAAwB,CAACQ;IAClC,CAAC,EACD;MACEH,MAAM,EAAEP,sBAAsB,CAACY,eAAe;MAC9CH,KAAK,EAAEP,wBAAwB,CAACQ;IAClC,CAAC,EACD;MACEH,MAAM,EAAEP,sBAAsB,CAACa,0BAA0B;MACzDJ,KAAK,EAAEP,wBAAwB,CAACQ;IAClC,CAAC,EACD;MACEH,MAAM,EAAEP,sBAAsB,CAACc,YAAY;MAC3CL,KAAK,EAAEP,wBAAwB,CAACa;IAClC,CAAC,EACD;MACER,MAAM,EAAEP,sBAAsB,CAACgB,yBAAyB;MACxDP,KAAK,EAAEP,wBAAwB,CAACa;IAClC,CAAC,EACD;MACER,MAAM,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AwB,kBACN,EAAE;AAAA,gBADpBA,wBAAwB,iBAGP,EAAE;AAAA,gBAHnBA,wBAAwB,sBAKF,EAAE;AAAA,gBALxBA,wBAAwB,iBAOP,EAAE;AA0FzB,eAAeA,wBAAwB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormatContextMenuUtils.js","names":["React","TableColumnFormatter","CustomFormatAction","FormatContextMenuUtils","isDefaultSelected","selectedFormat","TYPE_CONTEXT_CUSTOM","TYPE_CONTEXT_PRESET","includes","type","isCustomSelected","makeOption","title","format","group","isSelected","description","makeCustomFormatOption","placeholder","onChange","label","menuElement","
|
|
1
|
+
{"version":3,"file":"FormatContextMenuUtils.js","names":["React","TableColumnFormatter","CustomFormatAction","FormatContextMenuUtils","isDefaultSelected","selectedFormat","TYPE_CONTEXT_CUSTOM","TYPE_CONTEXT_PRESET","includes","type","isCustomSelected","makeOption","title","format","group","isSelected","description","makeCustomFormatOption","placeholder","onChange","label","menuElement","formatString"],"sources":["../../src/format-context-menus/FormatContextMenuUtils.tsx"],"sourcesContent":["import React from 'react';\nimport {\n TableColumnFormat,\n TableColumnFormatter,\n} from '@deephaven/jsapi-utils';\nimport CustomFormatAction from './CustomFormatAction';\n\nexport interface FormatContextMenuOption {\n title: string;\n description: string;\n group: number;\n format: TableColumnFormat | null;\n isSelected: boolean;\n}\n\nexport interface CustomFormatOption extends FormatContextMenuOption {\n menuElement: React.ReactElement;\n}\n\nclass FormatContextMenuUtils {\n /**\n * Returns true if default option should be active in the context menu\n * @param selectedFormat selected format object or null\n */\n static isDefaultSelected(selectedFormat: TableColumnFormat | null): boolean {\n return (\n !selectedFormat ||\n ![\n TableColumnFormatter.TYPE_CONTEXT_CUSTOM,\n TableColumnFormatter.TYPE_CONTEXT_PRESET,\n ].includes(selectedFormat.type)\n );\n }\n\n /**\n * Returns true if custom format option should be active in the context menu\n * @param selectedFormat selected format object or null\n */\n static isCustomSelected(selectedFormat: TableColumnFormat): boolean {\n return (\n selectedFormat != null &&\n selectedFormat.type === TableColumnFormatter.TYPE_CONTEXT_CUSTOM\n );\n }\n\n /**\n * Creates context menu option\n * @param title Context menu title\n * @param format Format object\n * @param group Context menu group\n * @param isSelected Is current option selected\n */\n static makeOption(\n title: string,\n format: TableColumnFormat | null,\n group: number,\n isSelected: boolean\n ): FormatContextMenuOption {\n return {\n title,\n description: title,\n group,\n format,\n isSelected,\n };\n }\n\n /**\n * Creates context menu option with an input element\n * @param format Format object\n * @param group Context menu group\n * @param placeholder Input element placeholder\n * @param isSelected Is current option selected\n * @param onChange Input element onChange callback\n */\n static makeCustomFormatOption(\n format: TableColumnFormat,\n group: number,\n placeholder: string,\n isSelected: boolean,\n onChange: (value: string | null) => void\n ): CustomFormatOption {\n return {\n title: format.label,\n description: format.label,\n format,\n group,\n isSelected,\n menuElement: (\n <CustomFormatAction\n formatString={format.formatString}\n title={format.label}\n placeholder={placeholder}\n onChange={onChange}\n />\n ),\n };\n }\n}\n\nexport default FormatContextMenuUtils;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAEEC,oBAAoB,QACf,wBAAwB;AAAC,OACzBC,kBAAkB;AAczB,MAAMC,sBAAsB,CAAC;EAC3B;AACF;AACA;AACA;EACE,OAAOC,iBAAiB,CAACC,cAAwC,EAAW;IAC1E,OACE,CAACA,cAAc,IACf,CAAC,CACCJ,oBAAoB,CAACK,mBAAmB,EACxCL,oBAAoB,CAACM,mBAAmB,CACzC,CAACC,QAAQ,CAACH,cAAc,CAACI,IAAI,CAAC;EAEnC;;EAEA;AACF;AACA;AACA;EACE,OAAOC,gBAAgB,CAACL,cAAiC,EAAW;IAClE,OACEA,cAAc,IAAI,IAAI,IACtBA,cAAc,CAACI,IAAI,KAAKR,oBAAoB,CAACK,mBAAmB;EAEpE;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACE,OAAOK,UAAU,CACfC,KAAa,EACbC,MAAgC,EAChCC,KAAa,EACbC,UAAmB,EACM;IACzB,OAAO;MACLH,KAAK;MACLI,WAAW,EAAEJ,KAAK;MAClBE,KAAK;MACLD,MAAM;MACNE;IACF,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAOE,sBAAsB,CAC3BJ,MAAyB,EACzBC,KAAa,EACbI,WAAmB,EACnBH,UAAmB,EACnBI,QAAwC,EACpB;IACpB,OAAO;MACLP,KAAK,EAAEC,MAAM,CAACO,KAAK;MACnBJ,WAAW,EAAEH,MAAM,CAACO,KAAK;MACzBP,MAAM;MACNC,KAAK;MACLC,UAAU;MACVM,WAAW,eACT,oBAAC,kBAAkB;QACjB,YAAY,EAAER,MAAM,CAACS,YAAa;QAClC,KAAK,EAAET,MAAM,CAACO,KAAM;QACpB,WAAW,EAAEF,WAAY;QACzB,QAAQ,EAAEC;MAAS;IAGzB,CAAC;EACH;AACF;AAEA,eAAehB,sBAAsB"}
|
|
@@ -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"
|
|
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,OACzBC,sBAAsB;AAI7B,MAAMC,wBAAwB,CAAC;EAO7B;AACF;AACA;AACA;AACA;AACA;EACE,OAAOC,UAAU,CACfC,cAAmC,EACnCC,oBAAiE,EACtC;IAC3B,IAAMC,WAAW,GAAG,CAClB;MACEC,MAAM,EAAEP,sBAAsB,CAACQ,eAAe;MAC9CC,KAAK,EAAEP,wBAAwB,CAACQ;IAClC,CAAC,EACD;MACEH,MAAM,EAAEP,sBAAsB,CAACW,0BAA0B;MACzDF,KAAK,EAAEP,wBAAwB,CAACQ;IAClC,CAAC,CACF;IAED,IAAME,mBAAmB,GAAGX,sBAAsB,CAACY,UAAU,CAC3D,SAAS,EACT,IAAI,EACJX,wBAAwB,CAACY,YAAY,EACrCb,sBAAsB,CAACc,iBAAiB,CAACX,cAAc,CAAC,CACzD;IAED,IAAMY,mBAAmB,GAAGV,WAAW,CAACW,GAAG,CAACC,IAAI,IAC9CjB,sBAAsB,CAACY,UAAU,CAC/BK,IAAI,CAACX,MAAM,CAACY,KAAK,EACjBD,IAAI,CAACX,MAAM,EACXW,IAAI,CAACT,KAAK,EACVT,sBAAsB,CAACoB,YAAY,CAACF,IAAI,CAACX,MAAM,EAAEH,cAAc,CAAC,CACjE,CACF;IAED,IAAMiB,gBAAgB,GAAGpB,sBAAsB,CAACoB,gBAAgB,CAC9DjB,cAAc,CACf;IAED,IAAMkB,YAAY,GAAGD,gBAAgB,GACjCjB,cAAc,GACdJ,sBAAsB,CAACuB,gBAAgB,EAAE;IAE7C,IAAMC,kBAAkB,GAAGvB,sBAAsB,CAACwB,sBAAsB,CACtEH,YAAY,EACZpB,wBAAwB,CAACwB,WAAW,EACpC1B,sBAAsB,CAAC2B,qBAAqB,EAC5CN,gBAAgB,EAChBO,YAAY,IAAI;MACd,IAAIA,YAAY,IAAI,IAAI,EAAE;QACxB,IAAMC,eAAe,GAAG7B,sBAAsB,CAACuB,gBAAgB,CAC7DK,YAAY,CACb;QACD,IAAI5B,sBAAsB,CAAC8B,OAAO,CAACD,eAAe,CAAC,EAAE;UACnDxB,oBAAoB,CAACwB,eAAe,CAAC;QACvC;MACF,CAAC,MAAM;QACLxB,oBAAoB,CAAC,IAAI,CAAC;MAC5B;IACF,CAAC,CACF;IAED,OAAO,CAACO,mBAAmB,EAAE,GAAGI,mBAAmB,EAAEQ,kBAAkB,CAAC;EAC1E;AACF;AAAC,gBAzEKtB,wBAAwB,kBACN,EAAE;AAAA,gBADpBA,wBAAwB,iBAGP,EAAE;AAAA,gBAHnBA,wBAAwB,iBAKP,EAAE;AAsEzB,eAAeA,wBAAwB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClearFilterKeyHandler.js","names":["KeyHandler","IrisGridShortcuts","ClearFilterKeyHandler","constructor","irisGrid","
|
|
1
|
+
{"version":3,"file":"ClearFilterKeyHandler.js","names":["KeyHandler","IrisGridShortcuts","ClearFilterKeyHandler","constructor","irisGrid","onDown","event","TABLE","CLEAR_FILTERS","matchesEvent","clearAllFilters"],"sources":["../../src/key-handlers/ClearFilterKeyHandler.ts"],"sourcesContent":["import { KeyboardEvent } from 'react';\nimport { KeyHandler } from '@deephaven/grid';\nimport { IrisGrid } from '../IrisGrid';\nimport IrisGridShortcuts from '../IrisGridShortcuts';\n\nclass ClearFilterKeyHandler extends KeyHandler {\n private irisGrid: IrisGrid;\n\n constructor(irisGrid: IrisGrid) {\n super();\n\n this.irisGrid = irisGrid;\n }\n\n onDown(event: KeyboardEvent): boolean {\n if (IrisGridShortcuts.TABLE.CLEAR_FILTERS.matchesEvent(event)) {\n this.irisGrid.clearAllFilters();\n return true;\n }\n return false;\n }\n}\n\nexport default ClearFilterKeyHandler;\n"],"mappings":";;;AACA,SAASA,UAAU,QAAQ,iBAAiB;AAAC,OAEtCC,iBAAiB;AAExB,MAAMC,qBAAqB,SAASF,UAAU,CAAC;EAG7CG,WAAW,CAACC,QAAkB,EAAE;IAC9B,KAAK,EAAE;IAAC;IAER,IAAI,CAACA,QAAQ,GAAGA,QAAQ;EAC1B;EAEAC,MAAM,CAACC,KAAoB,EAAW;IACpC,IAAIL,iBAAiB,CAACM,KAAK,CAACC,aAAa,CAACC,YAAY,CAACH,KAAK,CAAC,EAAE;MAC7D,IAAI,CAACF,QAAQ,CAACM,eAAe,EAAE;MAC/B,OAAO,IAAI;IACb;IACA,OAAO,KAAK;EACd;AACF;AAEA,eAAeR,qBAAqB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopyKeyHandler.js","names":["ContextActionUtils","KeyHandler","IrisGridUtils","CopyKeyHandler","constructor","irisGrid","
|
|
1
|
+
{"version":3,"file":"CopyKeyHandler.js","names":["ContextActionUtils","KeyHandler","IrisGridUtils","CopyKeyHandler","constructor","irisGrid","onDown","event","selectedRanges","state","key","isModifierKeyDown","isValidSnapshotRanges","copyRanges"],"sources":["../../src/key-handlers/CopyKeyHandler.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\nimport { KeyboardEvent } from 'react';\nimport { ContextActionUtils } from '@deephaven/components';\nimport { KeyHandler } from '@deephaven/grid';\nimport { IrisGrid } from '../IrisGrid';\nimport IrisGridUtils from '../IrisGridUtils';\n\nclass CopyKeyHandler extends KeyHandler {\n private irisGrid: IrisGrid;\n\n constructor(irisGrid: IrisGrid) {\n super();\n\n this.irisGrid = irisGrid;\n }\n\n onDown(event: KeyboardEvent): boolean {\n const { selectedRanges } = this.irisGrid.state;\n if (event.key === 'c' && ContextActionUtils.isModifierKeyDown(event)) {\n if (IrisGridUtils.isValidSnapshotRanges(selectedRanges)) {\n this.irisGrid.copyRanges(selectedRanges);\n } else {\n this.irisGrid.copyRanges(\n selectedRanges,\n false,\n false,\n 'Invalid copy ranges'\n );\n }\n return true;\n }\n return false;\n }\n}\n\nexport default CopyKeyHandler;\n"],"mappings":";;;AAAA;;AAEA,SAASA,kBAAkB,QAAQ,uBAAuB;AAC1D,SAASC,UAAU,QAAQ,iBAAiB;AAAC,OAEtCC,aAAa;AAEpB,MAAMC,cAAc,SAASF,UAAU,CAAC;EAGtCG,WAAW,CAACC,QAAkB,EAAE;IAC9B,KAAK,EAAE;IAAC;IAER,IAAI,CAACA,QAAQ,GAAGA,QAAQ;EAC1B;EAEAC,MAAM,CAACC,KAAoB,EAAW;IACpC,IAAM;MAAEC;IAAe,CAAC,GAAG,IAAI,CAACH,QAAQ,CAACI,KAAK;IAC9C,IAAIF,KAAK,CAACG,GAAG,KAAK,GAAG,IAAIV,kBAAkB,CAACW,iBAAiB,CAACJ,KAAK,CAAC,EAAE;MACpE,IAAIL,aAAa,CAACU,qBAAqB,CAACJ,cAAc,CAAC,EAAE;QACvD,IAAI,CAACH,QAAQ,CAACQ,UAAU,CAACL,cAAc,CAAC;MAC1C,CAAC,MAAM;QACL,IAAI,CAACH,QAAQ,CAACQ,UAAU,CACtBL,cAAc,EACd,KAAK,EACL,KAAK,EACL,qBAAqB,CACtB;MACH;MACA,OAAO,IAAI;IACb;IACA,OAAO,KAAK;EACd;AACF;AAEA,eAAeL,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReverseKeyHandler.js","names":["KeyHandler","TableUtils","IrisGridShortcuts","ReverseKeyHandler","constructor","irisGrid","
|
|
1
|
+
{"version":3,"file":"ReverseKeyHandler.js","names":["KeyHandler","TableUtils","IrisGridShortcuts","ReverseKeyHandler","constructor","irisGrid","onDown","event","TABLE","REVERSE","matchesEvent","isReversible","reverseType","state","REVERSE_TYPE","NONE","reverse","POST_SORT"],"sources":["../../src/key-handlers/ReverseKeyHandler.ts"],"sourcesContent":["import { KeyboardEvent } from 'react';\nimport { KeyHandler } from '@deephaven/grid';\nimport { TableUtils } from '@deephaven/jsapi-utils';\nimport { IrisGrid } from '../IrisGrid';\nimport IrisGridShortcuts from '../IrisGridShortcuts';\n\nclass ReverseKeyHandler extends KeyHandler {\n private irisGrid: IrisGrid;\n\n constructor(irisGrid: IrisGrid) {\n super();\n\n this.irisGrid = irisGrid;\n }\n\n onDown(event: KeyboardEvent): boolean {\n if (IrisGridShortcuts.TABLE.REVERSE.matchesEvent(event)) {\n if (!this.irisGrid.isReversible()) {\n return false;\n }\n const { reverseType } = this.irisGrid.state;\n if (reverseType === TableUtils.REVERSE_TYPE.NONE) {\n this.irisGrid.reverse(TableUtils.REVERSE_TYPE.POST_SORT);\n } else {\n this.irisGrid.reverse(TableUtils.REVERSE_TYPE.NONE);\n }\n return true;\n }\n return false;\n }\n}\n\nexport default ReverseKeyHandler;\n"],"mappings":";;;AACA,SAASA,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,UAAU,QAAQ,wBAAwB;AAAC,OAE7CC,iBAAiB;AAExB,MAAMC,iBAAiB,SAASH,UAAU,CAAC;EAGzCI,WAAW,CAACC,QAAkB,EAAE;IAC9B,KAAK,EAAE;IAAC;IAER,IAAI,CAACA,QAAQ,GAAGA,QAAQ;EAC1B;EAEAC,MAAM,CAACC,KAAoB,EAAW;IACpC,IAAIL,iBAAiB,CAACM,KAAK,CAACC,OAAO,CAACC,YAAY,CAACH,KAAK,CAAC,EAAE;MACvD,IAAI,CAAC,IAAI,CAACF,QAAQ,CAACM,YAAY,EAAE,EAAE;QACjC,OAAO,KAAK;MACd;MACA,IAAM;QAAEC;MAAY,CAAC,GAAG,IAAI,CAACP,QAAQ,CAACQ,KAAK;MAC3C,IAAID,WAAW,KAAKX,UAAU,CAACa,YAAY,CAACC,IAAI,EAAE;QAChD,IAAI,CAACV,QAAQ,CAACW,OAAO,CAACf,UAAU,CAACa,YAAY,CAACG,SAAS,CAAC;MAC1D,CAAC,MAAM;QACL,IAAI,CAACZ,QAAQ,CAACW,OAAO,CAACf,UAAU,CAACa,YAAY,CAACC,IAAI,CAAC;MACrD;MACA,OAAO,IAAI;IACb;IACA,OAAO,KAAK;EACd;AACF;AAEA,eAAeZ,iBAAiB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IrisGridCellOverflowMouseHandler.js","names":["GridMouseHandler","deepEqual","IrisGridCellOverflowMouseHandler","constructor","irisGrid","
|
|
1
|
+
{"version":3,"file":"IrisGridCellOverflowMouseHandler.js","names":["GridMouseHandler","deepEqual","IrisGridCellOverflowMouseHandler","constructor","irisGrid","destroyColumnTooltip","setState","overflowButtonTooltipProps","setCursor","point","isHoveringOverflowButton","cursor","stopPropagation","preventDefault","getButtonPosition","x","y","column","row","renderer","grid","state","props","metrics","model","canvasContext","context","theme","getTheme","rendererState","mouseX","mouseY","left","top","width","height","getCellOverflowButtonPosition","shouldRenderOverflowButton","onMove","newProps","onWheel","onDown","showOverflowModal","overflowText","getValueForCell","onContextMenu","onLeave"],"sources":["../../src/mousehandlers/IrisGridCellOverflowMouseHandler.ts"],"sourcesContent":["import {\n GridPoint,\n GridMouseHandler,\n EventHandlerResult,\n} from '@deephaven/grid';\nimport deepEqual from 'deep-equal';\nimport type IrisGrid from '../IrisGrid';\nimport { IrisGridRenderState } from '../IrisGridRenderer';\n\n/**\n * Handles cursor and click action for cell overflow button\n * The button is rendered via IrisGridRenderer\n */\nclass IrisGridCellOverflowMouseHandler extends GridMouseHandler {\n private irisGrid: IrisGrid;\n\n constructor(irisGrid: IrisGrid) {\n super(850); // Needs to be before GridSelectionMouseHandler\n\n this.irisGrid = irisGrid;\n }\n\n private destroyColumnTooltip(): void {\n this.irisGrid.setState({ overflowButtonTooltipProps: null });\n }\n\n private setCursor(point: GridPoint): EventHandlerResult {\n if (this.isHoveringOverflowButton(point)) {\n this.cursor = 'pointer';\n return { stopPropagation: false, preventDefault: false };\n }\n\n this.cursor = null;\n return false;\n }\n\n private getButtonPosition({\n x,\n y,\n column,\n row,\n }: GridPoint): {\n left: number;\n top: number;\n width: number;\n height: number;\n } | null {\n if (column == null || row == null) {\n return null;\n }\n const { renderer, grid, state, props } = this.irisGrid;\n if (!grid) {\n return null;\n }\n const { metrics } = state;\n const { model } = props;\n\n const { canvasContext: context } = grid;\n const theme = grid.getTheme();\n const rendererState = {\n context,\n mouseX: x,\n mouseY: y,\n metrics,\n model,\n theme,\n };\n\n const { left, top, width, height } = renderer.getCellOverflowButtonPosition(\n rendererState\n );\n if (left == null || width == null || top == null || height == null) {\n return null;\n }\n\n return { left, top, width, height };\n }\n\n private isHoveringOverflowButton(point: GridPoint): boolean {\n const { x, y } = point;\n const { left, top, width, height } = this.getButtonPosition(point) ?? {};\n if (left == null || width == null || top == null || height == null) {\n return false;\n }\n\n const { renderer, grid, state, props } = this.irisGrid;\n if (!grid) {\n return false;\n }\n const { metrics } = state;\n const { model } = props;\n const { canvasContext: context } = grid;\n const theme = grid.getTheme();\n const rendererState = {\n context,\n mouseX: x,\n mouseY: y,\n metrics,\n model,\n theme,\n } as IrisGridRenderState;\n\n return (\n renderer.shouldRenderOverflowButton(rendererState) &&\n x >= left &&\n x <= left + width &&\n y >= top &&\n y <= top + height\n );\n }\n\n onMove(point: GridPoint): EventHandlerResult {\n if (this.isHoveringOverflowButton(point)) {\n const { overflowButtonTooltipProps } = this.irisGrid.state;\n const newProps = this.getButtonPosition(point);\n if (!deepEqual(overflowButtonTooltipProps, newProps)) {\n this.irisGrid.setState({ overflowButtonTooltipProps: newProps });\n }\n } else {\n this.destroyColumnTooltip();\n }\n return this.setCursor(point);\n }\n\n onWheel(point: GridPoint): EventHandlerResult {\n this.destroyColumnTooltip();\n return this.onMove(point);\n }\n\n // Needs to be onDown and not onClick b/c of GridSelectionMouseHandler shifting cell onDown\n onDown(point: GridPoint): boolean {\n this.destroyColumnTooltip();\n const { column, row } = point;\n\n if (this.isHoveringOverflowButton(point)) {\n this.irisGrid.setState({\n showOverflowModal: true,\n overflowText: this.irisGrid.getValueForCell(column, row) as string,\n });\n }\n\n return false;\n }\n\n onContextMenu(): EventHandlerResult {\n this.destroyColumnTooltip();\n return false;\n }\n\n onLeave(): EventHandlerResult {\n this.destroyColumnTooltip();\n return false;\n }\n}\n\nexport default IrisGridCellOverflowMouseHandler;\n"],"mappings":";;;AAAA,SAEEA,gBAAgB,QAEX,iBAAiB;AACxB,OAAOC,SAAS,MAAM,YAAY;AAIlC;AACA;AACA;AACA;AACA,MAAMC,gCAAgC,SAASF,gBAAgB,CAAC;EAG9DG,WAAW,CAACC,QAAkB,EAAE;IAC9B,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IAAA;IAEZ,IAAI,CAACA,QAAQ,GAAGA,QAAQ;EAC1B;EAEQC,oBAAoB,GAAS;IACnC,IAAI,CAACD,QAAQ,CAACE,QAAQ,CAAC;MAAEC,0BAA0B,EAAE;IAAK,CAAC,CAAC;EAC9D;EAEQC,SAAS,CAACC,KAAgB,EAAsB;IACtD,IAAI,IAAI,CAACC,wBAAwB,CAACD,KAAK,CAAC,EAAE;MACxC,IAAI,CAACE,MAAM,GAAG,SAAS;MACvB,OAAO;QAAEC,eAAe,EAAE,KAAK;QAAEC,cAAc,EAAE;MAAM,CAAC;IAC1D;IAEA,IAAI,CAACF,MAAM,GAAG,IAAI;IAClB,OAAO,KAAK;EACd;EAEQG,iBAAiB,OAUhB;IAAA,IAViB;MACxBC,CAAC;MACDC,CAAC;MACDC,MAAM;MACNC;IACS,CAAC;IAMV,IAAID,MAAM,IAAI,IAAI,IAAIC,GAAG,IAAI,IAAI,EAAE;MACjC,OAAO,IAAI;IACb;IACA,IAAM;MAAEC,QAAQ;MAAEC,IAAI;MAAEC,KAAK;MAAEC;IAAM,CAAC,GAAG,IAAI,CAAClB,QAAQ;IACtD,IAAI,CAACgB,IAAI,EAAE;MACT,OAAO,IAAI;IACb;IACA,IAAM;MAAEG;IAAQ,CAAC,GAAGF,KAAK;IACzB,IAAM;MAAEG;IAAM,CAAC,GAAGF,KAAK;IAEvB,IAAM;MAAEG,aAAa,EAAEC;IAAQ,CAAC,GAAGN,IAAI;IACvC,IAAMO,KA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BC,YAAY,EAAE,IAAI,CAACvC,QAAQ,CAACwC,eAAe,CAAC3B,MAAM,EAAEC,GAAG;MACzD,CAAC,CAAC;IACJ;IAEA,OAAO,KAAK;EACd;EAEA2B,aAAa,GAAuB;IAClC,IAAI,CAACxC,oBAAoB,EAAE;IAC3B,OAAO,KAAK;EACd;EAEAyC,OAAO,GAAuB;IAC5B,IAAI,CAACzC,oBAAoB,EAAE;IAC3B,OAAO,KAAK;EACd;AACF;AAEA,eAAeH,gCAAgC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IrisGridColumnSelectMouseHandler.js","names":["GridMouseHandler","IrisGridColumnSelectMouseHandler","constructor","irisGrid","
|
|
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-shim';\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,IAAIA,WAAW,IAAI,IAAI,EAAE;MACvB,OAAO,IAAI;IACb;IAEA,IAAM;MAAEC;IAAM,CAAC,GAAG,IAAI,CAACX,QAAQ,CAACI,KAAK;IACrC,IAAMQ,WAAW,GAAG,IAAI,CAACZ,QAAQ,CAACa,cAAc,CAACH,WAAW,CAAC;IAC7D,IAAIE,WAAW,IAAI,IAAI,EAAE;MACvB,OA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,MAAM;MACL,IAAI,CAAClB,MAAM,GAAGiB,sBAAsB;MACpC,IAAI,CAAClB,QAAQ,CAACoB,QAAQ,CAAC;QAAEC,iBAAiB,EAAE;MAAK,CAAC,CAAC;IACrD;;IAEA;IACA,OAAO;MAAEE,cAAc,EAAE,KAAK;MAAEC,eAAe,EAAE;IAAM,CAAC;EAC1D;EAEAC,OAAO,GAAuB;IAC5B,IAAI,IAAI,CAACvB,QAAQ,EAAE,EAAE;MACnB,IAAI,CAACF,QAAQ,CAACoB,QAAQ,CAAC;QAAEC,iBAAiB,EAAE;MAAK,CAAC,CAAC;IACrD;IAEA,IAAI,CAACb,2BAA2B,EAAE;IAElC,OAAO,KAAK;EACd;EAEAkB,MAAM,GAAuB;IAC3B,OAAO,IAAI,CAACxB,QAAQ,EAAE;EACxB;EAEAyB,OAAO,CAACX,SAAoB,EAAsB;IAChD,IAAI,CAAC,IAAI,CAACd,QAAQ,EAAE,EAAE;MACpB,OAAO,KAAK;IACd;IAEA,IAAM;MAAEiB;IAAO,CAAC,GAAGH,SAAS;IAC5B,IAAMV,WAAW,GAAG,IAAI,CAACG,cAAc,CAACU,MAAM,CAAC;IAC/C,IAAIb,WAAW,IAAI,IAAI,IAAI,IAAI,CAACD,aAAa,CAACC,WAAW,CAAC,EAAE;MAC1D,IAAI,CAACN,QAAQ,CAAC4B,YAAY,CAACtB,WAAW,CAAC;IACzC;IAEA,OAAO,IAAI;EACb;AACF;AAEA,eAAeR,gCAAgC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IrisGridColumnTooltipMouseHandler.js","names":["GridMouseHandler","IrisGridColumnTooltipMouseHandler","constructor","irisGrid","
|
|
1
|
+
{"version":3,"file":"IrisGridColumnTooltipMouseHandler.js","names":["GridMouseHandler","IrisGridColumnTooltipMouseHandler","constructor","irisGrid","hideColumnTooltip","tooltip","stopTimer","hide","onDown","onContextMenu","onWheel","onLeave","gridPoint","grid","event","relatedTarget","MouseEvent","nativeEvent","popper","current","Element","element","contains","onMove","column","row","columnHeaderDepth","shownColumnTooltip","state","newTooltip","setState"],"sources":["../../src/mousehandlers/IrisGridColumnTooltipMouseHandler.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\nimport {\n GridMouseHandler,\n GridPoint,\n EventHandlerResult,\n Grid,\n GridMouseEvent,\n} from '@deephaven/grid';\nimport type { IrisGrid } from '../IrisGrid';\n\n/**\n * Detects mouse hover over column headers and displays the appropriate tooltip\n */\nclass IrisGridColumnTooltipMouseHandler extends GridMouseHandler {\n constructor(irisGrid: IrisGrid) {\n super();\n\n this.irisGrid = irisGrid;\n }\n\n private irisGrid: IrisGrid;\n\n private hideColumnTooltip(): void {\n const { tooltip } = this.irisGrid;\n if (tooltip) {\n tooltip.stopTimer();\n tooltip.hide();\n }\n }\n\n onDown(): EventHandlerResult {\n this.hideColumnTooltip();\n return false;\n }\n\n onContextMenu(): EventHandlerResult {\n this.hideColumnTooltip();\n return false;\n }\n\n onWheel(): EventHandlerResult {\n this.hideColumnTooltip();\n return false;\n }\n\n onLeave(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n /**\n * This should always be a react event\n * React seems to be handling onMouseLeave incorrectly at times\n * When moving to the padding between the column and popper, React sets\n * event.relatedTarget to window, but event.nativeEvent.relatedTarget is the popper.\n * It's possibly related to popper being rendered in a portal\n */\n const { relatedTarget } =\n event instanceof MouseEvent ? event : event.nativeEvent;\n\n const { tooltip } = this.irisGrid;\n if (!tooltip) {\n return false;\n }\n\n const popper = tooltip.popper.current;\n\n if (\n popper &&\n relatedTarget instanceof Element &&\n popper.element.contains(relatedTarget)\n ) {\n // Do not hide the popper if we moved the cursor from canvas to popper\n return false;\n }\n this.hideColumnTooltip();\n return false;\n }\n\n onMove(gridPoint: GridPoint): EventHandlerResult {\n const { column, row, columnHeaderDepth } = gridPoint;\n const { shownColumnTooltip } = this.irisGrid.state;\n let newTooltip = null;\n if (column !== null && row === null && columnHeaderDepth === 0) {\n newTooltip = column;\n }\n\n if (newTooltip !== shownColumnTooltip) {\n this.irisGrid.setState({ shownColumnTooltip: newTooltip });\n }\n\n return false;\n }\n}\n\nexport default IrisGridColumnTooltipMouseHandler;\n"],"mappings":";;;AAAA;AACA,SACEA,gBAAgB,QAKX,iBAAiB;AAGxB;AACA;AACA;AACA,MAAMC,iCAAiC,SAASD,gBAAgB,CAAC;EAC/DE,WAAW,CAACC,QAAkB,EAAE;IAC9B,KAAK,EAAE;IAAC;IAER,IAAI,CAACA,QAAQ,GAAGA,QAAQ;EAC1B;EAIQC,iBAAiB,GAAS;IAChC,IAAM;MAAEC;IAAQ,CAAC,GAAG,IAAI,CAACF,QAAQ;IACjC,IAAIE,OAAO,EAAE;MACXA,OAAO,CAACC,SAAS,EAAE;MACnBD,OAAO,CAACE,IAAI,EAAE;IAChB;EACF;EAEAC,MAAM,GAAuB;IAC3B,IAAI,CAACJ,iBAAiB,EAAE;IACxB,OAAO,KAAK;EACd;EAEAK,aAAa,GAAuB;IAClC,IAAI,CAACL,iBAAiB,EAAE;IACxB,OAAO,KAAK;EACd;EAEAM,OAAO,GAAuB;IAC5B,IAAI,CAACN,iBAAiB,EAAE;IACxB,OAAO,KAAK;EACd;EAEAO,OAAO,CACLC,SAAoB,EACpBC,IAAU,EACVC,KAAqB,EACD;IACpB;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,IAAM;MAAEC;IAAc,CAAC,GACrBD,KAAK,YAAYE,UAAU,GAAGF,KAAK,GAAGA,KAAK,CAACG,WAAW;IAEzD,IAAM;MAAEZ;IAAQ,CAAC,GAAG,IAAI,CAACF,QAAQ;IACjC,IAAI,CAACE,OAAO,EAAE;MACZ,OAAO,KAAK;IACd;IAEA,IAAMa,MAAM,GAAGb,OAAO,CAACa,MAAM,CAACC,OAAO;IAErC,IACED,MAAM,IACNH,aAAa,YAAYK,OAAO,IAChCF,MAAM,CAACG,OAAO,CAACC,QAAQ,CAACP,aAAa,CAAC,EACtC;MACA;M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