@deephaven/iris-grid 1.2.1-plotly-rc.3 → 1.3.0
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.css.map +1 -1
- package/dist/AdvancedFilterCreator.js.map +1 -1
- package/dist/AdvancedFilterCreatorFilterItem.css.map +1 -1
- package/dist/AdvancedFilterCreatorFilterItem.js.map +1 -1
- package/dist/AdvancedFilterCreatorSelectValue.css.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.css.map +1 -1
- package/dist/ColumnStatistics.js.map +1 -1
- package/dist/CommonTypes.js.map +1 -1
- package/dist/CrossColumnSearch.css.map +1 -1
- package/dist/CrossColumnSearch.js.map +1 -1
- package/dist/EmptyIrisGridModel.js.map +1 -1
- package/dist/FilterInputField.css.map +1 -1
- package/dist/FilterInputField.js.map +1 -1
- package/dist/GotoRow.css.map +1 -1
- package/dist/GotoRow.js.map +1 -1
- package/dist/IrisGrid.css.map +1 -1
- package/dist/IrisGrid.js.map +1 -1
- package/dist/IrisGridBottomBar.css.map +1 -1
- package/dist/IrisGridBottomBar.js.map +1 -1
- package/dist/IrisGridCacheUtils.js.map +1 -1
- package/dist/IrisGridCellOverflowModal.css.map +1 -1
- package/dist/IrisGridCellOverflowModal.js.map +1 -1
- package/dist/IrisGridCellRendererUtils.js.map +1 -1
- package/dist/IrisGridCopyHandler.css.map +1 -1
- package/dist/IrisGridCopyHandler.js.map +1 -1
- package/dist/IrisGridDataBarCellRenderer.js.map +1 -1
- package/dist/IrisGridIcons.js.map +1 -1
- package/dist/IrisGridMetricCalculator.js.map +1 -1
- package/dist/IrisGridModel.js.map +1 -1
- package/dist/IrisGridModelFactory.js.map +1 -1
- package/dist/IrisGridModelUpdater.js.map +1 -1
- package/dist/IrisGridPartitionSelector.css.map +1 -1
- package/dist/IrisGridPartitionSelector.js.map +1 -1
- package/dist/IrisGridPartitionedTableModel.js.map +1 -1
- package/dist/IrisGridProxyModel.js.map +1 -1
- package/dist/IrisGridRenderer.js.map +1 -1
- package/dist/IrisGridShortcuts.js.map +1 -1
- package/dist/IrisGridTableModel.js.map +1 -1
- package/dist/IrisGridTableModelTemplate.js.map +1 -1
- package/dist/IrisGridTestUtils.js.map +1 -1
- package/dist/IrisGridTextCellRenderer.js.map +1 -1
- package/dist/IrisGridTheme.js.map +1 -1
- package/dist/IrisGridTheme.module.css.map +1 -1
- package/dist/IrisGridThemeProvider.js.map +1 -1
- package/dist/IrisGridTreeTableModel.js.map +1 -1
- package/dist/IrisGridUtils.js.map +1 -1
- package/dist/LazyIrisGrid.js.map +1 -1
- package/dist/MissingKeyError.js.map +1 -1
- package/dist/MissingPartitionError.js.map +1 -1
- package/dist/NoPastePermissionModal.js.map +1 -1
- package/dist/PartitionedGridModel.js.map +1 -1
- package/dist/PendingDataBottomBar.css.map +1 -1
- package/dist/PendingDataBottomBar.js.map +1 -1
- package/dist/ToastBottomBar.js.map +1 -1
- package/dist/declaration.d.js.map +1 -1
- package/dist/format-context-menus/CustomFormatAction.css.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/format-context-menus/index.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/key-handlers/ClearFilterKeyHandler.js.map +1 -1
- package/dist/key-handlers/CopyCellKeyHandler.js.map +1 -1
- package/dist/key-handlers/CopyKeyHandler.js.map +1 -1
- package/dist/key-handlers/ReverseKeyHandler.js.map +1 -1
- package/dist/key-handlers/index.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.css.map +1 -1
- package/dist/mousehandlers/IrisGridContextMenuHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridCopyCellMouseHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridDataSelectMouseHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridFilterMouseHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridPartitionedTableMouseHandler.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.map +1 -1
- package/dist/mousehandlers/PendingMouseHandler.js.map +1 -1
- package/dist/mousehandlers/index.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.map +1 -1
- package/dist/sidebar/ChartBuilder.css.map +1 -1
- package/dist/sidebar/ChartBuilder.js.map +1 -1
- package/dist/sidebar/CustomColumnBuilder.css.map +1 -1
- package/dist/sidebar/CustomColumnBuilder.js.map +1 -1
- package/dist/sidebar/CustomColumnInput.js.map +1 -1
- package/dist/sidebar/DownloadServiceWorkerUtils.js.map +1 -1
- package/dist/sidebar/InputEditor.css.map +1 -1
- package/dist/sidebar/InputEditor.js.map +1 -1
- package/dist/sidebar/OptionType.js.map +1 -1
- package/dist/sidebar/RollupRows.css.map +1 -1
- package/dist/sidebar/RollupRows.js.map +1 -1
- package/dist/sidebar/SelectDistinctBuilder.css.map +1 -1
- package/dist/sidebar/SelectDistinctBuilder.js.map +1 -1
- package/dist/sidebar/TableCsvExporter.css.map +1 -1
- package/dist/sidebar/TableCsvExporter.js.map +1 -1
- package/dist/sidebar/TableSaver.js.map +1 -1
- package/dist/sidebar/aggregations/AggregationEdit.css.map +1 -1
- package/dist/sidebar/aggregations/AggregationEdit.js.map +1 -1
- package/dist/sidebar/aggregations/AggregationOperation.js.map +1 -1
- package/dist/sidebar/aggregations/AggregationUtils.js.map +1 -1
- package/dist/sidebar/aggregations/Aggregations.css.map +1 -1
- package/dist/sidebar/aggregations/Aggregations.js.map +1 -1
- package/dist/sidebar/aggregations/index.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.css.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.css.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingMenu.js.map +1 -1
- 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.css.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/icons/index.js.map +1 -1
- package/dist/sidebar/index.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilder.css.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.css.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.css.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 +16 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnFormatEditor.js","names":["React","useCallback","useEffect","useMemo","useState","Log","ComboBox","getDefaultConditionConfigForType","getConditionConfig","getDefaultStyleConfig","FormatStyleType","ConditionEditor","StyleEditor","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","log","module","DEFAULT_CALLBACK","undefined","makeDefaultConfig","columns","type","name","column","config","_objectSpread","style","ColumnFormatEditor","props","_columns$find","dh","onChange","selectedColumn","setColumn","find","c","conditionConfig","setConditionConfig","conditionValid","setConditionValid","selectedStyle","setStyle","handleColumnChange","value","newColumn","_ref","error","concat","handleConditionChange","updatedConditionConfig","isValid","debug","handleStyleChange","updatedStyleConfig","updateColumnFormat","NO_FORMATTING","columnNames","map","_ref2","className","children","defaultSelectedKey"],"sources":["../../../src/sidebar/conditional-formatting/ColumnFormatEditor.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport Log from '@deephaven/log';\nimport { ComboBox } from '@deephaven/components';\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport {\n type BaseFormatConfig,\n type ChangeCallback,\n getDefaultConditionConfigForType,\n getConditionConfig,\n getDefaultStyleConfig,\n type ModelColumn,\n FormatStyleType,\n} from './ConditionalFormattingUtils';\nimport ConditionEditor from './ConditionEditor';\nimport StyleEditor from './StyleEditor';\n\nconst log = Log.module('ColumnFormatEditor');\n\nexport interface ColumnFormatEditorProps {\n columns: ModelColumn[];\n config?: BaseFormatConfig;\n dh: typeof DhType;\n onChange?: ChangeCallback;\n}\n\nconst DEFAULT_CALLBACK = (): void => undefined;\n\nfunction makeDefaultConfig(columns: ModelColumn[]): BaseFormatConfig {\n const { type, name } = columns[0];\n const column = { type, name };\n const config = {\n column,\n style: getDefaultStyleConfig(),\n ...getDefaultConditionConfigForType(type),\n };\n return config;\n}\n\nfunction ColumnFormatEditor(props: ColumnFormatEditorProps): JSX.Element {\n const {\n columns,\n config = makeDefaultConfig(columns),\n dh,\n onChange = DEFAULT_CALLBACK,\n } = props;\n\n const [selectedColumn, setColumn] = useState(\n columns.find(\n c => c.name === config.column.name && c.type === config.column.type\n ) ?? columns[0]\n );\n const [conditionConfig, setConditionConfig] = useState(\n getConditionConfig(config)\n );\n const [conditionValid, setConditionValid] = useState(false);\n const [selectedStyle, setStyle] = useState(config.style);\n\n const handleColumnChange = useCallback(\n value => {\n const newColumn = columns.find(({ name }) => name === value);\n if (newColumn !== undefined) {\n setColumn(newColumn);\n if (selectedColumn.type !== newColumn.type) {\n setConditionConfig(getDefaultConditionConfigForType(newColumn.type));\n setConditionValid(false);\n }\n } else {\n log.error(`Column ${value} not found.`);\n }\n },\n [columns, selectedColumn]\n );\n\n const handleConditionChange = useCallback(\n (updatedConditionConfig, isValid) => {\n log.debug('handleConditionChange', updatedConditionConfig, isValid);\n setConditionConfig(updatedConditionConfig);\n setConditionValid(isValid);\n },\n []\n );\n\n const handleStyleChange = useCallback(updatedStyleConfig => {\n log.debug('handleStyleChange', updatedStyleConfig);\n setStyle(updatedStyleConfig);\n }, []);\n\n useEffect(\n function updateColumnFormat() {\n let isValid = conditionValid;\n\n if (selectedColumn === undefined) {\n log.debug('Column is not selected, invalidating update.');\n isValid = false;\n }\n if (\n selectedStyle === undefined ||\n selectedStyle.type === FormatStyleType.NO_FORMATTING\n ) {\n log.debug('Style is not selected, invalidating update.');\n isValid = false;\n }\n\n const { type, name } = selectedColumn;\n const column = { type, name };\n onChange(\n {\n column,\n style: selectedStyle,\n ...conditionConfig,\n },\n isValid\n );\n },\n [onChange, selectedColumn, selectedStyle, conditionConfig, conditionValid]\n );\n\n const columnNames = useMemo(() => columns.map(({ name }) => name), [columns]);\n\n return (\n <div className=\"conditional-rule-editor form\">\n <div className=\"mb-2\">\n <label className=\"mb-0\">Format Cell If</label>\n <ComboBox\n aria-label=\"Select column to format\"\n defaultSelectedKey={selectedColumn?.name}\n onChange={handleColumnChange}\n >\n {columnNames}\n </ComboBox>\n </div>\n\n {selectedColumn !== undefined && (\n <>\n <ConditionEditor\n dh={dh}\n column={selectedColumn}\n config={conditionConfig}\n onChange={handleConditionChange}\n />\n <StyleEditor config={selectedStyle} onChange={handleStyleChange} />\n </>\n )}\n </div>\n );\n}\n\nexport default ColumnFormatEditor;\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACxE,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,QAAQ,QAAQ,uBAAuB;AAAC,SAK/CC,gCAAgC,EAChCC,kBAAkB,EAClBC,qBAAqB,EAErBC,eAAe;AAAA,OAEVC,eAAe;AAAA,OACfC,WAAW;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;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G;QACPP,MAAM,EAAES,cAAe;QACvBR,MAAM,EAAEY,eAAgB;QACxBL,QAAQ,EAAEiB;MAAsB,CACjC,CAAC,eACFtC,IAAA,CAACF,WAAW;QAACgB,MAAM,EAAEgB,aAAc;QAACT,QAAQ,EAAEqB;MAAkB,CAAE,CAAC;IAAA,CACnE,CACH;EAAA,CACE,CAAC;AAEV;AAEA,eAAezB,kBAAkB"
|
|
1
|
+
{"version":3,"file":"ColumnFormatEditor.js","names":["React","useCallback","useEffect","useMemo","useState","Log","ComboBox","getDefaultConditionConfigForType","getConditionConfig","getDefaultStyleConfig","FormatStyleType","ConditionEditor","StyleEditor","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","log","module","DEFAULT_CALLBACK","undefined","makeDefaultConfig","columns","type","name","column","config","_objectSpread","style","ColumnFormatEditor","props","_columns$find","dh","onChange","selectedColumn","setColumn","find","c","conditionConfig","setConditionConfig","conditionValid","setConditionValid","selectedStyle","setStyle","handleColumnChange","value","newColumn","_ref","error","concat","handleConditionChange","updatedConditionConfig","isValid","debug","handleStyleChange","updatedStyleConfig","updateColumnFormat","NO_FORMATTING","columnNames","map","_ref2","className","children","defaultSelectedKey"],"sources":["../../../src/sidebar/conditional-formatting/ColumnFormatEditor.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport Log from '@deephaven/log';\nimport { ComboBox } from '@deephaven/components';\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport {\n type BaseFormatConfig,\n type ChangeCallback,\n getDefaultConditionConfigForType,\n getConditionConfig,\n getDefaultStyleConfig,\n type ModelColumn,\n FormatStyleType,\n} from './ConditionalFormattingUtils';\nimport ConditionEditor from './ConditionEditor';\nimport StyleEditor from './StyleEditor';\n\nconst log = Log.module('ColumnFormatEditor');\n\nexport interface ColumnFormatEditorProps {\n columns: ModelColumn[];\n config?: BaseFormatConfig;\n dh: typeof DhType;\n onChange?: ChangeCallback;\n}\n\nconst DEFAULT_CALLBACK = (): void => undefined;\n\nfunction makeDefaultConfig(columns: ModelColumn[]): BaseFormatConfig {\n const { type, name } = columns[0];\n const column = { type, name };\n const config = {\n column,\n style: getDefaultStyleConfig(),\n ...getDefaultConditionConfigForType(type),\n };\n return config;\n}\n\nfunction ColumnFormatEditor(props: ColumnFormatEditorProps): JSX.Element {\n const {\n columns,\n config = makeDefaultConfig(columns),\n dh,\n onChange = DEFAULT_CALLBACK,\n } = props;\n\n const [selectedColumn, setColumn] = useState(\n columns.find(\n c => c.name === config.column.name && c.type === config.column.type\n ) ?? columns[0]\n );\n const [conditionConfig, setConditionConfig] = useState(\n getConditionConfig(config)\n );\n const [conditionValid, setConditionValid] = useState(false);\n const [selectedStyle, setStyle] = useState(config.style);\n\n const handleColumnChange = useCallback(\n value => {\n const newColumn = columns.find(({ name }) => name === value);\n if (newColumn !== undefined) {\n setColumn(newColumn);\n if (selectedColumn.type !== newColumn.type) {\n setConditionConfig(getDefaultConditionConfigForType(newColumn.type));\n setConditionValid(false);\n }\n } else {\n log.error(`Column ${value} not found.`);\n }\n },\n [columns, selectedColumn]\n );\n\n const handleConditionChange = useCallback(\n (updatedConditionConfig, isValid) => {\n log.debug('handleConditionChange', updatedConditionConfig, isValid);\n setConditionConfig(updatedConditionConfig);\n setConditionValid(isValid);\n },\n []\n );\n\n const handleStyleChange = useCallback(updatedStyleConfig => {\n log.debug('handleStyleChange', updatedStyleConfig);\n setStyle(updatedStyleConfig);\n }, []);\n\n useEffect(\n function updateColumnFormat() {\n let isValid = conditionValid;\n\n if (selectedColumn === undefined) {\n log.debug('Column is not selected, invalidating update.');\n isValid = false;\n }\n if (\n selectedStyle === undefined ||\n selectedStyle.type === FormatStyleType.NO_FORMATTING\n ) {\n log.debug('Style is not selected, invalidating update.');\n isValid = false;\n }\n\n const { type, name } = selectedColumn;\n const column = { type, name };\n onChange(\n {\n column,\n style: selectedStyle,\n ...conditionConfig,\n },\n isValid\n );\n },\n [onChange, selectedColumn, selectedStyle, conditionConfig, conditionValid]\n );\n\n const columnNames = useMemo(() => columns.map(({ name }) => name), [columns]);\n\n return (\n <div className=\"conditional-rule-editor form\">\n <div className=\"mb-2\">\n <label className=\"mb-0\">Format Cell If</label>\n <ComboBox\n aria-label=\"Select column to format\"\n defaultSelectedKey={selectedColumn?.name}\n onChange={handleColumnChange}\n >\n {columnNames}\n </ComboBox>\n </div>\n\n {selectedColumn !== undefined && (\n <>\n <ConditionEditor\n dh={dh}\n column={selectedColumn}\n config={conditionConfig}\n onChange={handleConditionChange}\n />\n <StyleEditor config={selectedStyle} onChange={handleStyleChange} />\n </>\n )}\n </div>\n );\n}\n\nexport default ColumnFormatEditor;\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACxE,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,QAAQ,QAAQ,uBAAuB;AAAC,SAK/CC,gCAAgC,EAChCC,kBAAkB,EAClBC,qBAAqB,EAErBC,eAAe;AAAA,OAEVC,eAAe;AAAA,OACfC,WAAW;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAElB,IAAMC,GAAG,GAAGd,GAAG,CAACe,MAAM,CAAC,oBAAoB,CAAC;AAS5C,IAAMC,gBAAgB,GAAGA,CAAA,KAAYC,SAAS;AAE9C,SAASC,iBAAiBA,CAACC,OAAsB,EAAoB;EACnE,IAAM;IAAEC,IAAI;IAAEC;EAAK,CAAC,GAAGF,OAAO,CAAC,CAAC,CAAC;EACjC,IAAMG,MAAM,GAAG;IAAEF,IAAI;IAAEC;EAAK,CAAC;EAC7B,IAAME,MAAM,GAAAC,aAAA;IACVF,MAAM;IACNG,KAAK,EAAErB,qBAAqB,CAAC;EAAC,GAC3BF,gCAAgC,CAACkB,IAAI,CAAC,CAC1C;EACD,OAAOG,MAAM;AACf;AAEA,SAASG,kBAA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,EAAEE,cAAc,CAC3E,CAAC;EAED,IAAMkB,WAAW,GAAGzD,OAAO,CAAC,MAAMqB,OAAO,CAACqC,GAAG,CAACC,KAAA;IAAA,IAAC;MAAEpC;IAAK,CAAC,GAAAoC,KAAA;IAAA,OAAKpC,IAAI;EAAA,EAAC,EAAE,CAACF,OAAO,CAAC,CAAC;EAE7E,oBACER,KAAA;IAAK+C,SAAS,EAAC,8BAA8B;IAAAC,QAAA,gBAC3ChD,KAAA;MAAK+C,SAAS,EAAC,MAAM;MAAAC,QAAA,gBACnBlD,IAAA;QAAOiD,SAAS,EAAC,MAAM;QAAAC,QAAA,EAAC;MAAc,CAAO,CAAC,eAC9ClD,IAAA,CAACR,QAAQ;QACP,cAAW,yBAAyB;QACpC2D,kBAAkB,EAAE7B,cAAc,aAAdA,cAAc,uBAAdA,cAAc,CAAEV,IAAK;QACzCS,QAAQ,EAAEW,kBAAmB;QAAAkB,QAAA,EAE5BJ;MAAW,CACJ,CAAC;IAAA,CACR,CAAC,EAELxB,cAAc,KAAKd,SAAS,iBAC3BN,KAAA,CAAAE,SAAA;MAAA8C,QAAA,gBACElD,IAAA,CAACH,eAAe;QACduB,EAAE,EAAEA,EAAG;QACPP,MAAM,EAAES,cAAe;QACvBR,MAAM,EAAEY,eAAgB;QACxBL,QAAQ,EAAEiB;MAAsB,CACjC,CAAC,eACFtC,IAAA,CAACF,WAAW;QAACgB,MAAM,EAAEgB,aAAc;QAACT,QAAQ,EAAEqB;MAAkB,CAAE,CAAC;IAAA,CACnE,CACH;EAAA,CACE,CAAC;AAEV;AAEA,eAAezB,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionEditor.js","names":["useCallback","useEffect","useMemo","useState","TableUtils","Log","Select","StringCondition","DateCondition","getLabelForNumberCondition","getLabelForDateCondition","getLabelForStringCondition","NumberCondition","getDefaultConditionForType","getLabelForBooleanCondition","BooleanCondition","CharCondition","getLabelForCharCondition","isDateConditionValid","getDefaultValueForType","jsx","_jsx","jsxs","_jsxs","log","module","DEFAULT_CALLBACK","undefined","numberConditionOptions","IS_EQUAL","IS_NOT_EQUAL","IS_BETWEEN","GREATER_THAN","GREATER_THAN_OR_EQUAL","LESS_THAN","LESS_THAN_OR_EQUAL","IS_NULL","IS_NOT_NULL","map","option","value","children","stringConditions","IS_EXACTLY","IS_NOT_EXACTLY","CONTAINS","DOES_NOT_CONTAIN","STARTS_WITH","ENDS_WITH","dateConditions","IS_BEFORE","IS_BEFORE_OR_EQUAL","IS_AFTER","IS_AFTER_OR_EQUAL","booleanConditions","IS_TRUE","IS_FALSE","charConditions","isNumberConditionValid","condition","startValue","endValue","Number","isNaN","parseFloat","getNumberInputs","selectedCondition","handleValueChange","handleStartValueChange","handleEndValueChange","conditionValue","type","className","placeholder","onChange","getStringInputs","getDateInputs","getBooleanInputs","getCharInputs","maxLength","ConditionEditor","props","column","config","dh","selectedColumnType","prevColumnType","setPrevColumnType","setCondition","setValue","setStartValue","start","setEndValue","end","conditions","isNumberType","isCharType","isStringType","isDateType","isBooleanType","handleConditionChange","debug","e","target","changeCondition","isValid","conditionInputs"],"sources":["../../../src/sidebar/conditional-formatting/ConditionEditor.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useState } from 'react';\nimport { TableUtils } from '@deephaven/jsapi-utils';\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport Log from '@deephaven/log';\nimport { Select } from '@deephaven/components';\nimport {\n StringCondition,\n DateCondition,\n getLabelForNumberCondition,\n getLabelForDateCondition,\n getLabelForStringCondition,\n NumberCondition,\n type ModelColumn,\n type ConditionConfig,\n getDefaultConditionForType,\n getLabelForBooleanCondition,\n BooleanCondition,\n CharCondition,\n type Condition,\n getLabelForCharCondition,\n isDateConditionValid,\n getDefaultValueForType,\n} from './ConditionalFormattingUtils';\n\nconst log = Log.module('ConditionEditor');\n\nexport interface ConditionEditorProps {\n dh: typeof DhType;\n column: ModelColumn;\n config: ConditionConfig;\n onChange?: (config: ConditionConfig, isValid: boolean) => void;\n}\n\nconst DEFAULT_CALLBACK = (): void => undefined;\n\nconst numberConditionOptions = [\n NumberCondition.IS_EQUAL,\n NumberCondition.IS_NOT_EQUAL,\n NumberCondition.IS_BETWEEN,\n NumberCondition.GREATER_THAN,\n NumberCondition.GREATER_THAN_OR_EQUAL,\n NumberCondition.LESS_THAN,\n NumberCondition.LESS_THAN_OR_EQUAL,\n NumberCondition.IS_NULL,\n NumberCondition.IS_NOT_NULL,\n].map(option => (\n <option key={option} value={option}>\n {getLabelForNumberCondition(option)}\n </option>\n));\n\nconst stringConditions = [\n StringCondition.IS_EXACTLY,\n StringCondition.IS_NOT_EXACTLY,\n StringCondition.CONTAINS,\n StringCondition.DOES_NOT_CONTAIN,\n StringCondition.STARTS_WITH,\n StringCondition.ENDS_WITH,\n StringCondition.IS_NULL,\n StringCondition.IS_NOT_NULL,\n].map(option => (\n <option key={option} value={option}>\n {getLabelForStringCondition(option)}\n </option>\n));\n\nconst dateConditions = [\n DateCondition.IS_EXACTLY,\n DateCondition.IS_NOT_EXACTLY,\n DateCondition.IS_BEFORE,\n DateCondition.IS_BEFORE_OR_EQUAL,\n DateCondition.IS_AFTER,\n DateCondition.IS_AFTER_OR_EQUAL,\n DateCondition.IS_NULL,\n DateCondition.IS_NOT_NULL,\n].map(option => (\n <option key={option} value={option}>\n {getLabelForDateCondition(option)}\n </option>\n));\n\nconst booleanConditions = [\n BooleanCondition.IS_TRUE,\n BooleanCondition.IS_FALSE,\n BooleanCondition.IS_NULL,\n BooleanCondition.IS_NOT_NULL,\n].map(option => (\n <option key={option} value={option}>\n {getLabelForBooleanCondition(option)}\n </option>\n));\n\nconst charConditions = [\n CharCondition.IS_EQUAL,\n CharCondition.IS_NOT_EQUAL,\n CharCondition.IS_NULL,\n CharCondition.IS_NOT_NULL,\n].map(option => (\n <option key={option} value={option}>\n {getLabelForCharCondition(option)}\n </option>\n));\n\nfunction isNumberConditionValid(\n condition: NumberCondition,\n value?: string,\n startValue?: string,\n endValue?: string\n): boolean {\n if (\n condition === NumberCondition.IS_NULL ||\n condition === NumberCondition.IS_NOT_NULL\n ) {\n return true;\n }\n if (\n condition === NumberCondition.IS_BETWEEN &&\n startValue != null &&\n startValue !== '' &&\n !Number.isNaN(Number.parseFloat(startValue)) &&\n endValue != null &&\n endValue !== '' &&\n !Number.isNaN(Number.parseFloat(endValue))\n ) {\n return true;\n }\n if (\n condition !== NumberCondition.IS_BETWEEN &&\n value !== undefined &&\n value !== '' &&\n !Number.isNaN(Number.parseFloat(value))\n ) {\n return true;\n }\n return false;\n}\n\nfunction getNumberInputs(\n selectedCondition: NumberCondition,\n handleValueChange: (e: unknown) => void,\n handleStartValueChange: (e: unknown) => void,\n handleEndValueChange: (e: unknown) => void,\n conditionValue?: string,\n startValue?: string,\n endValue?: string\n): JSX.Element | null {\n switch (selectedCondition) {\n case NumberCondition.IS_EQUAL:\n case NumberCondition.IS_NOT_EQUAL:\n case NumberCondition.GREATER_THAN:\n case NumberCondition.GREATER_THAN_OR_EQUAL:\n case NumberCondition.LESS_THAN:\n case NumberCondition.LESS_THAN_OR_EQUAL:\n return (\n <input\n type=\"number\"\n className=\"form-control\"\n placeholder=\"Enter value\"\n value={conditionValue ?? ''}\n onChange={handleValueChange}\n />\n );\n case NumberCondition.IS_BETWEEN:\n return (\n <div className=\"d-flex flex-row\">\n <input\n type=\"number\"\n className=\"form-control d-flex mr-2\"\n placeholder=\"Start value\"\n value={startValue ?? ''}\n onChange={handleStartValueChange}\n />\n <input\n type=\"number\"\n className=\"form-control d-flex\"\n placeholder=\"End value\"\n value={endValue ?? ''}\n onChange={handleEndValueChange}\n />\n </div>\n );\n case NumberCondition.IS_NULL:\n case NumberCondition.IS_NOT_NULL:\n return null;\n }\n}\n\nfunction getStringInputs(\n selectedCondition: StringCondition,\n handleValueChange: (e: unknown) => void,\n conditionValue?: string\n): JSX.Element | null {\n switch (selectedCondition) {\n case StringCondition.IS_NULL:\n case StringCondition.IS_NOT_NULL:\n return null;\n default:\n return (\n <input\n type=\"text\"\n className=\"form-control\"\n placeholder=\"Enter value\"\n value={conditionValue ?? ''}\n onChange={handleValueChange}\n />\n );\n }\n}\n\nfunction getDateInputs(\n selectedCondition: DateCondition,\n handleValueChange: (e: unknown) => void,\n conditionValue?: string\n): JSX.Element | null {\n switch (selectedCondition) {\n case DateCondition.IS_NULL:\n case DateCondition.IS_NOT_NULL:\n return null;\n default:\n return (\n <input\n type=\"text\"\n className=\"form-control\"\n placeholder=\"Enter value\"\n value={conditionValue ?? ''}\n onChange={handleValueChange}\n />\n );\n }\n}\n\nfunction getBooleanInputs(): null {\n return null;\n}\n\nfunction getCharInputs(\n selectedCondition: CharCondition,\n handleValueChange: (e: unknown) => void,\n conditionValue?: string\n): JSX.Element | null {\n switch (selectedCondition) {\n case CharCondition.IS_NULL:\n case CharCondition.IS_NOT_NULL:\n return null;\n default:\n return (\n <input\n type=\"text\"\n className=\"form-control\"\n maxLength={1}\n placeholder=\"Enter value\"\n value={conditionValue ?? ''}\n onChange={handleValueChange}\n />\n );\n }\n}\n\nfunction ConditionEditor(props: ConditionEditorProps): JSX.Element {\n const { column, config, dh, onChange = DEFAULT_CALLBACK } = props;\n const selectedColumnType = column.type;\n const [prevColumnType, setPrevColumnType] = useState(selectedColumnType);\n const [selectedCondition, setCondition] = useState(config.condition);\n const [conditionValue, setValue] = useState(config.value);\n const [startValue, setStartValue] = useState(config.start);\n const [endValue, setEndValue] = useState(config.end);\n\n if (selectedColumnType !== prevColumnType) {\n // Column type changed, reset condition and value fields\n setCondition(getDefaultConditionForType(selectedColumnType));\n setValue(getDefaultValueForType(selectedColumnType));\n setStartValue(undefined);\n setEndValue(undefined);\n setPrevColumnType(selectedColumnType);\n }\n\n const conditions = useMemo(() => {\n if (selectedColumnType === undefined) {\n return [];\n }\n if (TableUtils.isNumberType(selectedColumnType)) {\n return numberConditionOptions;\n }\n if (TableUtils.isCharType(selectedColumnType)) {\n return charConditions;\n }\n if (TableUtils.isStringType(selectedColumnType)) {\n return stringConditions;\n }\n if (TableUtils.isDateType(selectedColumnType)) {\n return dateConditions;\n }\n if (TableUtils.isBooleanType(selectedColumnType)) {\n return booleanConditions;\n }\n }, [selectedColumnType]);\n\n const handleConditionChange = useCallback((value: string) => {\n log.debug('handleConditionChange', value);\n setCondition(value as Condition);\n }, []);\n\n const handleValueChange = useCallback(e => {\n const { value } = e.target;\n log.debug('handleValueChange', value);\n setValue(value);\n }, []);\n\n const handleStartValueChange = useCallback(e => {\n const { value } = e.target;\n log.debug('handleStartValueChange', value);\n setStartValue(value);\n }, []);\n\n const handleEndValueChange = useCallback(e => {\n const { value } = e.target;\n log.debug('handleEndValueChange', value);\n setEndValue(value);\n }, []);\n\n useEffect(\n function changeCondition() {\n let isValid = true;\n\n if (selectedCondition === undefined) {\n log.debug(\n 'Unable to create formatting rule. Condition is not selected.'\n );\n isValid = false;\n } else if (\n TableUtils.isNumberType(column.type) &&\n !isNumberConditionValid(\n selectedCondition as NumberCondition,\n conditionValue,\n startValue,\n endValue\n )\n ) {\n log.debug(\n 'Unable to create formatting rule. Invalid value',\n conditionValue\n );\n isValid = false;\n } else if (\n TableUtils.isDateType(column.type) &&\n !isDateConditionValid(\n dh,\n selectedCondition as DateCondition,\n conditionValue\n )\n ) {\n log.debug(\n 'Unable to create formatting rule. Invalid date condition',\n conditionValue\n );\n isValid = false;\n }\n\n onChange(\n {\n condition: selectedCondition,\n value: conditionValue,\n start: startValue,\n end: endValue,\n },\n isValid\n );\n },\n [\n onChange,\n column.type,\n dh,\n selectedCondition,\n conditionValue,\n startValue,\n endValue,\n ]\n );\n\n const conditionInputs = useMemo(() => {\n if (selectedColumnType === undefined) {\n // Column not selected\n return null;\n }\n if (TableUtils.isNumberType(selectedColumnType)) {\n return getNumberInputs(\n selectedCondition as NumberCondition,\n handleValueChange,\n handleStartValueChange,\n handleEndValueChange,\n conditionValue,\n startValue,\n endValue\n );\n }\n if (TableUtils.isCharType(selectedColumnType)) {\n return getCharInputs(\n selectedCondition as CharCondition,\n handleValueChange,\n conditionValue\n );\n }\n if (TableUtils.isStringType(selectedColumnType)) {\n return getStringInputs(\n selectedCondition as StringCondition,\n handleValueChange,\n conditionValue\n );\n }\n if (TableUtils.isDateType(selectedColumnType)) {\n return getDateInputs(\n selectedCondition as DateCondition,\n handleValueChange,\n conditionValue\n );\n }\n if (TableUtils.isBooleanType(selectedColumnType)) {\n return getBooleanInputs();\n }\n }, [\n selectedColumnType,\n selectedCondition,\n conditionValue,\n startValue,\n endValue,\n handleValueChange,\n handleStartValueChange,\n handleEndValueChange,\n ]);\n\n return (\n <div className=\"condition-editor mb-2\">\n <Select\n value={selectedCondition}\n data-testid=\"condition-select\"\n className=\"custom-select mb-2\"\n onChange={handleConditionChange}\n >\n {conditions}\n </Select>\n {conditionInputs}\n </div>\n );\n}\n\nexport default ConditionEditor;\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACjE,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,MAAM,QAAQ,uBAAuB;AAAC,SAE7CC,eAAe,EACfC,aAAa,EACbC,0BAA0B,EAC1BC,wBAAwB,EACxBC,0BAA0B,EAC1BC,eAAe,EAGfC,0BAA0B,EAC1BC,2BAA2B,EAC3BC,gBAAgB,EAChBC,aAAa,EAEbC,wBAAwB,EACxBC,oBAAoB,EACpBC,sBAAsB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAGxB,IAAMC,GAAG,GAAGnB,GAAG,CAACoB,MAAM,CAAC,iBAAiB,CAAC;AASzC,IAAMC,gBAAgB,GAAGA,CAAA,KAAYC,SAAS;AAE9C,IAAMC,sBAAsB,GAAG,CAC7BhB,eAAe,CAACiB,QAAQ,EACxBjB,eAAe,CAACkB,YAAY,EAC5BlB,eAAe,CAACmB,UAAU,EAC1BnB,eAAe,CA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EACpBC,cAAc,EACdV,UAAU,EACVC,QACF,CAAC;IACH;IACA,IAAIzD,UAAU,CAAC4F,UAAU,CAACX,kBAAkB,CAAC,EAAE;MAC7C,OAAOP,aAAa,CAClBZ,iBAAiB,EACjBC,iBAAiB,EACjBG,cACF,CAAC;IACH;IACA,IAAIlE,UAAU,CAAC6F,YAAY,CAACZ,kBAAkB,CAAC,EAAE;MAC/C,OAAOV,eAAe,CACpBT,iBAAiB,EACjBC,iBAAiB,EACjBG,cACF,CAAC;IACH;IACA,IAAIlE,UAAU,CAAC8F,UAAU,CAACb,kBAAkB,CAAC,EAAE;MAC7C,OAAOT,aAAa,CAClBV,iBAAiB,EACjBC,iBAAiB,EACjBG,cACF,CAAC;IACH;IACA,IAAIlE,UAAU,CAAC+F,aAAa,CAACd,kBAAkB,CAAC,EAAE;MAChD,OAAOR,gBAAgB,CAAC,CAAC;IAC3B;EACF,CAAC,EAAE,CACDQ,kBAAkB,EAClBnB,iBAAiB,EACjBI,cAAc,EACdV,UAAU,EACVC,QAAQ,EACRM,iBAAiB,EACjBC,sBAAsB,EACtBC,oBAAoB,CACrB,CAAC;EAEF,oBACE9C,KAAA;IAAKiD,SAAS,EAAC,uBAAuB;IAAA/B,QAAA,gBACpCpB,IAAA,CAACf,MAAM;MACLkC,KAAK,EAAE0B,iBAAkB;MACzB,eAAY,kBAAkB;MAC9BM,SAAS,EAAC,oBAAoB;MAC9BE,QAAQ,EAAE0B,qBAAsB;MAAA3D,QAAA,EAE/BqD;IAAU,CACL,CAAC,EACRY,eAAe;EAAA,CACb,CAAC;AAEV;AAEA,eAAe1B,eAAe","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ConditionEditor.js","names":["useCallback","useEffect","useMemo","useState","TableUtils","Log","Select","StringCondition","DateCondition","getLabelForNumberCondition","getLabelForDateCondition","getLabelForStringCondition","NumberCondition","getDefaultConditionForType","getLabelForBooleanCondition","BooleanCondition","CharCondition","getLabelForCharCondition","isDateConditionValid","getDefaultValueForType","jsx","_jsx","jsxs","_jsxs","log","module","DEFAULT_CALLBACK","undefined","numberConditionOptions","IS_EQUAL","IS_NOT_EQUAL","IS_BETWEEN","GREATER_THAN","GREATER_THAN_OR_EQUAL","LESS_THAN","LESS_THAN_OR_EQUAL","IS_NULL","IS_NOT_NULL","map","option","value","children","stringConditions","IS_EXACTLY","IS_NOT_EXACTLY","CONTAINS","DOES_NOT_CONTAIN","STARTS_WITH","ENDS_WITH","dateConditions","IS_BEFORE","IS_BEFORE_OR_EQUAL","IS_AFTER","IS_AFTER_OR_EQUAL","booleanConditions","IS_TRUE","IS_FALSE","charConditions","isNumberConditionValid","condition","startValue","endValue","Number","isNaN","parseFloat","getNumberInputs","selectedCondition","handleValueChange","handleStartValueChange","handleEndValueChange","conditionValue","type","className","placeholder","onChange","getStringInputs","getDateInputs","getBooleanInputs","getCharInputs","maxLength","ConditionEditor","props","column","config","dh","selectedColumnType","prevColumnType","setPrevColumnType","setCondition","setValue","setStartValue","start","setEndValue","end","conditions","isNumberType","isCharType","isStringType","isDateType","isBooleanType","handleConditionChange","debug","e","target","changeCondition","isValid","conditionInputs"],"sources":["../../../src/sidebar/conditional-formatting/ConditionEditor.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useState } from 'react';\nimport { TableUtils } from '@deephaven/jsapi-utils';\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport Log from '@deephaven/log';\nimport { Select } from '@deephaven/components';\nimport {\n StringCondition,\n DateCondition,\n getLabelForNumberCondition,\n getLabelForDateCondition,\n getLabelForStringCondition,\n NumberCondition,\n type ModelColumn,\n type ConditionConfig,\n getDefaultConditionForType,\n getLabelForBooleanCondition,\n BooleanCondition,\n CharCondition,\n type Condition,\n getLabelForCharCondition,\n isDateConditionValid,\n getDefaultValueForType,\n} from './ConditionalFormattingUtils';\n\nconst log = Log.module('ConditionEditor');\n\nexport interface ConditionEditorProps {\n dh: typeof DhType;\n column: ModelColumn;\n config: ConditionConfig;\n onChange?: (config: ConditionConfig, isValid: boolean) => void;\n}\n\nconst DEFAULT_CALLBACK = (): void => undefined;\n\nconst numberConditionOptions = [\n NumberCondition.IS_EQUAL,\n NumberCondition.IS_NOT_EQUAL,\n NumberCondition.IS_BETWEEN,\n NumberCondition.GREATER_THAN,\n NumberCondition.GREATER_THAN_OR_EQUAL,\n NumberCondition.LESS_THAN,\n NumberCondition.LESS_THAN_OR_EQUAL,\n NumberCondition.IS_NULL,\n NumberCondition.IS_NOT_NULL,\n].map(option => (\n <option key={option} value={option}>\n {getLabelForNumberCondition(option)}\n </option>\n));\n\nconst stringConditions = [\n StringCondition.IS_EXACTLY,\n StringCondition.IS_NOT_EXACTLY,\n StringCondition.CONTAINS,\n StringCondition.DOES_NOT_CONTAIN,\n StringCondition.STARTS_WITH,\n StringCondition.ENDS_WITH,\n StringCondition.IS_NULL,\n StringCondition.IS_NOT_NULL,\n].map(option => (\n <option key={option} value={option}>\n {getLabelForStringCondition(option)}\n </option>\n));\n\nconst dateConditions = [\n DateCondition.IS_EXACTLY,\n DateCondition.IS_NOT_EXACTLY,\n DateCondition.IS_BEFORE,\n DateCondition.IS_BEFORE_OR_EQUAL,\n DateCondition.IS_AFTER,\n DateCondition.IS_AFTER_OR_EQUAL,\n DateCondition.IS_NULL,\n DateCondition.IS_NOT_NULL,\n].map(option => (\n <option key={option} value={option}>\n {getLabelForDateCondition(option)}\n </option>\n));\n\nconst booleanConditions = [\n BooleanCondition.IS_TRUE,\n BooleanCondition.IS_FALSE,\n BooleanCondition.IS_NULL,\n BooleanCondition.IS_NOT_NULL,\n].map(option => (\n <option key={option} value={option}>\n {getLabelForBooleanCondition(option)}\n </option>\n));\n\nconst charConditions = [\n CharCondition.IS_EQUAL,\n CharCondition.IS_NOT_EQUAL,\n CharCondition.IS_NULL,\n CharCondition.IS_NOT_NULL,\n].map(option => (\n <option key={option} value={option}>\n {getLabelForCharCondition(option)}\n </option>\n));\n\nfunction isNumberConditionValid(\n condition: NumberCondition,\n value?: string,\n startValue?: string,\n endValue?: string\n): boolean {\n if (\n condition === NumberCondition.IS_NULL ||\n condition === NumberCondition.IS_NOT_NULL\n ) {\n return true;\n }\n if (\n condition === NumberCondition.IS_BETWEEN &&\n startValue != null &&\n startValue !== '' &&\n !Number.isNaN(Number.parseFloat(startValue)) &&\n endValue != null &&\n endValue !== '' &&\n !Number.isNaN(Number.parseFloat(endValue))\n ) {\n return true;\n }\n if (\n condition !== NumberCondition.IS_BETWEEN &&\n value !== undefined &&\n value !== '' &&\n !Number.isNaN(Number.parseFloat(value))\n ) {\n return true;\n }\n return false;\n}\n\nfunction getNumberInputs(\n selectedCondition: NumberCondition,\n handleValueChange: (e: unknown) => void,\n handleStartValueChange: (e: unknown) => void,\n handleEndValueChange: (e: unknown) => void,\n conditionValue?: string,\n startValue?: string,\n endValue?: string\n): JSX.Element | null {\n switch (selectedCondition) {\n case NumberCondition.IS_EQUAL:\n case NumberCondition.IS_NOT_EQUAL:\n case NumberCondition.GREATER_THAN:\n case NumberCondition.GREATER_THAN_OR_EQUAL:\n case NumberCondition.LESS_THAN:\n case NumberCondition.LESS_THAN_OR_EQUAL:\n return (\n <input\n type=\"number\"\n className=\"form-control\"\n placeholder=\"Enter value\"\n value={conditionValue ?? ''}\n onChange={handleValueChange}\n />\n );\n case NumberCondition.IS_BETWEEN:\n return (\n <div className=\"d-flex flex-row\">\n <input\n type=\"number\"\n className=\"form-control d-flex mr-2\"\n placeholder=\"Start value\"\n value={startValue ?? ''}\n onChange={handleStartValueChange}\n />\n <input\n type=\"number\"\n className=\"form-control d-flex\"\n placeholder=\"End value\"\n value={endValue ?? ''}\n onChange={handleEndValueChange}\n />\n </div>\n );\n case NumberCondition.IS_NULL:\n case NumberCondition.IS_NOT_NULL:\n return null;\n }\n}\n\nfunction getStringInputs(\n selectedCondition: StringCondition,\n handleValueChange: (e: unknown) => void,\n conditionValue?: string\n): JSX.Element | null {\n switch (selectedCondition) {\n case StringCondition.IS_NULL:\n case StringCondition.IS_NOT_NULL:\n return null;\n default:\n return (\n <input\n type=\"text\"\n className=\"form-control\"\n placeholder=\"Enter value\"\n value={conditionValue ?? ''}\n onChange={handleValueChange}\n />\n );\n }\n}\n\nfunction getDateInputs(\n selectedCondition: DateCondition,\n handleValueChange: (e: unknown) => void,\n conditionValue?: string\n): JSX.Element | null {\n switch (selectedCondition) {\n case DateCondition.IS_NULL:\n case DateCondition.IS_NOT_NULL:\n return null;\n default:\n return (\n <input\n type=\"text\"\n className=\"form-control\"\n placeholder=\"Enter value\"\n value={conditionValue ?? ''}\n onChange={handleValueChange}\n />\n );\n }\n}\n\nfunction getBooleanInputs(): null {\n return null;\n}\n\nfunction getCharInputs(\n selectedCondition: CharCondition,\n handleValueChange: (e: unknown) => void,\n conditionValue?: string\n): JSX.Element | null {\n switch (selectedCondition) {\n case CharCondition.IS_NULL:\n case CharCondition.IS_NOT_NULL:\n return null;\n default:\n return (\n <input\n type=\"text\"\n className=\"form-control\"\n maxLength={1}\n placeholder=\"Enter value\"\n value={conditionValue ?? ''}\n onChange={handleValueChange}\n />\n );\n }\n}\n\nfunction ConditionEditor(props: ConditionEditorProps): JSX.Element {\n const { column, config, dh, onChange = DEFAULT_CALLBACK } = props;\n const selectedColumnType = column.type;\n const [prevColumnType, setPrevColumnType] = useState(selectedColumnType);\n const [selectedCondition, setCondition] = useState(config.condition);\n const [conditionValue, setValue] = useState(config.value);\n const [startValue, setStartValue] = useState(config.start);\n const [endValue, setEndValue] = useState(config.end);\n\n if (selectedColumnType !== prevColumnType) {\n // Column type changed, reset condition and value fields\n setCondition(getDefaultConditionForType(selectedColumnType));\n setValue(getDefaultValueForType(selectedColumnType));\n setStartValue(undefined);\n setEndValue(undefined);\n setPrevColumnType(selectedColumnType);\n }\n\n const conditions = useMemo(() => {\n if (selectedColumnType === undefined) {\n return [];\n }\n if (TableUtils.isNumberType(selectedColumnType)) {\n return numberConditionOptions;\n }\n if (TableUtils.isCharType(selectedColumnType)) {\n return charConditions;\n }\n if (TableUtils.isStringType(selectedColumnType)) {\n return stringConditions;\n }\n if (TableUtils.isDateType(selectedColumnType)) {\n return dateConditions;\n }\n if (TableUtils.isBooleanType(selectedColumnType)) {\n return booleanConditions;\n }\n }, [selectedColumnType]);\n\n const handleConditionChange = useCallback((value: string) => {\n log.debug('handleConditionChange', value);\n setCondition(value as Condition);\n }, []);\n\n const handleValueChange = useCallback(e => {\n const { value } = e.target;\n log.debug('handleValueChange', value);\n setValue(value);\n }, []);\n\n const handleStartValueChange = useCallback(e => {\n const { value } = e.target;\n log.debug('handleStartValueChange', value);\n setStartValue(value);\n }, []);\n\n const handleEndValueChange = useCallback(e => {\n const { value } = e.target;\n log.debug('handleEndValueChange', value);\n setEndValue(value);\n }, []);\n\n useEffect(\n function changeCondition() {\n let isValid = true;\n\n if (selectedCondition === undefined) {\n log.debug(\n 'Unable to create formatting rule. Condition is not selected.'\n );\n isValid = false;\n } else if (\n TableUtils.isNumberType(column.type) &&\n !isNumberConditionValid(\n selectedCondition as NumberCondition,\n conditionValue,\n startValue,\n endValue\n )\n ) {\n log.debug(\n 'Unable to create formatting rule. Invalid value',\n conditionValue\n );\n isValid = false;\n } else if (\n TableUtils.isDateType(column.type) &&\n !isDateConditionValid(\n dh,\n selectedCondition as DateCondition,\n conditionValue\n )\n ) {\n log.debug(\n 'Unable to create formatting rule. Invalid date condition',\n conditionValue\n );\n isValid = false;\n }\n\n onChange(\n {\n condition: selectedCondition,\n value: conditionValue,\n start: startValue,\n end: endValue,\n },\n isValid\n );\n },\n [\n onChange,\n column.type,\n dh,\n selectedCondition,\n conditionValue,\n startValue,\n endValue,\n ]\n );\n\n const conditionInputs = useMemo(() => {\n if (selectedColumnType === undefined) {\n // Column not selected\n return null;\n }\n if (TableUtils.isNumberType(selectedColumnType)) {\n return getNumberInputs(\n selectedCondition as NumberCondition,\n handleValueChange,\n handleStartValueChange,\n handleEndValueChange,\n conditionValue,\n startValue,\n endValue\n );\n }\n if (TableUtils.isCharType(selectedColumnType)) {\n return getCharInputs(\n selectedCondition as CharCondition,\n handleValueChange,\n conditionValue\n );\n }\n if (TableUtils.isStringType(selectedColumnType)) {\n return getStringInputs(\n selectedCondition as StringCondition,\n handleValueChange,\n conditionValue\n );\n }\n if (TableUtils.isDateType(selectedColumnType)) {\n return getDateInputs(\n selectedCondition as DateCondition,\n handleValueChange,\n conditionValue\n );\n }\n if (TableUtils.isBooleanType(selectedColumnType)) {\n return getBooleanInputs();\n }\n }, [\n selectedColumnType,\n selectedCondition,\n conditionValue,\n startValue,\n endValue,\n handleValueChange,\n handleStartValueChange,\n handleEndValueChange,\n ]);\n\n return (\n <div className=\"condition-editor mb-2\">\n <Select\n value={selectedCondition}\n data-testid=\"condition-select\"\n className=\"custom-select mb-2\"\n onChange={handleConditionChange}\n >\n {conditions}\n </Select>\n {conditionInputs}\n </div>\n );\n}\n\nexport default ConditionEditor;\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACjE,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,MAAM,QAAQ,uBAAuB;AAAC,SAE7CC,eAAe,EACfC,aAAa,EACbC,0BAA0B,EAC1BC,wBAAwB,EACxBC,0BAA0B,EAC1BC,eAAe,EAGfC,0BAA0B,EAC1BC,2BAA2B,EAC3BC,gBAAgB,EAChBC,aAAa,EAEbC,wBAAwB,EACxBC,oBAAoB,EACpBC,sBAAsB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAGxB,IAAMC,GAAG,GAAGnB,GAAG,CAACoB,MAAM,CAAC,iBAAiB,CAAC;AASzC,IAAMC,gBAAgB,GAAGA,CAAA,KAAYC,SAAS;AAE9C,IAAMC,sBAAsB,GAAG,CAC7BhB,eAAe,CAACiB,QAAQ,EACxBjB,eAAe,CAACkB,YAAY,EAC5BlB,eAAe,CAACmB,UAAU,EAC1BnB,eAAe,CAACoB,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C,cAAc,EACdV,UAAU,EACVC,QACF,CAAC;IACH;IACA,IAAIzD,UAAU,CAAC4F,UAAU,CAACX,kBAAkB,CAAC,EAAE;MAC7C,OAAOP,aAAa,CAClBZ,iBAAiB,EACjBC,iBAAiB,EACjBG,cACF,CAAC;IACH;IACA,IAAIlE,UAAU,CAAC6F,YAAY,CAACZ,kBAAkB,CAAC,EAAE;MAC/C,OAAOV,eAAe,CACpBT,iBAAiB,EACjBC,iBAAiB,EACjBG,cACF,CAAC;IACH;IACA,IAAIlE,UAAU,CAAC8F,UAAU,CAACb,kBAAkB,CAAC,EAAE;MAC7C,OAAOT,aAAa,CAClBV,iBAAiB,EACjBC,iBAAiB,EACjBG,cACF,CAAC;IACH;IACA,IAAIlE,UAAU,CAAC+F,aAAa,CAACd,kBAAkB,CAAC,EAAE;MAChD,OAAOR,gBAAgB,CAAC,CAAC;IAC3B;EACF,CAAC,EAAE,CACDQ,kBAAkB,EAClBnB,iBAAiB,EACjBI,cAAc,EACdV,UAAU,EACVC,QAAQ,EACRM,iBAAiB,EACjBC,sBAAsB,EACtBC,oBAAoB,CACrB,CAAC;EAEF,oBACE9C,KAAA;IAAKiD,SAAS,EAAC,uBAAuB;IAAA/B,QAAA,gBACpCpB,IAAA,CAACf,MAAM;MACLkC,KAAK,EAAE0B,iBAAkB;MACzB,eAAY,kBAAkB;MAC9BM,SAAS,EAAC,oBAAoB;MAC9BE,QAAQ,EAAE0B,qBAAsB;MAAA3D,QAAA,EAE/BqD;IAAU,CACL,CAAC,EACRY,eAAe;EAAA,CACb,CAAC;AAEV;AAEA,eAAe1B,eAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../../../../../node_modules/@deephaven/components/scss/custom.scss","../../../../../node_modules/@deephaven/components/scss/bootstrap_overrides.scss","../../../src/sidebar/conditional-formatting/ConditionalFormatEditor.scss","../../../../../node_modules/@deephaven/components/scss/new_variables.scss"],"names":[],"mappings":"AAAA;AC6LA;AC3LA;EACE,SCGS;;ADDT;EACE;EACA;EACA,aCHO;;ADMT;EACE;EACA;;AAGF;EACE;EACA;;AAGF;EACE;;AAGF;EACE","file":"ConditionalFormatEditor.css","sourcesContent":["/* stylelint-disable scss/at-import-no-partial-leading-underscore */\n// Consumers should be able to resolve bootstrap/ to node_modules/bootstrap\n\n//Make bootstrap functions available for use in overrides\n@import 'bootstrap/scss/_functions.scss';\n@import './bootstrap_overrides.scss';\n\n//_variable imports come after bootstrap default overrides,\n// makes all other variables and mixins from bootstrap available\n/// with just importing customer.scss\n@import 'bootstrap/scss/_variables.scss';\n@import 'bootstrap/scss/_mixins.scss';\n\n//New variables come after imports\n@import './new_variables.scss';\n@import './util.scss';\n","// Styling overrides for bootstrap\n@use 'sass:map';\n\n// Override / set color variables\n$red: var(--dh-color-visual-red);\n$orange: var(--dh-color-visual-orange);\n$yellow: var(--dh-color-visual-yellow);\n$green: var(--dh-color-visual-green);\n$blue: var(--dh-color-visual-blue);\n$purple: var(--dh-color-visual-purple);\n\n// Fallback colors are used if theme isn't loaded\n// this is required for error messages if the API doesn't load\n\n//Define our Gray scale\n$gray-100: var(--dh-color-gray-900, #fcfcfa);\n$gray-200: var(--dh-color-gray-800);\n$gray-300: var(--dh-color-gray-700);\n$gray-400: var(--dh-color-gray-600);\n$gray-500: var(--dh-color-gray-500);\n// intentional duplicate, scale doesn't line up otherwise\n// as we have gray-850 and spectrum doesn't and it is needed\n$gray-600: var(--dh-color-gray-500);\n$gray-700: var(--dh-color-gray-400);\n$gray-800: var(--dh-color-gray-300);\n$gray-850: var(--dh-color-gray-200);\n$gray-900: var(--dh-color-gray-75);\n$black: var(--dh-color-black, #1a171a);\n$white: var(--dh-color-white, #f0f0ee);\n\n//Define some UI colors\n$interfacegray: var(--dh-color-content-bg, #2d2a2e);\n$interfaceblue: var(--dh-color-accent-bg);\n$interfacewhite: $white;\n$interfaceblack: $black;\n$content-bg: var(--dh-color-content-bg, #2d2a2e);\n$background: var(--dh-color-bg, #1a171a);\n$foreground: var(--dh-color-fg, #f0f0ee);\n\n// Extend default Bootstrap $grays map\n$grays-custom: (\n '850': $gray-850,\n);\n$grays: () !default;\n$grays: map-merge($grays, $grays-custom);\n\n// Extend default Bootstrap $colors map\n$colors-custom: (\n 'black': $black,\n);\n$colors: () !default;\n$colors: map-merge($colors, $colors-custom);\n\n// Override default Bootstrap $theme-colors map by mapping each key to itself.\n// These will then be re-mapped inside of `button-outline-variant` and\n// `button-outline-variant` mixins in `bootstrap_override_mixins_buttons.scss`\n$theme-colors-self-map: ();\n@each $key\n in (\n 'primary',\n 'secondary',\n 'success',\n 'info',\n 'warning',\n 'danger',\n 'light',\n 'dark'\n )\n{\n $theme-colors-self-map: map.set($theme-colors-self-map, $key, $key);\n}\n$theme-colors: () !default;\n$theme-colors: map-merge($theme-colors, $theme-colors-self-map);\n\n// Used by bootstrap_override_mixins_buttons.scss to map Bootstrap colors to\n// DH semantic colors\n$bootstrap-dh-semantic-map: (\n 'primary': 'accent',\n 'secondary': 'neutral',\n 'success': 'positive',\n 'info': 'info',\n 'warning': 'notice',\n 'danger': 'negative',\n // We shouldn't be using these, but mapping so they work with our custom\n // `color-yiq` mixin. If we find a way to remove $light + $dark that are\n // defined in Bootstrap _variables.scss, we should remove these\n 'light': 'neutral',\n 'dark': 'neutral',\n);\n\n//Set default colors\n$body-bg: $black;\n$body-color: $interfacewhite;\n\n// Set brand colors\n$primary: var(--dh-color-accent-bg);\n$primary-hover: var(--dh-color-accent-hover-bg);\n$primary-dark: var(--dh-color-accent-down-bg);\n$secondary: var(--dh-color-neutral-bg);\n$secondary-hover: var(--dh-color-neutral-hover-bg);\n$success: $green;\n$info: $yellow;\n$warning: $orange;\n$danger: var(--dh-color-negative-bg);\n$danger-hover: var(--dh-color-negative-hover-bg);\n// We really don't want to use $light or $dark variables, but Bootstrap defines\n// them in _variables.scss. Explicitly setting them to ensure we are in control\n// of their values. If we can find a way to remove them, we should\n$light: var(--dh-color-gray-light);\n$dark: var(--dh-color-gray-dark);\n// Bootstrap doesn't define $mid, and we want to move away from this particular\n// semantic. Should be deleted by #1635\n$mid: var(--dh-color-gray-mid);\n\n$semantic-colors: (\n 'primary-hover': $primary-hover,\n 'primary-dark': $primary-dark,\n 'mid': $mid,\n 'content-bg': $interfacegray,\n 'background': $interfaceblack,\n 'foreground': $interfacewhite,\n 'secondary-hover': $secondary-hover,\n 'danger-hover': $danger-hover,\n);\n\n$component-active-bg: $primary;\n$theme-color-interval: 9%;\n$yiq-contrasted-threshold: 180;\n\n// Override fonts\n$font-family-sans-serif:\n 'Fira Sans',\n -apple-system,\n blinkmacsystemfont,\n 'Segoe UI',\n 'Roboto',\n 'Helvetica Neue',\n arial,\n sans-serif; //fira sans then native system ui fallbacks\n$font-family-monospace: 'Fira Mono', menlo, monaco, consolas, 'Liberation Mono',\n 'Courier New', monospace;\n$font-family-base: $font-family-sans-serif;\n\n$headings-font-weight: 400;\n\n//Text overides\n$text-muted: $gray-400;\n\n//Style Selection highlight color\n$text-select-color: var(--dh-color-text-highlight);\n\n//Grid variables, same value as default just making easily accessible\n$grid-gutter-width: 30px;\n\n//Visual Overrides\n$border-radius: 4px;\n$box-shadow: 0 0.1rem 1rem var(--dh-color-dropshadow);\n\n//Override Btn\n$btn-border-radius: 4rem;\n$btn-padding-x: 1.5rem;\n$btn-transition:\n color 0.12s ease-in-out,\n background-color 0.12s ease-in-out,\n border-color 0.12s ease-in-out,\n box-shadow 0.12s ease-in-out; //default 0.15 is too long\n$btn-border-width: 2px;\n$btn-font-weight: var(--spectrum-global-font-weight-bold);\n$btn-line-height: 1.3;\n\n//Override Inputs\n$input-bg: var(--dh-color-input-bg);\n$input-disabled-bg: var(--dh-color-input-disabled-bg);\n$input-color: var(--dh-color-input-fg);\n$input-border-color: var(--dh-color-input-border);\n$input-placeholder-color: var(--dh-color-input-placeholder);\n$input-focus-border-color: var(--dh-color-input-focus-border);\n\n$input-btn-focus-width: 0.2rem;\n$input-btn-focus-color: color-mix(\n in srgb,\n var(--dh-color-accent) 35%,\n transparent\n);\n$input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color;\n$input-btn-line-height: 1.3;\n// Bootstrap uses a calc expression to determine the input height (calc(line-height + 2*padding-y + border)).\n// The padding-y value has to be in rem to match units as it is a SASS calc.\n// Using 0.42145rem with 1.3 line height gets us to spectrum's 32px.\n/* stylelint-disable-next-line number-max-precision */\n$input-btn-padding-y: 0.42145rem;\n\n//checkbox\n$custom-control-indicator-bg: var(--dh-color-input-bg);\n$custom-control-indicator-border-color: var(--dh-color-input-border);\n$custom-checkbox-indicator-border-radius: 2px;\n$custom-control-indicator-border-width: 2px;\n$custom-control-indicator-active-bg: var(--dh-color-input-bg);\n$custom-control-indicator-active-border-color: var(--dh-color-input-fg);\n$custom-control-indicator-checked-bg: var(--dh-color-input-fg);\n$custom-control-indicator-checked-color: black; // used as mask fill color\n$custom-checkbox-indicator-indeterminate-bg: var(--dh-color-input-fg);\n$custom-control-indicator-bg-size: 75% 75%;\n$custom-control-indicator-disabled-bg: var(--dh-color-input-disabled-bg);\n$custom-control-indicator-checked-disabled-bg: var(\n --dh-color-input-disabled-bg\n);\n$custom-control-label-disabled-color: var(--dh-color-input-disabled-fg);\n\n// The $custom-select-indicator variable is used by Bootstrap to provide the\n// icon for the select dropdown. Inline svgs can't use CSS variables, so we hard\n// code the color to #929192 (the default value of --dh-color-gray-600). PR #1651\n// overrides this icon altogether for known dropdowns, so technically we may not\n// need this, but it's here in case there are any remaining instances.\n$custom-select-indicator-color: #929192;\n$custom-select-bg: var(--dh-color-selector-bg);\n$custom-select-bg-size: 16px 16px;\n//dhSort icon encoded\n$custom-select-indicator: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='#{$custom-select-indicator-color}' d='M4 7l-.4-.8 4-3.7h.8l4 3.7-.4.8H4zm0 2l-.4.8 4 3.7h.8l4-3.7L12 9H4z'/%3E%3C/svg%3E\"),\n '#',\n '%23'\n);\n$custom-select-focus-box-shadow: $input-btn-focus-box-shadow;\n$custom-select-disabled-color: $gray-500;\n$custom-select-disabled-bg: $gray-800;\n\n//modal\n$modal-content-bg: $content-bg;\n$modal-content-border-width: 0;\n$modal-md: 550px;\n$close-color: var(--dh-color-text);\n$close-text-shadow: none;\n\n// Toast notification\n$toast-bg: var(--dh-color-accent-100);\n$toast-color: var(--dh-color-text);\n$toast-error-bg: var(--dh-color-negative-bg);\n$toast-error-color: var(--dh-color-text);\n\n//tooltips\n$tooltip-bg: var(--dh-color-tooltip-bg);\n$tooltip-color: var(--dh-color-tooltip-fg);\n$tooltip-box-shadow: 0 0.1rem 1.5rem 0.1rem var(--dh-color-tooltip-box-shadow);\n\n//drowdowns\n$dropdown-bg: $gray-600;\n$dropdown-link-color: $foreground;\n$dropdown-link-hover-color: $foreground;\n$dropdown-link-hover-bg: var(--dh-color-item-list-hover-bg);\n$dropdown-divider-bg: $gray-700;\n\n//context menus\n$contextmenu-bg: var(--dh-color-popover-bg);\n$contextmenu-color: var(--dh-color-text);\n$contextmenu-disabled-color: var(--dh-color-input-disabled-fg);\n$contextmenu-keyboard-selected-bg: var(--dh-color-keyboard-selected-bg);\n$contextmenu-selected-bg: var(--dh-color-item-list-hover-bg);\n$contextmenu-selected-color: var(--dh-color-item-list-selected-fg);\n\n//hr\n$hr-border-color: var(--dh-color-hr);\n\n//links\n$link-color: $gray-400;\n$link-hover-color: $foreground;\n\n//progress-bar\n$progress-bg: $gray-600;\n$progress-border-radius: 1rem;\n\n// Set global options\n$enable-shadows: false;\n$enable-gradients: false;\n$enable-print-styles: false; //I don't think anyone should expect to \"print\" this app.\n\n// Transition times\n$transition: 0.15s;\n$transition-mid: 0.2s;\n$transition-long: 0.3s;\n$transition-slow: 0.6s;\n\n//form-validation icon, uses vsWarning icon encoded here as svg\n$form-feedback-icon-invalid-color: $danger;\n$form-feedback-icon-invalid: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cg fill='none'%3E%3Cg fill='#{$form-feedback-icon-invalid-color}'%3E%3Cpath d='M7.56 1h.88l6.54 12.26-.44.74H1.44L1 13.26 7.56 1zM8 2.28 2.28 13H13.7L8 2.28zM8.625 12v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E \"),\n '#',\n '%23'\n);\n\n// This section of variables is not consumed directly by DH, but they need to be\n// defined for sass to compile _variables\n$table-dark-bg: $gray-800;\n$table-dark-accent-bg: var(--dh-color-highlight-hover);\n$table-dark-hover-bg: var(--dh-color-highlight-active);\n$table-dark-border-color: $gray-700;\n$popover-bg: var(--dh-color-tooltip-bg);\n$popover-border-color: var(--dh-color-overlay-modal-bg);\n$popover-header-bg: #000;\n$popover-arrow-outer-color: var(--dh-color-dropshadow);\n$custom-range-thumb-active-bg: var(--dh-color-accent-1100);\n","@import '@deephaven/components/scss/custom.scss';\n\n.conditional-format-editor {\n padding: $spacer-3;\n\n .formatter-list {\n display: flex;\n justify-content: flex-start;\n padding-top: $spacer-2;\n }\n\n .formatter-type {\n margin: 0 $spacer-3 0 0;\n display: flex;\n }\n\n .btn-formatter-type {\n font-size: smaller;\n width: 100%;\n }\n\n .color-select {\n padding: 0 2em 0 0.25em;\n }\n\n .dh-combobox {\n width: 100%;\n }\n}\n","@use 'sass:math';\n\n//Set of spacer variables from the spacer map\n$spacer-0: map-get($spacers, 0); //0\n$spacer-1: map-get($spacers, 1);\n$spacer-2: map-get($spacers, 2);\n$spacer-3: map-get($spacers, 3);\n$spacer-4: map-get($spacers, 4);\n$spacer-5: map-get($spacers, 5);\n\n//Marching Ants for golden layout dropzone and drag and drop\n//top bottom, left right.\n//create 4 background images that are 50% color 1, 50% color 2 using graidents, two veritical, two horizontal\n//size them to ant-size and thickness\n//position those images along the egdes and make top/bottom repeat-x and left/right repeat-y\n//then offest each of those background positions by ant-size in animation to make them march.\n$ant-size: 8px;\n$ant-thickness: 1px;\n\n@mixin ants-base($color-1: black, $color-2: white) {\n background-image: linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%);\n background-size:\n $ant-size $ant-thickness,\n $ant-size $ant-thickness,\n $ant-thickness $ant-size,\n $ant-thickness $ant-size;\n background-position:\n 0 top,\n 0 bottom,\n left 0,\n right 0;\n background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;\n animation: march 0.5s;\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n}\n\n@mixin drag-stack($pseudo-element) {\n &::#{$pseudo-element} {\n content: ' ';\n background: $primary;\n box-shadow: $box-shadow;\n border-radius: $border-radius;\n position: absolute;\n height: 100%;\n width: 100%;\n @content;\n }\n}\n\n$focus-bg-transparency: 12%;\n$hover-bg-transparency: 14%;\n$active-bg-transparency: 28%;\n$exception-transparency: 28%;\n"]}
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../../../node_modules/@deephaven/components/scss/custom.scss","../../../../../node_modules/@deephaven/components/scss/bootstrap_overrides.scss","../../../src/sidebar/conditional-formatting/ConditionalFormatEditor.scss","../../../../../node_modules/@deephaven/components/scss/new_variables.scss"],"names":[],"mappings":"AAAA;AC6LA;AC3LA;EACE,SCGS;;ADDT;EACE;EACA;EACA,aCHO;;ADMT;EACE;EACA;;AAGF;EACE;EACA;;AAGF;EACE;;AAGF;EACE","file":"ConditionalFormatEditor.css","sourcesContent":["/* stylelint-disable scss/at-import-no-partial-leading-underscore */\n// Consumers should be able to resolve bootstrap/ to node_modules/bootstrap\n\n//Make bootstrap functions available for use in overrides\n@import 'bootstrap/scss/_functions.scss';\n@import './bootstrap_overrides.scss';\n\n//_variable imports come after bootstrap default overrides,\n// makes all other variables and mixins from bootstrap available\n/// with just importing customer.scss\n@import 'bootstrap/scss/_variables.scss';\n@import 'bootstrap/scss/_mixins.scss';\n\n//New variables come after imports\n@import './new_variables.scss';\n@import './util.scss';\n","// Styling overrides for bootstrap\n@use 'sass:map';\n\n// Override / set color variables\n$red: var(--dh-color-visual-red);\n$orange: var(--dh-color-visual-orange);\n$yellow: var(--dh-color-visual-yellow);\n$green: var(--dh-color-visual-green);\n$blue: var(--dh-color-visual-blue);\n$purple: var(--dh-color-visual-purple);\n\n// Fallback colors are used if theme isn't loaded\n// this is required for error messages if the API doesn't load\n\n//Define our Gray scale\n$gray-100: var(--dh-color-gray-900, #fcfcfa);\n$gray-200: var(--dh-color-gray-800);\n$gray-300: var(--dh-color-gray-700);\n$gray-400: var(--dh-color-gray-600);\n$gray-500: var(--dh-color-gray-500);\n// intentional duplicate, scale doesn't line up otherwise\n// as we have gray-850 and spectrum doesn't and it is needed\n$gray-600: var(--dh-color-gray-500);\n$gray-700: var(--dh-color-gray-400);\n$gray-800: var(--dh-color-gray-300);\n$gray-850: var(--dh-color-gray-200);\n$gray-900: var(--dh-color-gray-75);\n$black: var(--dh-color-black, #1a171a);\n$white: var(--dh-color-white, #f0f0ee);\n\n//Define some UI colors\n$interfacegray: var(--dh-color-content-bg, #2d2a2e);\n$interfaceblue: var(--dh-color-accent-bg);\n$interfacewhite: $white;\n$interfaceblack: $black;\n$content-bg: var(--dh-color-content-bg, #2d2a2e);\n$background: var(--dh-color-bg, #1a171a);\n$foreground: var(--dh-color-fg, #f0f0ee);\n\n// Extend default Bootstrap $grays map\n$grays-custom: (\n '850': $gray-850,\n);\n$grays: () !default;\n$grays: map-merge($grays, $grays-custom);\n\n// Extend default Bootstrap $colors map\n$colors-custom: (\n 'black': $black,\n);\n$colors: () !default;\n$colors: map-merge($colors, $colors-custom);\n\n// Override default Bootstrap $theme-colors map by mapping each key to itself.\n// These will then be re-mapped inside of `button-outline-variant` and\n// `button-outline-variant` mixins in `bootstrap_override_mixins_buttons.scss`\n$theme-colors-self-map: ();\n@each $key\n in (\n 'primary',\n 'secondary',\n 'success',\n 'info',\n 'warning',\n 'danger',\n 'light',\n 'dark'\n )\n{\n $theme-colors-self-map: map.set($theme-colors-self-map, $key, $key);\n}\n$theme-colors: () !default;\n$theme-colors: map-merge($theme-colors, $theme-colors-self-map);\n\n// Used by bootstrap_override_mixins_buttons.scss to map Bootstrap colors to\n// DH semantic colors\n$bootstrap-dh-semantic-map: (\n 'primary': 'accent',\n 'secondary': 'neutral',\n 'success': 'positive',\n 'info': 'info',\n 'warning': 'notice',\n 'danger': 'negative',\n // We shouldn't be using these, but mapping so they work with our custom\n // `color-yiq` mixin. If we find a way to remove $light + $dark that are\n // defined in Bootstrap _variables.scss, we should remove these\n 'light': 'neutral',\n 'dark': 'neutral',\n);\n\n//Set default colors\n$body-bg: $black;\n$body-color: $interfacewhite;\n\n// Set brand colors\n$primary: var(--dh-color-accent-bg);\n$primary-hover: var(--dh-color-accent-hover-bg);\n$primary-dark: var(--dh-color-accent-down-bg);\n$secondary: var(--dh-color-neutral-bg);\n$secondary-hover: var(--dh-color-neutral-hover-bg);\n$success: $green;\n$info: $yellow;\n$warning: $orange;\n$danger: var(--dh-color-negative-bg);\n$danger-hover: var(--dh-color-negative-hover-bg);\n// We really don't want to use $light or $dark variables, but Bootstrap defines\n// them in _variables.scss. Explicitly setting them to ensure we are in control\n// of their values. If we can find a way to remove them, we should\n$light: var(--dh-color-gray-light);\n$dark: var(--dh-color-gray-dark);\n// Bootstrap doesn't define $mid, and we want to move away from this particular\n// semantic. Should be deleted by #1635\n$mid: var(--dh-color-gray-mid);\n\n$semantic-colors: (\n 'primary-hover': $primary-hover,\n 'primary-dark': $primary-dark,\n 'mid': $mid,\n 'content-bg': $interfacegray,\n 'background': $interfaceblack,\n 'foreground': $interfacewhite,\n 'secondary-hover': $secondary-hover,\n 'danger-hover': $danger-hover,\n);\n\n$component-active-bg: $primary;\n$theme-color-interval: 9%;\n$yiq-contrasted-threshold: 180;\n\n// Override fonts\n$font-family-sans-serif:\n 'Fira Sans',\n -apple-system,\n blinkmacsystemfont,\n 'Segoe UI',\n 'Roboto',\n 'Helvetica Neue',\n arial,\n sans-serif; //fira sans then native system ui fallbacks\n$font-family-monospace: 'Fira Mono', menlo, monaco, consolas, 'Liberation Mono',\n 'Courier New', monospace;\n$font-family-base: $font-family-sans-serif;\n\n$headings-font-weight: 400;\n\n//Text overides\n$text-muted: $gray-400;\n\n//Style Selection highlight color\n$text-select-color: var(--dh-color-text-highlight);\n\n//Grid variables, same value as default just making easily accessible\n$grid-gutter-width: 30px;\n\n//Visual Overrides\n$border-radius: 4px;\n$box-shadow: 0 0.1rem 1rem var(--dh-color-dropshadow);\n\n//Override Btn\n$btn-border-radius: 4rem;\n$btn-padding-x: 1.5rem;\n$btn-transition:\n color 0.12s ease-in-out,\n background-color 0.12s ease-in-out,\n border-color 0.12s ease-in-out,\n box-shadow 0.12s ease-in-out; //default 0.15 is too long\n$btn-border-width: 2px;\n$btn-font-weight: var(--spectrum-global-font-weight-bold);\n$btn-line-height: 1.3;\n\n//Override Inputs\n$input-bg: var(--dh-color-input-bg);\n$input-disabled-bg: var(--dh-color-input-disabled-bg);\n$input-color: var(--dh-color-input-fg);\n$input-border-color: var(--dh-color-input-border);\n$input-placeholder-color: var(--dh-color-input-placeholder);\n$input-focus-border-color: var(--dh-color-input-focus-border);\n\n$input-btn-focus-width: 0.2rem;\n$input-btn-focus-color: color-mix(\n in srgb,\n var(--dh-color-accent) 35%,\n transparent\n);\n$input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color;\n$input-btn-line-height: 1.3;\n// Bootstrap uses a calc expression to determine the input height (calc(line-height + 2*padding-y + border)).\n// The padding-y value has to be in rem to match units as it is a SASS calc.\n// Using 0.42145rem with 1.3 line height gets us to spectrum's 32px.\n/* stylelint-disable-next-line number-max-precision */\n$input-btn-padding-y: 0.42145rem;\n\n//checkbox\n$custom-control-indicator-bg: var(--dh-color-input-bg);\n$custom-control-indicator-border-color: var(--dh-color-input-border);\n$custom-checkbox-indicator-border-radius: 2px;\n$custom-control-indicator-border-width: 2px;\n$custom-control-indicator-active-bg: var(--dh-color-input-bg);\n$custom-control-indicator-active-border-color: var(--dh-color-input-fg);\n$custom-control-indicator-checked-bg: var(--dh-color-input-fg);\n$custom-control-indicator-checked-color: black; // used as mask fill color\n$custom-checkbox-indicator-indeterminate-bg: var(--dh-color-input-fg);\n$custom-control-indicator-bg-size: 75% 75%;\n$custom-control-indicator-disabled-bg: var(--dh-color-input-disabled-bg);\n$custom-control-indicator-checked-disabled-bg: var(\n --dh-color-input-disabled-bg\n);\n$custom-control-label-disabled-color: var(--dh-color-input-disabled-fg);\n\n// The $custom-select-indicator variable is used by Bootstrap to provide the\n// icon for the select dropdown. Inline svgs can't use CSS variables, so we hard\n// code the color to #929192 (the default value of --dh-color-gray-600). PR #1651\n// overrides this icon altogether for known dropdowns, so technically we may not\n// need this, but it's here in case there are any remaining instances.\n$custom-select-indicator-color: #929192;\n$custom-select-bg: var(--dh-color-selector-bg);\n$custom-select-bg-size: 16px 16px;\n//dhSort icon encoded\n$custom-select-indicator: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='#{$custom-select-indicator-color}' d='M4 7l-.4-.8 4-3.7h.8l4 3.7-.4.8H4zm0 2l-.4.8 4 3.7h.8l4-3.7L12 9H4z'/%3E%3C/svg%3E\"),\n '#',\n '%23'\n);\n$custom-select-focus-box-shadow: $input-btn-focus-box-shadow;\n$custom-select-disabled-color: $gray-500;\n$custom-select-disabled-bg: $gray-800;\n\n//modal\n$modal-content-bg: $content-bg;\n$modal-content-border-width: 0;\n$modal-md: 550px;\n$close-color: var(--dh-color-text);\n$close-text-shadow: none;\n\n// Toast notification\n$toast-bg: var(--dh-color-accent-100);\n$toast-color: var(--dh-color-text);\n$toast-error-bg: var(--dh-color-negative-bg);\n$toast-error-color: var(--dh-color-text);\n\n//tooltips\n$tooltip-bg: var(--dh-color-tooltip-bg);\n$tooltip-color: var(--dh-color-tooltip-fg);\n$tooltip-box-shadow: 0 0.1rem 1.5rem 0.1rem var(--dh-color-tooltip-box-shadow);\n\n//drowdowns\n$dropdown-bg: $gray-600;\n$dropdown-link-color: $foreground;\n$dropdown-link-hover-color: $foreground;\n$dropdown-link-hover-bg: var(--dh-color-item-list-hover-bg);\n$dropdown-divider-bg: $gray-700;\n\n//context menus\n$contextmenu-bg: var(--dh-color-popover-bg);\n$contextmenu-color: var(--dh-color-text);\n$contextmenu-disabled-color: var(--dh-color-text-disabled);\n$contextmenu-keyboard-selected-bg: var(--dh-color-keyboard-selected-bg);\n$contextmenu-selected-bg: var(--dh-color-item-list-hover-bg);\n$contextmenu-selected-color: var(--dh-color-item-list-selected-fg);\n\n//hr\n$hr-border-color: var(--dh-color-hr);\n\n//links\n$link-color: $gray-400;\n$link-hover-color: $foreground;\n\n//progress-bar\n$progress-bg: $gray-600;\n$progress-border-radius: 1rem;\n\n// Set global options\n$enable-shadows: false;\n$enable-gradients: false;\n$enable-print-styles: false; //I don't think anyone should expect to \"print\" this app.\n\n// Transition times\n$transition: 0.15s;\n$transition-mid: 0.2s;\n$transition-long: 0.3s;\n$transition-slow: 0.6s;\n\n//form-validation icon, uses vsWarning icon encoded here as svg\n$form-feedback-icon-invalid-color: $danger;\n$form-feedback-icon-invalid: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cg fill='none'%3E%3Cg fill='#{$form-feedback-icon-invalid-color}'%3E%3Cpath d='M7.56 1h.88l6.54 12.26-.44.74H1.44L1 13.26 7.56 1zM8 2.28 2.28 13H13.7L8 2.28zM8.625 12v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E \"),\n '#',\n '%23'\n);\n\n// This section of variables is not consumed directly by DH, but they need to be\n// defined for sass to compile _variables\n$table-dark-bg: $gray-800;\n$table-dark-accent-bg: var(--dh-color-highlight-hover);\n$table-dark-hover-bg: var(--dh-color-highlight-active);\n$table-dark-border-color: $gray-700;\n$popover-bg: var(--dh-color-tooltip-bg);\n$popover-border-color: var(--dh-color-overlay-modal-bg);\n$popover-header-bg: #000;\n$popover-arrow-outer-color: var(--dh-color-dropshadow);\n$custom-range-thumb-active-bg: var(--dh-color-accent-1100);\n","@import '@deephaven/components/scss/custom.scss';\n\n.conditional-format-editor {\n padding: $spacer-3;\n\n .formatter-list {\n display: flex;\n justify-content: flex-start;\n padding-top: $spacer-2;\n }\n\n .formatter-type {\n margin: 0 $spacer-3 0 0;\n display: flex;\n }\n\n .btn-formatter-type {\n font-size: smaller;\n width: 100%;\n }\n\n .color-select {\n padding: 0 2em 0 0.25em;\n }\n\n .dh-combobox {\n width: 100%;\n }\n}\n","@use 'sass:math';\n\n//Set of spacer variables from the spacer map\n$spacer-0: map-get($spacers, 0); //0\n$spacer-1: map-get($spacers, 1);\n$spacer-2: map-get($spacers, 2);\n$spacer-3: map-get($spacers, 3);\n$spacer-4: map-get($spacers, 4);\n$spacer-5: map-get($spacers, 5);\n\n//Marching Ants for golden layout dropzone and drag and drop\n//top bottom, left right.\n//create 4 background images that are 50% color 1, 50% color 2 using graidents, two veritical, two horizontal\n//size them to ant-size and thickness\n//position those images along the egdes and make top/bottom repeat-x and left/right repeat-y\n//then offest each of those background positions by ant-size in animation to make them march.\n$ant-size: 8px;\n$ant-thickness: 1px;\n\n@mixin ants-base($color-1: black, $color-2: white) {\n background-image: linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%);\n background-size:\n $ant-size $ant-thickness,\n $ant-size $ant-thickness,\n $ant-thickness $ant-size,\n $ant-thickness $ant-size;\n background-position:\n 0 top,\n 0 bottom,\n left 0,\n right 0;\n background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;\n animation: march 0.5s;\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n}\n\n@mixin drag-stack($pseudo-element) {\n &::#{$pseudo-element} {\n content: ' ';\n background: $primary;\n box-shadow: $box-shadow;\n border-radius: $border-radius;\n position: absolute;\n height: 100%;\n width: 100%;\n @content;\n }\n}\n\n$focus-bg-transparency: 12%;\n$hover-bg-transparency: 14%;\n$active-bg-transparency: 28%;\n$exception-transparency: 28%;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionalFormatEditor.js","names":["React","useCallback","useState","classNames","Button","Log","FormatColumnWhereIcon","FormatRowWhereIcon","ColumnFormatEditor","RowFormatEditor","FormatterType","isSupportedColumn","jsx","_jsx","jsxs","_jsxs","log","module","DEFAULT_CALLBACK","undefined","getFormatterTypeIcon","option","CONDITIONAL","ROWS","getFormatterTypeLabel","formatterTypes","ConditionalFormatEditor","props","_defaultRule$type","columns","originalColumns","dh","onSave","onUpdate","onCancel","rule","defaultRule","filter","selectedFormatter","setFormatter","type","setRule","isValid","setIsValid","handleCancel","handleSave","error","handleFormatterChange","value","debug","handleRuleChange","ruleConfig","isRuleValid","updatedRule","config","className","children","htmlFor","map","index","active","onClick","onChange","kind","disabled"],"sources":["../../../src/sidebar/conditional-formatting/ConditionalFormatEditor.tsx"],"sourcesContent":["import React, { useCallback, useState } from 'react';\nimport classNames from 'classnames';\nimport { Button } from '@deephaven/components';\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport Log from '@deephaven/log';\nimport { FormatColumnWhereIcon, FormatRowWhereIcon } from '../icons';\nimport ColumnFormatEditor from './ColumnFormatEditor';\nimport RowFormatEditor from './RowFormatEditor';\nimport {\n type BaseFormatConfig,\n FormatterType,\n type FormattingRule,\n isSupportedColumn,\n type ModelColumn,\n} from './ConditionalFormattingUtils';\nimport './ConditionalFormatEditor.scss';\n\nconst log = Log.module('ConditionalFormatEditor');\n\nexport type SaveCallback = (rule: FormattingRule) => void;\n\nexport type UpdateCallback = (rule?: FormattingRule) => void;\n\nexport type CancelCallback = () => void;\n\nexport interface ConditionalFormatEditorProps {\n dh: typeof DhType;\n columns: readonly ModelColumn[];\n rule?: FormattingRule;\n onCancel?: CancelCallback;\n onSave?: SaveCallback;\n onUpdate?: UpdateCallback;\n}\n\nconst DEFAULT_CALLBACK = (): void => undefined;\n\nfunction getFormatterTypeIcon(option: FormatterType): JSX.Element | undefined {\n switch (option) {\n case FormatterType.CONDITIONAL:\n return <FormatColumnWhereIcon />;\n case FormatterType.ROWS:\n return <FormatRowWhereIcon />;\n }\n}\n\nfunction getFormatterTypeLabel(option: FormatterType): string {\n switch (option) {\n case FormatterType.CONDITIONAL:\n return 'Conditional';\n case FormatterType.ROWS:\n return 'Rows';\n }\n}\n\nconst formatterTypes = [FormatterType.CONDITIONAL, FormatterType.ROWS];\n\nfunction ConditionalFormatEditor(\n props: ConditionalFormatEditorProps\n): JSX.Element {\n const {\n columns: originalColumns,\n dh,\n onSave = DEFAULT_CALLBACK,\n onUpdate = DEFAULT_CALLBACK,\n onCancel = DEFAULT_CALLBACK,\n rule: defaultRule,\n } = props;\n\n const columns = originalColumns.filter(isSupportedColumn);\n\n const [selectedFormatter, setFormatter] = useState(\n defaultRule?.type ?? formatterTypes[0]\n );\n const [rule, setRule] = useState(defaultRule);\n const [isValid, setIsValid] = useState(false);\n\n const handleCancel = useCallback(() => {\n onCancel();\n }, [onCancel]);\n\n const handleSave = useCallback(() => {\n if (rule === undefined) {\n log.error('Rule is not defined.');\n return;\n }\n onSave(rule);\n }, [onSave, rule]);\n\n const handleFormatterChange = useCallback(value => {\n log.debug('handleFormatterChange', value);\n setFormatter(value);\n }, []);\n\n const handleRuleChange = useCallback(\n (ruleConfig, isRuleValid: boolean) => {\n log.debug('handleRuleChange', ruleConfig, isRuleValid, selectedFormatter);\n const updatedRule = {\n type: selectedFormatter,\n config: ruleConfig as BaseFormatConfig,\n };\n setRule(updatedRule);\n setIsValid(isRuleValid);\n onUpdate(isRuleValid ? updatedRule : undefined);\n },\n [onUpdate, selectedFormatter]\n );\n\n return (\n <div className=\"conditional-format-editor form\">\n <div className=\"mb-2\">\n <label className=\"mb-0\" htmlFor=\"formatter-select\">\n Select Formatter\n </label>\n\n <div className=\"formatter-list\">\n {formatterTypes.map((type, index) => (\n <div key={type} className=\"formatter-type\">\n <button\n type=\"button\"\n className={classNames('btn', 'btn-icon', 'btn-formatter-type', {\n active: type === selectedFormatter,\n })}\n data-index={index}\n onClick={() => handleFormatterChange(type)}\n >\n {getFormatterTypeIcon(type)}\n {getFormatterTypeLabel(type)}\n </button>\n </div>\n ))}\n </div>\n </div>\n {selectedFormatter === FormatterType.CONDITIONAL && (\n <ColumnFormatEditor\n columns={columns}\n dh={dh}\n config={rule?.config}\n onChange={handleRuleChange}\n />\n )}\n {selectedFormatter === FormatterType.ROWS && (\n <RowFormatEditor\n columns={columns}\n config={rule?.config}\n dh={dh}\n onChange={handleRuleChange}\n />\n )}\n <hr />\n <div className=\"d-flex justify-content-end my-3\">\n <Button kind=\"secondary\" onClick={handleCancel} className=\"mr-2\">\n Cancel\n </Button>\n <Button\n kind=\"primary\"\n onClick={handleSave}\n disabled={rule === undefined || !isValid}\n >\n Done\n </Button>\n </div>\n </div>\n );\n}\n\nexport default ConditionalFormatEditor;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AACpD,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,MAAM,QAAQ,uBAAuB;AAE9C,OAAOC,GAAG,MAAM,gBAAgB;AAAC,SACxBC,qBAAqB,EAAEC,kBAAkB;AAAA,OAC3CC,kBAAkB;AAAA,OAClBC,eAAe;AAAA,SAGpBC,aAAa,EAEbC,iBAAiB;AAAA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAKnB,IAAMC,GAAG,GAAGX,GAAG,CAACY,MAAM,CAAC,yBAAyB,CAAC;AAiBjD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,MAAM;QACL2D,IAAI,EAAC,SAAS;QACdF,OAAO,EAAEhB,UAAW;QACpBmB,QAAQ,EAAE7B,IAAI,KAAKhB,SAAS,IAAI,CAACuB,OAAQ;QAAAc,QAAA,EAC1C;MAED,CAAQ,CAAC;IAAA,CACN,CAAC;EAAA,CACH,CAAC;AAEV;AAEA,eAAe9B,uBAAuB"
|
|
1
|
+
{"version":3,"file":"ConditionalFormatEditor.js","names":["React","useCallback","useState","classNames","Button","Log","FormatColumnWhereIcon","FormatRowWhereIcon","ColumnFormatEditor","RowFormatEditor","FormatterType","isSupportedColumn","jsx","_jsx","jsxs","_jsxs","log","module","DEFAULT_CALLBACK","undefined","getFormatterTypeIcon","option","CONDITIONAL","ROWS","getFormatterTypeLabel","formatterTypes","ConditionalFormatEditor","props","_defaultRule$type","columns","originalColumns","dh","onSave","onUpdate","onCancel","rule","defaultRule","filter","selectedFormatter","setFormatter","type","setRule","isValid","setIsValid","handleCancel","handleSave","error","handleFormatterChange","value","debug","handleRuleChange","ruleConfig","isRuleValid","updatedRule","config","className","children","htmlFor","map","index","active","onClick","onChange","kind","disabled"],"sources":["../../../src/sidebar/conditional-formatting/ConditionalFormatEditor.tsx"],"sourcesContent":["import React, { useCallback, useState } from 'react';\nimport classNames from 'classnames';\nimport { Button } from '@deephaven/components';\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport Log from '@deephaven/log';\nimport { FormatColumnWhereIcon, FormatRowWhereIcon } from '../icons';\nimport ColumnFormatEditor from './ColumnFormatEditor';\nimport RowFormatEditor from './RowFormatEditor';\nimport {\n type BaseFormatConfig,\n FormatterType,\n type FormattingRule,\n isSupportedColumn,\n type ModelColumn,\n} from './ConditionalFormattingUtils';\nimport './ConditionalFormatEditor.scss';\n\nconst log = Log.module('ConditionalFormatEditor');\n\nexport type SaveCallback = (rule: FormattingRule) => void;\n\nexport type UpdateCallback = (rule?: FormattingRule) => void;\n\nexport type CancelCallback = () => void;\n\nexport interface ConditionalFormatEditorProps {\n dh: typeof DhType;\n columns: readonly ModelColumn[];\n rule?: FormattingRule;\n onCancel?: CancelCallback;\n onSave?: SaveCallback;\n onUpdate?: UpdateCallback;\n}\n\nconst DEFAULT_CALLBACK = (): void => undefined;\n\nfunction getFormatterTypeIcon(option: FormatterType): JSX.Element | undefined {\n switch (option) {\n case FormatterType.CONDITIONAL:\n return <FormatColumnWhereIcon />;\n case FormatterType.ROWS:\n return <FormatRowWhereIcon />;\n }\n}\n\nfunction getFormatterTypeLabel(option: FormatterType): string {\n switch (option) {\n case FormatterType.CONDITIONAL:\n return 'Conditional';\n case FormatterType.ROWS:\n return 'Rows';\n }\n}\n\nconst formatterTypes = [FormatterType.CONDITIONAL, FormatterType.ROWS];\n\nfunction ConditionalFormatEditor(\n props: ConditionalFormatEditorProps\n): JSX.Element {\n const {\n columns: originalColumns,\n dh,\n onSave = DEFAULT_CALLBACK,\n onUpdate = DEFAULT_CALLBACK,\n onCancel = DEFAULT_CALLBACK,\n rule: defaultRule,\n } = props;\n\n const columns = originalColumns.filter(isSupportedColumn);\n\n const [selectedFormatter, setFormatter] = useState(\n defaultRule?.type ?? formatterTypes[0]\n );\n const [rule, setRule] = useState(defaultRule);\n const [isValid, setIsValid] = useState(false);\n\n const handleCancel = useCallback(() => {\n onCancel();\n }, [onCancel]);\n\n const handleSave = useCallback(() => {\n if (rule === undefined) {\n log.error('Rule is not defined.');\n return;\n }\n onSave(rule);\n }, [onSave, rule]);\n\n const handleFormatterChange = useCallback(value => {\n log.debug('handleFormatterChange', value);\n setFormatter(value);\n }, []);\n\n const handleRuleChange = useCallback(\n (ruleConfig, isRuleValid: boolean) => {\n log.debug('handleRuleChange', ruleConfig, isRuleValid, selectedFormatter);\n const updatedRule = {\n type: selectedFormatter,\n config: ruleConfig as BaseFormatConfig,\n };\n setRule(updatedRule);\n setIsValid(isRuleValid);\n onUpdate(isRuleValid ? updatedRule : undefined);\n },\n [onUpdate, selectedFormatter]\n );\n\n return (\n <div className=\"conditional-format-editor form\">\n <div className=\"mb-2\">\n <label className=\"mb-0\" htmlFor=\"formatter-select\">\n Select Formatter\n </label>\n\n <div className=\"formatter-list\">\n {formatterTypes.map((type, index) => (\n <div key={type} className=\"formatter-type\">\n <button\n type=\"button\"\n className={classNames('btn', 'btn-icon', 'btn-formatter-type', {\n active: type === selectedFormatter,\n })}\n data-index={index}\n onClick={() => handleFormatterChange(type)}\n >\n {getFormatterTypeIcon(type)}\n {getFormatterTypeLabel(type)}\n </button>\n </div>\n ))}\n </div>\n </div>\n {selectedFormatter === FormatterType.CONDITIONAL && (\n <ColumnFormatEditor\n columns={columns}\n dh={dh}\n config={rule?.config}\n onChange={handleRuleChange}\n />\n )}\n {selectedFormatter === FormatterType.ROWS && (\n <RowFormatEditor\n columns={columns}\n config={rule?.config}\n dh={dh}\n onChange={handleRuleChange}\n />\n )}\n <hr />\n <div className=\"d-flex justify-content-end my-3\">\n <Button kind=\"secondary\" onClick={handleCancel} className=\"mr-2\">\n Cancel\n </Button>\n <Button\n kind=\"primary\"\n onClick={handleSave}\n disabled={rule === undefined || !isValid}\n >\n Done\n </Button>\n </div>\n </div>\n );\n}\n\nexport default ConditionalFormatEditor;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AACpD,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,MAAM,QAAQ,uBAAuB;AAE9C,OAAOC,GAAG,MAAM,gBAAgB;AAAC,SACxBC,qBAAqB,EAAEC,kBAAkB;AAAA,OAC3CC,kBAAkB;AAAA,OAClBC,eAAe;AAAA,SAGpBC,aAAa,EAEbC,iBAAiB;AAAA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAKnB,IAAMC,GAAG,GAAGX,GAAG,CAACY,MAAM,CAAC,yBAAyB,CAAC;AAiBjD,IAAMC,gBAAgB,GAAGA,CAAA,KAAYC,SAAS;AAE9C,SAASC,oBAAoBA,CAACC,MAAqB,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7B,IAAI,KAAKhB,SAAS,IAAI,CAACuB,OAAQ;QAAAc,QAAA,EAC1C;MAED,CAAQ,CAAC;IAAA,CACN,CAAC;EAAA,CACH,CAAC;AAEV;AAEA,eAAe9B,uBAAuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionalFormattingAPIUtils.js","names":["getConditionDBString","getStyleDBString","makeTernaryFormatRule","config","prevRule","styleDBString","undefined","conditionDBString","concat","makeRowFormatColumn","dh","rule","Column","formatRowColor","makeColumnFormatColumn","col","formatColor"],"sources":["../../../src/sidebar/conditional-formatting/ConditionalFormattingAPIUtils.ts"],"sourcesContent":["import type { dh as DhType } from '@deephaven/jsapi-types';\nimport {\n type BaseFormatConfig,\n getConditionDBString,\n getStyleDBString,\n} from './ConditionalFormattingUtils';\n\n// Conditional formatting API utils in a separate file\n// to make ConditionalFormattingUtils.ts easier to test.\n// https://github.com/facebook/jest/issues/936#issuecomment-545080082\n\nexport function makeTernaryFormatRule(\n config: BaseFormatConfig,\n prevRule: string\n): string | undefined {\n const styleDBString = getStyleDBString(config);\n if (styleDBString === undefined) {\n return undefined;\n }\n const conditionDBString = getConditionDBString(config);\n return `${conditionDBString} ? ${styleDBString} : ${prevRule}`;\n}\n\nexport function makeRowFormatColumn(\n dh: typeof DhType,\n rule: string\n): DhType.CustomColumn {\n return dh.Column.formatRowColor(rule);\n}\n\nexport function makeColumnFormatColumn(\n col: DhType.Column,\n rule: string\n): DhType.CustomColumn {\n return col.formatColor(rule);\n}\n"],"mappings":"SAGEA,oBAAoB,EACpBC,gBAAgB,2CAGlB;AACA;AACA;AAEA,OAAO,SAASC,qBAAqBA,CACnCC,MAAwB,EACxBC,QAAgB,EACI;EACpB,IAAMC,aAAa,GAAGJ,gBAAgB,CAACE,MAAM,CAAC;EAC9C,IAAIE,aAAa,KAAKC,SAAS,EAAE;IAC/B,OAAOA,SAAS;EAClB;EACA,IAAMC,iBAAiB,GAAGP,oBAAoB,CAACG,MAAM,CAAC;EACtD,UAAAK,MAAA,CAAUD,iBAAiB,SAAAC,MAAA,CAAMH,aAAa,SAAAG,MAAA,CAAMJ,QAAQ;AAC9D;AAEA,OAAO,SAASK,mBAAmBA,CACjCC,EAAiB,EACjBC,IAAY,EACS;EACrB,OAAOD,EAAE,CAACE,MAAM,CAACC,cAAc,CAACF,IAAI,CAAC;AACvC;AAEA,OAAO,SAASG,sBAAsBA,CACpCC,GAAkB,EAClBJ,IAAY,EACS;EACrB,OAAOI,GAAG,CAACC,WAAW,CAACL,IAAI,CAAC;AAC9B"
|
|
1
|
+
{"version":3,"file":"ConditionalFormattingAPIUtils.js","names":["getConditionDBString","getStyleDBString","makeTernaryFormatRule","config","prevRule","styleDBString","undefined","conditionDBString","concat","makeRowFormatColumn","dh","rule","Column","formatRowColor","makeColumnFormatColumn","col","formatColor"],"sources":["../../../src/sidebar/conditional-formatting/ConditionalFormattingAPIUtils.ts"],"sourcesContent":["import type { dh as DhType } from '@deephaven/jsapi-types';\nimport {\n type BaseFormatConfig,\n getConditionDBString,\n getStyleDBString,\n} from './ConditionalFormattingUtils';\n\n// Conditional formatting API utils in a separate file\n// to make ConditionalFormattingUtils.ts easier to test.\n// https://github.com/facebook/jest/issues/936#issuecomment-545080082\n\nexport function makeTernaryFormatRule(\n config: BaseFormatConfig,\n prevRule: string\n): string | undefined {\n const styleDBString = getStyleDBString(config);\n if (styleDBString === undefined) {\n return undefined;\n }\n const conditionDBString = getConditionDBString(config);\n return `${conditionDBString} ? ${styleDBString} : ${prevRule}`;\n}\n\nexport function makeRowFormatColumn(\n dh: typeof DhType,\n rule: string\n): DhType.CustomColumn {\n return dh.Column.formatRowColor(rule);\n}\n\nexport function makeColumnFormatColumn(\n col: DhType.Column,\n rule: string\n): DhType.CustomColumn {\n return col.formatColor(rule);\n}\n"],"mappings":"SAGEA,oBAAoB,EACpBC,gBAAgB,2CAGlB;AACA;AACA;AAEA,OAAO,SAASC,qBAAqBA,CACnCC,MAAwB,EACxBC,QAAgB,EACI;EACpB,IAAMC,aAAa,GAAGJ,gBAAgB,CAACE,MAAM,CAAC;EAC9C,IAAIE,aAAa,KAAKC,SAAS,EAAE;IAC/B,OAAOA,SAAS;EAClB;EACA,IAAMC,iBAAiB,GAAGP,oBAAoB,CAACG,MAAM,CAAC;EACtD,UAAAK,MAAA,CAAUD,iBAAiB,SAAAC,MAAA,CAAMH,aAAa,SAAAG,MAAA,CAAMJ,QAAQ;AAC9D;AAEA,OAAO,SAASK,mBAAmBA,CACjCC,EAAiB,EACjBC,IAAY,EACS;EACrB,OAAOD,EAAE,CAACE,MAAM,CAACC,cAAc,CAACF,IAAI,CAAC;AACvC;AAEA,OAAO,SAASG,sBAAsBA,CACpCC,GAAkB,EAClBJ,IAAY,EACS;EACrB,OAAOI,GAAG,CAACC,WAAW,CAACL,IAAI,CAAC;AAC9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../../../../../node_modules/@deephaven/components/scss/custom.scss","../../../../../node_modules/@deephaven/components/scss/bootstrap_overrides.scss","../../../src/sidebar/conditional-formatting/ConditionalFormattingMenu.scss","../../../../../node_modules/@deephaven/components/scss/new_variables.scss"],"names":[],"mappings":"AAAA;AC6LA;AC3LA;EACE,SCCS;;;ADEX;EACE;EACA;EACA;EACA;;AAEA;EACE,aCTO;;ADYT;EACE,eD0IY;ECzIZ;EACA,SCfO;EDgBP;EACA;EACA;EACA,YD2IF;EC1IE;EACA,aD+Ic;EC9Id;;AAEA;EACE;;AAGF;EACE,eC5BK;;AD+BP;EACE;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA,YDgIuB;;AC7HzB;EACE;;AAKF;EACE,YD6BI;EC5BJ,YDyFO;ECxFP;;AAEA;EACE","file":"ConditionalFormattingMenu.css","sourcesContent":["/* stylelint-disable scss/at-import-no-partial-leading-underscore */\n// Consumers should be able to resolve bootstrap/ to node_modules/bootstrap\n\n//Make bootstrap functions available for use in overrides\n@import 'bootstrap/scss/_functions.scss';\n@import './bootstrap_overrides.scss';\n\n//_variable imports come after bootstrap default overrides,\n// makes all other variables and mixins from bootstrap available\n/// with just importing customer.scss\n@import 'bootstrap/scss/_variables.scss';\n@import 'bootstrap/scss/_mixins.scss';\n\n//New variables come after imports\n@import './new_variables.scss';\n@import './util.scss';\n","// Styling overrides for bootstrap\n@use 'sass:map';\n\n// Override / set color variables\n$red: var(--dh-color-visual-red);\n$orange: var(--dh-color-visual-orange);\n$yellow: var(--dh-color-visual-yellow);\n$green: var(--dh-color-visual-green);\n$blue: var(--dh-color-visual-blue);\n$purple: var(--dh-color-visual-purple);\n\n// Fallback colors are used if theme isn't loaded\n// this is required for error messages if the API doesn't load\n\n//Define our Gray scale\n$gray-100: var(--dh-color-gray-900, #fcfcfa);\n$gray-200: var(--dh-color-gray-800);\n$gray-300: var(--dh-color-gray-700);\n$gray-400: var(--dh-color-gray-600);\n$gray-500: var(--dh-color-gray-500);\n// intentional duplicate, scale doesn't line up otherwise\n// as we have gray-850 and spectrum doesn't and it is needed\n$gray-600: var(--dh-color-gray-500);\n$gray-700: var(--dh-color-gray-400);\n$gray-800: var(--dh-color-gray-300);\n$gray-850: var(--dh-color-gray-200);\n$gray-900: var(--dh-color-gray-75);\n$black: var(--dh-color-black, #1a171a);\n$white: var(--dh-color-white, #f0f0ee);\n\n//Define some UI colors\n$interfacegray: var(--dh-color-content-bg, #2d2a2e);\n$interfaceblue: var(--dh-color-accent-bg);\n$interfacewhite: $white;\n$interfaceblack: $black;\n$content-bg: var(--dh-color-content-bg, #2d2a2e);\n$background: var(--dh-color-bg, #1a171a);\n$foreground: var(--dh-color-fg, #f0f0ee);\n\n// Extend default Bootstrap $grays map\n$grays-custom: (\n '850': $gray-850,\n);\n$grays: () !default;\n$grays: map-merge($grays, $grays-custom);\n\n// Extend default Bootstrap $colors map\n$colors-custom: (\n 'black': $black,\n);\n$colors: () !default;\n$colors: map-merge($colors, $colors-custom);\n\n// Override default Bootstrap $theme-colors map by mapping each key to itself.\n// These will then be re-mapped inside of `button-outline-variant` and\n// `button-outline-variant` mixins in `bootstrap_override_mixins_buttons.scss`\n$theme-colors-self-map: ();\n@each $key\n in (\n 'primary',\n 'secondary',\n 'success',\n 'info',\n 'warning',\n 'danger',\n 'light',\n 'dark'\n )\n{\n $theme-colors-self-map: map.set($theme-colors-self-map, $key, $key);\n}\n$theme-colors: () !default;\n$theme-colors: map-merge($theme-colors, $theme-colors-self-map);\n\n// Used by bootstrap_override_mixins_buttons.scss to map Bootstrap colors to\n// DH semantic colors\n$bootstrap-dh-semantic-map: (\n 'primary': 'accent',\n 'secondary': 'neutral',\n 'success': 'positive',\n 'info': 'info',\n 'warning': 'notice',\n 'danger': 'negative',\n // We shouldn't be using these, but mapping so they work with our custom\n // `color-yiq` mixin. If we find a way to remove $light + $dark that are\n // defined in Bootstrap _variables.scss, we should remove these\n 'light': 'neutral',\n 'dark': 'neutral',\n);\n\n//Set default colors\n$body-bg: $black;\n$body-color: $interfacewhite;\n\n// Set brand colors\n$primary: var(--dh-color-accent-bg);\n$primary-hover: var(--dh-color-accent-hover-bg);\n$primary-dark: var(--dh-color-accent-down-bg);\n$secondary: var(--dh-color-neutral-bg);\n$secondary-hover: var(--dh-color-neutral-hover-bg);\n$success: $green;\n$info: $yellow;\n$warning: $orange;\n$danger: var(--dh-color-negative-bg);\n$danger-hover: var(--dh-color-negative-hover-bg);\n// We really don't want to use $light or $dark variables, but Bootstrap defines\n// them in _variables.scss. Explicitly setting them to ensure we are in control\n// of their values. If we can find a way to remove them, we should\n$light: var(--dh-color-gray-light);\n$dark: var(--dh-color-gray-dark);\n// Bootstrap doesn't define $mid, and we want to move away from this particular\n// semantic. Should be deleted by #1635\n$mid: var(--dh-color-gray-mid);\n\n$semantic-colors: (\n 'primary-hover': $primary-hover,\n 'primary-dark': $primary-dark,\n 'mid': $mid,\n 'content-bg': $interfacegray,\n 'background': $interfaceblack,\n 'foreground': $interfacewhite,\n 'secondary-hover': $secondary-hover,\n 'danger-hover': $danger-hover,\n);\n\n$component-active-bg: $primary;\n$theme-color-interval: 9%;\n$yiq-contrasted-threshold: 180;\n\n// Override fonts\n$font-family-sans-serif:\n 'Fira Sans',\n -apple-system,\n blinkmacsystemfont,\n 'Segoe UI',\n 'Roboto',\n 'Helvetica Neue',\n arial,\n sans-serif; //fira sans then native system ui fallbacks\n$font-family-monospace: 'Fira Mono', menlo, monaco, consolas, 'Liberation Mono',\n 'Courier New', monospace;\n$font-family-base: $font-family-sans-serif;\n\n$headings-font-weight: 400;\n\n//Text overides\n$text-muted: $gray-400;\n\n//Style Selection highlight color\n$text-select-color: var(--dh-color-text-highlight);\n\n//Grid variables, same value as default just making easily accessible\n$grid-gutter-width: 30px;\n\n//Visual Overrides\n$border-radius: 4px;\n$box-shadow: 0 0.1rem 1rem var(--dh-color-dropshadow);\n\n//Override Btn\n$btn-border-radius: 4rem;\n$btn-padding-x: 1.5rem;\n$btn-transition:\n color 0.12s ease-in-out,\n background-color 0.12s ease-in-out,\n border-color 0.12s ease-in-out,\n box-shadow 0.12s ease-in-out; //default 0.15 is too long\n$btn-border-width: 2px;\n$btn-font-weight: var(--spectrum-global-font-weight-bold);\n$btn-line-height: 1.3;\n\n//Override Inputs\n$input-bg: var(--dh-color-input-bg);\n$input-disabled-bg: var(--dh-color-input-disabled-bg);\n$input-color: var(--dh-color-input-fg);\n$input-border-color: var(--dh-color-input-border);\n$input-placeholder-color: var(--dh-color-input-placeholder);\n$input-focus-border-color: var(--dh-color-input-focus-border);\n\n$input-btn-focus-width: 0.2rem;\n$input-btn-focus-color: color-mix(\n in srgb,\n var(--dh-color-accent) 35%,\n transparent\n);\n$input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color;\n$input-btn-line-height: 1.3;\n// Bootstrap uses a calc expression to determine the input height (calc(line-height + 2*padding-y + border)).\n// The padding-y value has to be in rem to match units as it is a SASS calc.\n// Using 0.42145rem with 1.3 line height gets us to spectrum's 32px.\n/* stylelint-disable-next-line number-max-precision */\n$input-btn-padding-y: 0.42145rem;\n\n//checkbox\n$custom-control-indicator-bg: var(--dh-color-input-bg);\n$custom-control-indicator-border-color: var(--dh-color-input-border);\n$custom-checkbox-indicator-border-radius: 2px;\n$custom-control-indicator-border-width: 2px;\n$custom-control-indicator-active-bg: var(--dh-color-input-bg);\n$custom-control-indicator-active-border-color: var(--dh-color-input-fg);\n$custom-control-indicator-checked-bg: var(--dh-color-input-fg);\n$custom-control-indicator-checked-color: black; // used as mask fill color\n$custom-checkbox-indicator-indeterminate-bg: var(--dh-color-input-fg);\n$custom-control-indicator-bg-size: 75% 75%;\n$custom-control-indicator-disabled-bg: var(--dh-color-input-disabled-bg);\n$custom-control-indicator-checked-disabled-bg: var(\n --dh-color-input-disabled-bg\n);\n$custom-control-label-disabled-color: var(--dh-color-input-disabled-fg);\n\n// The $custom-select-indicator variable is used by Bootstrap to provide the\n// icon for the select dropdown. Inline svgs can't use CSS variables, so we hard\n// code the color to #929192 (the default value of --dh-color-gray-600). PR #1651\n// overrides this icon altogether for known dropdowns, so technically we may not\n// need this, but it's here in case there are any remaining instances.\n$custom-select-indicator-color: #929192;\n$custom-select-bg: var(--dh-color-selector-bg);\n$custom-select-bg-size: 16px 16px;\n//dhSort icon encoded\n$custom-select-indicator: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='#{$custom-select-indicator-color}' d='M4 7l-.4-.8 4-3.7h.8l4 3.7-.4.8H4zm0 2l-.4.8 4 3.7h.8l4-3.7L12 9H4z'/%3E%3C/svg%3E\"),\n '#',\n '%23'\n);\n$custom-select-focus-box-shadow: $input-btn-focus-box-shadow;\n$custom-select-disabled-color: $gray-500;\n$custom-select-disabled-bg: $gray-800;\n\n//modal\n$modal-content-bg: $content-bg;\n$modal-content-border-width: 0;\n$modal-md: 550px;\n$close-color: var(--dh-color-text);\n$close-text-shadow: none;\n\n// Toast notification\n$toast-bg: var(--dh-color-accent-100);\n$toast-color: var(--dh-color-text);\n$toast-error-bg: var(--dh-color-negative-bg);\n$toast-error-color: var(--dh-color-text);\n\n//tooltips\n$tooltip-bg: var(--dh-color-tooltip-bg);\n$tooltip-color: var(--dh-color-tooltip-fg);\n$tooltip-box-shadow: 0 0.1rem 1.5rem 0.1rem var(--dh-color-tooltip-box-shadow);\n\n//drowdowns\n$dropdown-bg: $gray-600;\n$dropdown-link-color: $foreground;\n$dropdown-link-hover-color: $foreground;\n$dropdown-link-hover-bg: var(--dh-color-item-list-hover-bg);\n$dropdown-divider-bg: $gray-700;\n\n//context menus\n$contextmenu-bg: var(--dh-color-popover-bg);\n$contextmenu-color: var(--dh-color-text);\n$contextmenu-disabled-color: var(--dh-color-input-disabled-fg);\n$contextmenu-keyboard-selected-bg: var(--dh-color-keyboard-selected-bg);\n$contextmenu-selected-bg: var(--dh-color-item-list-hover-bg);\n$contextmenu-selected-color: var(--dh-color-item-list-selected-fg);\n\n//hr\n$hr-border-color: var(--dh-color-hr);\n\n//links\n$link-color: $gray-400;\n$link-hover-color: $foreground;\n\n//progress-bar\n$progress-bg: $gray-600;\n$progress-border-radius: 1rem;\n\n// Set global options\n$enable-shadows: false;\n$enable-gradients: false;\n$enable-print-styles: false; //I don't think anyone should expect to \"print\" this app.\n\n// Transition times\n$transition: 0.15s;\n$transition-mid: 0.2s;\n$transition-long: 0.3s;\n$transition-slow: 0.6s;\n\n//form-validation icon, uses vsWarning icon encoded here as svg\n$form-feedback-icon-invalid-color: $danger;\n$form-feedback-icon-invalid: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cg fill='none'%3E%3Cg fill='#{$form-feedback-icon-invalid-color}'%3E%3Cpath d='M7.56 1h.88l6.54 12.26-.44.74H1.44L1 13.26 7.56 1zM8 2.28 2.28 13H13.7L8 2.28zM8.625 12v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E \"),\n '#',\n '%23'\n);\n\n// This section of variables is not consumed directly by DH, but they need to be\n// defined for sass to compile _variables\n$table-dark-bg: $gray-800;\n$table-dark-accent-bg: var(--dh-color-highlight-hover);\n$table-dark-hover-bg: var(--dh-color-highlight-active);\n$table-dark-border-color: $gray-700;\n$popover-bg: var(--dh-color-tooltip-bg);\n$popover-border-color: var(--dh-color-overlay-modal-bg);\n$popover-header-bg: #000;\n$popover-arrow-outer-color: var(--dh-color-dropshadow);\n$custom-range-thumb-active-bg: var(--dh-color-accent-1100);\n","@import '@deephaven/components/scss/custom.scss';\n\n.conditional-formatting-rules {\n padding: $spacer-1;\n}\n\n.conditional-formatting-list-item {\n display: flex;\n flex-direction: row;\n margin-bottom: 2px;\n padding: 0 $spacer-1;\n\n &:first-child {\n padding-top: $spacer-1;\n }\n\n .formatting-item {\n border-radius: $border-radius;\n display: flex;\n padding: $spacer-1;\n flex-grow: 1;\n align-items: center;\n user-select: none;\n transition: $btn-transition;\n border: $input-border-width solid transparent;\n line-height: $btn-line-height;\n cursor: pointer;\n\n .btn-drag-handle {\n cursor: grab;\n }\n\n .rule-icon {\n padding-right: $spacer-2;\n }\n\n .rule-icon-bg {\n min-width: 2rem;\n height: 2rem;\n display: flex;\n font-size: x-small;\n justify-content: center;\n align-items: center;\n }\n\n .rule-title {\n overflow-x: hidden;\n text-overflow: ellipsis;\n padding-right: 2px;\n display: flex;\n flex-grow: 1;\n }\n\n &:focus {\n outline: 0;\n border: $input-border-width solid $input-focus-border-color;\n box-shadow: $input-focus-box-shadow;\n }\n\n &:hover {\n background: var(--dh-color-item-list-hover-bg);\n }\n }\n\n .dragging > & {\n .formatting-item {\n background: $primary;\n box-shadow: $box-shadow;\n color: var(--dh-color-accent-contrast);\n\n .btn {\n color: var(--dh-color-accent-contrast);\n }\n }\n }\n}\n","@use 'sass:math';\n\n//Set of spacer variables from the spacer map\n$spacer-0: map-get($spacers, 0); //0\n$spacer-1: map-get($spacers, 1);\n$spacer-2: map-get($spacers, 2);\n$spacer-3: map-get($spacers, 3);\n$spacer-4: map-get($spacers, 4);\n$spacer-5: map-get($spacers, 5);\n\n//Marching Ants for golden layout dropzone and drag and drop\n//top bottom, left right.\n//create 4 background images that are 50% color 1, 50% color 2 using graidents, two veritical, two horizontal\n//size them to ant-size and thickness\n//position those images along the egdes and make top/bottom repeat-x and left/right repeat-y\n//then offest each of those background positions by ant-size in animation to make them march.\n$ant-size: 8px;\n$ant-thickness: 1px;\n\n@mixin ants-base($color-1: black, $color-2: white) {\n background-image: linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%);\n background-size:\n $ant-size $ant-thickness,\n $ant-size $ant-thickness,\n $ant-thickness $ant-size,\n $ant-thickness $ant-size;\n background-position:\n 0 top,\n 0 bottom,\n left 0,\n right 0;\n background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;\n animation: march 0.5s;\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n}\n\n@mixin drag-stack($pseudo-element) {\n &::#{$pseudo-element} {\n content: ' ';\n background: $primary;\n box-shadow: $box-shadow;\n border-radius: $border-radius;\n position: absolute;\n height: 100%;\n width: 100%;\n @content;\n }\n}\n\n$focus-bg-transparency: 12%;\n$hover-bg-transparency: 14%;\n$active-bg-transparency: 28%;\n$exception-transparency: 28%;\n"]}
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../../../node_modules/@deephaven/components/scss/custom.scss","../../../../../node_modules/@deephaven/components/scss/bootstrap_overrides.scss","../../../src/sidebar/conditional-formatting/ConditionalFormattingMenu.scss","../../../../../node_modules/@deephaven/components/scss/new_variables.scss"],"names":[],"mappings":"AAAA;AC6LA;AC3LA;EACE,SCCS;;;ADEX;EACE;EACA;EACA;EACA;;AAEA;EACE,aCTO;;ADYT;EACE,eD0IY;ECzIZ;EACA,SCfO;EDgBP;EACA;EACA;EACA,YD2IF;EC1IE;EACA,aD+Ic;EC9Id;;AAEA;EACE;;AAGF;EACE,eC5BK;;AD+BP;EACE;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA,YDgIuB;;AC7HzB;EACE;;AAKF;EACE,YD6BI;EC5BJ,YDyFO;ECxFP;;AAEA;EACE","file":"ConditionalFormattingMenu.css","sourcesContent":["/* stylelint-disable scss/at-import-no-partial-leading-underscore */\n// Consumers should be able to resolve bootstrap/ to node_modules/bootstrap\n\n//Make bootstrap functions available for use in overrides\n@import 'bootstrap/scss/_functions.scss';\n@import './bootstrap_overrides.scss';\n\n//_variable imports come after bootstrap default overrides,\n// makes all other variables and mixins from bootstrap available\n/// with just importing customer.scss\n@import 'bootstrap/scss/_variables.scss';\n@import 'bootstrap/scss/_mixins.scss';\n\n//New variables come after imports\n@import './new_variables.scss';\n@import './util.scss';\n","// Styling overrides for bootstrap\n@use 'sass:map';\n\n// Override / set color variables\n$red: var(--dh-color-visual-red);\n$orange: var(--dh-color-visual-orange);\n$yellow: var(--dh-color-visual-yellow);\n$green: var(--dh-color-visual-green);\n$blue: var(--dh-color-visual-blue);\n$purple: var(--dh-color-visual-purple);\n\n// Fallback colors are used if theme isn't loaded\n// this is required for error messages if the API doesn't load\n\n//Define our Gray scale\n$gray-100: var(--dh-color-gray-900, #fcfcfa);\n$gray-200: var(--dh-color-gray-800);\n$gray-300: var(--dh-color-gray-700);\n$gray-400: var(--dh-color-gray-600);\n$gray-500: var(--dh-color-gray-500);\n// intentional duplicate, scale doesn't line up otherwise\n// as we have gray-850 and spectrum doesn't and it is needed\n$gray-600: var(--dh-color-gray-500);\n$gray-700: var(--dh-color-gray-400);\n$gray-800: var(--dh-color-gray-300);\n$gray-850: var(--dh-color-gray-200);\n$gray-900: var(--dh-color-gray-75);\n$black: var(--dh-color-black, #1a171a);\n$white: var(--dh-color-white, #f0f0ee);\n\n//Define some UI colors\n$interfacegray: var(--dh-color-content-bg, #2d2a2e);\n$interfaceblue: var(--dh-color-accent-bg);\n$interfacewhite: $white;\n$interfaceblack: $black;\n$content-bg: var(--dh-color-content-bg, #2d2a2e);\n$background: var(--dh-color-bg, #1a171a);\n$foreground: var(--dh-color-fg, #f0f0ee);\n\n// Extend default Bootstrap $grays map\n$grays-custom: (\n '850': $gray-850,\n);\n$grays: () !default;\n$grays: map-merge($grays, $grays-custom);\n\n// Extend default Bootstrap $colors map\n$colors-custom: (\n 'black': $black,\n);\n$colors: () !default;\n$colors: map-merge($colors, $colors-custom);\n\n// Override default Bootstrap $theme-colors map by mapping each key to itself.\n// These will then be re-mapped inside of `button-outline-variant` and\n// `button-outline-variant` mixins in `bootstrap_override_mixins_buttons.scss`\n$theme-colors-self-map: ();\n@each $key\n in (\n 'primary',\n 'secondary',\n 'success',\n 'info',\n 'warning',\n 'danger',\n 'light',\n 'dark'\n )\n{\n $theme-colors-self-map: map.set($theme-colors-self-map, $key, $key);\n}\n$theme-colors: () !default;\n$theme-colors: map-merge($theme-colors, $theme-colors-self-map);\n\n// Used by bootstrap_override_mixins_buttons.scss to map Bootstrap colors to\n// DH semantic colors\n$bootstrap-dh-semantic-map: (\n 'primary': 'accent',\n 'secondary': 'neutral',\n 'success': 'positive',\n 'info': 'info',\n 'warning': 'notice',\n 'danger': 'negative',\n // We shouldn't be using these, but mapping so they work with our custom\n // `color-yiq` mixin. If we find a way to remove $light + $dark that are\n // defined in Bootstrap _variables.scss, we should remove these\n 'light': 'neutral',\n 'dark': 'neutral',\n);\n\n//Set default colors\n$body-bg: $black;\n$body-color: $interfacewhite;\n\n// Set brand colors\n$primary: var(--dh-color-accent-bg);\n$primary-hover: var(--dh-color-accent-hover-bg);\n$primary-dark: var(--dh-color-accent-down-bg);\n$secondary: var(--dh-color-neutral-bg);\n$secondary-hover: var(--dh-color-neutral-hover-bg);\n$success: $green;\n$info: $yellow;\n$warning: $orange;\n$danger: var(--dh-color-negative-bg);\n$danger-hover: var(--dh-color-negative-hover-bg);\n// We really don't want to use $light or $dark variables, but Bootstrap defines\n// them in _variables.scss. Explicitly setting them to ensure we are in control\n// of their values. If we can find a way to remove them, we should\n$light: var(--dh-color-gray-light);\n$dark: var(--dh-color-gray-dark);\n// Bootstrap doesn't define $mid, and we want to move away from this particular\n// semantic. Should be deleted by #1635\n$mid: var(--dh-color-gray-mid);\n\n$semantic-colors: (\n 'primary-hover': $primary-hover,\n 'primary-dark': $primary-dark,\n 'mid': $mid,\n 'content-bg': $interfacegray,\n 'background': $interfaceblack,\n 'foreground': $interfacewhite,\n 'secondary-hover': $secondary-hover,\n 'danger-hover': $danger-hover,\n);\n\n$component-active-bg: $primary;\n$theme-color-interval: 9%;\n$yiq-contrasted-threshold: 180;\n\n// Override fonts\n$font-family-sans-serif:\n 'Fira Sans',\n -apple-system,\n blinkmacsystemfont,\n 'Segoe UI',\n 'Roboto',\n 'Helvetica Neue',\n arial,\n sans-serif; //fira sans then native system ui fallbacks\n$font-family-monospace: 'Fira Mono', menlo, monaco, consolas, 'Liberation Mono',\n 'Courier New', monospace;\n$font-family-base: $font-family-sans-serif;\n\n$headings-font-weight: 400;\n\n//Text overides\n$text-muted: $gray-400;\n\n//Style Selection highlight color\n$text-select-color: var(--dh-color-text-highlight);\n\n//Grid variables, same value as default just making easily accessible\n$grid-gutter-width: 30px;\n\n//Visual Overrides\n$border-radius: 4px;\n$box-shadow: 0 0.1rem 1rem var(--dh-color-dropshadow);\n\n//Override Btn\n$btn-border-radius: 4rem;\n$btn-padding-x: 1.5rem;\n$btn-transition:\n color 0.12s ease-in-out,\n background-color 0.12s ease-in-out,\n border-color 0.12s ease-in-out,\n box-shadow 0.12s ease-in-out; //default 0.15 is too long\n$btn-border-width: 2px;\n$btn-font-weight: var(--spectrum-global-font-weight-bold);\n$btn-line-height: 1.3;\n\n//Override Inputs\n$input-bg: var(--dh-color-input-bg);\n$input-disabled-bg: var(--dh-color-input-disabled-bg);\n$input-color: var(--dh-color-input-fg);\n$input-border-color: var(--dh-color-input-border);\n$input-placeholder-color: var(--dh-color-input-placeholder);\n$input-focus-border-color: var(--dh-color-input-focus-border);\n\n$input-btn-focus-width: 0.2rem;\n$input-btn-focus-color: color-mix(\n in srgb,\n var(--dh-color-accent) 35%,\n transparent\n);\n$input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color;\n$input-btn-line-height: 1.3;\n// Bootstrap uses a calc expression to determine the input height (calc(line-height + 2*padding-y + border)).\n// The padding-y value has to be in rem to match units as it is a SASS calc.\n// Using 0.42145rem with 1.3 line height gets us to spectrum's 32px.\n/* stylelint-disable-next-line number-max-precision */\n$input-btn-padding-y: 0.42145rem;\n\n//checkbox\n$custom-control-indicator-bg: var(--dh-color-input-bg);\n$custom-control-indicator-border-color: var(--dh-color-input-border);\n$custom-checkbox-indicator-border-radius: 2px;\n$custom-control-indicator-border-width: 2px;\n$custom-control-indicator-active-bg: var(--dh-color-input-bg);\n$custom-control-indicator-active-border-color: var(--dh-color-input-fg);\n$custom-control-indicator-checked-bg: var(--dh-color-input-fg);\n$custom-control-indicator-checked-color: black; // used as mask fill color\n$custom-checkbox-indicator-indeterminate-bg: var(--dh-color-input-fg);\n$custom-control-indicator-bg-size: 75% 75%;\n$custom-control-indicator-disabled-bg: var(--dh-color-input-disabled-bg);\n$custom-control-indicator-checked-disabled-bg: var(\n --dh-color-input-disabled-bg\n);\n$custom-control-label-disabled-color: var(--dh-color-input-disabled-fg);\n\n// The $custom-select-indicator variable is used by Bootstrap to provide the\n// icon for the select dropdown. Inline svgs can't use CSS variables, so we hard\n// code the color to #929192 (the default value of --dh-color-gray-600). PR #1651\n// overrides this icon altogether for known dropdowns, so technically we may not\n// need this, but it's here in case there are any remaining instances.\n$custom-select-indicator-color: #929192;\n$custom-select-bg: var(--dh-color-selector-bg);\n$custom-select-bg-size: 16px 16px;\n//dhSort icon encoded\n$custom-select-indicator: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='#{$custom-select-indicator-color}' d='M4 7l-.4-.8 4-3.7h.8l4 3.7-.4.8H4zm0 2l-.4.8 4 3.7h.8l4-3.7L12 9H4z'/%3E%3C/svg%3E\"),\n '#',\n '%23'\n);\n$custom-select-focus-box-shadow: $input-btn-focus-box-shadow;\n$custom-select-disabled-color: $gray-500;\n$custom-select-disabled-bg: $gray-800;\n\n//modal\n$modal-content-bg: $content-bg;\n$modal-content-border-width: 0;\n$modal-md: 550px;\n$close-color: var(--dh-color-text);\n$close-text-shadow: none;\n\n// Toast notification\n$toast-bg: var(--dh-color-accent-100);\n$toast-color: var(--dh-color-text);\n$toast-error-bg: var(--dh-color-negative-bg);\n$toast-error-color: var(--dh-color-text);\n\n//tooltips\n$tooltip-bg: var(--dh-color-tooltip-bg);\n$tooltip-color: var(--dh-color-tooltip-fg);\n$tooltip-box-shadow: 0 0.1rem 1.5rem 0.1rem var(--dh-color-tooltip-box-shadow);\n\n//drowdowns\n$dropdown-bg: $gray-600;\n$dropdown-link-color: $foreground;\n$dropdown-link-hover-color: $foreground;\n$dropdown-link-hover-bg: var(--dh-color-item-list-hover-bg);\n$dropdown-divider-bg: $gray-700;\n\n//context menus\n$contextmenu-bg: var(--dh-color-popover-bg);\n$contextmenu-color: var(--dh-color-text);\n$contextmenu-disabled-color: var(--dh-color-text-disabled);\n$contextmenu-keyboard-selected-bg: var(--dh-color-keyboard-selected-bg);\n$contextmenu-selected-bg: var(--dh-color-item-list-hover-bg);\n$contextmenu-selected-color: var(--dh-color-item-list-selected-fg);\n\n//hr\n$hr-border-color: var(--dh-color-hr);\n\n//links\n$link-color: $gray-400;\n$link-hover-color: $foreground;\n\n//progress-bar\n$progress-bg: $gray-600;\n$progress-border-radius: 1rem;\n\n// Set global options\n$enable-shadows: false;\n$enable-gradients: false;\n$enable-print-styles: false; //I don't think anyone should expect to \"print\" this app.\n\n// Transition times\n$transition: 0.15s;\n$transition-mid: 0.2s;\n$transition-long: 0.3s;\n$transition-slow: 0.6s;\n\n//form-validation icon, uses vsWarning icon encoded here as svg\n$form-feedback-icon-invalid-color: $danger;\n$form-feedback-icon-invalid: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cg fill='none'%3E%3Cg fill='#{$form-feedback-icon-invalid-color}'%3E%3Cpath d='M7.56 1h.88l6.54 12.26-.44.74H1.44L1 13.26 7.56 1zM8 2.28 2.28 13H13.7L8 2.28zM8.625 12v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E \"),\n '#',\n '%23'\n);\n\n// This section of variables is not consumed directly by DH, but they need to be\n// defined for sass to compile _variables\n$table-dark-bg: $gray-800;\n$table-dark-accent-bg: var(--dh-color-highlight-hover);\n$table-dark-hover-bg: var(--dh-color-highlight-active);\n$table-dark-border-color: $gray-700;\n$popover-bg: var(--dh-color-tooltip-bg);\n$popover-border-color: var(--dh-color-overlay-modal-bg);\n$popover-header-bg: #000;\n$popover-arrow-outer-color: var(--dh-color-dropshadow);\n$custom-range-thumb-active-bg: var(--dh-color-accent-1100);\n","@import '@deephaven/components/scss/custom.scss';\n\n.conditional-formatting-rules {\n padding: $spacer-1;\n}\n\n.conditional-formatting-list-item {\n display: flex;\n flex-direction: row;\n margin-bottom: 2px;\n padding: 0 $spacer-1;\n\n &:first-child {\n padding-top: $spacer-1;\n }\n\n .formatting-item {\n border-radius: $border-radius;\n display: flex;\n padding: $spacer-1;\n flex-grow: 1;\n align-items: center;\n user-select: none;\n transition: $btn-transition;\n border: $input-border-width solid transparent;\n line-height: $btn-line-height;\n cursor: pointer;\n\n .btn-drag-handle {\n cursor: grab;\n }\n\n .rule-icon {\n padding-right: $spacer-2;\n }\n\n .rule-icon-bg {\n min-width: 2rem;\n height: 2rem;\n display: flex;\n font-size: x-small;\n justify-content: center;\n align-items: center;\n }\n\n .rule-title {\n overflow-x: hidden;\n text-overflow: ellipsis;\n padding-right: 2px;\n display: flex;\n flex-grow: 1;\n }\n\n &:focus {\n outline: 0;\n border: $input-border-width solid $input-focus-border-color;\n box-shadow: $input-focus-box-shadow;\n }\n\n &:hover {\n background: var(--dh-color-item-list-hover-bg);\n }\n }\n\n .dragging > & {\n .formatting-item {\n background: $primary;\n box-shadow: $box-shadow;\n color: var(--dh-color-accent-contrast);\n\n .btn {\n color: var(--dh-color-accent-contrast);\n }\n }\n }\n}\n","@use 'sass:math';\n\n//Set of spacer variables from the spacer map\n$spacer-0: map-get($spacers, 0); //0\n$spacer-1: map-get($spacers, 1);\n$spacer-2: map-get($spacers, 2);\n$spacer-3: map-get($spacers, 3);\n$spacer-4: map-get($spacers, 4);\n$spacer-5: map-get($spacers, 5);\n\n//Marching Ants for golden layout dropzone and drag and drop\n//top bottom, left right.\n//create 4 background images that are 50% color 1, 50% color 2 using graidents, two veritical, two horizontal\n//size them to ant-size and thickness\n//position those images along the egdes and make top/bottom repeat-x and left/right repeat-y\n//then offest each of those background positions by ant-size in animation to make them march.\n$ant-size: 8px;\n$ant-thickness: 1px;\n\n@mixin ants-base($color-1: black, $color-2: white) {\n background-image: linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%);\n background-size:\n $ant-size $ant-thickness,\n $ant-size $ant-thickness,\n $ant-thickness $ant-size,\n $ant-thickness $ant-size;\n background-position:\n 0 top,\n 0 bottom,\n left 0,\n right 0;\n background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;\n animation: march 0.5s;\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n}\n\n@mixin drag-stack($pseudo-element) {\n &::#{$pseudo-element} {\n content: ' ';\n background: $primary;\n box-shadow: $box-shadow;\n border-radius: $border-radius;\n position: absolute;\n height: 100%;\n width: 100%;\n @content;\n }\n}\n\n$focus-bg-transparency: 12%;\n$hover-bg-transparency: 14%;\n$active-bg-transparency: 28%;\n$exception-transparency: 28%;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionalFormattingMenu.js","names":["React","useCallback","DragDropContext","Draggable","Droppable","classNames","FontAwesomeIcon","dhNewCircleLargeFilled","vsGripper","vsTrash","Button","DragUtils","Tooltip","TableUtils","Log","FormatterType","getBackgroundForStyleConfig","getColorForStyleConfig","getShortLabelForConditionType","NumberCondition","StringCondition","DateCondition","jsx","_jsx","jsxs","_jsxs","log","module","DEFAULT_CALLBACK","undefined","getRuleValue","config","column","type","isNumberType","condition","IS_NULL","IS_NOT_NULL","concat","value","isCharType","isStringType","isDateType","isBooleanType","Error","getRuleTitle","IS_BETWEEN","start","name","end","ConditionalFormattingMenu","props","rules","onChange","onCreate","onSelect","handleRuleClick","e","rule","index","stopPropagation","debug","handleDeleteClick","updatedRules","splice","handleDragHandlerClick","handleDragEnd","result","stopDragging","destination","sourceIndex","source","destinationIndex","sourceInput","className","children","onDragStart","startDragging","onDragEnd","droppableId","provided","snapshot","_objectSpread","ref","innerRef","droppableProps","dragging","draggingFromThisWith","length","map","draggableId","disableInteractiveElementBlocking","role","tabIndex","onClick","isDragging","draggableProps","style","backgroundColor","color","ROWS","kind","icon","tooltip","dragHandleProps","placeholder"],"sources":["../../../src/sidebar/conditional-formatting/ConditionalFormattingMenu.tsx"],"sourcesContent":["import React, { useCallback } from 'react';\nimport {\n DragDropContext,\n Draggable,\n Droppable,\n type DropResult,\n} from 'react-beautiful-dnd';\nimport classNames from 'classnames';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { dhNewCircleLargeFilled, vsGripper, vsTrash } from '@deephaven/icons';\nimport { Button, DragUtils, Tooltip } from '@deephaven/components';\nimport { TableUtils } from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport './ConditionalFormattingMenu.scss';\nimport {\n type BaseFormatConfig,\n type FormattingRule,\n FormatterType,\n getBackgroundForStyleConfig,\n getColorForStyleConfig,\n getShortLabelForConditionType,\n NumberCondition,\n StringCondition,\n DateCondition,\n} from './ConditionalFormattingUtils';\nimport { type ColumnName } from '../../CommonTypes';\n\nconst log = Log.module('ConditionalFormattingMenu');\n\nexport type ChangeCallback = (rules: readonly FormattingRule[]) => void;\n\nexport type SelectCallback = (index: number) => void;\n\nexport type CreateCallback = () => void;\n\nexport type ConditionalFormattingMenuProps = {\n rules: readonly FormattingRule[];\n selectedColumn?: ColumnName;\n onChange?: ChangeCallback;\n onCreate?: CreateCallback;\n onSelect?: SelectCallback;\n};\n\nconst DEFAULT_CALLBACK = (): void => undefined;\n\nfunction getRuleValue(config: BaseFormatConfig): string {\n const {\n column: { type },\n } = config;\n if (TableUtils.isNumberType(type)) {\n return config.condition === NumberCondition.IS_NULL ||\n config.condition === NumberCondition.IS_NOT_NULL\n ? ''\n : `${config.value}`;\n }\n if (TableUtils.isCharType(type)) {\n return config.condition === DateCondition.IS_NULL ||\n config.condition === DateCondition.IS_NOT_NULL\n ? ''\n : `${config.value}`;\n }\n if (TableUtils.isStringType(type)) {\n return config.condition === StringCondition.IS_NULL ||\n config.condition === StringCondition.IS_NOT_NULL\n ? ''\n : `\"${config.value}\"`;\n }\n if (TableUtils.isDateType(type)) {\n return config.condition === DateCondition.IS_NULL ||\n config.condition === DateCondition.IS_NOT_NULL\n ? ''\n : `${config.value}`;\n }\n if (TableUtils.isBooleanType(type)) {\n return '';\n }\n throw new Error(`Invalid column type ${type} in getRuleValue`);\n}\n\nfunction getRuleTitle(config: BaseFormatConfig): string {\n if (\n TableUtils.isNumberType(config.column.type) &&\n config.condition === NumberCondition.IS_BETWEEN\n ) {\n return `${config.start} < ${config.column.name} < ${config.end}`;\n }\n return `${config.column.name} ${getShortLabelForConditionType(\n (config as BaseFormatConfig).column.type,\n (config as BaseFormatConfig).condition\n )} \n ${getRuleValue(config as BaseFormatConfig)}`;\n}\n\nfunction ConditionalFormattingMenu(\n props: ConditionalFormattingMenuProps\n): JSX.Element {\n const {\n rules = [],\n onChange = DEFAULT_CALLBACK,\n onCreate = DEFAULT_CALLBACK,\n onSelect = DEFAULT_CALLBACK,\n } = props;\n\n const handleRuleClick = useCallback(\n (e, rule, index) => {\n e.stopPropagation();\n log.debug('Rule clicked', rule, index);\n onSelect(index);\n },\n [onSelect]\n );\n\n const handleDeleteClick = useCallback(\n (e, rule, index) => {\n e.stopPropagation();\n log.debug('Delete button clicked', rule, index);\n const updatedRules = [...rules];\n updatedRules.splice(index, 1);\n onChange(updatedRules);\n },\n [onChange, rules]\n );\n\n const handleDragHandlerClick = useCallback(e => {\n e.stopPropagation();\n }, []);\n\n const handleDragEnd = useCallback(\n (result: DropResult) => {\n DragUtils.stopDragging();\n\n // if dropped outside the list\n if (result.destination == null) {\n return;\n }\n const sourceIndex = result.source.index;\n const destinationIndex = result.destination.index;\n const updatedRules = [...rules];\n const sourceInput = rules[sourceIndex];\n\n updatedRules.splice(sourceIndex, 1);\n updatedRules.splice(destinationIndex, 0, sourceInput);\n\n onChange(updatedRules);\n },\n [onChange, rules]\n );\n\n // Display list of rules\n return (\n <div className=\"conditional-formatting-rules\">\n <DragDropContext\n onDragStart={DragUtils.startDragging}\n onDragEnd={handleDragEnd}\n >\n <Droppable droppableId=\"droppable-custom-columns\">\n {(provided, snapshot) => (\n <div\n ref={provided.innerRef}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...provided.droppableProps}\n className={classNames('droppable-container', {\n dragging: snapshot.draggingFromThisWith,\n })}\n >\n {rules.length === 0 && (\n <div className=\"text-muted pl-2\">No formats defined</div>\n )}\n {rules.map((rule, index) => (\n <Draggable\n // eslint-disable-next-line react/no-array-index-key\n key={`${index}-${rule.type}`}\n draggableId={`${index}-${rule.type}`}\n index={index}\n disableInteractiveElementBlocking\n >\n {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n (provided, snapshot) => (\n <div\n role=\"menuitem\"\n tabIndex={0}\n onClick={e => handleRuleClick(e, rule, index)}\n className={classNames('draggable-container', {\n dragging: snapshot.isDragging,\n })}\n ref={provided.innerRef}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...provided.draggableProps}\n >\n <div className=\"conditional-formatting-list-item\">\n <div className=\"formatting-item\">\n <div className=\"rule-icon\">\n <span\n className=\"rule-icon-bg\"\n style={{\n backgroundColor: getBackgroundForStyleConfig(\n (rule.config as BaseFormatConfig).style\n ),\n color: getColorForStyleConfig(\n (rule.config as BaseFormatConfig).style\n ),\n }}\n >\n {rule.type === FormatterType.ROWS\n ? 'row'\n : 'col'}\n </span>\n </div>\n <div className=\"rule-title\">\n {getRuleTitle(rule.config as BaseFormatConfig)}\n </div>\n <Button\n kind=\"ghost\"\n className=\"ml-1 px-2\"\n onClick={e => handleDeleteClick(e, rule, index)}\n icon={vsTrash}\n tooltip=\"Delete rule\"\n />\n <button\n type=\"button\"\n className=\"btn btn-link btn-link-icon px-2 btn-drag-handle\"\n onClick={handleDragHandlerClick}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...provided.dragHandleProps}\n >\n <Tooltip>Drag to re-order</Tooltip>\n <FontAwesomeIcon icon={vsGripper} />\n </button>\n </div>\n </div>\n </div>\n )\n }\n </Draggable>\n ))}\n {provided.placeholder}\n </div>\n )}\n </Droppable>\n </DragDropContext>\n <hr />\n <Button kind=\"ghost\" onClick={onCreate} icon={dhNewCircleLargeFilled}>\n Add New Rule\n </Button>\n </div>\n );\n}\n\nexport default ConditionalFormattingMenu;\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,IAAIC,WAAW,QAAQ,OAAO;AAC1C,SACEC,eAAe,EACfC,SAAS,EACTC,SAAS,QAEJ,qBAAqB;AAC5B,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,eAAe,QAAQ,gCAAgC;AAChE,SAASC,sBAAsB,EAAEC,SAAS,EAAEC,OAAO,QAAQ,kBAAkB;AAC7E,SAASC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sBAACgG,IAAI,EAAE9F;oBAAU,CAAE,CAAC;kBAAA,EAC9B,CAAC;gBAAA,CACN;cAAC,CACH;YAAC,EACH;UACN,MAAA8B,MAAA,CA7DKqB,KAAK,OAAArB,MAAA,CAAIoB,IAAI,CAACzB,IAAI,CA+DjB,CACZ,CAAC,EACD+C,QAAQ,CAACyB,WAAW;QAAA,EAClB;MACN,CACQ;IAAC,CACG,CAAC,eAClBlF,IAAA,SAAK,CAAC,eACNA,IAAA,CAACb,MAAM;MAAC2F,IAAI,EAAC,OAAO;MAACP,OAAO,EAAExC,QAAS;MAACgD,IAAI,EAAE/F,sBAAuB;MAAAoE,QAAA,EAAC;IAEtE,CAAQ,CAAC;EAAA,CACN,CAAC;AAEV;AAEA,eAAezB,yBAAyB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ConditionalFormattingMenu.js","names":["React","useCallback","DragDropContext","Draggable","Droppable","classNames","FontAwesomeIcon","dhNewCircleLargeFilled","vsGripper","vsTrash","Button","DragUtils","Tooltip","TableUtils","Log","FormatterType","getBackgroundForStyleConfig","getColorForStyleConfig","getShortLabelForConditionType","NumberCondition","StringCondition","DateCondition","jsx","_jsx","jsxs","_jsxs","log","module","DEFAULT_CALLBACK","undefined","getRuleValue","config","column","type","isNumberType","condition","IS_NULL","IS_NOT_NULL","concat","value","isCharType","isStringType","isDateType","isBooleanType","Error","getRuleTitle","IS_BETWEEN","start","name","end","ConditionalFormattingMenu","props","rules","onChange","onCreate","onSelect","handleRuleClick","e","rule","index","stopPropagation","debug","handleDeleteClick","updatedRules","splice","handleDragHandlerClick","handleDragEnd","result","stopDragging","destination","sourceIndex","source","destinationIndex","sourceInput","className","children","onDragStart","startDragging","onDragEnd","droppableId","provided","snapshot","_objectSpread","ref","innerRef","droppableProps","dragging","draggingFromThisWith","length","map","draggableId","disableInteractiveElementBlocking","role","tabIndex","onClick","isDragging","draggableProps","style","backgroundColor","color","ROWS","kind","icon","tooltip","dragHandleProps","placeholder"],"sources":["../../../src/sidebar/conditional-formatting/ConditionalFormattingMenu.tsx"],"sourcesContent":["import React, { useCallback } from 'react';\nimport {\n DragDropContext,\n Draggable,\n Droppable,\n type DropResult,\n} from 'react-beautiful-dnd';\nimport classNames from 'classnames';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { dhNewCircleLargeFilled, vsGripper, vsTrash } from '@deephaven/icons';\nimport { Button, DragUtils, Tooltip } from '@deephaven/components';\nimport { TableUtils } from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport './ConditionalFormattingMenu.scss';\nimport {\n type BaseFormatConfig,\n type FormattingRule,\n FormatterType,\n getBackgroundForStyleConfig,\n getColorForStyleConfig,\n getShortLabelForConditionType,\n NumberCondition,\n StringCondition,\n DateCondition,\n} from './ConditionalFormattingUtils';\nimport { type ColumnName } from '../../CommonTypes';\n\nconst log = Log.module('ConditionalFormattingMenu');\n\nexport type ChangeCallback = (rules: readonly FormattingRule[]) => void;\n\nexport type SelectCallback = (index: number) => void;\n\nexport type CreateCallback = () => void;\n\nexport type ConditionalFormattingMenuProps = {\n rules: readonly FormattingRule[];\n selectedColumn?: ColumnName;\n onChange?: ChangeCallback;\n onCreate?: CreateCallback;\n onSelect?: SelectCallback;\n};\n\nconst DEFAULT_CALLBACK = (): void => undefined;\n\nfunction getRuleValue(config: BaseFormatConfig): string {\n const {\n column: { type },\n } = config;\n if (TableUtils.isNumberType(type)) {\n return config.condition === NumberCondition.IS_NULL ||\n config.condition === NumberCondition.IS_NOT_NULL\n ? ''\n : `${config.value}`;\n }\n if (TableUtils.isCharType(type)) {\n return config.condition === DateCondition.IS_NULL ||\n config.condition === DateCondition.IS_NOT_NULL\n ? ''\n : `${config.value}`;\n }\n if (TableUtils.isStringType(type)) {\n return config.condition === StringCondition.IS_NULL ||\n config.condition === StringCondition.IS_NOT_NULL\n ? ''\n : `\"${config.value}\"`;\n }\n if (TableUtils.isDateType(type)) {\n return config.condition === DateCondition.IS_NULL ||\n config.condition === DateCondition.IS_NOT_NULL\n ? ''\n : `${config.value}`;\n }\n if (TableUtils.isBooleanType(type)) {\n return '';\n }\n throw new Error(`Invalid column type ${type} in getRuleValue`);\n}\n\nfunction getRuleTitle(config: BaseFormatConfig): string {\n if (\n TableUtils.isNumberType(config.column.type) &&\n config.condition === NumberCondition.IS_BETWEEN\n ) {\n return `${config.start} < ${config.column.name} < ${config.end}`;\n }\n return `${config.column.name} ${getShortLabelForConditionType(\n (config as BaseFormatConfig).column.type,\n (config as BaseFormatConfig).condition\n )} \n ${getRuleValue(config as BaseFormatConfig)}`;\n}\n\nfunction ConditionalFormattingMenu(\n props: ConditionalFormattingMenuProps\n): JSX.Element {\n const {\n rules = [],\n onChange = DEFAULT_CALLBACK,\n onCreate = DEFAULT_CALLBACK,\n onSelect = DEFAULT_CALLBACK,\n } = props;\n\n const handleRuleClick = useCallback(\n (e, rule, index) => {\n e.stopPropagation();\n log.debug('Rule clicked', rule, index);\n onSelect(index);\n },\n [onSelect]\n );\n\n const handleDeleteClick = useCallback(\n (e, rule, index) => {\n e.stopPropagation();\n log.debug('Delete button clicked', rule, index);\n const updatedRules = [...rules];\n updatedRules.splice(index, 1);\n onChange(updatedRules);\n },\n [onChange, rules]\n );\n\n const handleDragHandlerClick = useCallback(e => {\n e.stopPropagation();\n }, []);\n\n const handleDragEnd = useCallback(\n (result: DropResult) => {\n DragUtils.stopDragging();\n\n // if dropped outside the list\n if (result.destination == null) {\n return;\n }\n const sourceIndex = result.source.index;\n const destinationIndex = result.destination.index;\n const updatedRules = [...rules];\n const sourceInput = rules[sourceIndex];\n\n updatedRules.splice(sourceIndex, 1);\n updatedRules.splice(destinationIndex, 0, sourceInput);\n\n onChange(updatedRules);\n },\n [onChange, rules]\n );\n\n // Display list of rules\n return (\n <div className=\"conditional-formatting-rules\">\n <DragDropContext\n onDragStart={DragUtils.startDragging}\n onDragEnd={handleDragEnd}\n >\n <Droppable droppableId=\"droppable-custom-columns\">\n {(provided, snapshot) => (\n <div\n ref={provided.innerRef}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...provided.droppableProps}\n className={classNames('droppable-container', {\n dragging: snapshot.draggingFromThisWith,\n })}\n >\n {rules.length === 0 && (\n <div className=\"text-muted pl-2\">No formats defined</div>\n )}\n {rules.map((rule, index) => (\n <Draggable\n // eslint-disable-next-line react/no-array-index-key\n key={`${index}-${rule.type}`}\n draggableId={`${index}-${rule.type}`}\n index={index}\n disableInteractiveElementBlocking\n >\n {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n (provided, snapshot) => (\n <div\n role=\"menuitem\"\n tabIndex={0}\n onClick={e => handleRuleClick(e, rule, index)}\n className={classNames('draggable-container', {\n dragging: snapshot.isDragging,\n })}\n ref={provided.innerRef}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...provided.draggableProps}\n >\n <div className=\"conditional-formatting-list-item\">\n <div className=\"formatting-item\">\n <div className=\"rule-icon\">\n <span\n className=\"rule-icon-bg\"\n style={{\n backgroundColor: getBackgroundForStyleConfig(\n (rule.config as BaseFormatConfig).style\n ),\n color: getColorForStyleConfig(\n (rule.config as BaseFormatConfig).style\n ),\n }}\n >\n {rule.type === FormatterType.ROWS\n ? 'row'\n : 'col'}\n </span>\n </div>\n <div className=\"rule-title\">\n {getRuleTitle(rule.config as BaseFormatConfig)}\n </div>\n <Button\n kind=\"ghost\"\n className=\"ml-1 px-2\"\n onClick={e => handleDeleteClick(e, rule, index)}\n icon={vsTrash}\n tooltip=\"Delete rule\"\n />\n <button\n type=\"button\"\n className=\"btn btn-link btn-link-icon px-2 btn-drag-handle\"\n onClick={handleDragHandlerClick}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...provided.dragHandleProps}\n >\n <Tooltip>Drag to re-order</Tooltip>\n <FontAwesomeIcon icon={vsGripper} />\n </button>\n </div>\n </div>\n </div>\n )\n }\n </Draggable>\n ))}\n {provided.placeholder}\n </div>\n )}\n </Droppable>\n </DragDropContext>\n <hr />\n <Button kind=\"ghost\" onClick={onCreate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