@adaptabletools/adaptable 13.1.0 → 13.1.1-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle.cjs.js +161 -161
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableOptions/AlertOptions.d.ts +4 -0
- package/src/AdaptableOptions/FinancePluginOptions.d.ts +9 -0
- package/src/Api/AlertApi.d.ts +5 -0
- package/src/Api/ColumnApi.d.ts +14 -0
- package/src/Api/FinanceApi.d.ts +5 -0
- package/src/Api/GridApi.d.ts +1 -0
- package/src/Api/Implementation/AlertApiImpl.d.ts +1 -0
- package/src/Api/Implementation/AlertApiImpl.js +14 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +3 -0
- package/src/Api/Implementation/ColumnApiImpl.js +11 -0
- package/src/Api/Implementation/GridApiImpl.d.ts +1 -0
- package/src/Api/Implementation/GridApiImpl.js +3 -0
- package/src/Api/Implementation/InternalApiImpl.d.ts +2 -0
- package/src/Api/Implementation/InternalApiImpl.js +59 -0
- package/src/Api/InternalApi.d.ts +2 -0
- package/src/PredefinedConfig/AlertState.d.ts +4 -0
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +1 -1
- package/src/PredefinedConfig/Common/FDC3Context.d.ts +2 -2
- package/src/PredefinedConfig/Common/Types.d.ts +1 -1
- package/src/PredefinedConfig/StyledColumnState.d.ts +5 -0
- package/src/Strategy/AlertModule.js +1 -1
- package/src/Strategy/FlashingCellModule.js +1 -1
- package/src/Strategy/StyledColumnModule.js +5 -2
- package/src/Utilities/Extensions/ObjectExtensions.d.ts +10 -0
- package/src/Utilities/Extensions/ObjectExtensions.js +20 -0
- package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +16 -8
- package/src/View/Components/FilterForm/ListBoxFilterForm.d.ts +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.d.ts +6 -0
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +285 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +28 -17
- package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.js +7 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.js +16 -7
- package/src/agGrid/Adaptable.js +15 -1
- package/src/agGrid/agGridHelper.js +12 -0
- package/src/components/ExpressionEditor/index.js +3 -41
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StyledColumnSparklineSettingsSection = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const rebass_1 = require("rebass");
|
|
7
|
+
const CheckBox_1 = require("../../../components/CheckBox");
|
|
8
|
+
const ColorPicker_1 = require("../../../components/ColorPicker");
|
|
9
|
+
const DropdownButton_1 = tslib_1.__importDefault(require("../../../components/DropdownButton"));
|
|
10
|
+
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
11
|
+
const Input_1 = tslib_1.__importDefault(require("../../../components/Input"));
|
|
12
|
+
const Tabs_1 = require("../../../components/Tabs");
|
|
13
|
+
const Tag_1 = require("../../../components/Tag");
|
|
14
|
+
const ObjectExtensions_1 = require("../../../Utilities/Extensions/ObjectExtensions");
|
|
15
|
+
const StringExtensions_1 = require("../../../Utilities/Extensions/StringExtensions");
|
|
16
|
+
const LoggingHelper_1 = require("../../../Utilities/Helpers/LoggingHelper");
|
|
17
|
+
const AdaptableInput_1 = tslib_1.__importDefault(require("../../Components/AdaptableInput"));
|
|
18
|
+
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
19
|
+
const CommonProperties = (props) => {
|
|
20
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
|
|
21
|
+
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
22
|
+
const axisTypeOptions = React.useMemo(() => {
|
|
23
|
+
return [
|
|
24
|
+
{
|
|
25
|
+
label: 'Number',
|
|
26
|
+
value: 'number',
|
|
27
|
+
onClick: () => props.onOptionChange(['axis', 'type'], 'number'),
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
label: 'Category',
|
|
31
|
+
value: 'category',
|
|
32
|
+
onClick: () => props.onOptionChange(['axis', 'type'], 'category'),
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: 'Time',
|
|
36
|
+
value: 'time',
|
|
37
|
+
onClick: () => props.onOptionChange(['axis', 'type'], 'time'),
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
}, [data]);
|
|
41
|
+
return (React.createElement(Tabs_1.Tabs, { mb: 2 },
|
|
42
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Padding"),
|
|
43
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Axis"),
|
|
44
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Highlight Style"),
|
|
45
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
46
|
+
React.createElement(FormLayout_1.default, null,
|
|
47
|
+
React.createElement(FormLayout_1.FormRow, { label: "Top" },
|
|
48
|
+
React.createElement(Input_1.default, { onChange: (event) => { var _a; return props.onOptionChange(['padding', 'top'], (_a = event.target.value) !== null && _a !== void 0 ? _a : 0); }, type: "number", value: (_b = (_a = data.SparkLineStyle.options) === null || _a === void 0 ? void 0 : _a.padding) === null || _b === void 0 ? void 0 : _b.top })),
|
|
49
|
+
React.createElement(FormLayout_1.FormRow, { label: "Bottom" },
|
|
50
|
+
React.createElement(Input_1.default, { onChange: (event) => { var _a; return props.onOptionChange(['padding', 'bottom'], (_a = event.target.value) !== null && _a !== void 0 ? _a : 0); }, type: "number", value: (_d = (_c = data.SparkLineStyle.options) === null || _c === void 0 ? void 0 : _c.padding) === null || _d === void 0 ? void 0 : _d.bottom })),
|
|
51
|
+
React.createElement(FormLayout_1.FormRow, { label: "Left" },
|
|
52
|
+
React.createElement(Input_1.default, { onChange: (event) => { var _a; return props.onOptionChange(['padding', 'left'], (_a = event.target.value) !== null && _a !== void 0 ? _a : 0); }, type: "number", value: (_f = (_e = data.SparkLineStyle.options) === null || _e === void 0 ? void 0 : _e.padding) === null || _f === void 0 ? void 0 : _f.left })),
|
|
53
|
+
React.createElement(FormLayout_1.FormRow, { label: "Right" },
|
|
54
|
+
React.createElement(Input_1.default, { onChange: (event) => { var _a; return props.onOptionChange(['padding', 'right'], (_a = event.target.value) !== null && _a !== void 0 ? _a : 0); }, type: "number", value: (_h = (_g = data.SparkLineStyle.options) === null || _g === void 0 ? void 0 : _g.padding) === null || _h === void 0 ? void 0 : _h.right })))),
|
|
55
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
56
|
+
React.createElement(FormLayout_1.default, null,
|
|
57
|
+
React.createElement(FormLayout_1.FormRow, { label: "Axis Type" },
|
|
58
|
+
React.createElement(DropdownButton_1.default, { columns: ['label'], items: axisTypeOptions }, (_k = (_j = axisTypeOptions.find((option) => { var _a, _b, _c; return option.value === ((_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.SparkLineStyle) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.axis) === null || _c === void 0 ? void 0 : _c.type); })) === null || _j === void 0 ? void 0 : _j.label) !== null && _k !== void 0 ? _k : 'Select Type')),
|
|
59
|
+
React.createElement(FormLayout_1.FormRow, { label: "Stroke Color" },
|
|
60
|
+
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_p = (_o = (_m = (_l = data.SparkLineStyle) === null || _l === void 0 ? void 0 : _l.options) === null || _m === void 0 ? void 0 : _m.axis) === null || _o === void 0 ? void 0 : _o.stroke) !== null && _p !== void 0 ? _p : '#fff', onChange: (color) => props.onOptionChange(['axis', 'stroke'], color) })),
|
|
61
|
+
React.createElement(FormLayout_1.FormRow, { label: "Stroke Width" },
|
|
62
|
+
React.createElement(AdaptableInput_1.default, { type: "number", value: (_t = (_s = (_r = (_q = data.SparkLineStyle) === null || _q === void 0 ? void 0 : _q.options) === null || _r === void 0 ? void 0 : _r.axis) === null || _s === void 0 ? void 0 : _s.strokeWidth) !== null && _t !== void 0 ? _t : 0, onChange: (event) => props.onOptionChange(['axis', 'strokeWidth'], parseFloat(event.target.value)) })))),
|
|
63
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
64
|
+
React.createElement(FormLayout_1.default, null,
|
|
65
|
+
React.createElement(FormLayout_1.FormRow, { label: "Size" },
|
|
66
|
+
React.createElement(AdaptableInput_1.default, { type: "number", value: (_w = (_v = (_u = data.SparkLineStyle) === null || _u === void 0 ? void 0 : _u.options) === null || _v === void 0 ? void 0 : _v.highlightStyle) === null || _w === void 0 ? void 0 : _w.size, onChange: (event) => props.onOptionChange(['highlightStyle', 'size'], parseFloat(event.target.value)) })),
|
|
67
|
+
React.createElement(FormLayout_1.FormRow, { label: "Fill" },
|
|
68
|
+
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_0 = (_z = (_y = (_x = data.SparkLineStyle) === null || _x === void 0 ? void 0 : _x.options) === null || _y === void 0 ? void 0 : _y.highlightStyle) === null || _z === void 0 ? void 0 : _z.fill) !== null && _0 !== void 0 ? _0 : 'yellow', onChange: (color) => props.onOptionChange(['highlightStyle', 'fill'], color) })),
|
|
69
|
+
React.createElement(FormLayout_1.FormRow, { label: "Stroke" },
|
|
70
|
+
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_4 = (_3 = (_2 = (_1 = data.SparkLineStyle) === null || _1 === void 0 ? void 0 : _1.options) === null || _2 === void 0 ? void 0 : _2.highlightStyle) === null || _3 === void 0 ? void 0 : _3.stroke) !== null && _4 !== void 0 ? _4 : 'silver', onChange: (color) => props.onOptionChange(['highlightStyle', 'stroke'], color) })),
|
|
71
|
+
React.createElement(FormLayout_1.FormRow, { label: "Stroke Width" },
|
|
72
|
+
React.createElement(AdaptableInput_1.default, { type: "number", value: (_7 = (_6 = (_5 = data.SparkLineStyle) === null || _5 === void 0 ? void 0 : _5.options) === null || _6 === void 0 ? void 0 : _6.highlightStyle) === null || _7 === void 0 ? void 0 : _7.strokeWidth, onChange: (event) => props.onOptionChange(['highlightStyle', 'strokeWidth'], parseFloat(event.target.value)) }))))));
|
|
73
|
+
};
|
|
74
|
+
const SparklineMarkerProperties = (props) => {
|
|
75
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
76
|
+
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
77
|
+
const sparklineOptions = data.SparkLineStyle.options;
|
|
78
|
+
return (React.createElement(FormLayout_1.default, null,
|
|
79
|
+
React.createElement(FormLayout_1.FormRow, { label: "Enabled" },
|
|
80
|
+
React.createElement(CheckBox_1.CheckBox, { checked: (_b = (_a = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.marker) === null || _a === void 0 ? void 0 : _a.enabled) !== null && _b !== void 0 ? _b : true, onChange: (checked) => props.onOptionChange(['marker', 'enabled'], checked) })),
|
|
81
|
+
React.createElement(FormLayout_1.FormRow, { label: "Size" },
|
|
82
|
+
React.createElement(AdaptableInput_1.default, { type: "number", value: (_d = (_c = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.marker) === null || _c === void 0 ? void 0 : _c.size) !== null && _d !== void 0 ? _d : 0, onChange: (event) => props.onOptionChange(['marker', 'size'], parseFloat(event.target.value)) })),
|
|
83
|
+
React.createElement(FormLayout_1.FormRow, { label: "Fill" },
|
|
84
|
+
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_f = (_e = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.marker) === null || _e === void 0 ? void 0 : _e.fill) !== null && _f !== void 0 ? _f : 'rgb(124, 181, 236)', onChange: (color) => props.onOptionChange(['marker', 'fill'], color) })),
|
|
85
|
+
React.createElement(FormLayout_1.FormRow, { label: "Stroke" },
|
|
86
|
+
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_h = (_g = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.marker) === null || _g === void 0 ? void 0 : _g.stroke) !== null && _h !== void 0 ? _h : 'rgb(124, 181, 236)', onChange: (color) => props.onOptionChange(['marker', 'stroke'], color) })),
|
|
87
|
+
React.createElement(FormLayout_1.FormRow, { label: "Stroke Width" },
|
|
88
|
+
React.createElement(AdaptableInput_1.default, { type: "number", value: (_k = (_j = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.marker) === null || _j === void 0 ? void 0 : _j.strokeWidth) !== null && _k !== void 0 ? _k : 1, onChange: (event) => props.onOptionChange(['marker', 'strokeWidth'], parseFloat(event.target.value)) }))));
|
|
89
|
+
};
|
|
90
|
+
const SparklineLineProperties = (props) => {
|
|
91
|
+
var _a, _b, _c;
|
|
92
|
+
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
93
|
+
const sparklineOptions = data.SparkLineStyle.options;
|
|
94
|
+
return (React.createElement(FormLayout_1.default, null,
|
|
95
|
+
React.createElement(FormLayout_1.FormRow, { label: "Stroke" },
|
|
96
|
+
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_b = (_a = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.line) === null || _a === void 0 ? void 0 : _a.stroke) !== null && _b !== void 0 ? _b : 'rgb(124, 181, 236)', onChange: (color) => props.onOptionChange(['line', 'stroke'], color) })),
|
|
97
|
+
React.createElement(FormLayout_1.FormRow, { label: "Stroke Width" },
|
|
98
|
+
React.createElement(AdaptableInput_1.default, { type: "number", value: (_c = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.line) === null || _c === void 0 ? void 0 : _c.strokeWidth, onChange: (event) => props.onOptionChange(['line', 'strokeWidth'], parseFloat(event.target.value)) }))));
|
|
99
|
+
};
|
|
100
|
+
const CrossHairsProperties = (props) => {
|
|
101
|
+
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
102
|
+
const sparklineOptions = data.SparkLineStyle.options;
|
|
103
|
+
const lineDashes = [
|
|
104
|
+
'dash',
|
|
105
|
+
'dashDot',
|
|
106
|
+
'dashDotDot',
|
|
107
|
+
'dot',
|
|
108
|
+
'longDash',
|
|
109
|
+
'longDashDot',
|
|
110
|
+
'longDashDotDot',
|
|
111
|
+
'shortDash',
|
|
112
|
+
'shortDashDot',
|
|
113
|
+
'shortDashDotDot',
|
|
114
|
+
'shortDot',
|
|
115
|
+
'solid',
|
|
116
|
+
];
|
|
117
|
+
const lineCapOptions = [
|
|
118
|
+
'butt',
|
|
119
|
+
'round',
|
|
120
|
+
'square',
|
|
121
|
+
];
|
|
122
|
+
const buildLineDashProperties = (key) => {
|
|
123
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
124
|
+
const lineDashOptions = lineDashes.map((item) => ({
|
|
125
|
+
label: (0, StringExtensions_1.Humanize)(item),
|
|
126
|
+
value: item,
|
|
127
|
+
onClick: () => props.onOptionChange(['crosshairs', key, 'lineDash'], item),
|
|
128
|
+
}));
|
|
129
|
+
const lineCapOptionsItems = lineCapOptions.map((item) => ({
|
|
130
|
+
label: (0, StringExtensions_1.Humanize)(item),
|
|
131
|
+
value: item,
|
|
132
|
+
onClick: () => props.onOptionChange(['crosshairs', key, 'lineCap'], item),
|
|
133
|
+
}));
|
|
134
|
+
return (React.createElement(FormLayout_1.default, null,
|
|
135
|
+
React.createElement(FormLayout_1.FormRow, { label: "Show" },
|
|
136
|
+
React.createElement(CheckBox_1.CheckBox, { checked: (_c = (_b = (_a = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.crosshairs) === null || _a === void 0 ? void 0 : _a[key]) === null || _b === void 0 ? void 0 : _b.enabled) !== null && _c !== void 0 ? _c : true, onChange: (checked) => props.onOptionChange(['crosshairs', key, 'enabled'], checked) })),
|
|
137
|
+
React.createElement(FormLayout_1.FormRow, { label: "Stroke" },
|
|
138
|
+
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_f = (_e = (_d = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.crosshairs) === null || _d === void 0 ? void 0 : _d[key]) === null || _e === void 0 ? void 0 : _e.stroke) !== null && _f !== void 0 ? _f : 'rgba(0,0,0, 0.54)', onChange: (color) => props.onOptionChange(['crosshairs', key, 'stroke'], color) })),
|
|
139
|
+
React.createElement(FormLayout_1.FormRow, { label: "Stroke Width" },
|
|
140
|
+
React.createElement(AdaptableInput_1.default, { type: "number", value: (_j = (_h = (_g = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.crosshairs) === null || _g === void 0 ? void 0 : _g[key]) === null || _h === void 0 ? void 0 : _h.strokeWidth) !== null && _j !== void 0 ? _j : 1, onChange: (event) => props.onOptionChange(['crosshairs', key, 'strokeWidth'], event.target.value) })),
|
|
141
|
+
React.createElement(FormLayout_1.FormRow, { label: "Line Dash" },
|
|
142
|
+
React.createElement(DropdownButton_1.default, { columns: ['label'], items: lineDashOptions }, (_l = (_k = lineDashOptions.find((option) => { var _a, _b; return option.value === ((_b = (_a = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.crosshairs) === null || _a === void 0 ? void 0 : _a[key]) === null || _b === void 0 ? void 0 : _b.lineDash); })) === null || _k === void 0 ? void 0 : _k.label) !== null && _l !== void 0 ? _l : 'Solid')),
|
|
143
|
+
React.createElement(FormLayout_1.FormRow, { label: "Line Cap" },
|
|
144
|
+
React.createElement(DropdownButton_1.default, { columns: ['label'], items: lineCapOptionsItems }, (_o = (_m = lineCapOptionsItems.find((option) => { var _a, _b; return option.value === ((_b = (_a = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.crosshairs) === null || _a === void 0 ? void 0 : _a[key]) === null || _b === void 0 ? void 0 : _b.lineCap); })) === null || _m === void 0 ? void 0 : _m.label) !== null && _o !== void 0 ? _o : 'Butt'))));
|
|
145
|
+
};
|
|
146
|
+
return (React.createElement(rebass_1.Flex, null,
|
|
147
|
+
React.createElement(rebass_1.Box, { mr: 3 },
|
|
148
|
+
React.createElement(rebass_1.Box, null, "X Line"),
|
|
149
|
+
buildLineDashProperties('xLine')),
|
|
150
|
+
React.createElement(rebass_1.Box, null,
|
|
151
|
+
React.createElement(rebass_1.Box, null, "Y Line"),
|
|
152
|
+
buildLineDashProperties('yLine'))));
|
|
153
|
+
};
|
|
154
|
+
const TypeAreaProperties = (props) => {
|
|
155
|
+
var _a;
|
|
156
|
+
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
157
|
+
const sparklineOptions = data.SparkLineStyle.options;
|
|
158
|
+
return (React.createElement(Tabs_1.Tabs, { mb: 2 },
|
|
159
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Stroke"),
|
|
160
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Line"),
|
|
161
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Marker"),
|
|
162
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Cross Hairs"),
|
|
163
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
164
|
+
React.createElement(FormLayout_1.default, null,
|
|
165
|
+
React.createElement(FormLayout_1.FormRow, { label: "Stroke" },
|
|
166
|
+
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_a = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.fill) !== null && _a !== void 0 ? _a : 'rgba(124, 181, 236, 0.25)', onChange: (color) => props.onOptionChange(['fill'], color) })))),
|
|
167
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
168
|
+
React.createElement(SparklineLineProperties, { onOptionChange: props.onOptionChange })),
|
|
169
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
170
|
+
React.createElement(SparklineMarkerProperties, { onOptionChange: props.onOptionChange })),
|
|
171
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
172
|
+
React.createElement(CrossHairsProperties, { onOptionChange: props.onOptionChange }))));
|
|
173
|
+
};
|
|
174
|
+
const TypeLineProperties = (props) => {
|
|
175
|
+
return (React.createElement(Tabs_1.Tabs, { mb: 2 },
|
|
176
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Line"),
|
|
177
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Marker"),
|
|
178
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Cross Hairs"),
|
|
179
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
180
|
+
React.createElement(SparklineLineProperties, { onOptionChange: props.onOptionChange })),
|
|
181
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
182
|
+
React.createElement(SparklineMarkerProperties, { onOptionChange: props.onOptionChange })),
|
|
183
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
184
|
+
React.createElement(CrossHairsProperties, { onOptionChange: props.onOptionChange }))));
|
|
185
|
+
};
|
|
186
|
+
const TypeColumnBarProperties = (props) => {
|
|
187
|
+
var _a, _b, _c, _d, _e;
|
|
188
|
+
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
189
|
+
const sparklineOptions = data.SparkLineStyle.options;
|
|
190
|
+
return (React.createElement(Tabs_1.Tabs, { mb: 2 },
|
|
191
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "General"),
|
|
192
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
193
|
+
React.createElement(FormLayout_1.default, null,
|
|
194
|
+
React.createElement(FormLayout_1.FormRow, { label: "Fill" },
|
|
195
|
+
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_a = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.fill) !== null && _a !== void 0 ? _a : 'rgb(124, 181, 236)', onChange: (color) => props.onOptionChange(['fill'], color) })),
|
|
196
|
+
React.createElement(FormLayout_1.FormRow, { label: "Stroke" },
|
|
197
|
+
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_b = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.stroke) !== null && _b !== void 0 ? _b : 'silver', onChange: (color) => props.onOptionChange(['stroke'], color) })),
|
|
198
|
+
React.createElement(FormLayout_1.FormRow, { label: "Stroke Width" },
|
|
199
|
+
React.createElement(AdaptableInput_1.default, { type: "number", value: (_c = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.strokeWidth) !== null && _c !== void 0 ? _c : 1, onChange: (event) => props.onOptionChange(['strokeWidth'], event.target.value) })),
|
|
200
|
+
React.createElement(FormLayout_1.FormRow, { label: "Padding Inner" },
|
|
201
|
+
React.createElement(AdaptableInput_1.default, { type: "number", value: (_d = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.paddingInner) !== null && _d !== void 0 ? _d : 0.1, onChange: (event) => props.onOptionChange(['paddingInner'], event.target.value) })),
|
|
202
|
+
React.createElement(FormLayout_1.FormRow, { label: "Padding Outer" },
|
|
203
|
+
React.createElement(AdaptableInput_1.default, { type: "number", value: (_e = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.paddingOuter) !== null && _e !== void 0 ? _e : 0.2, onChange: (event) => props.onOptionChange(['paddingOuter'], event.target.value) }))))));
|
|
204
|
+
};
|
|
205
|
+
const SparklineObjectNumberArrayProperties = (props) => {
|
|
206
|
+
var _a, _b;
|
|
207
|
+
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
208
|
+
const sparkLineOptions = data.SparkLineStyle.options;
|
|
209
|
+
const [sparklineDataItem, setSparklineDataItem] = React.useState('');
|
|
210
|
+
React.useEffect(() => {
|
|
211
|
+
var _a, _b, _c;
|
|
212
|
+
try {
|
|
213
|
+
let cellData = null;
|
|
214
|
+
const MAX_ROWS_TO_CHECK = 20;
|
|
215
|
+
let currentRow = 0;
|
|
216
|
+
while (!cellData || currentRow < MAX_ROWS_TO_CHECK) {
|
|
217
|
+
const rowWithData = (_a = api.gridApi.getRowNodeForIndex(currentRow)) === null || _a === void 0 ? void 0 : _a.data;
|
|
218
|
+
const column = api.columnApi.getColumnFromId(data.ColumnId);
|
|
219
|
+
if ((_b = rowWithData === null || rowWithData === void 0 ? void 0 : rowWithData[column === null || column === void 0 ? void 0 : column.field]) === null || _b === void 0 ? void 0 : _b[0]) {
|
|
220
|
+
cellData = (_c = rowWithData === null || rowWithData === void 0 ? void 0 : rowWithData[column === null || column === void 0 ? void 0 : column.field]) === null || _c === void 0 ? void 0 : _c[0];
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
currentRow++;
|
|
224
|
+
}
|
|
225
|
+
if (cellData) {
|
|
226
|
+
const str = JSON.stringify(cellData, null, 2).replace(/[{}",]/g, '');
|
|
227
|
+
setSparklineDataItem(str);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
catch (e) {
|
|
231
|
+
(0, LoggingHelper_1.ConsoleLogError)('Error parsing sparkline data', e);
|
|
232
|
+
}
|
|
233
|
+
}, [data]);
|
|
234
|
+
return (React.createElement(React.Fragment, null,
|
|
235
|
+
React.createElement(FormLayout_1.FormRow, { label: "X Key" },
|
|
236
|
+
React.createElement(Input_1.default, { onChange: (event) => props.onOptionChange(['xKey'], event.target.value), value: (_a = sparkLineOptions.xKey) !== null && _a !== void 0 ? _a : 'x' })),
|
|
237
|
+
React.createElement(FormLayout_1.FormRow, { label: "Y Key" },
|
|
238
|
+
React.createElement(Input_1.default, { onChange: (event) => props.onOptionChange(['yKey'], event.target.value), value: (_b = sparkLineOptions.yKey) !== null && _b !== void 0 ? _b : 'y' })),
|
|
239
|
+
sparklineDataItem && (React.createElement(FormLayout_1.FormRow, { label: "Preview" },
|
|
240
|
+
React.createElement(Tag_1.Tag, null, sparklineDataItem)))));
|
|
241
|
+
};
|
|
242
|
+
const StyledColumnSparklineSettingsSection = (props) => {
|
|
243
|
+
var _a, _b, _c;
|
|
244
|
+
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
245
|
+
const handleTypeChange = React.useCallback((type) => {
|
|
246
|
+
const newStyledColumn = Object.assign(Object.assign({}, data), { SparkLineStyle: Object.assign(Object.assign({}, data.SparkLineStyle), { options: Object.assign(Object.assign({}, data.SparkLineStyle.options), { type }) }) });
|
|
247
|
+
props.onChange(newStyledColumn);
|
|
248
|
+
}, [data]);
|
|
249
|
+
const sparklineTypeOptions = React.useMemo(() => [
|
|
250
|
+
{ label: 'Line', value: 'line', onClick: () => handleTypeChange('line') },
|
|
251
|
+
{ label: 'Area', value: 'area', onClick: () => handleTypeChange('area') },
|
|
252
|
+
{ label: 'Column', value: 'column', onClick: () => handleTypeChange('column') },
|
|
253
|
+
{ label: 'Bar', value: 'bar', onClick: () => handleTypeChange('bar') },
|
|
254
|
+
], [data]);
|
|
255
|
+
const handleOptionChange = React.useCallback((path, value) => {
|
|
256
|
+
var _a;
|
|
257
|
+
const newOptions = (0, ObjectExtensions_1.setInPath)((_a = data.SparkLineStyle.options) !== null && _a !== void 0 ? _a : {}, path, value);
|
|
258
|
+
props.onChange(Object.assign(Object.assign({}, data), { SparkLineStyle: Object.assign(Object.assign({}, data.SparkLineStyle), { options: newOptions }) }));
|
|
259
|
+
}, [data]);
|
|
260
|
+
const isObjectNumberArray = ((_a = api.columnApi.getColumnFromId(data.ColumnId)) === null || _a === void 0 ? void 0 : _a.dataType) === 'ObjectNumberArray';
|
|
261
|
+
return (React.createElement(React.Fragment, null,
|
|
262
|
+
React.createElement(Tabs_1.Tabs, { mb: 2 },
|
|
263
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Settings"),
|
|
264
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
265
|
+
React.createElement(FormLayout_1.default, null,
|
|
266
|
+
React.createElement(FormLayout_1.FormRow, { label: "Type" },
|
|
267
|
+
React.createElement(DropdownButton_1.default, { columns: ['label'], items: sparklineTypeOptions }, (_c = (_b = sparklineTypeOptions.find((option) => { var _a; return option.value === ((_a = data.SparkLineStyle.options) === null || _a === void 0 ? void 0 : _a.type); })) === null || _b === void 0 ? void 0 : _b.label) !== null && _c !== void 0 ? _c : 'Select Type')),
|
|
268
|
+
isObjectNumberArray && (React.createElement(SparklineObjectNumberArrayProperties, { onOptionChange: handleOptionChange }))))),
|
|
269
|
+
React.createElement(CommonProperties, { onOptionChange: handleOptionChange }),
|
|
270
|
+
(() => {
|
|
271
|
+
var _a;
|
|
272
|
+
switch ((_a = data.SparkLineStyle.options) === null || _a === void 0 ? void 0 : _a.type) {
|
|
273
|
+
case 'line':
|
|
274
|
+
return React.createElement(TypeLineProperties, { onOptionChange: handleOptionChange });
|
|
275
|
+
case 'area':
|
|
276
|
+
return React.createElement(TypeAreaProperties, { onOptionChange: handleOptionChange });
|
|
277
|
+
case 'column':
|
|
278
|
+
return React.createElement(TypeColumnBarProperties, { onOptionChange: handleOptionChange });
|
|
279
|
+
case 'bar':
|
|
280
|
+
// It is the same as column. If they diverge, we can split them out.
|
|
281
|
+
return React.createElement(TypeColumnBarProperties, { onOptionChange: handleOptionChange });
|
|
282
|
+
}
|
|
283
|
+
})()));
|
|
284
|
+
};
|
|
285
|
+
exports.StyledColumnSparklineSettingsSection = StyledColumnSparklineSettingsSection;
|
|
@@ -14,6 +14,7 @@ const StyledColumnWizardColumnSection_1 = require("./StyledColumnWizardColumnSec
|
|
|
14
14
|
const StyledColumnWizardStyleSection_1 = require("./StyledColumnWizardStyleSection");
|
|
15
15
|
const Helper_1 = require("../../../Utilities/Helpers/Helper");
|
|
16
16
|
const StyledColumnWizardSettingsSection_1 = require("./StyledColumnWizardSettingsSection");
|
|
17
|
+
const StyledColumnSparklineSettingsSection_1 = require("./StyledColumnSparklineSettingsSection");
|
|
17
18
|
const StyledColumnWizard = (props) => {
|
|
18
19
|
var _a, _b;
|
|
19
20
|
const data = (_a = props.data) !== null && _a !== void 0 ? _a : (_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.value;
|
|
@@ -35,6 +36,32 @@ const StyledColumnWizard = (props) => {
|
|
|
35
36
|
}
|
|
36
37
|
props.onFinishWizard(styledColumn);
|
|
37
38
|
};
|
|
39
|
+
const checkboxGrandientPercentSteps = [
|
|
40
|
+
{
|
|
41
|
+
details: 'Select the style to apply',
|
|
42
|
+
renderSummary: StyledColumnWizardStyleSection_1.renderStyledColumnStyleSummary,
|
|
43
|
+
render: () => {
|
|
44
|
+
return (React.createElement(rebass_1.Box, { padding: 2 },
|
|
45
|
+
React.createElement(StyledColumnWizardStyleSection_1.StyledColumnWizardStyleSection, { onChange: setStyledColumn })));
|
|
46
|
+
},
|
|
47
|
+
title: 'Style',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
renderSummary: StyledColumnWizardSettingsSection_1.renderStyledColumnWizardSettingsSummary,
|
|
51
|
+
render: () => {
|
|
52
|
+
return (React.createElement(rebass_1.Box, { padding: 2 },
|
|
53
|
+
React.createElement(StyledColumnWizardSettingsSection_1.StyledColumnWizardSettingsSection, { onChange: setStyledColumn })));
|
|
54
|
+
},
|
|
55
|
+
title: 'Settings',
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
const sparklineSteps = [
|
|
59
|
+
{
|
|
60
|
+
title: 'Settings',
|
|
61
|
+
render: () => (React.createElement(rebass_1.Box, { p: 2 },
|
|
62
|
+
React.createElement(StyledColumnSparklineSettingsSection_1.StyledColumnSparklineSettingsSection, { onChange: setStyledColumn }))),
|
|
63
|
+
},
|
|
64
|
+
];
|
|
38
65
|
return (React.createElement(OnePageAdaptableWizard_1.OnePageAdaptableWizard, { defaultCurrentSectionName: props.defaultCurrentSectionName, moduleInfo: props.moduleInfo, data: styledColumn, onFinish: handleFinish, onHide: props.onCloseWizard, sections: [
|
|
39
66
|
{
|
|
40
67
|
details: 'Select a Styled Column Type',
|
|
@@ -55,23 +82,7 @@ const StyledColumnWizard = (props) => {
|
|
|
55
82
|
},
|
|
56
83
|
title: 'Column',
|
|
57
84
|
},
|
|
58
|
-
|
|
59
|
-
details: 'Select the style to apply',
|
|
60
|
-
renderSummary: StyledColumnWizardStyleSection_1.renderStyledColumnStyleSummary,
|
|
61
|
-
render: () => {
|
|
62
|
-
return (React.createElement(rebass_1.Box, { padding: 2 },
|
|
63
|
-
React.createElement(StyledColumnWizardStyleSection_1.StyledColumnWizardStyleSection, { onChange: setStyledColumn })));
|
|
64
|
-
},
|
|
65
|
-
title: 'Style',
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
renderSummary: StyledColumnWizardSettingsSection_1.renderStyledColumnWizardSettingsSummary,
|
|
69
|
-
render: () => {
|
|
70
|
-
return (React.createElement(rebass_1.Box, { padding: 2 },
|
|
71
|
-
React.createElement(StyledColumnWizardSettingsSection_1.StyledColumnWizardSettingsSection, { onChange: setStyledColumn })));
|
|
72
|
-
},
|
|
73
|
-
title: 'Settings',
|
|
74
|
-
},
|
|
85
|
+
...(styledColumn.SparkLineStyle ? sparklineSteps : checkboxGrandientPercentSteps),
|
|
75
86
|
'-',
|
|
76
87
|
{
|
|
77
88
|
title: 'Summary',
|
|
@@ -30,7 +30,13 @@ const StyledColumnWizardColumnSection = (props) => {
|
|
|
30
30
|
const sortableCols = React.useMemo(() => {
|
|
31
31
|
const sortableColumns = data.CheckBoxStyle
|
|
32
32
|
? api.columnApi.getBooleanColumns()
|
|
33
|
-
:
|
|
33
|
+
: data.SparkLineStyle
|
|
34
|
+
? [
|
|
35
|
+
...api.columnApi.getNumberArrayColumns(),
|
|
36
|
+
...api.columnApi.getTupleNumberArrayColumns(),
|
|
37
|
+
...api.columnApi.getObjectNumberArrayColumns(),
|
|
38
|
+
]
|
|
39
|
+
: api.columnApi.getNumericColumns();
|
|
34
40
|
const styledColumns = api.styledColumnApi.getAllStyledColumn();
|
|
35
41
|
const usedColumnIds = styledColumns
|
|
36
42
|
.map((styledColumn) => {
|
|
@@ -19,6 +19,9 @@ const renderStyledColumnTypeSummary = (data) => {
|
|
|
19
19
|
else if (data.CheckBoxStyle) {
|
|
20
20
|
type = 'Check Box';
|
|
21
21
|
}
|
|
22
|
+
else if (data.SparkLineStyle) {
|
|
23
|
+
type = 'Spark Line';
|
|
24
|
+
}
|
|
22
25
|
return (React.createElement(rebass_1.Text, { pr: 2, py: 2 },
|
|
23
26
|
"Type ",
|
|
24
27
|
React.createElement(Tag_1.Tag, null, type)));
|
|
@@ -28,21 +31,26 @@ const StyledColumnWizardTypeSection = (props) => {
|
|
|
28
31
|
const { data } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
29
32
|
const handleTypeChange = (type) => {
|
|
30
33
|
const newStyledColumn = Object.assign({}, data);
|
|
34
|
+
delete newStyledColumn.GradientStyle;
|
|
35
|
+
delete newStyledColumn.PercentBarStyle;
|
|
36
|
+
delete newStyledColumn.CheckBoxStyle;
|
|
37
|
+
delete newStyledColumn.SparkLineStyle;
|
|
31
38
|
switch (type) {
|
|
32
39
|
case 'gradient':
|
|
33
40
|
newStyledColumn.GradientStyle = {};
|
|
34
|
-
delete newStyledColumn.PercentBarStyle;
|
|
35
|
-
delete newStyledColumn.CheckBoxStyle;
|
|
36
41
|
break;
|
|
37
42
|
case 'percent':
|
|
38
43
|
newStyledColumn.PercentBarStyle = {};
|
|
39
|
-
delete newStyledColumn.GradientStyle;
|
|
40
|
-
delete newStyledColumn.CheckBoxStyle;
|
|
41
44
|
break;
|
|
42
45
|
case 'checkbox':
|
|
43
46
|
newStyledColumn.CheckBoxStyle = true;
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
break;
|
|
48
|
+
case 'sparkline':
|
|
49
|
+
newStyledColumn.SparkLineStyle = {
|
|
50
|
+
options: {
|
|
51
|
+
type: 'line',
|
|
52
|
+
},
|
|
53
|
+
};
|
|
46
54
|
break;
|
|
47
55
|
}
|
|
48
56
|
newStyledColumn.ColumnId = null;
|
|
@@ -54,6 +62,7 @@ const StyledColumnWizardTypeSection = (props) => {
|
|
|
54
62
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
55
63
|
React.createElement(Radio_1.default, { checked: Boolean(data.GradientStyle), onChange: () => handleTypeChange('gradient') }, "Gradient Column"),
|
|
56
64
|
React.createElement(Radio_1.default, { onChange: () => handleTypeChange('percent'), checked: Boolean(data.PercentBarStyle) }, "Percent Bar"),
|
|
57
|
-
React.createElement(Radio_1.default, { onChange: () => handleTypeChange('checkbox'), checked: Boolean(data.CheckBoxStyle) }, "Check Box")
|
|
65
|
+
React.createElement(Radio_1.default, { onChange: () => handleTypeChange('checkbox'), checked: Boolean(data.CheckBoxStyle) }, "Check Box"),
|
|
66
|
+
React.createElement(Radio_1.default, { onChange: () => handleTypeChange('sparkline'), checked: Boolean(data.SparkLineStyle) }, "Sparkline")))));
|
|
58
67
|
};
|
|
59
68
|
exports.StyledColumnWizardTypeSection = StyledColumnWizardTypeSection;
|
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AdaptableNoCodeWizard = exports.Adaptable = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const core_1 = require("@ag-grid-community/core");
|
|
6
|
+
const merge_1 = tslib_1.__importDefault(require("lodash/merge"));
|
|
6
7
|
const debounce_1 = tslib_1.__importDefault(require("lodash/debounce"));
|
|
7
8
|
const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
|
|
8
9
|
const throttle_1 = tslib_1.__importDefault(require("lodash/throttle"));
|
|
@@ -350,7 +351,7 @@ class Adaptable {
|
|
|
350
351
|
// the 'old' constructor which takes an Adaptable adaptable object
|
|
351
352
|
// this is still used internally but should not be used externally as a preference
|
|
352
353
|
async init(adaptableOptions, runtimeConfig, _staticInit) {
|
|
353
|
-
var _a, _b, _c, _d, _e, _f;
|
|
354
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
354
355
|
if (runtimeConfig) {
|
|
355
356
|
this.supressReact18RenderWarning = !!runtimeConfig.supressReact18RenderWarning;
|
|
356
357
|
if (runtimeConfig.renderReactRoot) {
|
|
@@ -453,6 +454,7 @@ class Adaptable {
|
|
|
453
454
|
abColDefDate: (_d = this.gridOptions.columnTypes.abColDefDate) !== null && _d !== void 0 ? _d : {},
|
|
454
455
|
abColDefObject: (_e = this.gridOptions.columnTypes.abColDefObject) !== null && _e !== void 0 ? _e : {},
|
|
455
456
|
abColDefCustom: (_f = this.gridOptions.columnTypes.abColDefCustom) !== null && _f !== void 0 ? _f : {},
|
|
457
|
+
abColDefNumberArray: (_g = this.gridOptions.columnTypes.abColDefNumberArray) !== null && _g !== void 0 ? _g : {},
|
|
456
458
|
});
|
|
457
459
|
if (this.gridOptions.columnTypes.abColDefNumber.cellEditor === undefined) {
|
|
458
460
|
this.gridOptions.columnTypes.abColDefNumber.cellEditor =
|
|
@@ -3312,6 +3314,18 @@ class Adaptable {
|
|
|
3312
3314
|
if (styledColumn.CheckBoxStyle) {
|
|
3313
3315
|
return this.agGridHelper.createCheckboxRendererComp(abColumn.columnId, abColumn.readOnly);
|
|
3314
3316
|
}
|
|
3317
|
+
if (styledColumn.SparkLineStyle) {
|
|
3318
|
+
return 'agSparklineCellRenderer';
|
|
3319
|
+
}
|
|
3320
|
+
}
|
|
3321
|
+
});
|
|
3322
|
+
this.setColDefProperty(col, 'cellRendererParams', (userDefined) => {
|
|
3323
|
+
const styledColumn = this.api.styledColumnApi.getStyledColumnByColumnId(abColumn.columnId);
|
|
3324
|
+
if (styledColumn && !styledColumn.IsSuspended) {
|
|
3325
|
+
if (styledColumn.SparkLineStyle) {
|
|
3326
|
+
const sparklineOptions = (0, merge_1.default)({}, userDefined === null || userDefined === void 0 ? void 0 : userDefined.sparklineOptions, styledColumn.SparkLineStyle.options);
|
|
3327
|
+
return Object.assign(Object.assign({}, userDefined), { sparklineOptions });
|
|
3328
|
+
}
|
|
3315
3329
|
}
|
|
3316
3330
|
});
|
|
3317
3331
|
}
|
|
@@ -474,6 +474,12 @@ class agGridHelper {
|
|
|
474
474
|
return 'Date';
|
|
475
475
|
case 'abColDefObject':
|
|
476
476
|
return 'Object';
|
|
477
|
+
case 'abColDefNumberArray':
|
|
478
|
+
return 'NumberArray';
|
|
479
|
+
case 'abColDefTupleNumberArray':
|
|
480
|
+
return 'TupleNumberArray';
|
|
481
|
+
case 'abColDefObjectNumberArray':
|
|
482
|
+
return 'ObjectNumberArray';
|
|
477
483
|
default:
|
|
478
484
|
return 'Unknown';
|
|
479
485
|
}
|
|
@@ -495,6 +501,12 @@ class agGridHelper {
|
|
|
495
501
|
return 'abColDefObject';
|
|
496
502
|
case 'String':
|
|
497
503
|
return 'abColDefString';
|
|
504
|
+
case 'NumberArray':
|
|
505
|
+
return 'abColDefNumberArray';
|
|
506
|
+
case 'TupleNumberArray':
|
|
507
|
+
return 'abColDefTupleNumberArray';
|
|
508
|
+
case 'ObjectNumberArray':
|
|
509
|
+
return 'abColDefObjectNumberArray';
|
|
498
510
|
default:
|
|
499
511
|
return 'abColDefCustom';
|
|
500
512
|
}
|
|
@@ -50,50 +50,12 @@ function ExpressionEditor(props) {
|
|
|
50
50
|
const queryableColumns = type === 'scalar' || type === 'boolean' || type === 'aggregatedScalar'
|
|
51
51
|
? props.columns
|
|
52
52
|
: props.columns.filter((c) => !props.api.columnApi.isCalculatedColumn(c.columnId));
|
|
53
|
-
// borrowed from https://github.com/ag-grid/ag-grid/blob/v27.2.1/community-modules/core/src/ts/utils/object.ts#L205
|
|
54
53
|
const getColValue = (column) => {
|
|
55
|
-
|
|
56
|
-
const columnValueKey = (_a = column.field) !== null && _a !== void 0 ? _a : column.columnId;
|
|
57
|
-
const isColumnValueContainsDots = (_b = column.field) === null || _b === void 0 ? void 0 : _b.includes('.');
|
|
58
|
-
// if no '.', then it's not a deep value
|
|
59
|
-
if (!isColumnValueContainsDots) {
|
|
60
|
-
return data[columnValueKey];
|
|
61
|
-
}
|
|
62
|
-
// otherwise it is a deep value, so need to dig for it
|
|
63
|
-
const fields = columnValueKey.split('.');
|
|
64
|
-
let currentObject = data;
|
|
65
|
-
for (let i = 0; i < fields.length; i++) {
|
|
66
|
-
if (currentObject == null) {
|
|
67
|
-
return undefined;
|
|
68
|
-
}
|
|
69
|
-
currentObject = currentObject[fields[i]];
|
|
70
|
-
}
|
|
71
|
-
return currentObject;
|
|
54
|
+
return props.api.internalApi.getValueUsingField(data, column);
|
|
72
55
|
};
|
|
73
|
-
// borrowed from https://github.com/ag-grid/ag-grid/blob/v27.2.1/community-modules/core/src/ts/valueService/valueService.ts#L217
|
|
74
56
|
const updateColValue = (rowData, column, newValue) => {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const isColumnValueContainsDots = (_b = column.field) === null || _b === void 0 ? void 0 : _b.includes('.');
|
|
78
|
-
// if no '.', then it's not a deep value
|
|
79
|
-
if (!isColumnValueContainsDots) {
|
|
80
|
-
rowData[columnValueKey] = newValue;
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
// otherwise it is a deep value, so need to dig for it
|
|
84
|
-
const fieldPieces = columnValueKey.split('.');
|
|
85
|
-
let currentObject = rowData;
|
|
86
|
-
while (fieldPieces.length > 0 && currentObject) {
|
|
87
|
-
const fieldPiece = fieldPieces.shift();
|
|
88
|
-
if (fieldPieces.length === 0) {
|
|
89
|
-
currentObject[fieldPiece] = newValue;
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
currentObject = currentObject[fieldPiece];
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
return Object.assign({}, rowData);
|
|
57
|
+
const updatedRowData = props.api.internalApi.setValueUsingField(rowData, column, newValue);
|
|
58
|
+
return Object.assign({}, updatedRowData);
|
|
97
59
|
};
|
|
98
60
|
const getColDateValue = (column) => {
|
|
99
61
|
const colValue = getColValue(column);
|