@deephaven/iris-grid 0.46.1-beta.2 → 0.46.1-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AdvancedFilterCreator.js +122 -102
- package/dist/AdvancedFilterCreator.js.map +1 -1
- package/dist/AdvancedFilterCreatorFilterItem.js +47 -38
- package/dist/AdvancedFilterCreatorFilterItem.js.map +1 -1
- package/dist/AdvancedFilterCreatorSelectValue.js +52 -40
- package/dist/AdvancedFilterCreatorSelectValue.js.map +1 -1
- package/dist/AdvancedFilterCreatorSelectValueList.js +35 -28
- package/dist/AdvancedFilterCreatorSelectValueList.js.map +1 -1
- package/dist/ColumnStatistics.js +74 -54
- package/dist/ColumnStatistics.js.map +1 -1
- package/dist/CrossColumnSearch.d.ts.map +1 -1
- package/dist/CrossColumnSearch.js +114 -90
- package/dist/CrossColumnSearch.js.map +1 -1
- package/dist/FilterInputField.js +42 -35
- package/dist/FilterInputField.js.map +1 -1
- package/dist/GotoRow.js +226 -193
- package/dist/GotoRow.js.map +1 -1
- package/dist/IrisGrid.js +371 -344
- package/dist/IrisGrid.js.map +1 -1
- package/dist/IrisGridBottomBar.js +11 -8
- package/dist/IrisGridBottomBar.js.map +1 -1
- package/dist/IrisGridCellOverflowModal.js +56 -50
- package/dist/IrisGridCellOverflowModal.js.map +1 -1
- package/dist/IrisGridCopyHandler.js +34 -24
- package/dist/IrisGridCopyHandler.js.map +1 -1
- package/dist/IrisGridPartitionSelector.js +59 -46
- package/dist/IrisGridPartitionSelector.js.map +1 -1
- package/dist/PartitionSelectorSearch.js +43 -36
- package/dist/PartitionSelectorSearch.js.map +1 -1
- package/dist/PendingDataBottomBar.js +34 -22
- package/dist/PendingDataBottomBar.js.map +1 -1
- package/dist/ToastBottomBar.js +5 -3
- package/dist/ToastBottomBar.js.map +1 -1
- package/dist/format-context-menus/CustomFormatAction.js +34 -25
- package/dist/format-context-menus/CustomFormatAction.js.map +1 -1
- package/dist/format-context-menus/FormatContextMenuUtils.js +2 -1
- package/dist/format-context-menus/FormatContextMenuUtils.js.map +1 -1
- package/dist/mousehandlers/IrisGridContextMenuHandler.js +50 -36
- package/dist/mousehandlers/IrisGridContextMenuHandler.js.map +1 -1
- package/dist/sidebar/AdvancedSettingsMenu.js +2 -1
- package/dist/sidebar/AdvancedSettingsMenu.js.map +1 -1
- package/dist/sidebar/ChartBuilder.js +134 -107
- package/dist/sidebar/ChartBuilder.js.map +1 -1
- package/dist/sidebar/CustomColumnBuilder.js +70 -48
- package/dist/sidebar/CustomColumnBuilder.js.map +1 -1
- package/dist/sidebar/CustomColumnInput.js +66 -53
- package/dist/sidebar/CustomColumnInput.js.map +1 -1
- package/dist/sidebar/InputEditor.js +15 -11
- package/dist/sidebar/InputEditor.js.map +1 -1
- package/dist/sidebar/RollupRows.js +130 -103
- package/dist/sidebar/RollupRows.js.map +1 -1
- package/dist/sidebar/SelectDistinctBuilder.js +49 -39
- package/dist/sidebar/SelectDistinctBuilder.js.map +1 -1
- package/dist/sidebar/TableCsvExporter.js +178 -128
- package/dist/sidebar/TableCsvExporter.js.map +1 -1
- package/dist/sidebar/aggregations/AggregationEdit.js +67 -57
- package/dist/sidebar/aggregations/AggregationEdit.js.map +1 -1
- package/dist/sidebar/aggregations/Aggregations.js +86 -63
- package/dist/sidebar/aggregations/Aggregations.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ColumnFormatEditor.js +30 -22
- package/dist/sidebar/conditional-formatting/ColumnFormatEditor.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionEditor.js +52 -47
- package/dist/sidebar/conditional-formatting/ConditionEditor.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormatEditor.js +52 -42
- package/dist/sidebar/conditional-formatting/ConditionalFormatEditor.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingMenu.js +90 -67
- package/dist/sidebar/conditional-formatting/ConditionalFormattingMenu.js.map +1 -1
- package/dist/sidebar/conditional-formatting/RowFormatEditor.js +30 -22
- package/dist/sidebar/conditional-formatting/RowFormatEditor.js.map +1 -1
- package/dist/sidebar/conditional-formatting/StyleEditor.js +70 -58
- package/dist/sidebar/conditional-formatting/StyleEditor.js.map +1 -1
- package/dist/sidebar/icons/BarIcon.js +21 -12
- package/dist/sidebar/icons/BarIcon.js.map +1 -1
- package/dist/sidebar/icons/FormatColumnWhereIcon.js +38 -30
- package/dist/sidebar/icons/FormatColumnWhereIcon.js.map +1 -1
- package/dist/sidebar/icons/FormatRowWhereIcon.js +32 -24
- package/dist/sidebar/icons/FormatRowWhereIcon.js.map +1 -1
- package/dist/sidebar/icons/HistogramIcon.js +21 -12
- package/dist/sidebar/icons/HistogramIcon.js.map +1 -1
- package/dist/sidebar/icons/LineIcon.js +24 -15
- package/dist/sidebar/icons/LineIcon.js.map +1 -1
- package/dist/sidebar/icons/PieIcon.js +21 -12
- package/dist/sidebar/icons/PieIcon.js.map +1 -1
- package/dist/sidebar/icons/ScatterIcon.js +71 -62
- package/dist/sidebar/icons/ScatterIcon.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilder.js +129 -121
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilder.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingGroup.js +121 -87
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingGroup.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingItem.js +40 -26
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingItem.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTree.js +17 -14
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTree.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTreeInner.js +34 -28
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTreeInner.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTreeItem.js +2 -2
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTreeItem.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/TreeItem.js +8 -7
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/TreeItem.js.map +1 -1
- package/package.json +15 -15
|
@@ -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","log","module","DEFAULT_CALLBACK","undefined","getRuleValue","config","column","type","isNumberType","condition","IS_NULL","IS_NOT_NULL","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","startDragging","provided","snapshot","innerRef","droppableProps","dragging","draggingFromThisWith","length","map","isDragging","draggableProps","backgroundColor","style","color","ROWS","dragHandleProps","placeholder"],"sources":["../../../src/sidebar/conditional-formatting/ConditionalFormattingMenu.tsx"],"sourcesContent":["import React, { useCallback } from 'react';\nimport {\n DragDropContext,\n Draggable,\n Droppable,\n 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 BaseFormatConfig,\n FormattingRule,\n FormatterType,\n getBackgroundForStyleConfig,\n getColorForStyleConfig,\n getShortLabelForConditionType,\n NumberCondition,\n StringCondition,\n DateCondition,\n} from './ConditionalFormattingUtils';\nimport { 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 = () => 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,MAAM,EAAEC,SAAS,EAAEC,OAAO,QAAQ,uBAAuB;AAClE,SAASC,UAAU,QAAQ,w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,oBAAC,MAAM;IACL,IAAI,EAAC,OAAO;IACZ,SAAS,EAAC,WAAW;IACrB,OAAO,EAAEyB,CAAC,IAAIK,iBAAiB,CAACL,CAAC,EAAEC,IAAI,EAAEC,KAAK,CAAE;IAChD,IAAI,EAAE7C,OAAQ;IACd,OAAO,EAAC;EAAa,EACrB,eACF;IACE,IAAI,EAAC,QAAQ;IACb,SAAS,EAAC,iDAAiD;IAC3D,OAAO,EAAEmD;IACT;EAAA,GACIU,QAAQ,CAACc,eAAe,gBAE5B,oBAAC,OAAO,QAAC,kBAAgB,CAAU,eACnC,oBAAC,eAAe;IAAC,IAAI,EAAE5E;EAAU,EAAG,CAC7B,CACL,CACF,CAET,CAGN,CAAC,EACD8D,QAAQ,CAACe,WAAW,CAExB,CACS,CACI,eAClB,+BAAM,eACN,oBAAC,MAAM;IAAC,IAAI,EAAC,OAAO;IAAC,OAAO,EAAEpC,QAAS;IAAC,IAAI,EAAE1C;EAAuB,GAAC,cAEtE,CAAS,CACL;AAEV;AAEA,eAAesC,yBAAyB"}
|
|
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","log","module","DEFAULT_CALLBACK","undefined","getRuleValue","config","column","type","isNumberType","condition","IS_NULL","IS_NOT_NULL","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","startDragging","provided","snapshot","innerRef","droppableProps","dragging","draggingFromThisWith","length","map","isDragging","draggableProps","backgroundColor","style","color","ROWS","dragHandleProps","placeholder"],"sources":["../../../src/sidebar/conditional-formatting/ConditionalFormattingMenu.tsx"],"sourcesContent":["import React, { useCallback } from 'react';\nimport {\n DragDropContext,\n Draggable,\n Droppable,\n 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 BaseFormatConfig,\n FormattingRule,\n FormatterType,\n getBackgroundForStyleConfig,\n getColorForStyleConfig,\n getShortLabelForConditionType,\n NumberCondition,\n StringCondition,\n DateCondition,\n} from './ConditionalFormattingUtils';\nimport { 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 = () => 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,MAAM,EAAEC,SAAS,EAAEC,OAAO,QAAQ,uBAAuB;AAClE,SAASC,UAAU,QAAQ,wBAAwB;AACnD,OAAOC,GAAG,MAAM,gBAAgB;AAAC;AAAA,SAK/BC,aAAa,EACbC,2BAA2B,EAC3BC,sBAAsB,EACtBC,6BAA6B,EAC7BC,eAAe,EACfC,eAAe,EACfC,aAAa;AAAA;AAAA;AAIf,IAAMC,GAAG,GAAGR,GAAG,CAACS,MAAM,CAAC,2BAA2B,CAAC;AAgBnD,IAAMC,gBAAgB,GAAG,MAAMC,SAAS;AAExC,SAASC,YAAY,CAACC,MAAwB,EAAU;EACtD,IAAM;IACJC,MAAM,EAAE;MAAEC;IAAK;EACjB,CAAC,GAAGF,MAAM;EACV,IAAId,UAAU,CAACiB,YAAY,CAACD,IAAI,CAAC,EAAE;IACjC,OAAOF,MAAM,CAACI,SAAS,KAAKZ,eAAe,CAACa,OAAO,IACjDL,MAAM,CAACI,SAAS,KAAKZ,eAAe,CAACc,WAAW,GAC9C,EAAE,aACCN,MAAM,CAACO,KAAK,CAAE;EACvB;EACA,IAAIrB,UAAU,CAACsB,UAAU,CAACN,IAAI,CAAC,EAAE;IAC/B,OAAOF,MAAM,CAACI,SAAS,KAAKV,aAAa,CAACW,OAAO,IAC/CL,MAAM,CAACI,SAAS,KAAKV,aAAa,CAACY,WAAW,GAC5C,EAAE,aACCN,MAA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C,yBAAyB"}
|
|
@@ -9,6 +9,9 @@ import { ComboBox } from '@deephaven/components';
|
|
|
9
9
|
import { getDefaultConditionConfigForType, getConditionConfig, getDefaultStyleConfig } from "./ConditionalFormattingUtils.js";
|
|
10
10
|
import ConditionEditor from "./ConditionEditor.js";
|
|
11
11
|
import StyleEditor from "./StyleEditor.js";
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
12
15
|
var log = Log.module('RowFormatEditor');
|
|
13
16
|
var DEFAULT_CALLBACK = () => undefined;
|
|
14
17
|
function makeDefaultConfig(columns) {
|
|
@@ -95,28 +98,33 @@ function RowFormatEditor(props) {
|
|
|
95
98
|
value: name
|
|
96
99
|
};
|
|
97
100
|
});
|
|
98
|
-
return /*#__PURE__*/
|
|
99
|
-
className: "conditional-rule-editor form"
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
101
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
102
|
+
className: "conditional-rule-editor form",
|
|
103
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
104
|
+
className: "mb-2",
|
|
105
|
+
children: [/*#__PURE__*/_jsx("label", {
|
|
106
|
+
className: "mb-0",
|
|
107
|
+
children: "Format Row If"
|
|
108
|
+
}), /*#__PURE__*/_jsx(ComboBox, {
|
|
109
|
+
defaultValue: selectedColumn === null || selectedColumn === void 0 ? void 0 : selectedColumn.name,
|
|
110
|
+
options: columnInputOptions,
|
|
111
|
+
inputPlaceholder: "Select a column",
|
|
112
|
+
spellCheck: false,
|
|
113
|
+
onChange: handleColumnChange,
|
|
114
|
+
searchPlaceholder: "Filter columns"
|
|
115
|
+
})]
|
|
116
|
+
}), selectedColumn !== undefined && /*#__PURE__*/_jsxs(_Fragment, {
|
|
117
|
+
children: [/*#__PURE__*/_jsx(ConditionEditor, {
|
|
118
|
+
column: selectedColumn,
|
|
119
|
+
config: conditionConfig,
|
|
120
|
+
dh: dh,
|
|
121
|
+
onChange: handleConditionChange
|
|
122
|
+
}), /*#__PURE__*/_jsx(StyleEditor, {
|
|
123
|
+
config: selectedStyle,
|
|
124
|
+
onChange: handleStyleChange
|
|
125
|
+
})]
|
|
126
|
+
})]
|
|
127
|
+
});
|
|
120
128
|
}
|
|
121
129
|
export default RowFormatEditor;
|
|
122
130
|
//# sourceMappingURL=RowFormatEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowFormatEditor.js","names":["React","useCallback","useEffect","useState","Log","ComboBox","getDefaultConditionConfigForType","getConditionConfig","getDefaultStyleConfig","ConditionEditor","StyleEditor","log","module","DEFAULT_CALLBACK","undefined","makeDefaultConfig","columns","type","name","column","config","style","RowFormatEditor","props","dh","onChange","selectedColumn","setColumn","find","c","conditionConfig","setConditionConfig","conditionValid","setConditionValid","selectedStyle","setStyle","handleColumnChange","value","newColumn","error","handleConditionChange","updatedConditionConfig","isValid","debug","handleStyleChange","updatedStyleConfig","updateRowFormat","columnInputOptions","map","title"],"sources":["../../../src/sidebar/conditional-formatting/RowFormatEditor.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\nimport Log from '@deephaven/log';\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport { ComboBox } from '@deephaven/components';\nimport {\n BaseFormatConfig,\n ChangeCallback,\n getDefaultConditionConfigForType,\n getConditionConfig,\n getDefaultStyleConfig,\n ModelColumn,\n} from './ConditionalFormattingUtils';\nimport ConditionEditor from './ConditionEditor';\nimport StyleEditor from './StyleEditor';\n\nconst log = Log.module('RowFormatEditor');\n\nexport interface RowFormatEditorProps {\n columns: ModelColumn[];\n config?: BaseFormatConfig;\n dh: DhType;\n onChange?: ChangeCallback;\n}\n\nconst DEFAULT_CALLBACK = () => 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 RowFormatEditor(props: RowFormatEditorProps): 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 updateRowFormat() {\n if (selectedColumn === undefined) {\n log.debug('Column is not selected, skip update.');\n return;\n }\n if (selectedStyle === undefined) {\n log.debug('Style is not selected, skip update.');\n return;\n }\n const { type, name } = selectedColumn;\n const column = { type, name };\n onChange(\n {\n column,\n style: selectedStyle,\n ...conditionConfig,\n },\n conditionValid\n );\n },\n [onChange, selectedColumn, selectedStyle, conditionConfig, conditionValid]\n );\n\n const columnInputOptions = columns.map(({ name }) => ({\n title: name,\n value: name,\n }));\n\n return (\n <div className=\"conditional-rule-editor form\">\n <div className=\"mb-2\">\n <label className=\"mb-0\">Format Row If</label>\n <ComboBox\n defaultValue={selectedColumn?.name}\n options={columnInputOptions}\n inputPlaceholder=\"Select a column\"\n spellCheck={false}\n onChange={handleColumnChange}\n searchPlaceholder=\"Filter columns\"\n />\n </div>\n\n {selectedColumn !== undefined && (\n <>\n <ConditionEditor\n column={selectedColumn}\n config={conditionConfig}\n dh={dh}\n onChange={handleConditionChange}\n />\n <StyleEditor config={selectedStyle} onChange={handleStyleChange} />\n </>\n )}\n </div>\n );\n}\n\nexport default RowFormatEditor;\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC/D,OAAOC,GAAG,MAAM,gBAAgB;AAEhC,SAASC,QAAQ,QAAQ,uBAAuB;AAAC,SAI/CC,gCAAgC,EAChCC,kBAAkB,EAClBC,qBAAqB;AAAA,OAGhBC,eAAe;AAAA,OACfC,WAAW;AAElB,IAAMC,GAAG,GAAGP,GAAG,CAACQ,MAAM,CAAC,iBAAiB,CAAC;AASzC,IAAMC,gBAAgB,GAAG,MAAMC,SAAS;AAExC,SAASC,iBAAiB,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;IACVD,MAAM;IACNE,KAAK,EAAEb,qBAAqB;EAAE,GAC3BF,gCAAgC,CAACW,IAAI,CAAC,CAC1C;EACD,OAAOG,MAAM;AACf;AAEA,SAASE,eAAe,CAACC,KAA2B,EAAe;EAAA;EACjE,IAAM;IACJP,OAAO;IACPI,MAAM,GAAGL,iBAAiB,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wC,sBAAsB,EAAEC,OAAO,KAAK;IACnC/B,GAAG,CAACgC,KAAK,CAAC,uBAAuB,EAAEF,sBAAsB,EAAEC,OAAO,CAAC;IACnEX,kBAAkB,CAACU,sBAAsB,CAAC;IAC1CR,iBAAiB,CAACS,OAAO,CAAC;EAC5B,CAAC,EACD,EAAE,CACH;EAED,IAAME,iBAAiB,GAAG3C,WAAW,CAAC4C,kBAAkB,IAAI;IAC1DlC,GAAG,CAACgC,KAAK,CAAC,mBAAmB,EAAEE,kBAAkB,CAAC;IAClDV,QAAQ,CAACU,kBAAkB,CAAC;EAC9B,CAAC,EAAE,EAAE,CAAC;EAEN3C,SAAS,CACP,SAAS4C,eAAe,GAAG;IACzB,IAAIpB,cAAc,KAAKZ,SAAS,EAAE;MAChCH,GAAG,CAACgC,KAAK,CAAC,sCAAsC,CAAC;MACjD;IACF;IACA,IAAIT,aAAa,KAAKpB,SAAS,EAAE;MAC/BH,GAAG,CAACgC,KAAK,CAAC,qCAAqC,CAAC;MAChD;IACF;IACA,IAAM;MAAE1B,IAAI;MAAEC;IAAK,CAAC,GAAGQ,cAAc;IACrC,IAAMP,MAAM,GAAG;MAAEF,IAAI;MAAEC;IAAK,CAAC;IAC7BO,QAAQ;MAEJN,MAAM;MACNE,KAAK,EAAEa;IAAa,GACjBJ,eAAe,GAEpBE,cAAc,CACf;EACH,CAAC,EACD,CAACP,QAAQ,EAAEC,cAAc,EAAEQ,aAAa,EAAEJ,eAAe,EAAEE,cAAc,CAAC,CAC3E;EAED,IAAMe,kBAAkB,GAAG/B,OAAO,CAACgC,GAAG,CAAC;IAAA,IAAC;MAAE9B;IAAK,CAAC;IAAA,OAAM;MACpD+B,KAAK,EAAE/B,IAAI;MACXmB,KAAK,EAAEnB;IACT,CAAC;EAAA,CAAC,CAAC;EAEH,oBACE;IAAK,SAAS,EAAC;
|
|
1
|
+
{"version":3,"file":"RowFormatEditor.js","names":["React","useCallback","useEffect","useState","Log","ComboBox","getDefaultConditionConfigForType","getConditionConfig","getDefaultStyleConfig","ConditionEditor","StyleEditor","log","module","DEFAULT_CALLBACK","undefined","makeDefaultConfig","columns","type","name","column","config","style","RowFormatEditor","props","dh","onChange","selectedColumn","setColumn","find","c","conditionConfig","setConditionConfig","conditionValid","setConditionValid","selectedStyle","setStyle","handleColumnChange","value","newColumn","error","handleConditionChange","updatedConditionConfig","isValid","debug","handleStyleChange","updatedStyleConfig","updateRowFormat","columnInputOptions","map","title"],"sources":["../../../src/sidebar/conditional-formatting/RowFormatEditor.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\nimport Log from '@deephaven/log';\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport { ComboBox } from '@deephaven/components';\nimport {\n BaseFormatConfig,\n ChangeCallback,\n getDefaultConditionConfigForType,\n getConditionConfig,\n getDefaultStyleConfig,\n ModelColumn,\n} from './ConditionalFormattingUtils';\nimport ConditionEditor from './ConditionEditor';\nimport StyleEditor from './StyleEditor';\n\nconst log = Log.module('RowFormatEditor');\n\nexport interface RowFormatEditorProps {\n columns: ModelColumn[];\n config?: BaseFormatConfig;\n dh: DhType;\n onChange?: ChangeCallback;\n}\n\nconst DEFAULT_CALLBACK = () => 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 RowFormatEditor(props: RowFormatEditorProps): 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 updateRowFormat() {\n if (selectedColumn === undefined) {\n log.debug('Column is not selected, skip update.');\n return;\n }\n if (selectedStyle === undefined) {\n log.debug('Style is not selected, skip update.');\n return;\n }\n const { type, name } = selectedColumn;\n const column = { type, name };\n onChange(\n {\n column,\n style: selectedStyle,\n ...conditionConfig,\n },\n conditionValid\n );\n },\n [onChange, selectedColumn, selectedStyle, conditionConfig, conditionValid]\n );\n\n const columnInputOptions = columns.map(({ name }) => ({\n title: name,\n value: name,\n }));\n\n return (\n <div className=\"conditional-rule-editor form\">\n <div className=\"mb-2\">\n <label className=\"mb-0\">Format Row If</label>\n <ComboBox\n defaultValue={selectedColumn?.name}\n options={columnInputOptions}\n inputPlaceholder=\"Select a column\"\n spellCheck={false}\n onChange={handleColumnChange}\n searchPlaceholder=\"Filter columns\"\n />\n </div>\n\n {selectedColumn !== undefined && (\n <>\n <ConditionEditor\n column={selectedColumn}\n config={conditionConfig}\n dh={dh}\n onChange={handleConditionChange}\n />\n <StyleEditor config={selectedStyle} onChange={handleStyleChange} />\n </>\n )}\n </div>\n );\n}\n\nexport default RowFormatEditor;\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC/D,OAAOC,GAAG,MAAM,gBAAgB;AAEhC,SAAS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, vsCheck } from '@deephaven/icons';
|
|
|
6
6
|
import { Button, DropdownMenu } from '@deephaven/components';
|
|
7
7
|
import { FormatStyleType, getLabelForStyleType, getBackgroundForStyleConfig, getColorForStyleConfig } from "./ConditionalFormattingUtils.js";
|
|
8
8
|
import "./StyleEditor.css";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
11
|
var log = Log.module('StyleEditor');
|
|
10
12
|
var DEFAULT_BACKGROUND = '#fcfcfa';
|
|
11
13
|
var DEFAULT_COLOR_LIGHT = '#f0f0ee';
|
|
@@ -63,8 +65,7 @@ function StyleEditor(props) {
|
|
|
63
65
|
var option = styleOptions[index];
|
|
64
66
|
var key = "option-".concat(index, "-").concat(option);
|
|
65
67
|
matchFound = matchFound || option === styleType;
|
|
66
|
-
optionArray.push( /*#__PURE__*/
|
|
67
|
-
key: key,
|
|
68
|
+
optionArray.push( /*#__PURE__*/_jsxs(Button, {
|
|
68
69
|
kind: "inline",
|
|
69
70
|
className: "style-option-btn",
|
|
70
71
|
onClick: () => {
|
|
@@ -78,73 +79,84 @@ function StyleEditor(props) {
|
|
|
78
79
|
background: getBackgroundForStyleConfig({
|
|
79
80
|
type: option
|
|
80
81
|
})
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
},
|
|
83
|
+
children: [option === styleType && /*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
84
|
+
icon: vsCheck,
|
|
85
|
+
className: "mr-2"
|
|
86
|
+
}), option !== styleType && /*#__PURE__*/_jsx("span", {
|
|
87
|
+
className: "mr-4"
|
|
88
|
+
}), getLabelForStyleType(option)]
|
|
89
|
+
}, key));
|
|
88
90
|
};
|
|
89
91
|
for (var index = 0; index < styleOptions.length; index += 1) {
|
|
90
92
|
_loop();
|
|
91
93
|
}
|
|
92
94
|
return optionArray;
|
|
93
95
|
}, [styleOptions, styleType]);
|
|
94
|
-
var renderMenuElement = useCallback(() => /*#__PURE__*/
|
|
96
|
+
var renderMenuElement = useCallback(() => /*#__PURE__*/_jsx("div", {
|
|
95
97
|
className: "style-menu-container",
|
|
96
98
|
role: "presentation",
|
|
97
99
|
style: {
|
|
98
100
|
width: dropdownWidth
|
|
99
|
-
}
|
|
100
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
101
|
-
className: "style-options"
|
|
102
|
-
}, renderOptions())), [dropdownWidth, renderOptions]);
|
|
103
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
104
|
-
className: "style-editor"
|
|
105
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
106
|
-
className: "mb-2",
|
|
107
|
-
ref: csContainer
|
|
108
|
-
}, /*#__PURE__*/React.createElement("label", {
|
|
109
|
-
className: "mb-0"
|
|
110
|
-
}, "Style"), /*#__PURE__*/React.createElement(Button, {
|
|
111
|
-
kind: "inline",
|
|
112
|
-
className: "cs-dropdown",
|
|
113
|
-
style: {
|
|
114
|
-
color: getColorForStyleConfig({
|
|
115
|
-
type: styleType
|
|
116
|
-
}),
|
|
117
|
-
background: getBackgroundForStyleConfig({
|
|
118
|
-
type: styleType
|
|
119
|
-
})
|
|
120
|
-
},
|
|
121
|
-
onClick: handleToggleClick
|
|
122
|
-
}, getLabelForStyleType(styleType), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
123
|
-
icon: dhSort,
|
|
124
|
-
className: "cs-caret"
|
|
125
|
-
})), /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
126
|
-
isShown: isShown,
|
|
127
|
-
actions: {
|
|
128
|
-
menuElement: renderMenuElement()
|
|
129
101
|
},
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
102
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
103
|
+
className: "style-options",
|
|
104
|
+
children: renderOptions()
|
|
105
|
+
})
|
|
106
|
+
}), [dropdownWidth, renderOptions]);
|
|
107
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
108
|
+
className: "style-editor",
|
|
109
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
110
|
+
className: "mb-2",
|
|
111
|
+
ref: csContainer,
|
|
112
|
+
children: [/*#__PURE__*/_jsx("label", {
|
|
113
|
+
className: "mb-0",
|
|
114
|
+
children: "Style"
|
|
115
|
+
}), /*#__PURE__*/_jsxs(Button, {
|
|
116
|
+
kind: "inline",
|
|
117
|
+
className: "cs-dropdown",
|
|
118
|
+
style: {
|
|
119
|
+
color: getColorForStyleConfig({
|
|
120
|
+
type: styleType
|
|
121
|
+
}),
|
|
122
|
+
background: getBackgroundForStyleConfig({
|
|
123
|
+
type: styleType
|
|
124
|
+
})
|
|
125
|
+
},
|
|
126
|
+
onClick: handleToggleClick,
|
|
127
|
+
children: [getLabelForStyleType(styleType), /*#__PURE__*/_jsx("span", {
|
|
128
|
+
children: /*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
129
|
+
icon: dhSort,
|
|
130
|
+
className: "cs-caret"
|
|
131
|
+
})
|
|
132
|
+
}), /*#__PURE__*/_jsx(DropdownMenu, {
|
|
133
|
+
isShown: isShown,
|
|
134
|
+
actions: {
|
|
135
|
+
menuElement: renderMenuElement()
|
|
136
|
+
},
|
|
137
|
+
popperOptions: {
|
|
138
|
+
placement: 'bottom-start'
|
|
139
|
+
},
|
|
140
|
+
popperClassName: "style-dropdown-menu",
|
|
141
|
+
onMenuClosed: handleMenuClosed,
|
|
142
|
+
menuStyle: {
|
|
143
|
+
maxWidth: '100rem'
|
|
144
|
+
}
|
|
145
|
+
})]
|
|
146
|
+
})]
|
|
147
|
+
}), styleType === FormatStyleType.CUSTOM && /*#__PURE__*/_jsxs("div", {
|
|
148
|
+
className: "mb-2",
|
|
149
|
+
children: [/*#__PURE__*/_jsx("label", {
|
|
150
|
+
className: "mb-0",
|
|
151
|
+
children: "Background"
|
|
152
|
+
}), /*#__PURE__*/_jsx("input", {
|
|
153
|
+
type: "color",
|
|
154
|
+
value: background,
|
|
155
|
+
className: "custom-select color-select",
|
|
156
|
+
onChange: handleBackgroundChange
|
|
157
|
+
})]
|
|
158
|
+
})]
|
|
159
|
+
});
|
|
148
160
|
}
|
|
149
161
|
export default StyleEditor;
|
|
150
162
|
//# sourceMappingURL=StyleEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyleEditor.js","names":["React","useCallback","useEffect","useMemo","useRef","useState","FontAwesomeIcon","Log","ColorUtils","dhSort","vsCheck","Button","DropdownMenu","FormatStyleType","getLabelForStyleType","getBackgroundForStyleConfig","getColorForStyleConfig","log","module","DEFAULT_BACKGROUND","DEFAULT_COLOR_LIGHT","DEFAULT_COLOR_DARK","DEFAULT_DROPDOWN_WIDTH","DEFAULT_CALLBACK","undefined","StyleEditor","props","config","onChange","styleType","setStyleType","type","background","setBackground","customConfig","isShown","setShown","dropdownWidth","setDropdownWidth","csContainer","handleBackgroundChange","e","value","target","debug","handleMenuClosed","handleToggleClick","updateDropdownWidth","styleOptions","NO_FORMATTING","POSITIVE","NEGATIVE","WARN","NEUTRAL","ACCENT_1","ACCENT_2","CUSTOM","current","getBoundingClientRect","width","updateTheme","color","isDark","renderOptions","matchFound","optionArray","option","index","key","push","length","renderMenuElement","menuElement","placement","maxWidth"],"sources":["../../../src/sidebar/conditional-formatting/StyleEditor.tsx"],"sourcesContent":["import React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport Log from '@deephaven/log';\nimport { ColorUtils } from '@deephaven/utils';\nimport { dhSort, vsCheck } from '@deephaven/icons';\nimport { Button, DropdownMenu } from '@deephaven/components';\nimport {\n FormatStyleType,\n getLabelForStyleType,\n FormatStyleConfig,\n getBackgroundForStyleConfig,\n getColorForStyleConfig,\n} from './ConditionalFormattingUtils';\n\nimport './StyleEditor.scss';\n\nconst log = Log.module('StyleEditor');\n\nconst DEFAULT_BACKGROUND = '#fcfcfa';\n\nconst DEFAULT_COLOR_LIGHT = '#f0f0ee';\n\nconst DEFAULT_COLOR_DARK = '#1a171a';\n\nconst DEFAULT_DROPDOWN_WIDTH = 200;\n\nexport interface ConditionEditorProps {\n config: FormatStyleConfig;\n onChange?: (config: FormatStyleConfig) => void;\n}\n\nconst DEFAULT_CALLBACK = () => undefined;\n\nfunction StyleEditor(props: ConditionEditorProps): JSX.Element {\n const { config, onChange = DEFAULT_CALLBACK } = props;\n const [styleType, setStyleType] = useState(config.type);\n const [background, setBackground] = useState(\n config.customConfig?.background ?? DEFAULT_BACKGROUND\n );\n const [isShown, setShown] = useState(false);\n const [dropdownWidth, setDropdownWidth] = useState(DEFAULT_DROPDOWN_WIDTH);\n const csContainer = useRef<HTMLDivElement>(null);\n\n const handleBackgroundChange = useCallback(e => {\n const { value } = e.target;\n log.debug('handleBackgroundChange', value);\n setBackground(value);\n }, []);\n\n const handleMenuClosed = useCallback(() => {\n if (isShown) {\n setShown(false);\n }\n }, [isShown]);\n\n const handleToggleClick = useCallback(() => {\n if (!isShown) {\n updateDropdownWidth();\n }\n setShown(!isShown);\n }, [isShown]);\n\n const styleOptions = useMemo(\n () => [\n FormatStyleType.NO_FORMATTING,\n FormatStyleType.POSITIVE,\n FormatStyleType.NEGATIVE,\n FormatStyleType.WARN,\n FormatStyleType.NEUTRAL,\n FormatStyleType.ACCENT_1,\n FormatStyleType.ACCENT_2,\n FormatStyleType.CUSTOM,\n ],\n []\n );\n\n function updateDropdownWidth(): void {\n if (csContainer.current) {\n setDropdownWidth(csContainer.current.getBoundingClientRect().width);\n }\n }\n\n useEffect(\n function updateTheme() {\n onChange({\n type: styleType,\n customConfig: {\n color: ColorUtils.isDark(background)\n ? DEFAULT_COLOR_LIGHT\n : DEFAULT_COLOR_DARK,\n background,\n },\n });\n },\n [onChange, styleType, background]\n );\n\n const renderOptions = useCallback(() => {\n let matchFound = false;\n const optionArray: JSX.Element[] = [];\n for (let index = 0; index < styleOptions.length; index += 1) {\n const option = styleOptions[index];\n const key = `option-${index}-${option}`;\n matchFound = matchFound || option === styleType;\n optionArray.push(\n <Button\n key={key}\n kind=\"inline\"\n className=\"style-option-btn\"\n onClick={() => {\n setStyleType(option);\n setShown(false);\n }}\n style={{\n color: getColorForStyleConfig({ type: option }),\n background: getBackgroundForStyleConfig({ type: option }),\n }}\n >\n {option === styleType && (\n <FontAwesomeIcon icon={vsCheck} className=\"mr-2\" />\n )}\n {option !== styleType && <span className=\"mr-4\" />}\n {getLabelForStyleType(option)}\n </Button>\n );\n }\n return optionArray;\n }, [styleOptions, styleType]);\n\n const renderMenuElement = useCallback(\n () => (\n <div\n className=\"style-menu-container\"\n role=\"presentation\"\n style={{ width: dropdownWidth }}\n >\n <div className=\"style-options\">{renderOptions()}</div>\n </div>\n ),\n [dropdownWidth, renderOptions]\n );\n\n return (\n <div className=\"style-editor\">\n <div className=\"mb-2\" ref={csContainer}>\n <label className=\"mb-0\">Style</label>\n <Button\n kind=\"inline\"\n className=\"cs-dropdown\"\n style={{\n color: getColorForStyleConfig({ type: styleType }),\n background: getBackgroundForStyleConfig({ type: styleType }),\n }}\n onClick={handleToggleClick}\n >\n {getLabelForStyleType(styleType)}\n\n <span>\n <FontAwesomeIcon icon={dhSort} className=\"cs-caret\" />\n </span>\n <DropdownMenu\n isShown={isShown}\n actions={{ menuElement: renderMenuElement() }}\n popperOptions={{ placement: 'bottom-start' }}\n popperClassName=\"style-dropdown-menu\"\n onMenuClosed={handleMenuClosed}\n menuStyle={{ maxWidth: '100rem' }}\n />\n </Button>\n </div>\n\n {styleType === FormatStyleType.CUSTOM && (\n <div className=\"mb-2\">\n <label className=\"mb-0\">Background</label>\n <input\n type=\"color\"\n value={background}\n className=\"custom-select color-select\"\n onChange={handleBackgroundChange}\n />\n </div>\n )}\n </div>\n );\n}\n\nexport default StyleEditor;\n"],"mappings":"AAAA,OAAOA,KAAK,IACVC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,SAASC,eAAe,QAAQ,gCAAgC;AAChE,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,MAAM,EAAEC,OAAO,QAAQ,kBAAkB;AAClD,SAASC,MAAM,EAAEC,YAAY,QAAQ,uBAAuB;AAAC,SAE3DC,eAAe,EACfC,oBAAoB,EAEpBC,2BAA2B,EAC3BC,sBAAsB;AAAA;AAKxB,IAAMC,GAAG,GAAGV,GAAG,CAACW,MAAM,CAAC,aAAa,CAAC;AAErC,IAAMC,kBAAkB,GAAG,SAAS;AAEpC,IAAMC,mBAAmB,GAAG,SAAS;AAErC,IAAMC,kBAAkB,GAAG,SAAS;AAEpC,IAAMC,sBAAsB,GAAG,GAAG;AAOlC,IAAMC,gBAAgB,GAAG,MAAMC,SAAS;AAExC,SAASC,WAAW,CAACC,KAA2B,EAAe;EAAA;EAC7D,IAAM;IAAEC,MAAM;IAAEC,QAAQ,GAAGL;EAAiB,CAAC,GAAGG,KAAK;EACrD,IAAM,CAACG,SAAS,EAAEC,YAAY,CAAC,GAAGzB,QAAQ,CAACsB,MAAM,CAACI,IAAI,CAAC;EACvD,IAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAG5B,QAAQ,kDAC1CsB,MAAM,CAACO,YAAY,yDAAnB,qBAAqBF,UAAU,yEAAIb,kBAAkB,CACtD;EACD,IAAM,CAACgB,OAAO,EAAEC,QAAQ,CAAC,GAAG/B,QAAQ,CAAC,KAAK,CAAC;EAC3C,IAAM,CAACgC,aAAa,EAAEC,gBAAgB,CAAC,GAAGjC,QAAQ,CAACi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,GAAC,YAAU,CAAQ,eAC1C;IACE,IAAI,EAAC,OAAO;IACZ,KAAK,EAAExB,UAAW;IAClB,SAAS,EAAC,4BAA4B;IACtC,QAAQ,EAAEQ;EAAuB,EACjC,CAEL,CACG;AAEV;AAEA,eAAef,WAAW"}
|
|
1
|
+
{"version":3,"file":"StyleEditor.js","names":["React","useCallback","useEffect","useMemo","useRef","useState","FontAwesomeIcon","Log","ColorUtils","dhSort","vsCheck","Button","DropdownMenu","FormatStyleType","getLabelForStyleType","getBackgroundForStyleConfig","getColorForStyleConfig","log","module","DEFAULT_BACKGROUND","DEFAULT_COLOR_LIGHT","DEFAULT_COLOR_DARK","DEFAULT_DROPDOWN_WIDTH","DEFAULT_CALLBACK","undefined","StyleEditor","props","config","onChange","styleType","setStyleType","type","background","setBackground","customConfig","isShown","setShown","dropdownWidth","setDropdownWidth","csContainer","handleBackgroundChange","e","value","target","debug","handleMenuClosed","handleToggleClick","updateDropdownWidth","styleOptions","NO_FORMATTING","POSITIVE","NEGATIVE","WARN","NEUTRAL","ACCENT_1","ACCENT_2","CUSTOM","current","getBoundingClientRect","width","updateTheme","color","isDark","renderOptions","matchFound","optionArray","option","index","key","push","length","renderMenuElement","menuElement","placement","maxWidth"],"sources":["../../../src/sidebar/conditional-formatting/StyleEditor.tsx"],"sourcesContent":["import React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport Log from '@deephaven/log';\nimport { ColorUtils } from '@deephaven/utils';\nimport { dhSort, vsCheck } from '@deephaven/icons';\nimport { Button, DropdownMenu } from '@deephaven/components';\nimport {\n FormatStyleType,\n getLabelForStyleType,\n FormatStyleConfig,\n getBackgroundForStyleConfig,\n getColorForStyleConfig,\n} from './ConditionalFormattingUtils';\n\nimport './StyleEditor.scss';\n\nconst log = Log.module('StyleEditor');\n\nconst DEFAULT_BACKGROUND = '#fcfcfa';\n\nconst DEFAULT_COLOR_LIGHT = '#f0f0ee';\n\nconst DEFAULT_COLOR_DARK = '#1a171a';\n\nconst DEFAULT_DROPDOWN_WIDTH = 200;\n\nexport interface ConditionEditorProps {\n config: FormatStyleConfig;\n onChange?: (config: FormatStyleConfig) => void;\n}\n\nconst DEFAULT_CALLBACK = () => undefined;\n\nfunction StyleEditor(props: ConditionEditorProps): JSX.Element {\n const { config, onChange = DEFAULT_CALLBACK } = props;\n const [styleType, setStyleType] = useState(config.type);\n const [background, setBackground] = useState(\n config.customConfig?.background ?? DEFAULT_BACKGROUND\n );\n const [isShown, setShown] = useState(false);\n const [dropdownWidth, setDropdownWidth] = useState(DEFAULT_DROPDOWN_WIDTH);\n const csContainer = useRef<HTMLDivElement>(null);\n\n const handleBackgroundChange = useCallback(e => {\n const { value } = e.target;\n log.debug('handleBackgroundChange', value);\n setBackground(value);\n }, []);\n\n const handleMenuClosed = useCallback(() => {\n if (isShown) {\n setShown(false);\n }\n }, [isShown]);\n\n const handleToggleClick = useCallback(() => {\n if (!isShown) {\n updateDropdownWidth();\n }\n setShown(!isShown);\n }, [isShown]);\n\n const styleOptions = useMemo(\n () => [\n FormatStyleType.NO_FORMATTING,\n FormatStyleType.POSITIVE,\n FormatStyleType.NEGATIVE,\n FormatStyleType.WARN,\n FormatStyleType.NEUTRAL,\n FormatStyleType.ACCENT_1,\n FormatStyleType.ACCENT_2,\n FormatStyleType.CUSTOM,\n ],\n []\n );\n\n function updateDropdownWidth(): void {\n if (csContainer.current) {\n setDropdownWidth(csContainer.current.getBoundingClientRect().width);\n }\n }\n\n useEffect(\n function updateTheme() {\n onChange({\n type: styleType,\n customConfig: {\n color: ColorUtils.isDark(background)\n ? DEFAULT_COLOR_LIGHT\n : DEFAULT_COLOR_DARK,\n background,\n },\n });\n },\n [onChange, styleType, background]\n );\n\n const renderOptions = useCallback(() => {\n let matchFound = false;\n const optionArray: JSX.Element[] = [];\n for (let index = 0; index < styleOptions.length; index += 1) {\n const option = styleOptions[index];\n const key = `option-${index}-${option}`;\n matchFound = matchFound || option === styleType;\n optionArray.push(\n <Button\n key={key}\n kind=\"inline\"\n className=\"style-option-btn\"\n onClick={() => {\n setStyleType(option);\n setShown(false);\n }}\n style={{\n color: getColorForStyleConfig({ type: option }),\n background: getBackgroundForStyleConfig({ type: option }),\n }}\n >\n {option === styleType && (\n <FontAwesomeIcon icon={vsCheck} className=\"mr-2\" />\n )}\n {option !== styleType && <span className=\"mr-4\" />}\n {getLabelForStyleType(option)}\n </Button>\n );\n }\n return optionArray;\n }, [styleOptions, styleType]);\n\n const renderMenuElement = useCallback(\n () => (\n <div\n className=\"style-menu-container\"\n role=\"presentation\"\n style={{ width: dropdownWidth }}\n >\n <div className=\"style-options\">{renderOptions()}</div>\n </div>\n ),\n [dropdownWidth, renderOptions]\n );\n\n return (\n <div className=\"style-editor\">\n <div className=\"mb-2\" ref={csContainer}>\n <label className=\"mb-0\">Style</label>\n <Button\n kind=\"inline\"\n className=\"cs-dropdown\"\n style={{\n color: getColorForStyleConfig({ type: styleType }),\n background: getBackgroundForStyleConfig({ type: styleType }),\n }}\n onClick={handleToggleClick}\n >\n {getLabelForStyleType(styleType)}\n\n <span>\n <FontAwesomeIcon icon={dhSort} className=\"cs-caret\" />\n </span>\n <DropdownMenu\n isShown={isShown}\n actions={{ menuElement: renderMenuElement() }}\n popperOptions={{ placement: 'bottom-start' }}\n popperClassName=\"style-dropdown-menu\"\n onMenuClosed={handleMenuClosed}\n menuStyle={{ maxWidth: '100rem' }}\n />\n </Button>\n </div>\n\n {styleType === FormatStyleType.CUSTOM && (\n <div className=\"mb-2\">\n <label className=\"mb-0\">Background</label>\n <input\n type=\"color\"\n value={background}\n className=\"custom-select color-select\"\n onChange={handleBackgroundChange}\n />\n </div>\n )}\n </div>\n );\n}\n\nexport default StyleEditor;\n"],"mappings":"AAAA,OAAOA,KAAK,IACVC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,SAASC,eAAe,QAAQ,g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ef,WAAW"}
|
|
@@ -1,23 +1,32 @@
|
|
|
1
|
-
function
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
5
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
2
6
|
import * as React from 'react';
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
9
|
function SvgBarIcon(props) {
|
|
4
10
|
return (
|
|
5
11
|
/*#__PURE__*/
|
|
6
12
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
7
|
-
|
|
13
|
+
_jsx("svg", _objectSpread(_objectSpread({
|
|
8
14
|
width: 48,
|
|
9
15
|
height: 48,
|
|
10
16
|
xmlns: "http://www.w3.org/2000/svg"
|
|
11
|
-
}, props),
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
}, props), {}, {
|
|
18
|
+
children: /*#__PURE__*/_jsxs("g", {
|
|
19
|
+
fill: "none",
|
|
20
|
+
fillRule: "evenodd",
|
|
21
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
22
|
+
fill: "#C1C0C0",
|
|
23
|
+
d: "M44 43v1H4v-1z"
|
|
24
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
25
|
+
fill: "#7DA4FF",
|
|
26
|
+
d: "M8 26h4v15H8zM15 17h4v24h-4zM22 21h4v20h-4zM29 17h4v24h-4zM36 11h4v30h-4z"
|
|
27
|
+
})]
|
|
28
|
+
})
|
|
29
|
+
}))
|
|
21
30
|
);
|
|
22
31
|
}
|
|
23
32
|
export default SvgBarIcon;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarIcon.js","names":["React","SvgBarIcon","props"],"sources":["../../../src/sidebar/icons/BarIcon.tsx"],"sourcesContent":["import * as React from 'react';\n\nfunction SvgBarIcon(\n props: JSX.IntrinsicAttributes & React.SVGProps<SVGSVGElement>\n): JSX.Element {\n return (\n // eslint-disable-next-line react/jsx-props-no-spreading\n <svg width={48} height={48} xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <g fill=\"none\" fillRule=\"evenodd\">\n <path fill=\"#C1C0C0\" d=\"M44 43v1H4v-1z\" />\n <path\n fill=\"#7DA4FF\"\n d=\"M8 26h4v15H8zM15 17h4v24h-4zM22 21h4v20h-4zM29 17h4v24h-4zM36 11h4v30h-4z\"\n />\n </g>\n </svg>\n );\n}\n\nexport default SvgBarIcon;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"BarIcon.js","names":["React","SvgBarIcon","props"],"sources":["../../../src/sidebar/icons/BarIcon.tsx"],"sourcesContent":["import * as React from 'react';\n\nfunction SvgBarIcon(\n props: JSX.IntrinsicAttributes & React.SVGProps<SVGSVGElement>\n): JSX.Element {\n return (\n // eslint-disable-next-line react/jsx-props-no-spreading\n <svg width={48} height={48} xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <g fill=\"none\" fillRule=\"evenodd\">\n <path fill=\"#C1C0C0\" d=\"M44 43v1H4v-1z\" />\n <path\n fill=\"#7DA4FF\"\n d=\"M8 26h4v15H8zM15 17h4v24h-4zM22 21h4v20h-4zM29 17h4v24h-4zM36 11h4v30h-4z\"\n />\n </g>\n </svg>\n );\n}\n\nexport default SvgBarIcon;\n"],"mappings":";;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAAC;AAAA;AAE/B,SAASC,UAAU,CACjBC,KAA8D,EACjD;EACb;IAAA;IACE;IACA;MAAK,KAAK,EAAE,EAAG;MAAC,MAAM,EAAE,EAAG;MAAC,KAAK,EAAC;IAA4B,GAAKA,KAAK;MAAA,uBACtE;QAAG,IAAI,EAAC,MAAM;QAAC,QAAQ,EAAC,SAAS;QAAA,wBAC/B;UAAM,IAAI,EAAC,SAAS;UAAC,CAAC,EAAC;QAAgB,EAAG,eAC1C;UACE,IAAI,EAAC,SAAS;UACd,CAAC,EAAC;QAA2E,EAC7E;MAAA;IACA;EACA;AAEV;AAEA,eAAeD,UAAU"}
|
|
@@ -1,41 +1,49 @@
|
|
|
1
|
-
function
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
5
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
2
6
|
import * as React from 'react';
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
9
|
function FormatColumnWhereIcon(props) {
|
|
4
|
-
return /*#__PURE__*/
|
|
10
|
+
return /*#__PURE__*/_jsxs("svg", _objectSpread(_objectSpread({
|
|
5
11
|
width: "48",
|
|
6
12
|
height: "48",
|
|
7
13
|
viewBox: "0 0 48 48",
|
|
8
14
|
fill: "none",
|
|
9
15
|
xmlns: "http://www.w3.org/2000/svg"
|
|
10
16
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
11
|
-
}, props),
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
17
|
+
}, props), {}, {
|
|
18
|
+
children: [/*#__PURE__*/_jsx("rect", {
|
|
19
|
+
width: "48",
|
|
20
|
+
height: "48",
|
|
21
|
+
fill: "none"
|
|
22
|
+
}), /*#__PURE__*/_jsx("rect", {
|
|
23
|
+
x: "26",
|
|
24
|
+
y: "10",
|
|
25
|
+
width: "15",
|
|
26
|
+
height: "4",
|
|
27
|
+
fill: "#9FDE70"
|
|
28
|
+
}), /*#__PURE__*/_jsx("rect", {
|
|
29
|
+
x: "26",
|
|
30
|
+
y: "22",
|
|
31
|
+
width: "15",
|
|
32
|
+
height: "4",
|
|
33
|
+
fill: "#9FDE70"
|
|
34
|
+
}), /*#__PURE__*/_jsx("rect", {
|
|
35
|
+
x: "26",
|
|
36
|
+
y: "28",
|
|
37
|
+
width: "15",
|
|
38
|
+
height: "4",
|
|
39
|
+
fill: "#FFD95C"
|
|
40
|
+
}), /*#__PURE__*/_jsx("rect", {
|
|
41
|
+
x: "26",
|
|
42
|
+
y: "34",
|
|
43
|
+
width: "15",
|
|
44
|
+
height: "4",
|
|
45
|
+
fill: "#9FDE70"
|
|
46
|
+
})]
|
|
39
47
|
}));
|
|
40
48
|
}
|
|
41
49
|
export default FormatColumnWhereIcon;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormatColumnWhereIcon.js","names":["React","FormatColumnWhereIcon","props"],"sources":["../../../src/sidebar/icons/FormatColumnWhereIcon.tsx"],"sourcesContent":["import * as React from 'react';\n\nfunction FormatColumnWhereIcon(\n props: JSX.IntrinsicAttributes & React.SVGProps<SVGSVGElement>\n): JSX.Element {\n return (\n <svg\n width=\"48\"\n height=\"48\"\n viewBox=\"0 0 48 48\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n >\n <rect width=\"48\" height=\"48\" fill=\"none\" />\n <rect x=\"26\" y=\"10\" width=\"15\" height=\"4\" fill=\"#9FDE70\" />\n <rect x=\"26\" y=\"22\" width=\"15\" height=\"4\" fill=\"#9FDE70\" />\n <rect x=\"26\" y=\"28\" width=\"15\" height=\"4\" fill=\"#FFD95C\" />\n <rect x=\"26\" y=\"34\" width=\"15\" height=\"4\" fill=\"#9FDE70\" />\n </svg>\n );\n}\n\nexport default FormatColumnWhereIcon;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"FormatColumnWhereIcon.js","names":["React","FormatColumnWhereIcon","props"],"sources":["../../../src/sidebar/icons/FormatColumnWhereIcon.tsx"],"sourcesContent":["import * as React from 'react';\n\nfunction FormatColumnWhereIcon(\n props: JSX.IntrinsicAttributes & React.SVGProps<SVGSVGElement>\n): JSX.Element {\n return (\n <svg\n width=\"48\"\n height=\"48\"\n viewBox=\"0 0 48 48\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n >\n <rect width=\"48\" height=\"48\" fill=\"none\" />\n <rect x=\"26\" y=\"10\" width=\"15\" height=\"4\" fill=\"#9FDE70\" />\n <rect x=\"26\" y=\"22\" width=\"15\" height=\"4\" fill=\"#9FDE70\" />\n <rect x=\"26\" y=\"28\" width=\"15\" height=\"4\" fill=\"#FFD95C\" />\n <rect x=\"26\" y=\"34\" width=\"15\" height=\"4\" fill=\"#9FDE70\" />\n </svg>\n );\n}\n\nexport default FormatColumnWhereIcon;\n"],"mappings":";;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAAC;AAAA;AAE/B,SAASC,qBAAqB,CAC5BC,KAA8D,EACjD;EACb,oBACE;IACE,KAAK,EAAC,IAAI;IACV,MAAM,EAAC,IAAI;IACX,OAAO,EAAC,WAAW;IACnB,IAAI,EAAC,MAAM;IACX,KAAK,EAAC;IACN;EAAA,GACIA,KAAK;IAAA,wBAET;MAAM,KAAK,EAAC,IAAI;MAAC,MAAM,EAAC,IAAI;MAAC,IAAI,EAAC;IAAM,EAAG,eAC3C;MAAM,CAAC,EAAC,IAAI;MAAC,CAAC,EAAC,IAAI;MAAC,KAAK,EAAC,IAAI;MAAC,MAAM,EAAC,GAAG;MAAC,IAAI,EAAC;IAAS,EAAG,eAC3D;MAAM,CAAC,EAAC,IAAI;MAAC,CAAC,EAAC,IAAI;MAAC,KAAK,EAAC,IAAI;MAAC,MAAM,EAAC,GAAG;MAAC,IAAI,EAAC;IAAS,EAAG,eAC3D;MAAM,CAAC,EAAC,IAAI;MAAC,CAAC,EAAC,IAAI;MAAC,KAAK,EAAC,IAAI;MAAC,MAAM,EAAC,GAAG;MAAC,IAAI,EAAC;IAAS,EAAG,eAC3D;MAAM,CAAC,EAAC,IAAI;MAAC,CAAC,EAAC,IAAI;MAAC,KAAK,EAAC,IAAI;MAAC,MAAM,EAAC,GAAG;MAAC,IAAI,EAAC;IAAS,EAAG;EAAA,GACvD;AAEV;AAEA,eAAeD,qBAAqB"}
|