@adaptabletools/adaptable 20.0.0-canary.2 → 20.0.0-canary.20
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/base.css +1288 -898
- package/base.css.map +1 -1
- package/index.css +428 -898
- package/index.css.map +1 -1
- package/package.json +4 -4
- package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -1
- package/src/AdaptableOptions/CellSummaryOptions.d.ts +1 -1
- package/src/AdaptableOptions/ContainerOptions.d.ts +0 -7
- package/src/AdaptableOptions/DashboardOptions.d.ts +1 -1
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +2 -2
- package/src/AdaptableOptions/EditOptions.d.ts +14 -3
- package/src/AdaptableOptions/ExportOptions.d.ts +11 -20
- package/src/AdaptableOptions/PredicateOptions.d.ts +4 -4
- package/src/AdaptableOptions/QuickSearchOptions.d.ts +2 -2
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +7 -0
- package/src/Api/ExportApi.d.ts +1 -6
- package/src/Api/Fdc3Api.d.ts +5 -3
- package/src/Api/Implementation/AdaptableApiImpl.js +1 -0
- package/src/Api/Implementation/ColumnFilterApiImpl.js +3 -3
- package/src/Api/Implementation/ExportApiImpl.d.ts +1 -2
- package/src/Api/Implementation/ExportApiImpl.js +17 -10
- package/src/Api/Implementation/Fdc3ApiImpl.d.ts +3 -3
- package/src/Api/Implementation/Fdc3ApiImpl.js +4 -4
- package/src/Api/Implementation/LayoutHelpers.js +8 -27
- package/src/Api/Implementation/PredicateApiImpl.js +1 -1
- package/src/Api/Implementation/ScheduleApiImpl.js +1 -1
- package/src/Api/Implementation/StyledColumnApiImpl.js +1 -1
- package/src/Api/Implementation/ThemeApiImpl.js +3 -1
- package/src/Api/Internal/ActionColumnInternalApi.js +16 -19
- package/src/Api/Internal/AdaptableInternalApi.js +1 -1
- package/src/Api/Internal/ColumnFilterInternalApi.js +2 -2
- package/src/Api/Internal/ColumnInternalApi.js +1 -2
- package/src/Api/Internal/EventInternalApi.js +6 -1
- package/src/Api/Internal/ExportInternalApi.d.ts +10 -6
- package/src/Api/Internal/ExportInternalApi.js +105 -136
- package/src/Api/Internal/RowFormInternalApi.js +1 -1
- package/src/Api/ThemeApi.d.ts +2 -0
- package/src/PredefinedConfig/AlertState.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptableColumnContext.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +13 -29
- package/src/PredefinedConfig/Common/ColumnFilter.d.ts +6 -2
- package/src/PredefinedConfig/ExportState.d.ts +10 -17
- package/src/PredefinedConfig/FlashingCellState.d.ts +1 -1
- package/src/PredefinedConfig/LayoutState.d.ts +17 -17
- package/src/PredefinedConfig/StyledColumnState.d.ts +1 -1
- package/src/Redux/ActionsReducers/LayoutRedux.d.ts +4 -3
- package/src/Redux/ActionsReducers/LayoutRedux.js +3 -3
- package/src/Redux/Store/AdaptableStore.js +3 -3
- package/src/Strategy/ColumnFilterModule.js +4 -4
- package/src/Strategy/StyledColumnModule.js +6 -6
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +1 -1
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +3 -3
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +13 -13
- package/src/Utilities/Helpers/AdaptableHelper.d.ts +2 -0
- package/src/Utilities/Helpers/AdaptableHelper.js +10 -0
- package/src/Utilities/Helpers/DateHelper.js +1 -2
- package/src/Utilities/Helpers/FormatHelper.js +18 -5
- package/src/Utilities/ObjectFactory.js +1 -0
- package/src/Utilities/Services/Fdc3Service.d.ts +2 -2
- package/src/Utilities/Services/Fdc3Service.js +7 -2
- package/src/Utilities/Services/ThemeService.d.ts +1 -1
- package/src/Utilities/Services/ThemeService.js +5 -5
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +41 -0
- package/src/View/ColumnInfo/ColumnInfo.js +0 -1
- package/src/View/Comments/CommentsEditor.js +5 -2
- package/src/View/Comments/CommentsPopup.js +5 -2
- package/src/View/Components/ColumnFilter/ColumnFilter.d.ts +1 -1
- package/src/View/Components/ColumnFilter/ColumnFilter.js +4 -2
- package/src/View/Components/ColumnFilter/FloatingFilter.js +1 -1
- package/src/View/Components/ColumnFilter/LayoutColumnFilter.js +1 -1
- package/src/View/Components/ColumnFilter/useAdaptableFilterWrapper.d.ts +1 -1
- package/src/View/Components/ColumnFilter/useAdaptableFilterWrapper.js +6 -2
- package/src/View/Components/ColumnFilter/utils.js +2 -2
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +3 -3
- package/src/View/Dashboard/CustomToolbar.js +2 -2
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +4 -1
- package/src/View/Filter/FilterSummary.js +1 -1
- package/src/View/GridInfo/GridInfoPopup/AdaptableObjectsSummary.js +6 -2
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +7 -2
- package/src/View/Note/NotePopup.js +5 -2
- package/src/View/QuickSearch/QuickSearchPopup.js +2 -2
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReport.d.ts +2 -0
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReport.js +18 -2
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsSummary.js +4 -0
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsWizard.js +2 -1
- package/src/View/StatusBar/AdaptableStatusBar.js +7 -5
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.d.ts +3 -4
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +348 -191
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.js +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.js +4 -4
- package/src/agGrid/AdaptableAgGrid.d.ts +4 -8
- package/src/agGrid/AdaptableAgGrid.js +72 -118
- package/src/agGrid/AgGridAdapter.d.ts +1 -1
- package/src/agGrid/AgGridAdapter.js +7 -8
- package/src/agGrid/AgGridColumnAdapter.js +5 -10
- package/src/agGrid/AgGridExportAdapter.d.ts +24 -1
- package/src/agGrid/AgGridExportAdapter.js +24 -25
- package/src/agGrid/AgGridThemeAdapter.d.ts +19 -0
- package/src/agGrid/AgGridThemeAdapter.js +122 -0
- package/src/agGrid/cellRenderers/BadgeRenderer.js +2 -1
- package/src/agGrid/editors/AdaptableDateEditor/InternalAdaptableDateEditor.js +1 -1
- package/src/components/ColorPicker/ColorPicker.js +2 -2
- package/src/components/Datepicker/DatepickerContext.d.ts +1 -0
- package/src/components/Datepicker/index.d.ts +1 -0
- package/src/components/Datepicker/index.js +1 -1
- package/src/components/OverlayTrigger/useAgGridClassName.js +1 -1
- package/src/components/Select/Select.d.ts +1 -0
- package/src/components/Select/Select.js +30 -7
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +23 -15
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/migration/VersionUpgrade20.d.ts +3 -0
- package/src/migration/VersionUpgrade20.js +140 -12
- package/src/types.d.ts +3 -3
- package/tsconfig.esm.tsbuildinfo +1 -1
|
@@ -1,214 +1,371 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Box } from 'rebass';
|
|
3
|
-
import { CheckBox } from '../../../components/CheckBox';
|
|
4
|
-
import { ColorPicker } from '../../../components/ColorPicker';
|
|
5
|
-
import FormLayout, { FormRow } from '../../../components/FormLayout';
|
|
6
|
-
import Input from '../../../components/Input';
|
|
2
|
+
import { Box, Flex } from 'rebass';
|
|
7
3
|
import { Select } from '../../../components/Select';
|
|
8
4
|
import { Tabs } from '../../../components/Tabs';
|
|
5
|
+
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
|
|
6
|
+
import FormLayout, { FormRow } from '../../../components/FormLayout';
|
|
9
7
|
import { Tag } from '../../../components/Tag';
|
|
10
|
-
import { setInPath } from '../../../Utilities/Extensions/ObjectExtensions';
|
|
11
8
|
import AdaptableInput from '../../Components/AdaptableInput';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
label: 'Number',
|
|
20
|
-
value: 'number',
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
label: 'Category',
|
|
24
|
-
value: 'category',
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
label: 'Time',
|
|
28
|
-
value: 'time',
|
|
29
|
-
},
|
|
30
|
-
];
|
|
31
|
-
}, [data]);
|
|
32
|
-
return (React.createElement(Tabs, { mb: 2 },
|
|
33
|
-
React.createElement(Tabs.Tab, null, "Padding"),
|
|
34
|
-
React.createElement(Tabs.Tab, null, "Axis"),
|
|
35
|
-
React.createElement(Tabs.Tab, null, "Highlight Style"),
|
|
36
|
-
React.createElement(Tabs.Content, null,
|
|
37
|
-
React.createElement(FormLayout, null,
|
|
38
|
-
React.createElement(FormRow, { label: "Top" },
|
|
39
|
-
React.createElement(Input, { onChange: (event) => props.onOptionChange(['padding', 'top'], event.target.value ?? 0), type: "number", value: data.SparkLineStyle.options?.padding?.top })),
|
|
40
|
-
React.createElement(FormRow, { label: "Bottom" },
|
|
41
|
-
React.createElement(Input, { onChange: (event) => props.onOptionChange(['padding', 'bottom'], event.target.value ?? 0), type: "number", value: data.SparkLineStyle.options?.padding?.bottom })),
|
|
42
|
-
React.createElement(FormRow, { label: "Left" },
|
|
43
|
-
React.createElement(Input, { onChange: (event) => props.onOptionChange(['padding', 'left'], event.target.value ?? 0), type: "number", value: data.SparkLineStyle.options?.padding?.left })),
|
|
44
|
-
React.createElement(FormRow, { label: "Right" },
|
|
45
|
-
React.createElement(Input, { onChange: (event) => props.onOptionChange(['padding', 'right'], event.target.value ?? 0), type: "number", value: data.SparkLineStyle.options?.padding?.right })))),
|
|
46
|
-
React.createElement(Tabs.Content, null,
|
|
47
|
-
React.createElement(FormLayout, null,
|
|
48
|
-
React.createElement(FormRow, { label: "Axis Type" },
|
|
49
|
-
React.createElement(Box, { maxWidth: 180 },
|
|
50
|
-
React.createElement(Select, { value: data?.SparkLineStyle?.options?.axis?.type, options: axisTypeOptions, onChange: (value) => props.onOptionChange(['axis', 'type'], value), placeholder: "Select Axis Type" }))),
|
|
51
|
-
React.createElement(FormRow, { label: "Stroke Color" },
|
|
52
|
-
React.createElement(ColorPicker, { api: api, value: data.SparkLineStyle?.options?.axis?.stroke ?? '#fff', onChange: (color) => props.onOptionChange(['axis', 'stroke'], color) })),
|
|
53
|
-
React.createElement(FormRow, { label: "Stroke Width" },
|
|
54
|
-
React.createElement(AdaptableInput, { type: "number", value: data.SparkLineStyle?.options?.axis?.strokeWidth ?? 0, onChange: (event) => props.onOptionChange(['axis', 'strokeWidth'], parseFloat(event.target.value)) })))),
|
|
55
|
-
React.createElement(Tabs.Content, null,
|
|
56
|
-
React.createElement(FormLayout, null,
|
|
57
|
-
React.createElement(FormRow, { label: "Fill" },
|
|
58
|
-
React.createElement(ColorPicker, { api: api, value: data.SparkLineStyle?.options?.highlightStyle?.item?.fill ?? YELLOW, onChange: (color) => props.onOptionChange(['highlightStyle', 'item', 'fill'], color) })),
|
|
59
|
-
React.createElement(FormRow, { label: "Stroke" },
|
|
60
|
-
React.createElement(ColorPicker, { api: api, value: data.SparkLineStyle?.options?.highlightStyle?.item?.stroke ?? LIGHT_GRAY, onChange: (color) => props.onOptionChange(['highlightStyle', 'item', 'stroke'], color) })),
|
|
61
|
-
React.createElement(FormRow, { label: "Stroke Width" },
|
|
62
|
-
React.createElement(AdaptableInput, { type: "number", value: data.SparkLineStyle?.options?.highlightStyle?.item?.strokeWidth, onChange: (event) => props.onOptionChange(['highlightStyle', 'item', 'strokeWidth'], parseFloat(event.target.value)) }))))));
|
|
63
|
-
};
|
|
64
|
-
const SparklineMarkerProperties = (props) => {
|
|
65
|
-
const { data, api } = useOnePageAdaptableWizardContext();
|
|
66
|
-
const sparklineOptions = data.SparkLineStyle.options;
|
|
67
|
-
return (React.createElement(FormLayout, null,
|
|
68
|
-
React.createElement(FormRow, { label: "Enabled" },
|
|
69
|
-
React.createElement(CheckBox, { checked: sparklineOptions?.marker?.enabled ?? true, onChange: (checked) => props.onOptionChange(['marker', 'enabled'], checked) })),
|
|
70
|
-
React.createElement(FormRow, { label: "Size" },
|
|
71
|
-
React.createElement(AdaptableInput, { type: "number", value: sparklineOptions?.marker?.size ?? 0, onChange: (event) => props.onOptionChange(['marker', 'size'], parseFloat(event.target.value)) })),
|
|
72
|
-
React.createElement(FormRow, { label: "Fill" },
|
|
73
|
-
React.createElement(ColorPicker, { api: api, value: sparklineOptions?.marker?.fill ?? LIGHT_BLUE, onChange: (color) => props.onOptionChange(['marker', 'fill'], color) })),
|
|
74
|
-
React.createElement(FormRow, { label: "Stroke" },
|
|
75
|
-
React.createElement(ColorPicker, { api: api, value: sparklineOptions?.marker?.stroke ?? LIGHT_BLUE, onChange: (color) => props.onOptionChange(['marker', 'stroke'], color) })),
|
|
76
|
-
React.createElement(FormRow, { label: "Stroke Width" },
|
|
77
|
-
React.createElement(AdaptableInput, { type: "number", value: sparklineOptions?.marker?.strokeWidth ?? 1, onChange: (event) => props.onOptionChange(['marker', 'strokeWidth'], parseFloat(event.target.value)) }))));
|
|
78
|
-
};
|
|
79
|
-
const SparklineLineProperties = (props) => {
|
|
80
|
-
const { data, api } = useOnePageAdaptableWizardContext();
|
|
81
|
-
const sparklineOptions = data.SparkLineStyle.options;
|
|
82
|
-
return (React.createElement(FormLayout, null,
|
|
83
|
-
React.createElement(FormRow, { label: "Stroke" },
|
|
84
|
-
React.createElement(ColorPicker, { api: api, value: sparklineOptions?.stroke ?? LIGHT_BLUE, onChange: (color) => props.onOptionChange(['stroke'], color) })),
|
|
85
|
-
React.createElement(FormRow, { label: "Stroke Width" },
|
|
86
|
-
React.createElement(AdaptableInput, { type: "number", value: sparklineOptions?.strokeWidth, onChange: (event) => props.onOptionChange(['strokeWidth'], parseFloat(event.target.value)) }))));
|
|
87
|
-
};
|
|
88
|
-
const TypeAreaProperties = (props) => {
|
|
89
|
-
const { data, api } = useOnePageAdaptableWizardContext();
|
|
90
|
-
const sparklineOptions = data.SparkLineStyle.options;
|
|
91
|
-
return (React.createElement(Tabs, { mb: 2 },
|
|
92
|
-
React.createElement(Tabs.Tab, null, "Stroke"),
|
|
93
|
-
React.createElement(Tabs.Tab, null, "Line"),
|
|
94
|
-
React.createElement(Tabs.Tab, null, "Marker"),
|
|
95
|
-
React.createElement(Tabs.Content, null,
|
|
96
|
-
React.createElement(FormLayout, null,
|
|
97
|
-
React.createElement(FormRow, { label: "Stroke" },
|
|
98
|
-
React.createElement(ColorPicker, { api: api, value: sparklineOptions?.fill ?? LIGHT_BLUE, onChange: (color) => props.onOptionChange(['fill'], color) })))),
|
|
99
|
-
React.createElement(Tabs.Content, null,
|
|
100
|
-
React.createElement(SparklineLineProperties, { onOptionChange: props.onOptionChange })),
|
|
101
|
-
React.createElement(Tabs.Content, null,
|
|
102
|
-
React.createElement(SparklineMarkerProperties, { onOptionChange: props.onOptionChange }))));
|
|
103
|
-
};
|
|
104
|
-
const TypeLineProperties = (props) => {
|
|
105
|
-
return (React.createElement(Tabs, { mb: 2 },
|
|
106
|
-
React.createElement(Tabs.Tab, null, "Line"),
|
|
107
|
-
React.createElement(Tabs.Tab, null, "Marker"),
|
|
108
|
-
React.createElement(Tabs.Content, null,
|
|
109
|
-
React.createElement(SparklineLineProperties, { onOptionChange: props.onOptionChange })),
|
|
110
|
-
React.createElement(Tabs.Content, null,
|
|
111
|
-
React.createElement(SparklineMarkerProperties, { onOptionChange: props.onOptionChange }))));
|
|
9
|
+
import { ColorPicker } from '../../../components/ColorPicker';
|
|
10
|
+
import { CheckBox } from '../../../components/CheckBox';
|
|
11
|
+
const SparklineTypes = {
|
|
12
|
+
LINE: 'line',
|
|
13
|
+
AREA: 'area',
|
|
14
|
+
BAR_VERTICAL: 'bar_vertical',
|
|
15
|
+
BAR_HORIZONTAL: 'bar_horizontal',
|
|
112
16
|
};
|
|
113
|
-
const
|
|
17
|
+
const sparklineTypeOptions = [
|
|
18
|
+
{ label: 'Line', value: SparklineTypes.LINE },
|
|
19
|
+
{ label: 'Area', value: SparklineTypes.AREA },
|
|
20
|
+
{ label: 'Column', value: SparklineTypes.BAR_VERTICAL },
|
|
21
|
+
{ label: 'Bar', value: SparklineTypes.BAR_HORIZONTAL },
|
|
22
|
+
];
|
|
23
|
+
export const StyledColumnSparklineSettingsSection = ({ onChange }) => {
|
|
114
24
|
const { data, api } = useOnePageAdaptableWizardContext();
|
|
115
|
-
const sparklineOptions = data.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
25
|
+
const sparklineOptions = data.SparklineStyle?.options ?? {
|
|
26
|
+
type: SparklineTypes.LINE,
|
|
27
|
+
};
|
|
28
|
+
if (!sparklineOptions.type) {
|
|
29
|
+
sparklineOptions.type = SparklineTypes.LINE;
|
|
30
|
+
}
|
|
31
|
+
const handleOptionsChange = (newOptions) => {
|
|
32
|
+
const updatedStyledColumn = {
|
|
33
|
+
...data,
|
|
34
|
+
SparklineStyle: { ...data.SparklineStyle, options: newOptions },
|
|
35
|
+
};
|
|
36
|
+
onChange(updatedStyledColumn);
|
|
37
|
+
};
|
|
38
|
+
const currentType = sparklineOptions.type ?? 'line';
|
|
39
|
+
const currentDirection = sparklineOptions.direction;
|
|
40
|
+
const sparklineType = (currentType === 'bar' ? `bar_${currentDirection ?? 'vertical'}` : currentType);
|
|
41
|
+
const handleTypeChange = (value) => {
|
|
42
|
+
const [type, direction] = value.split('_');
|
|
43
|
+
const newOptions = { ...sparklineOptions, type };
|
|
44
|
+
if (direction) {
|
|
45
|
+
newOptions.direction = direction;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
delete newOptions.direction;
|
|
49
|
+
}
|
|
50
|
+
handleOptionsChange(newOptions);
|
|
51
|
+
};
|
|
52
|
+
const isObjectNumberArray = api.columnApi.getColumnWithColumnId(data.ColumnId)?.dataType === 'objectArray';
|
|
53
|
+
return (React.createElement(React.Fragment, null,
|
|
54
|
+
React.createElement(Tabs, { mb: 2 },
|
|
55
|
+
React.createElement(Tabs.Tab, null, "Settings"),
|
|
56
|
+
React.createElement(Tabs.Content, null,
|
|
57
|
+
React.createElement(FormLayout, null,
|
|
58
|
+
React.createElement(FormRow, { label: "Sparkline Type" },
|
|
59
|
+
React.createElement(Box, { maxWidth: 160 },
|
|
60
|
+
React.createElement(Select, { options: sparklineTypeOptions, value: sparklineType, onChange: handleTypeChange, placeholder: "Select Sparkline Type" }))),
|
|
61
|
+
isObjectNumberArray && (React.createElement(SparklineObjectArrayProperties, { options: sparklineOptions, onChange: handleOptionsChange })),
|
|
62
|
+
React.createElement(FormRow, { label: "Min Value" },
|
|
63
|
+
React.createElement(AdaptableInput, { type: "number", value: sparklineOptions.min ?? '', onChange: (e) => handleOptionsChange({
|
|
64
|
+
...sparklineOptions,
|
|
65
|
+
min: e.target.value === '' ? undefined : Number(e.target.value),
|
|
66
|
+
}), placeholder: 'Auto', title: "User override for the automatically determined min value (based on series data)" })),
|
|
67
|
+
React.createElement(FormRow, { label: "Max Value" },
|
|
68
|
+
React.createElement(AdaptableInput, { type: "number", value: sparklineOptions.max ?? '', onChange: (e) => handleOptionsChange({
|
|
69
|
+
...sparklineOptions,
|
|
70
|
+
max: e.target.value === '' ? undefined : Number(e.target.value),
|
|
71
|
+
}), placeholder: 'Auto', title: "User override for the automatically determined max value (based on series data)" }))))),
|
|
72
|
+
React.createElement(Tabs, { mb: 2 },
|
|
73
|
+
React.createElement(Tabs.Tab, null, "Theming"),
|
|
74
|
+
React.createElement(Tabs.Tab, null, "Axis"),
|
|
75
|
+
React.createElement(Tabs.Tab, { hidden: sparklineOptions.type === 'bar' }, "Marker"),
|
|
76
|
+
React.createElement(Tabs.Tab, null, "Tooltip"),
|
|
77
|
+
React.createElement(Tabs.Tab, null, "Highlight Style"),
|
|
78
|
+
React.createElement(Tabs.Content, null,
|
|
79
|
+
React.createElement(SparklineThemingOptions, { options: sparklineOptions, onChange: handleOptionsChange })),
|
|
80
|
+
React.createElement(Tabs.Content, null,
|
|
81
|
+
React.createElement(SparklineAxisOptions, { options: sparklineOptions, onChange: handleOptionsChange })),
|
|
82
|
+
React.createElement(Tabs.Content, null,
|
|
83
|
+
React.createElement(SparklineMarkerOptions, { options: sparklineOptions, onChange: handleOptionsChange })),
|
|
84
|
+
React.createElement(Tabs.Content, null,
|
|
85
|
+
React.createElement(SparklineTooltipOptions, { options: sparklineOptions, onChange: handleOptionsChange })),
|
|
86
|
+
React.createElement(Tabs.Content, null,
|
|
87
|
+
React.createElement(SparklineHighlightOptions, { options: sparklineOptions, onChange: handleOptionsChange })))));
|
|
126
88
|
};
|
|
127
|
-
const
|
|
89
|
+
const SparklineObjectArrayProperties = ({ options, onChange, }) => {
|
|
128
90
|
const { data, api } = useOnePageAdaptableWizardContext();
|
|
129
|
-
const
|
|
130
|
-
const [sparklineDataItem, setSparklineDataItem] = React.useState('');
|
|
91
|
+
const [previewData, setPreviewData] = React.useState('');
|
|
131
92
|
React.useEffect(() => {
|
|
93
|
+
const column = api.columnApi.getColumnWithColumnId(data.ColumnId);
|
|
94
|
+
if (!column) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
132
97
|
try {
|
|
133
|
-
let
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
if (rowWithData?.[column?.field]?.[0]) {
|
|
140
|
-
cellData = rowWithData?.[column?.field]?.[0];
|
|
98
|
+
for (let row = 0; row < 20; row++) {
|
|
99
|
+
const rowNode = api.gridApi.getRowNodeForIndex(row);
|
|
100
|
+
const cellData = rowNode?.data?.[column.field]?.[0];
|
|
101
|
+
if (cellData) {
|
|
102
|
+
const preview = JSON.stringify(cellData, null, 2).replace(/[{}",]/g, '');
|
|
103
|
+
setPreviewData(preview);
|
|
141
104
|
break;
|
|
142
105
|
}
|
|
143
|
-
currentRow++;
|
|
144
|
-
}
|
|
145
|
-
if (cellData) {
|
|
146
|
-
const str = JSON.stringify(cellData, null, 2).replace(/[{}",]/g, '');
|
|
147
|
-
setSparklineDataItem(str);
|
|
148
106
|
}
|
|
149
107
|
}
|
|
150
|
-
catch (
|
|
151
|
-
api.logError('Error parsing sparkline data',
|
|
108
|
+
catch (error) {
|
|
109
|
+
api.logError('Error parsing sparkline data', error);
|
|
152
110
|
}
|
|
153
|
-
}, [data]);
|
|
111
|
+
}, [api, data.ColumnId]);
|
|
154
112
|
return (React.createElement(React.Fragment, null,
|
|
155
113
|
React.createElement(FormRow, { label: "X Key" },
|
|
156
|
-
React.createElement(
|
|
114
|
+
React.createElement(AdaptableInput, { value: options.xKey ?? 'x', onChange: (e) => onChange({ ...options, xKey: e.target.value }) })),
|
|
157
115
|
React.createElement(FormRow, { label: "Y Key" },
|
|
158
|
-
React.createElement(
|
|
159
|
-
|
|
160
|
-
React.createElement(Tag, null,
|
|
116
|
+
React.createElement(AdaptableInput, { value: options.yKey ?? 'y', onChange: (e) => onChange({ ...options, yKey: e.target.value }) })),
|
|
117
|
+
previewData && (React.createElement(FormRow, { label: "Preview" },
|
|
118
|
+
React.createElement(Tag, null, previewData)))));
|
|
161
119
|
};
|
|
162
|
-
|
|
163
|
-
const {
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
{
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
120
|
+
const SparklineThemingOptions = ({ options, onChange, }) => {
|
|
121
|
+
const { api } = useOnePageAdaptableWizardContext();
|
|
122
|
+
const sparklineOptions = options;
|
|
123
|
+
const handleChange = (key, value) => {
|
|
124
|
+
onChange({ ...options, [key]: value });
|
|
125
|
+
};
|
|
126
|
+
const handlePaddingChange = (key, value) => {
|
|
127
|
+
const currentPadding = sparklineOptions.padding || {};
|
|
128
|
+
handleChange('padding', { ...currentPadding, [key]: value });
|
|
129
|
+
};
|
|
130
|
+
const themes = [
|
|
131
|
+
{ value: 'ag-default', label: 'Default' },
|
|
132
|
+
{ value: 'ag-default-dark', label: 'Default Dark' },
|
|
133
|
+
{ value: 'ag-sheets', label: 'Sheets' },
|
|
134
|
+
{ value: 'ag-sheets-dark', label: 'Sheets Dark' },
|
|
135
|
+
{ value: 'ag-polychroma', label: 'Polychroma' },
|
|
136
|
+
{ value: 'ag-polychroma-dark', label: 'Polychroma Dark' },
|
|
137
|
+
{ value: 'ag-vivid', label: 'Vivid' },
|
|
138
|
+
{ value: 'ag-vivid-dark', label: 'Vivid Dark' },
|
|
139
|
+
{ value: 'ag-material', label: 'Material' },
|
|
140
|
+
{ value: 'ag-material-dark', label: 'Material Dark' },
|
|
141
|
+
{ value: 'ag-financial', label: 'Financial' },
|
|
142
|
+
{ value: 'ag-financial-dark', label: 'Financial Dark' },
|
|
143
|
+
];
|
|
144
|
+
return (React.createElement(FormLayout, null,
|
|
145
|
+
sparklineOptions.type !== 'line' && (React.createElement(FormRow, { label: "Fill" },
|
|
146
|
+
React.createElement(ColorPicker, { title: "The colour for filling shapes", api: api, value: sparklineOptions.fill, onChange: (color) => handleChange('fill', color) }))),
|
|
147
|
+
React.createElement(FormRow, { label: "Stroke" },
|
|
148
|
+
React.createElement(Flex, { alignItems: "center" },
|
|
149
|
+
React.createElement(ColorPicker, { title: "The colour for the stroke", api: api, value: sparklineOptions.stroke, onChange: (color) => handleChange('stroke', color) }),
|
|
150
|
+
React.createElement(Box, { ml: 2, mr: 1 }, "Width"),
|
|
151
|
+
React.createElement(AdaptableInput, { title: "The width of the stroke in pixels", type: "number", style: { width: '70px' }, min: 0, value: sparklineOptions.strokeWidth ?? '', onChange: (e) => handleChange('strokeWidth', Number(e.target.value)) }))),
|
|
152
|
+
React.createElement(FormRow, { label: "Padding" },
|
|
153
|
+
React.createElement(Flex, { alignItems: "center" },
|
|
154
|
+
React.createElement(Box, { mr: 1 }, "Top"),
|
|
155
|
+
React.createElement(AdaptableInput, { type: "number", min: 0, value: sparklineOptions.padding?.top ?? '', onChange: (e) => handlePaddingChange('top', Number(e.target.value)), style: { width: '70px' }, title: "The number of pixels of padding at the top of the chart area" }),
|
|
156
|
+
React.createElement(Box, { ml: 2, mr: 1 }, "Right"),
|
|
157
|
+
React.createElement(AdaptableInput, { type: "number", min: 0, value: sparklineOptions.padding?.right ?? '', onChange: (e) => handlePaddingChange('right', Number(e.target.value)), style: { width: '70px' }, title: "The number of pixels of padding at the right of the chart area" }),
|
|
158
|
+
React.createElement(Box, { ml: 2, mr: 1 }, "Bottom"),
|
|
159
|
+
React.createElement(AdaptableInput, { type: "number", min: 0, value: sparklineOptions.padding?.bottom ?? '', onChange: (e) => handlePaddingChange('bottom', Number(e.target.value)), style: { width: '70px' }, title: "The number of pixels of padding at the bottom of the chart area" }),
|
|
160
|
+
React.createElement(Box, { ml: 2, mr: 1 }, "Left"),
|
|
161
|
+
React.createElement(AdaptableInput, { type: "number", min: 0, value: sparklineOptions.padding?.left ?? '', onChange: (e) => handlePaddingChange('left', Number(e.target.value)), style: { width: '70px' }, title: "The number of pixels of padding at the left of the chart area" }))),
|
|
162
|
+
React.createElement(FormRow, { label: "Line Dash" },
|
|
163
|
+
React.createElement(AdaptableInput, { title: "Length of dashes and gaps in pixels (comma-separated values, e.g. '3,6,9')", value: sparklineOptions.lineDash?.join(',') ?? '', onChange: (e) => {
|
|
164
|
+
const value = e.target.value;
|
|
165
|
+
const dashArray = value
|
|
166
|
+
? value
|
|
167
|
+
.split(',')
|
|
168
|
+
.map(Number)
|
|
169
|
+
.filter((n) => !isNaN(n))
|
|
170
|
+
: [];
|
|
171
|
+
handleChange('lineDash', dashArray);
|
|
172
|
+
} })),
|
|
173
|
+
React.createElement(FormRow, { label: "Line Dash Offset" },
|
|
174
|
+
React.createElement(AdaptableInput, { title: "The offset of the line dash pattern in pixels", type: "number", min: 0, value: sparklineOptions.lineDashOffset ?? '', onChange: (e) => handleChange('lineDashOffset', Number(e.target.value)) })),
|
|
175
|
+
React.createElement(FormRow, { label: "Background" },
|
|
176
|
+
React.createElement(Flex, { alignItems: "center" },
|
|
177
|
+
React.createElement(CheckBox, { checked: sparklineOptions.background?.visible ?? false, onChange: (visible) => handleChange('background', {
|
|
178
|
+
...sparklineOptions.background,
|
|
179
|
+
visible,
|
|
180
|
+
}) }),
|
|
181
|
+
React.createElement(Box, { ml: 2 },
|
|
182
|
+
React.createElement(ColorPicker, { disabled: !sparklineOptions.background?.visible, title: "The colour of the chart background", api: api, value: sparklineOptions.background?.fill, onChange: (fill) => handleChange('background', {
|
|
183
|
+
...sparklineOptions.background,
|
|
184
|
+
fill,
|
|
185
|
+
}) })))),
|
|
186
|
+
typeof sparklineOptions.theme !== 'object' && (React.createElement(FormRow, { label: "Theme" },
|
|
187
|
+
React.createElement(Box, { maxWidth: 160 },
|
|
188
|
+
React.createElement(Select, { value: sparklineOptions.theme ?? 'ag-default', onChange: (themeName) => handleChange('theme', themeName), options: themes }))))));
|
|
189
|
+
};
|
|
190
|
+
const SparklineAxisOptions = ({ options, onChange, }) => {
|
|
191
|
+
const { api } = useOnePageAdaptableWizardContext();
|
|
192
|
+
const sparklineOptions = options ?? {};
|
|
193
|
+
if (!sparklineOptions.axis?.type) {
|
|
194
|
+
sparklineOptions.axis = sparklineOptions.axis ?? { type: 'category' };
|
|
195
|
+
sparklineOptions.axis.type = 'category';
|
|
196
|
+
}
|
|
197
|
+
const handleChange = (value) => {
|
|
198
|
+
onChange({
|
|
199
|
+
...options,
|
|
200
|
+
axis: {
|
|
201
|
+
...options.axis,
|
|
202
|
+
...value,
|
|
177
203
|
},
|
|
178
204
|
});
|
|
179
|
-
}
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
205
|
+
};
|
|
206
|
+
const axisTypes = [
|
|
207
|
+
{ value: 'category', label: 'Category' },
|
|
208
|
+
{ value: 'number', label: 'Number' },
|
|
209
|
+
{ value: 'time', label: 'Time' },
|
|
210
|
+
];
|
|
211
|
+
const isAxisEnabled = sparklineOptions.axis?.visible ?? false;
|
|
212
|
+
return (React.createElement(FormLayout, null,
|
|
213
|
+
React.createElement(FormRow, { label: "Show Axis" },
|
|
214
|
+
React.createElement(CheckBox, { checked: isAxisEnabled, onChange: (visible) => handleChange({ visible }) })),
|
|
215
|
+
React.createElement(FormRow, { label: "Axis Type" },
|
|
216
|
+
React.createElement(Box, { maxWidth: 160 },
|
|
217
|
+
React.createElement(Select, { disabled: !isAxisEnabled, value: sparklineOptions.axis.type, onChange: (type) => handleChange({ type }), options: axisTypes }))),
|
|
218
|
+
React.createElement(FormRow, { label: "Stroke" },
|
|
219
|
+
React.createElement(Flex, { alignItems: "center" },
|
|
220
|
+
React.createElement(ColorPicker, { disabled: !isAxisEnabled, title: "The colour of the axis line", api: api, value: sparklineOptions.axis?.stroke, onChange: (stroke) => handleChange({ stroke }) }),
|
|
221
|
+
React.createElement(Box, { ml: 2, mr: 1 }, "Width"),
|
|
222
|
+
React.createElement(AdaptableInput, { disabled: !isAxisEnabled, style: { width: '70px' }, title: "The width in pixels of the axis line", type: "number", min: 0, value: sparklineOptions.axis?.strokeWidth ?? '', onChange: (e) => handleChange({ strokeWidth: Number(e.target.value) }) }))),
|
|
223
|
+
React.createElement(FormRow, { label: "Reverse Scale" },
|
|
224
|
+
React.createElement(CheckBox, { disabled: !isAxisEnabled, checked: sparklineOptions.axis?.reverse, onChange: (reverse) => handleChange({ reverse }) })),
|
|
225
|
+
sparklineOptions.axis.type === 'category' && (React.createElement(React.Fragment, null,
|
|
226
|
+
React.createElement(FormRow, { label: "Padding" },
|
|
227
|
+
React.createElement(Flex, { alignItems: "center" },
|
|
228
|
+
React.createElement(Box, { mr: 1 }, "Inner"),
|
|
229
|
+
React.createElement(AdaptableInput, { disabled: !isAxisEnabled, title: "The size of the gap between categories (0-1)", type: "number", min: 0, max: 1, step: 0.1, value: sparklineOptions.axis?.paddingInner ?? '', onChange: (e) => handleChange({ paddingInner: Number(e.target.value) }) }),
|
|
230
|
+
React.createElement(Box, { ml: 2, mr: 1 }, "Outer"),
|
|
231
|
+
React.createElement(AdaptableInput, { disabled: !isAxisEnabled, title: "The padding on the outside of first and last categories (0-1)", type: "number", min: 0, max: 1, step: 0.1, value: sparklineOptions.axis?.paddingOuter ?? '', onChange: (e) => handleChange({ paddingOuter: Number(e.target.value) }) })))))));
|
|
232
|
+
};
|
|
233
|
+
const SparklineTooltipOptions = ({ options, onChange, }) => {
|
|
234
|
+
const sparklineOptions = options;
|
|
235
|
+
const handleChange = (key, value) => {
|
|
236
|
+
onChange({ ...options, [key]: value });
|
|
237
|
+
};
|
|
238
|
+
const isTooltipEnabled = sparklineOptions.tooltip?.enabled;
|
|
239
|
+
const positionTypes = [
|
|
240
|
+
{ value: 'pointer', label: 'Pointer' },
|
|
241
|
+
{ value: 'node', label: 'Node' },
|
|
242
|
+
{ value: 'top', label: 'Top' },
|
|
243
|
+
{ value: 'right', label: 'Right' },
|
|
244
|
+
{ value: 'bottom', label: 'Bottom' },
|
|
245
|
+
{ value: 'left', label: 'Left' },
|
|
246
|
+
{ value: 'top-left', label: 'Top Left' },
|
|
247
|
+
{ value: 'top-right', label: 'Top Right' },
|
|
248
|
+
{ value: 'bottom-right', label: 'Bottom Right' },
|
|
249
|
+
{ value: 'bottom-left', label: 'Bottom Left' },
|
|
250
|
+
];
|
|
251
|
+
const interactionRanges = [
|
|
252
|
+
{ value: 'exact', label: 'Exact' },
|
|
253
|
+
{ value: 'nearest', label: 'Nearest' },
|
|
254
|
+
];
|
|
255
|
+
return (React.createElement(FormLayout, null,
|
|
256
|
+
React.createElement(FormRow, { label: "Enabled" },
|
|
257
|
+
React.createElement(CheckBox, { checked: sparklineOptions.tooltip?.enabled, onChange: (enabled) => handleChange('tooltip', { ...sparklineOptions.tooltip, enabled }) })),
|
|
258
|
+
React.createElement(FormRow, { label: "Show Arrow" },
|
|
259
|
+
React.createElement(CheckBox, { disabled: !isTooltipEnabled, checked: sparklineOptions.tooltip?.showArrow, onChange: (showArrow) => handleChange('tooltip', { ...sparklineOptions.tooltip, showArrow }) })),
|
|
260
|
+
React.createElement(FormRow, { label: "Interaction Enabled" },
|
|
261
|
+
React.createElement(CheckBox, { disabled: !isTooltipEnabled, checked: sparklineOptions.tooltip?.interaction?.enabled, onChange: (enabled) => handleChange('tooltip', {
|
|
262
|
+
...sparklineOptions.tooltip,
|
|
263
|
+
interaction: { enabled },
|
|
264
|
+
}) })),
|
|
265
|
+
React.createElement(FormRow, { label: "Range" },
|
|
266
|
+
React.createElement(Box, { maxWidth: 160 },
|
|
267
|
+
React.createElement(Select, { disabled: !isTooltipEnabled, value: sparklineOptions.tooltip?.range ?? 'nearest', onChange: (range) => handleChange('tooltip', { ...sparklineOptions.tooltip, range }), options: interactionRanges }))),
|
|
268
|
+
React.createElement(FormRow, { label: "Position Type" },
|
|
269
|
+
React.createElement(Box, { maxWidth: 160 },
|
|
270
|
+
React.createElement(Select, { disabled: !isTooltipEnabled, value: sparklineOptions.tooltip?.position?.type ?? 'pointer', onChange: (type) => handleChange('tooltip', {
|
|
271
|
+
...sparklineOptions.tooltip,
|
|
272
|
+
position: { ...sparklineOptions.tooltip?.position, type },
|
|
273
|
+
}), options: positionTypes }))),
|
|
274
|
+
React.createElement(FormRow, { label: "Position Offset X" },
|
|
275
|
+
React.createElement(AdaptableInput, { disabled: !isTooltipEnabled, title: "The horizontal offset in pixels for the position of the tooltip.", type: "number", value: sparklineOptions.tooltip?.position?.xOffset ?? '', onChange: (e) => handleChange('tooltip', {
|
|
276
|
+
...sparklineOptions.tooltip,
|
|
277
|
+
position: { ...sparklineOptions.tooltip?.position, xOffset: Number(e.target.value) },
|
|
278
|
+
}) })),
|
|
279
|
+
React.createElement(FormRow, { label: "Position Offset Y" },
|
|
280
|
+
React.createElement(AdaptableInput, { disabled: !isTooltipEnabled, title: "The vertical offset in pixels for the position of the tooltip.", type: "number", value: sparklineOptions.tooltip?.position?.yOffset ?? '', onChange: (e) => handleChange('tooltip', {
|
|
281
|
+
...sparklineOptions.tooltip,
|
|
282
|
+
position: { ...sparklineOptions.tooltip?.position, yOffset: Number(e.target.value) },
|
|
283
|
+
}) }))));
|
|
284
|
+
};
|
|
285
|
+
const SparklineMarkerOptions = ({ options, onChange }) => {
|
|
286
|
+
const { api } = useOnePageAdaptableWizardContext();
|
|
287
|
+
const sparklineOptions = options;
|
|
288
|
+
const handleChange = (value) => {
|
|
289
|
+
onChange({
|
|
290
|
+
...options,
|
|
291
|
+
marker: {
|
|
292
|
+
...options.marker,
|
|
293
|
+
...value,
|
|
294
|
+
},
|
|
295
|
+
});
|
|
296
|
+
};
|
|
297
|
+
const markerShapes = [
|
|
298
|
+
{ value: 'circle', label: 'Circle' },
|
|
299
|
+
{ value: 'cross', label: 'Cross' },
|
|
300
|
+
{ value: 'diamond', label: 'Diamond' },
|
|
301
|
+
{ value: 'heart', label: 'Heart' },
|
|
302
|
+
{ value: 'plus', label: 'Plus' },
|
|
303
|
+
{ value: 'pin', label: 'Pin' },
|
|
304
|
+
{ value: 'square', label: 'Square' },
|
|
305
|
+
{ value: 'star', label: 'Star' },
|
|
306
|
+
{ value: 'triangle', label: 'Triangle' },
|
|
307
|
+
];
|
|
308
|
+
const isMarkerEnabled = sparklineOptions.marker?.enabled ?? false;
|
|
309
|
+
return (React.createElement(FormLayout, null,
|
|
310
|
+
React.createElement(FormRow, { label: "Show Markers" },
|
|
311
|
+
React.createElement(CheckBox, { checked: isMarkerEnabled, onChange: (enabled) => handleChange({ enabled }) })),
|
|
312
|
+
React.createElement(FormRow, { label: "Marker Size" },
|
|
313
|
+
React.createElement(AdaptableInput, { disabled: !isMarkerEnabled, type: "number", min: 1, value: sparklineOptions.marker?.size ?? '', onChange: (e) => handleChange({ size: Number(e.target.value) }), title: "The size in pixels of the markers" })),
|
|
314
|
+
React.createElement(FormRow, { label: "Marker Shape" },
|
|
315
|
+
React.createElement(Box, { maxWidth: 160 },
|
|
316
|
+
React.createElement(Select, { disabled: !isMarkerEnabled, value: sparklineOptions.marker?.shape, onChange: (shape) => handleChange({ shape: shape }), options: markerShapes }))),
|
|
317
|
+
React.createElement(FormRow, { label: "Fill" },
|
|
318
|
+
React.createElement(ColorPicker, { disabled: !isMarkerEnabled, title: "The colour for filling markers", api: api, value: sparklineOptions.marker?.fill, onChange: (fill) => handleChange({ fill }) })),
|
|
319
|
+
React.createElement(FormRow, { label: "Stroke" },
|
|
320
|
+
React.createElement(Flex, { alignItems: "center" },
|
|
321
|
+
React.createElement(ColorPicker, { disabled: !isMarkerEnabled, title: "The colour for the marker stroke", api: api, value: sparklineOptions.marker?.stroke, onChange: (stroke) => handleChange({ stroke }) }),
|
|
322
|
+
React.createElement(Box, { ml: 2, mr: 1 }, "Width"),
|
|
323
|
+
React.createElement(AdaptableInput, { disabled: !isMarkerEnabled, style: { width: '70px' }, type: "number", min: 0, value: sparklineOptions.marker?.strokeWidth ?? '', onChange: (e) => handleChange({ strokeWidth: Number(e.target.value) }), title: "The width of the marker stroke in pixels" })))));
|
|
324
|
+
};
|
|
325
|
+
const SparklineHighlightOptions = ({ options, onChange, }) => {
|
|
326
|
+
const { api } = useOnePageAdaptableWizardContext();
|
|
327
|
+
const sparklineOptions = options;
|
|
328
|
+
const handleItemChange = (value) => {
|
|
329
|
+
onChange({
|
|
330
|
+
...options,
|
|
331
|
+
highlightStyle: {
|
|
332
|
+
...options.highlightStyle,
|
|
333
|
+
item: {
|
|
334
|
+
...options.highlightStyle?.item,
|
|
335
|
+
...value,
|
|
336
|
+
},
|
|
337
|
+
},
|
|
338
|
+
});
|
|
339
|
+
};
|
|
340
|
+
const handleSeriesChange = (value) => {
|
|
341
|
+
onChange({
|
|
342
|
+
...options,
|
|
343
|
+
highlightStyle: {
|
|
344
|
+
...options.highlightStyle,
|
|
345
|
+
series: {
|
|
346
|
+
...options.highlightStyle?.series,
|
|
347
|
+
...value,
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
});
|
|
351
|
+
};
|
|
352
|
+
return (React.createElement(FormLayout, null,
|
|
353
|
+
React.createElement(FormRow, { label: "Item Fill" },
|
|
354
|
+
React.createElement(ColorPicker, { title: "The colour for filling highlighted items", api: api, value: sparklineOptions.highlightStyle?.item?.fill, onChange: (fill) => handleItemChange({ fill }) })),
|
|
355
|
+
React.createElement(FormRow, { label: "Item Stroke" },
|
|
356
|
+
React.createElement(Flex, { alignItems: "center" },
|
|
357
|
+
React.createElement(ColorPicker, { title: "The colour for the highlighted item stroke", api: api, value: sparklineOptions.highlightStyle?.item?.stroke, onChange: (stroke) => handleItemChange({ stroke }) }),
|
|
358
|
+
React.createElement(Box, { ml: 2, mr: 1 }, "Width"),
|
|
359
|
+
React.createElement(AdaptableInput, { style: { width: '70px' }, type: "number", min: 0, value: sparklineOptions.highlightStyle?.item?.strokeWidth ?? '', onChange: (e) => handleItemChange({ strokeWidth: Number(e.target.value) }), title: "The width of the highlighted item stroke in pixels" }))),
|
|
360
|
+
React.createElement(FormRow, { label: "Series" },
|
|
361
|
+
React.createElement(Flex, { alignItems: "center" },
|
|
362
|
+
React.createElement(CheckBox, { checked: sparklineOptions.highlightStyle?.series?.enabled ?? false, onChange: (enabled) => handleSeriesChange({ enabled }) }),
|
|
363
|
+
React.createElement(Box, { ml: 2, mr: 1 }, "Opacity"),
|
|
364
|
+
React.createElement(AdaptableInput, { disabled: !sparklineOptions.highlightStyle?.series?.enabled, style: { width: '70px' }, type: "number", min: 0, max: 1, step: 0.1, value: sparklineOptions.highlightStyle?.series?.dimOpacity ?? '', onChange: (e) => handleSeriesChange({ dimOpacity: Number(e.target.value) }), title: "The opacity of the whole series when another series is highlighted" }),
|
|
365
|
+
React.createElement(Box, { ml: 2, mr: 1 }, "Stroke Width"),
|
|
366
|
+
React.createElement(AdaptableInput, { disabled: !sparklineOptions.highlightStyle?.series?.enabled, style: { width: '70px' }, type: "number", min: 0, value: sparklineOptions.highlightStyle?.series?.strokeWidth ?? '', onChange: (e) => handleSeriesChange({ strokeWidth: Number(e.target.value) }), title: "The stroke width when markers are hovered or tooltip is shown" })))));
|
|
367
|
+
};
|
|
368
|
+
const test = {
|
|
369
|
+
type: 'line',
|
|
370
|
+
xName: 'test',
|
|
214
371
|
};
|
|
@@ -32,7 +32,7 @@ export const StyledColumnWizard = (props) => {
|
|
|
32
32
|
delete newData.GradientStyle;
|
|
33
33
|
}
|
|
34
34
|
else if (props.popupParams.column.dataType.includes('Array')) {
|
|
35
|
-
newData.
|
|
35
|
+
newData.SparklineStyle = {};
|
|
36
36
|
delete newData.GradientStyle;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -58,7 +58,7 @@ export const StyledColumnWizard = (props) => {
|
|
|
58
58
|
title: 'Settings',
|
|
59
59
|
};
|
|
60
60
|
const specificSteps = [];
|
|
61
|
-
if (styledColumn.
|
|
61
|
+
if (styledColumn.SparklineStyle) {
|
|
62
62
|
specificSteps.push({
|
|
63
63
|
title: 'Settings',
|
|
64
64
|
render: () => (React.createElement(Box, { p: 2 },
|
|
@@ -23,7 +23,7 @@ export const StyledColumnWizardColumnSection = (props) => {
|
|
|
23
23
|
const { data, api } = useOnePageAdaptableWizardContext();
|
|
24
24
|
const sortableCols = React.useMemo(() => {
|
|
25
25
|
let sortableColumns = [];
|
|
26
|
-
if (data.
|
|
26
|
+
if (data.SparklineStyle) {
|
|
27
27
|
sortableColumns = api.columnApi.getNumericArrayColumns();
|
|
28
28
|
}
|
|
29
29
|
else if (data.BadgeStyle) {
|