@adaptabletools/adaptable 13.0.0-canary.12 → 13.0.0-canary.14

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.
Files changed (94) hide show
  1. package/base.css +1131 -732
  2. package/base.css.map +1 -0
  3. package/bundle.cjs.js +174 -157
  4. package/index.css +1132 -732
  5. package/index.css.map +1 -0
  6. package/package.json +5 -5
  7. package/publishTimestamp.d.ts +1 -1
  8. package/publishTimestamp.js +1 -1
  9. package/src/AdaptableOptions/AdaptableQLOptions.d.ts +20 -3
  10. package/src/AdaptableOptions/LayoutOptions.d.ts +2 -1
  11. package/src/Api/AdaptableApi.d.ts +2 -0
  12. package/src/Api/FormatColumnApi.d.ts +2 -23
  13. package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -0
  14. package/src/Api/Implementation/AdaptableApiImpl.js +2 -0
  15. package/src/Api/Implementation/FormatColumnApiImpl.d.ts +1 -6
  16. package/src/Api/Implementation/FormatColumnApiImpl.js +13 -111
  17. package/src/Api/Implementation/StyledColumnApiImpl.d.ts +19 -0
  18. package/src/Api/Implementation/StyledColumnApiImpl.js +134 -0
  19. package/src/Api/StyledColumnApi.d.ts +68 -0
  20. package/src/Api/StyledColumnApi.js +2 -0
  21. package/src/PredefinedConfig/AdaptableState.d.ts +2 -0
  22. package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
  23. package/src/PredefinedConfig/Common/Types.d.ts +3 -3
  24. package/src/PredefinedConfig/Common/Types.js +1 -0
  25. package/src/PredefinedConfig/PredefinedConfig.d.ts +5 -0
  26. package/src/PredefinedConfig/StyledColumnState.d.ts +113 -0
  27. package/src/PredefinedConfig/StyledColumnState.js +2 -0
  28. package/src/Redux/ActionsReducers/StyledColumnRedux.d.ts +49 -0
  29. package/src/Redux/ActionsReducers/StyledColumnRedux.js +92 -0
  30. package/src/Redux/Store/AdaptableStore.js +7 -0
  31. package/src/Strategy/StyledColumnModule.d.ts +24 -0
  32. package/src/Strategy/StyledColumnModule.js +165 -0
  33. package/src/Strategy/Utilities/getScopeViewItems.js +1 -1
  34. package/src/Utilities/Constants/ModuleConstants.d.ts +3 -0
  35. package/src/Utilities/Constants/ModuleConstants.js +4 -1
  36. package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -0
  37. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.d.ts +1 -4
  38. package/src/Utilities/ObjectFactory.d.ts +3 -0
  39. package/src/Utilities/ObjectFactory.js +11 -3
  40. package/src/Utilities/Services/ModuleService.js +3 -1
  41. package/src/View/CalculatedColumn/CalculatedColumnSummary.d.ts +1 -1
  42. package/src/View/Components/RangesComponent.d.ts +1 -0
  43. package/src/View/Components/RangesComponent.js +12 -12
  44. package/src/View/Components/Selectors/ColumnSelector.d.ts +1 -0
  45. package/src/View/Components/Selectors/ColumnSelector.js +2 -1
  46. package/src/View/Components/StyleComponent.js +2 -2
  47. package/src/View/Components/ToolPanel/AdaptableToolPanel.d.ts +1 -11
  48. package/src/View/Components/ToolPanel/AdaptableToolPanel.js +21 -9
  49. package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
  50. package/src/View/Components/ToolPanel/ToolPanelPopup.d.ts +1 -1
  51. package/src/View/DataSet/DataSetViewPanel.d.ts +1 -1
  52. package/src/View/Export/ExportViewPanel.d.ts +1 -1
  53. package/src/View/Filter/FilterSummary.d.ts +1 -1
  54. package/src/View/Filter/FilterViewPanel.d.ts +1 -1
  55. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.d.ts +3 -3
  56. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +6 -315
  57. package/src/View/Layout/LayoutViewPanel.d.ts +1 -1
  58. package/src/View/Query/QueryViewPanel.d.ts +1 -1
  59. package/src/View/QuickSearch/QuickSearchViewPanel.d.ts +1 -1
  60. package/src/View/StyledColumn/Wizard/StyledColumnWizard.d.ts +7 -0
  61. package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +77 -0
  62. package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.d.ts +9 -0
  63. package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.js +65 -0
  64. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection.d.ts +9 -0
  65. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection.js +238 -0
  66. package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.d.ts +7 -0
  67. package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.js +59 -0
  68. package/src/View/SystemStatus/SystemStatusViewPanel.d.ts +1 -1
  69. package/src/View/Wizard/OnePageAdaptableWizard.d.ts +1 -1
  70. package/src/agGrid/Adaptable.d.ts +2 -1
  71. package/src/agGrid/Adaptable.js +49 -35
  72. package/src/agGrid/FilterWrapper.js +58 -19
  73. package/src/agGrid/FloatingFilterWrapper.js +10 -12
  74. package/src/agGrid/PercentBarRenderer.d.ts +6 -2
  75. package/src/agGrid/PercentBarRenderer.js +10 -18
  76. package/src/agGrid/agGridHelper.d.ts +6 -2
  77. package/src/agGrid/agGridHelper.js +4 -2
  78. package/src/agGrid/createAgStatusPanelComponent.d.ts +1 -1
  79. package/src/agGrid/createAgStatusPanelComponent.js +17 -0
  80. package/src/components/Datepicker/index.d.ts +1 -1
  81. package/src/components/icons/brush.d.ts +3 -0
  82. package/src/components/icons/brush.js +7 -0
  83. package/src/components/icons/index.js +2 -0
  84. package/src/metamodel/adaptable.metamodel.d.ts +56 -20
  85. package/src/metamodel/adaptable.metamodel.js +1 -1
  86. package/src/types.d.ts +3 -1
  87. package/themes/dark.css +8 -4
  88. package/themes/dark.css.map +1 -0
  89. package/themes/light.css +4 -1
  90. package/themes/light.css.map +1 -0
  91. package/version.d.ts +1 -1
  92. package/version.js +1 -1
  93. package/src/AdaptableComponents.d.ts +0 -1
  94. package/src/AdaptableComponents.js +0 -5
@@ -0,0 +1,238 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StyledColumnWizardStyleSection = exports.renderStyledColumnStyleSummary = exports.renderFormatColumnStyleWizardSummary = 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 ErrorBox_1 = tslib_1.__importDefault(require("../../../components/ErrorBox"));
9
+ const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
10
+ const Tabs_1 = require("../../../components/Tabs");
11
+ const Tag_1 = require("../../../components/Tag");
12
+ const ColorPicker_1 = require("../../ColorPicker");
13
+ const RangesComponent_1 = require("../../Components/RangesComponent");
14
+ const StyleVisualItem_1 = require("../../Components/StyleVisualItem");
15
+ const UIHelper_1 = require("../../UIHelper");
16
+ const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
17
+ const renderFormatColumnStyleWizardSummary = (data) => {
18
+ const { api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
19
+ return (0, exports.renderStyledColumnStyleSummary)(data, api);
20
+ };
21
+ exports.renderFormatColumnStyleWizardSummary = renderFormatColumnStyleWizardSummary;
22
+ const getRanges = (ranges) => {
23
+ return ranges.map((r, i) => (React.createElement(rebass_1.Flex, { key: i, alignItems: "center", mr: 3 },
24
+ React.createElement(rebass_1.Box, { mr: 1 },
25
+ r.Min,
26
+ " to ",
27
+ r.Max,
28
+ ' '),
29
+ React.createElement(StyleVisualItem_1.StyleVisualItem, { Style: {
30
+ BackColor: r.Color,
31
+ ForeColor: r.Color,
32
+ } }))));
33
+ };
34
+ const getColumnComparison = (columnComparison, api) => {
35
+ return (React.createElement(rebass_1.Flex, { key: 'cc', alignItems: "center", mr: 3 },
36
+ React.createElement(rebass_1.Box, { mr: 1 },
37
+ "Min Value:",
38
+ ' ',
39
+ isNaN(Number(columnComparison.MinValue))
40
+ ? '[' + api.columnApi.getFriendlyNameFromColumnId(String(columnComparison.MinValue)) + ']'
41
+ : columnComparison.MinValue,
42
+ ' ',
43
+ ", Max Value:",
44
+ ' ',
45
+ isNaN(Number(columnComparison.MaxValue))
46
+ ? '[' + api.columnApi.getFriendlyNameFromColumnId(String(columnComparison.MaxValue)) + ']'
47
+ : columnComparison.MaxValue,
48
+ ' '),
49
+ React.createElement(StyleVisualItem_1.StyleVisualItem, { Style: {
50
+ BackColor: columnComparison.Color,
51
+ ForeColor: columnComparison.Color,
52
+ } })));
53
+ };
54
+ const renderStyledColumnStyleSummary = (data, api) => {
55
+ if (data.CheckBoxStyle) {
56
+ return React.createElement(Tag_1.Tag, null, "Checkbox Style");
57
+ }
58
+ if (data.GradientStyle) {
59
+ if (data.GradientStyle.CellRanges) {
60
+ return getRanges(data.GradientStyle.CellRanges);
61
+ }
62
+ if (data.GradientStyle.ColumnComparison) {
63
+ return getColumnComparison(data.GradientStyle.ColumnComparison, api);
64
+ }
65
+ }
66
+ if (data.PercentBarStyle) {
67
+ if (data.PercentBarStyle.CellRanges) {
68
+ return getRanges(data.PercentBarStyle.CellRanges);
69
+ }
70
+ if (data.PercentBarStyle.ColumnComparison) {
71
+ return getColumnComparison(data.PercentBarStyle.ColumnComparison, api);
72
+ }
73
+ }
74
+ return React.createElement(Tag_1.Tag, null, "No Styling Defined");
75
+ };
76
+ exports.renderStyledColumnStyleSummary = renderStyledColumnStyleSummary;
77
+ const StyledColumnWizardStyleSection = (props) => {
78
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
79
+ const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
80
+ const minMaxRangeValues = React.useMemo(() => {
81
+ const columnId = data.ColumnId;
82
+ if (!columnId) {
83
+ return null;
84
+ }
85
+ const column = api.columnApi.getColumnFromId(columnId);
86
+ return {
87
+ min: api.columnApi.getMinValueForNumericColumn(column),
88
+ max: api.columnApi.getMaxValueForNumericColumn(column),
89
+ };
90
+ }, [data]);
91
+ const scope = { ColumnIds: [data.ColumnId] }; // TODO: remove scope when format column columnStyle is removed
92
+ // gradient
93
+ const onUpdateGradientStyleRanges = (ranges) => {
94
+ const GradientStyle = {
95
+ CellRanges: ranges,
96
+ };
97
+ props.onChange(Object.assign(Object.assign({}, data), { GradientStyle }));
98
+ };
99
+ const onUpdateGradientStyleColumnComparison = (columnComparison) => {
100
+ const GradientStyle = {
101
+ ColumnComparison: columnComparison,
102
+ };
103
+ props.onChange(Object.assign(Object.assign({}, data), { GradientStyle }));
104
+ };
105
+ // percentbar
106
+ const onUpdatePercentBarStyleColumnComparison = (columnComparison) => {
107
+ const PercentBarStyle = {
108
+ ColumnComparison: columnComparison,
109
+ };
110
+ props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle }));
111
+ };
112
+ const onUpdatePercentBarStyleRanges = (ranges) => {
113
+ const PercentBarStyle = {
114
+ CellRanges: ranges,
115
+ };
116
+ props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle }));
117
+ };
118
+ const onPercentBarCellTextCellValueChanged = (checked) => {
119
+ let percentBarStyle = data === null || data === void 0 ? void 0 : data.PercentBarStyle;
120
+ if (checked) {
121
+ if (!percentBarStyle.CellText) {
122
+ percentBarStyle.CellText = ['CellValue'];
123
+ }
124
+ else {
125
+ percentBarStyle.CellText.push('CellValue');
126
+ }
127
+ }
128
+ else {
129
+ if (percentBarStyle.CellText && percentBarStyle.CellText.includes('PercentageValue')) {
130
+ percentBarStyle.CellText = ['PercentageValue'];
131
+ }
132
+ else {
133
+ percentBarStyle.CellText = [];
134
+ }
135
+ }
136
+ props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle: percentBarStyle }));
137
+ };
138
+ const onPercentBarCellTextPercentValueChanged = (checked) => {
139
+ let percentBarStyle = data === null || data === void 0 ? void 0 : data.PercentBarStyle;
140
+ if (checked) {
141
+ if (!percentBarStyle.CellText) {
142
+ percentBarStyle.CellText = ['PercentageValue'];
143
+ }
144
+ else {
145
+ percentBarStyle.CellText.push('PercentageValue');
146
+ }
147
+ }
148
+ else {
149
+ if (percentBarStyle.CellText && percentBarStyle.CellText.includes('CellValue')) {
150
+ percentBarStyle.CellText = ['CellValue'];
151
+ }
152
+ else {
153
+ percentBarStyle.CellText = [];
154
+ }
155
+ }
156
+ props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle: percentBarStyle }));
157
+ };
158
+ const onPercentBarToolTipTextCellValueChanged = (checked) => {
159
+ let percentBarStyle = data === null || data === void 0 ? void 0 : data.PercentBarStyle;
160
+ if (checked) {
161
+ if (!percentBarStyle.ToolTipText) {
162
+ percentBarStyle.ToolTipText = ['CellValue'];
163
+ }
164
+ else {
165
+ percentBarStyle.ToolTipText.push('CellValue');
166
+ }
167
+ }
168
+ else {
169
+ if (percentBarStyle.ToolTipText && percentBarStyle.ToolTipText.includes('PercentageValue')) {
170
+ percentBarStyle.ToolTipText = ['PercentageValue'];
171
+ }
172
+ else {
173
+ percentBarStyle.ToolTipText = [];
174
+ }
175
+ }
176
+ props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle: percentBarStyle }));
177
+ };
178
+ const onPercentBarToolTipTextPercentValueChanged = (checked) => {
179
+ let percentBarStyle = data.PercentBarStyle;
180
+ if (checked) {
181
+ if (!percentBarStyle.ToolTipText) {
182
+ percentBarStyle.ToolTipText = ['PercentageValue'];
183
+ }
184
+ else {
185
+ percentBarStyle.ToolTipText.push('PercentageValue');
186
+ }
187
+ }
188
+ else {
189
+ if (percentBarStyle.ToolTipText && percentBarStyle.ToolTipText.includes('CellValue')) {
190
+ percentBarStyle.ToolTipText = ['CellValue'];
191
+ }
192
+ else {
193
+ percentBarStyle.ToolTipText = [];
194
+ }
195
+ }
196
+ props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle: percentBarStyle }));
197
+ };
198
+ const onUsePercentStyleColorCheckChanged = (checked) => {
199
+ let percentBarStyle = data === null || data === void 0 ? void 0 : data.PercentBarStyle;
200
+ percentBarStyle.BackColor = checked ? (0, UIHelper_1.getHexForName)(UIHelper_1.GRAY) : null;
201
+ props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle: percentBarStyle }));
202
+ };
203
+ const onForeColorSelectChange = (color) => {
204
+ let percentBarStyle = data.PercentBarStyle;
205
+ percentBarStyle.BackColor = color;
206
+ props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle: percentBarStyle }));
207
+ };
208
+ const disabled = !data.ColumnId;
209
+ return (React.createElement(rebass_1.Box, null,
210
+ data.CheckBoxStyle && (React.createElement(Tabs_1.Tabs, null,
211
+ React.createElement(Tabs_1.Tabs.Tab, null, "Check Box Column"),
212
+ React.createElement(Tabs_1.Tabs.Content, null,
213
+ React.createElement(CheckBox_1.CheckBox, { marginLeft: 2, readOnly: true, checked: true }, "Display Column As CheckBox")))),
214
+ (data === null || data === void 0 ? void 0 : data.GradientStyle) && (React.createElement(RangesComponent_1.RangesComponent, { disabled: !data.ColumnId, minMaxRangeValues: minMaxRangeValues, api: api, scope: scope, showRangeDirection: true, ranges: (_a = data.GradientStyle) === null || _a === void 0 ? void 0 : _a.CellRanges, columnComparison: (_b = data === null || data === void 0 ? void 0 : data.GradientStyle) === null || _b === void 0 ? void 0 : _b.ColumnComparison, updateRanges: (ranges) => onUpdateGradientStyleRanges(ranges), updateColumnComparison: (columnComparison) => onUpdateGradientStyleColumnComparison(columnComparison) })),
215
+ data.PercentBarStyle && (React.createElement(React.Fragment, null,
216
+ React.createElement(RangesComponent_1.RangesComponent, { disabled: disabled, minMaxRangeValues: minMaxRangeValues, api: api, scope: scope, showRangeDirection: false, ranges: (_c = data.PercentBarStyle) === null || _c === void 0 ? void 0 : _c.CellRanges, columnComparison: (_d = data === null || data === void 0 ? void 0 : data.PercentBarStyle) === null || _d === void 0 ? void 0 : _d.ColumnComparison, updateRanges: (ranges) => onUpdatePercentBarStyleRanges(ranges), updateColumnComparison: (columnComparison) => onUpdatePercentBarStyleColumnComparison(columnComparison) }),
217
+ React.createElement(FormLayout_1.default, { marginLeft: 2, marginTop: 2 },
218
+ React.createElement(FormLayout_1.FormRow, { label: "Cell Display:" },
219
+ React.createElement(CheckBox_1.CheckBox, { disabled: disabled, marginLeft: 2, checked: (_f = (_e = data.PercentBarStyle) === null || _e === void 0 ? void 0 : _e.CellText) === null || _f === void 0 ? void 0 : _f.includes('CellValue'), onChange: (checked) => onPercentBarCellTextCellValueChanged(checked) }, "Cell Value"),
220
+ ' ',
221
+ React.createElement(CheckBox_1.CheckBox, { disabled: disabled, marginLeft: 3, checked: (_h = (_g = data === null || data === void 0 ? void 0 : data.PercentBarStyle) === null || _g === void 0 ? void 0 : _g.CellText) === null || _h === void 0 ? void 0 : _h.includes('PercentageValue'), onChange: (checked) => onPercentBarCellTextPercentValueChanged(checked) },
222
+ "Percent Value",
223
+ ' '),
224
+ ' '),
225
+ React.createElement(FormLayout_1.FormRow, { label: "ToolTip Display:" },
226
+ React.createElement(CheckBox_1.CheckBox, { disabled: disabled, marginLeft: 2, checked: (_k = (_j = data === null || data === void 0 ? void 0 : data.PercentBarStyle) === null || _j === void 0 ? void 0 : _j.ToolTipText) === null || _k === void 0 ? void 0 : _k.includes('CellValue'), onChange: (checked) => onPercentBarToolTipTextCellValueChanged(checked) }, "Cell Value"),
227
+ ' ',
228
+ React.createElement(CheckBox_1.CheckBox, { disabled: disabled, marginLeft: 3, checked: (_m = (_l = data === null || data === void 0 ? void 0 : data.PercentBarStyle) === null || _l === void 0 ? void 0 : _l.ToolTipText) === null || _m === void 0 ? void 0 : _m.includes('PercentageValue'), onChange: (checked) => onPercentBarToolTipTextPercentValueChanged(checked) },
229
+ "Percent Value",
230
+ ' '),
231
+ ' '),
232
+ React.createElement(FormLayout_1.FormRow, { label: `Back ${api.internalApi.getCorrectEnglishVariant('Colour')}` },
233
+ React.createElement(rebass_1.Flex, { alignItems: "center", marginLeft: 2 },
234
+ React.createElement(CheckBox_1.CheckBox, { disabled: disabled, checked: !!((_o = data.PercentBarStyle) === null || _o === void 0 ? void 0 : _o.BackColor), onChange: (checked) => onUsePercentStyleColorCheckChanged(checked), mr: 2 }),
235
+ ((_p = data.PercentBarStyle) === null || _p === void 0 ? void 0 : _p.BackColor) !== undefined && (React.createElement(ColorPicker_1.ColorPicker, { disabled: disabled, api: api, value: (_q = data.PercentBarStyle) === null || _q === void 0 ? void 0 : _q.BackColor, onChange: (x) => onForeColorSelectChange(x) }))))))),
236
+ !data.ColumnId && React.createElement(ErrorBox_1.default, { mt: 2 }, "You need to select a column before styling.")));
237
+ };
238
+ exports.StyledColumnWizardStyleSection = StyledColumnWizardStyleSection;
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import { StyledColumn } from '../../../PredefinedConfig/StyledColumnState';
3
+ export declare const renderStyledColumnTypeSummary: (data: StyledColumn) => JSX.Element;
4
+ export interface StyledColumnWizardTypeSectionProps {
5
+ onChange: (styledColumn: StyledColumn) => void;
6
+ }
7
+ export declare const StyledColumnWizardTypeSection: React.FunctionComponent<StyledColumnWizardTypeSectionProps>;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StyledColumnWizardTypeSection = exports.renderStyledColumnTypeSummary = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const rebass_1 = require("rebass");
7
+ const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
8
+ const Tabs_1 = require("../../../components/Tabs");
9
+ const Tag_1 = require("../../../components/Tag");
10
+ const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
11
+ const renderStyledColumnTypeSummary = (data) => {
12
+ let type = null;
13
+ if (data.GradientStyle) {
14
+ type = 'Gradient Column';
15
+ }
16
+ else if (data.PercentBarStyle) {
17
+ type = 'Percent Bar';
18
+ }
19
+ else if (data.CheckBoxStyle) {
20
+ type = 'Check Box';
21
+ }
22
+ return (React.createElement(rebass_1.Text, { pr: 2, py: 2 },
23
+ "Type ",
24
+ React.createElement(Tag_1.Tag, null, type)));
25
+ };
26
+ exports.renderStyledColumnTypeSummary = renderStyledColumnTypeSummary;
27
+ const StyledColumnWizardTypeSection = (props) => {
28
+ const { data } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
29
+ const handleTypeChange = (type) => {
30
+ const newStyledColumn = Object.assign({}, data);
31
+ switch (type) {
32
+ case 'gradient':
33
+ newStyledColumn.GradientStyle = {};
34
+ delete newStyledColumn.PercentBarStyle;
35
+ delete newStyledColumn.CheckBoxStyle;
36
+ break;
37
+ case 'percent':
38
+ newStyledColumn.PercentBarStyle = {};
39
+ delete newStyledColumn.GradientStyle;
40
+ delete newStyledColumn.CheckBoxStyle;
41
+ break;
42
+ case 'checkbox':
43
+ newStyledColumn.CheckBoxStyle = true;
44
+ delete newStyledColumn.GradientStyle;
45
+ delete newStyledColumn.PercentBarStyle;
46
+ break;
47
+ }
48
+ newStyledColumn.ColumnId = null;
49
+ props.onChange(newStyledColumn);
50
+ };
51
+ return (React.createElement(rebass_1.Flex, { height: "100%", flexDirection: "column", "data-name": "styled-column-type" },
52
+ React.createElement(Tabs_1.Tabs, { autoFocus: false, padding: 2 },
53
+ React.createElement(Tabs_1.Tabs.Tab, null, "Type"),
54
+ React.createElement(Tabs_1.Tabs.Content, null,
55
+ React.createElement(Radio_1.default, { checked: Boolean(data.GradientStyle), onChange: () => handleTypeChange('gradient') }, "Gradient Column"),
56
+ 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")))));
58
+ };
59
+ exports.StyledColumnWizardTypeSection = StyledColumnWizardTypeSection;
@@ -8,5 +8,5 @@ declare class SystemStatusViewPanelComponent extends React.Component<SystemStatu
8
8
  constructor(props: SystemStatusViewPanelComponentProps);
9
9
  render(): JSX.Element;
10
10
  }
11
- export declare let SystemStatusViewPanel: import("react-redux").ConnectedComponent<typeof SystemStatusViewPanelComponent, import("react-redux").Omit<React.ClassAttributes<SystemStatusViewPanelComponent> & SystemStatusViewPanelComponentProps, "api" | "moduleInfo" | "accessLevel" | "SystemStatusMessageInfos" | "viewType">>;
11
+ export declare let SystemStatusViewPanel: import("react-redux").ConnectedComponent<typeof SystemStatusViewPanelComponent, import("react-redux").Omit<React.ClassAttributes<SystemStatusViewPanelComponent> & SystemStatusViewPanelComponentProps, "api" | "accessLevel" | "moduleInfo" | "SystemStatusMessageInfos" | "viewType">>;
12
12
  export {};
@@ -22,7 +22,7 @@ export interface OnePageAdaptableWizardSection<ENTITY> {
22
22
  isValid?: (data: ENTITY, api: AdaptableApi, context: OnePageAdaptableWizardContextType<ENTITY>) => true | string;
23
23
  isVisible?: (data: ENTITY, api: AdaptableApi, context: OnePageAdaptableWizardContextType<ENTITY>) => boolean;
24
24
  render: (data: ENTITY, index: number) => React.ReactNode;
25
- renderSummary?: (data: ENTITY) => React.ReactNode;
25
+ renderSummary?: (data: ENTITY, api: AdaptableApi) => React.ReactNode;
26
26
  }
27
27
  export interface OnePageAdaptableWizardProps<ENTITY> {
28
28
  moduleInfo: ModuleInfo;
@@ -157,6 +157,8 @@ export declare class Adaptable implements IAdaptable {
157
157
  updateColumnsIntoStore(): void;
158
158
  private createAdaptableColumn;
159
159
  private safeSetColDefs;
160
+ private getStyledColumnStyle;
161
+ private getSpecialColumnStyle;
160
162
  private getFormatColumnSpecialColumnStyle;
161
163
  private getFormatColumnColumnStyle;
162
164
  private getFormatColumnCellStyle;
@@ -365,7 +367,6 @@ export declare class Adaptable implements IAdaptable {
365
367
  private setupColumnHeaderAggregations;
366
368
  private getConditionalStyleRowClass;
367
369
  private getConditionalStyleRowStyle;
368
- private getFormatColumnRowStyle;
369
370
  private getGridOptionsApi;
370
371
  canGenerateCharts(): boolean;
371
372
  canHaveSparklines(): boolean;
@@ -349,9 +349,9 @@ class Adaptable {
349
349
  this.renderReactRoot = (el, container) => {
350
350
  const unmount = runtimeConfig.renderReactRoot(el, container);
351
351
  return () => {
352
- // we're doing this because of FloatingFilters - in our FloatingFilterWrapper component,
353
- // in the .destroy, we're unmounting, but this is done while aggrid is rendering
354
- // and can't be fixed by us as it's done during an AggridReact rendering operation
352
+ // we used to capture here because of FloatingFilters/Filters - see FloatingFilterWrapper and FilterWrapper
353
+ // as we didn't have a native React implementation for our React wrapper
354
+ // but we might need to do this again in the future for some other components that are not native React
355
355
  // captureReactWarnings();
356
356
  if (typeof unmount === 'function') {
357
357
  unmount();
@@ -911,13 +911,15 @@ class Adaptable {
911
911
  this.gridOptions.api.setColumnDefs(colDefs);
912
912
  this.updateColumnsIntoStore(); // todo remove this from here!!!
913
913
  }
914
- getFormatColumnSpecialColumnStyle(formatColumn, abColumn, params) {
915
- const columnStyle = formatColumn.ColumnStyle;
914
+ getStyledColumnStyle(styledColumn, abColumn, params) {
915
+ return this.getSpecialColumnStyle(styledColumn, abColumn, params);
916
+ }
917
+ getSpecialColumnStyle(columnStyle, abColumn, params) {
916
918
  let style = {};
917
919
  const gradientStyle = columnStyle === null || columnStyle === void 0 ? void 0 : columnStyle.GradientStyle;
918
920
  if (gradientStyle) {
919
- const min = this.api.formatColumnApi.getNumericStyleMinValue(columnStyle, abColumn, params.node, params.value);
920
- const max = this.api.formatColumnApi.getNumericStyleMaxValue(columnStyle, abColumn, params.node, params.value);
921
+ const min = this.api.styledColumnApi.getNumericStyleMinValue(columnStyle, abColumn, params.node, params.value);
922
+ const max = this.api.styledColumnApi.getNumericStyleMaxValue(columnStyle, abColumn, params.node, params.value);
921
923
  const clampedValue = (0, clamp_1.default)(params.value, min, max);
922
924
  let cellBackColor;
923
925
  let reverseGradient = false;
@@ -947,10 +949,26 @@ class Adaptable {
947
949
  }
948
950
  return style;
949
951
  }
952
+ getFormatColumnSpecialColumnStyle(formatColumn, abColumn, params) {
953
+ return this.getSpecialColumnStyle(formatColumn.ColumnStyle, abColumn, params);
954
+ }
950
955
  getFormatColumnColumnStyle(formatColumns) {
951
956
  // first has more precedence, then they need to be applied in reverse order
952
957
  return formatColumns.reduceRight((style, formatColumn) => {
953
958
  const formatColumnStyle = this.convertAdaptableStyleToCSS(formatColumn.Style);
959
+ if (formatColumn.CellAlignment) {
960
+ switch (formatColumn.CellAlignment) {
961
+ case 'Left':
962
+ style.textAlign = 'left';
963
+ break;
964
+ case 'Right':
965
+ style.textAlign = 'right';
966
+ break;
967
+ case 'Center':
968
+ style.textAlign = 'center';
969
+ break;
970
+ }
971
+ }
954
972
  return Object.assign(Object.assign({}, style), formatColumnStyle);
955
973
  }, {});
956
974
  }
@@ -974,19 +992,6 @@ class Adaptable {
974
992
  }
975
993
  style = Object.assign(Object.assign({}, style), this.getFormatColumnColumnStyle(activeFormatColumnsWithStyle));
976
994
  }
977
- if (formatColumn.CellAlignment) {
978
- switch (formatColumn.CellAlignment) {
979
- case 'Left':
980
- style.textAlign = 'left';
981
- break;
982
- case 'Right':
983
- style.textAlign = 'right';
984
- break;
985
- case 'Center':
986
- style.textAlign = 'center';
987
- break;
988
- }
989
- }
990
995
  return style;
991
996
  }
992
997
  getFormatColumnCellClass(formatColumns, abColumn, params) {
@@ -3205,16 +3210,20 @@ class Adaptable {
3205
3210
  };
3206
3211
  const formatColumn = this.api.formatColumnApi.getActiveFormatColumnForColumn(abColumn);
3207
3212
  const formatColumnsWithStyle = this.api.formatColumnApi.getColumnFormatColumnsWithStyle(abColumn);
3213
+ let styledColumn = this.api.styledColumnApi.getStyledColumnByColumnId(colId);
3214
+ if (styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.IsSuspended) {
3215
+ styledColumn = null;
3216
+ }
3208
3217
  const conditionalStyles = this.api.conditionalStyleApi.getConditionalStylesForColumn(abColumn);
3209
3218
  const quickSearchStyle = this.getQuickSearchCellStyle();
3210
3219
  const hasQuickSearchStyle = quickSearchStyle != undefined;
3211
3220
  const cellStyle = (params) => {
3212
- const formatColumnCellStyle = formatColumn
3221
+ const formatColumnCellStyle = formatColumn && !styledColumn // TODO: remove after refactor columnStyle
3213
3222
  ? this.getFormatColumnCellStyle(abColumn, formatColumn, formatColumnsWithStyle, params)
3214
3223
  : undefined;
3215
3224
  const isQuickSearchActive = hasQuickSearchStyle && this.isQuickSearchActive(abColumn, params);
3216
3225
  const conditionalStyleObj = this.getConditionalStyleCellStyle(conditionalStyles, abColumn, params);
3217
- const result = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, defaultCellStyle), this.getReadOnlyCellStyle(abColumn, params)), this.getEditableCellStyle(abColumn, params)), (typeof userCellStyle === 'function' ? userCellStyle(params) : userCellStyle)), formatColumnCellStyle), conditionalStyleObj), (isQuickSearchActive ? quickSearchStyle : undefined)), this.getAlertCellStyle(abColumn, params)), this.getFlashingCellStyle(abColumn, params)), this.getCellHighlightStyle(abColumn, params));
3226
+ const result = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, defaultCellStyle), this.getReadOnlyCellStyle(abColumn, params)), this.getEditableCellStyle(abColumn, params)), (typeof userCellStyle === 'function' ? userCellStyle(params) : userCellStyle)), formatColumnCellStyle), (styledColumn ? this.getStyledColumnStyle(styledColumn, abColumn, params) : {})), conditionalStyleObj), (isQuickSearchActive ? quickSearchStyle : undefined)), this.getAlertCellStyle(abColumn, params)), this.getFlashingCellStyle(abColumn, params)), this.getCellHighlightStyle(abColumn, params));
3218
3227
  return result;
3219
3228
  };
3220
3229
  return cellStyle;
@@ -3236,10 +3245,12 @@ class Adaptable {
3236
3245
  const readonlyClassName = this.getReadonlyCellClass(abColumn, params);
3237
3246
  const highlightAlertClassName = this.getAlertCellClass(abColumn, params);
3238
3247
  const flashingClassName = this.getFlashingCellClass(abColumn, params);
3248
+ const styledColumn = this.api.styledColumnApi.getStyledColumnByColumnId(colId);
3249
+ const hasStyledColumn = !!styledColumn && !styledColumn.IsSuspended;
3239
3250
  const returnValue = [
3240
3251
  this.getExcelClassNameForCell(colId, primaryKeyValue),
3241
3252
  typeof userCellClass === 'function' ? userCellClass(params) : userCellClass,
3242
- formatColumns.length
3253
+ !hasStyledColumn && formatColumns.length
3243
3254
  ? this.getFormatColumnCellClass(formatColumns, abColumn, params)
3244
3255
  : null,
3245
3256
  hasConditionalStylesWithClassNames
@@ -3254,7 +3265,9 @@ class Adaptable {
3254
3265
  // we flatten the array because some rules ('userCellClass',conditionalStyles etc) might return a string[]
3255
3266
  .flat()
3256
3267
  .filter((x) => !!x);
3257
- return returnValue.length ? returnValue : undefined;
3268
+ const result = returnValue.length ? returnValue : undefined;
3269
+ // console.log(result);
3270
+ return result;
3258
3271
  };
3259
3272
  return cellClass;
3260
3273
  });
@@ -3300,10 +3313,19 @@ class Adaptable {
3300
3313
  }
3301
3314
  setupColumnCellRenderer({ col, colId, abColumn }) {
3302
3315
  this.setColDefProperty(col, 'cellRenderer', () => {
3316
+ const styledColumn = this.api.styledColumnApi.getStyledColumnByColumnId(abColumn.columnId);
3317
+ if (styledColumn && !styledColumn.IsSuspended) {
3318
+ if (styledColumn.PercentBarStyle) {
3319
+ return this.agGridHelper.createPercentBarRendererComp(styledColumn, abColumn);
3320
+ }
3321
+ if (styledColumn.CheckBoxStyle) {
3322
+ return this.agGridHelper.createCheckboxRendererComp(abColumn.columnId, abColumn.readOnly);
3323
+ }
3324
+ }
3303
3325
  const formatColumn = this.api.formatColumnApi.getActiveFormatColumnForColumn(abColumn);
3304
3326
  if (formatColumn && !(formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.IsSuspended) && formatColumn.ColumnStyle) {
3305
3327
  if (formatColumn.ColumnStyle.PercentBarStyle) {
3306
- return this.agGridHelper.createPercentBarRendererComp(formatColumn, abColumn);
3328
+ return this.agGridHelper.createPercentBarRendererComp(formatColumn.ColumnStyle, abColumn);
3307
3329
  }
3308
3330
  if (formatColumn.ColumnStyle.CheckBoxStyle) {
3309
3331
  return this.agGridHelper.createCheckboxRendererComp(abColumn.columnId, abColumn.readOnly);
@@ -3322,8 +3344,8 @@ class Adaptable {
3322
3344
  formatColumn.ColumnStyle.PercentBarStyle.ToolTipText) {
3323
3345
  if ((_a = formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.ColumnStyle) === null || _a === void 0 ? void 0 : _a.PercentBarStyle) {
3324
3346
  return (params) => {
3325
- const min = this.api.formatColumnApi.getNumericStyleMinValue(formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.ColumnStyle, abColumn, params.node, params.value);
3326
- const max = this.api.formatColumnApi.getNumericStyleMaxValue(formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.ColumnStyle, abColumn, params.node, params.value);
3347
+ const min = this.api.styledColumnApi.getNumericStyleMinValue(formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.ColumnStyle, abColumn, params.node, params.value);
3348
+ const max = this.api.styledColumnApi.getNumericStyleMaxValue(formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.ColumnStyle, abColumn, params.node, params.value);
3327
3349
  const textOptions = formatColumn.ColumnStyle.PercentBarStyle.ToolTipText;
3328
3350
  let returnValue = '';
3329
3351
  if (textOptions.includes('CellValue')) {
@@ -4443,14 +4465,6 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
4443
4465
  }
4444
4466
  }
4445
4467
  }
4446
- getFormatColumnRowStyle(formatColumns, params) {
4447
- if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(formatColumns)) {
4448
- const formatColumnWithRowStyle = formatColumns.find((formatColumn) => this.api.formatColumnApi.isFormatColumnActiveForRow(formatColumn, params));
4449
- if (formatColumnWithRowStyle) {
4450
- return this.convertAdaptableStyleToCSS(formatColumnWithRowStyle.Style);
4451
- }
4452
- }
4453
- }
4454
4468
  getGridOptionsApi() {
4455
4469
  if (!this.gridOptions.api) {
4456
4470
  (0, LoggingHelper_1.ConsoleLogError)('There is a problem with your instance of AG Grid - it has no gridApi object. Please contact Support.');
@@ -1,30 +1,72 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FilterWrapperFactory = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const react_1 = require("react");
4
7
  const FilterForm_1 = require("../View/Components/FilterForm/FilterForm");
5
8
  let FilterWrapperFactory = (adaptable) => {
9
+ function isFilterActive(colId) {
10
+ // we need this here
11
+ if (adaptable.isDestroyed) {
12
+ return false;
13
+ }
14
+ //make the small filter icon to appear when there is a filter
15
+ return adaptable.api.filterApi.getColumnFilters().findIndex((x) => x.ColumnId == colId) > -1;
16
+ }
17
+ function getFilterContext(colId, hidePopup) {
18
+ let column = adaptable.api.columnApi.getColumnFromId(colId);
19
+ let filterContext = {
20
+ Column: column,
21
+ Adaptable: adaptable,
22
+ ShowCloseButton: hidePopup,
23
+ };
24
+ return filterContext;
25
+ }
26
+ function getContainerId(colId) {
27
+ return 'filter_' + colId + '_' + adaptable.adaptableOptions.adaptableId;
28
+ }
29
+ if (adaptable.variant === 'react') {
30
+ return (0, react_1.forwardRef)(function ReactFilterWrapper(props, ref) {
31
+ const [filterContext, setFilterContext] = (0, react_1.useState)(null);
32
+ const colId = props.column.getId();
33
+ const column = adaptable.api.columnApi.getColumnFromId(colId);
34
+ (0, react_1.useImperativeHandle)(ref, () => {
35
+ return {
36
+ isFilterActive: () => isFilterActive(colId),
37
+ afterGuiAttached: (params) => {
38
+ var _a;
39
+ const hidePopup = (_a = params === null || params === void 0 ? void 0 : params.hidePopup) !== null && _a !== void 0 ? _a : null;
40
+ const filterContext = getFilterContext(colId, !!hidePopup);
41
+ adaptable.hideFilterFormPopup = hidePopup;
42
+ setFilterContext(filterContext);
43
+ },
44
+ getModel: () => { },
45
+ setModel: () => { },
46
+ //we do not filter here.... we filter using the doesExternalFilterPass. Not sure there is a difference....
47
+ doesFilterPass: () => true,
48
+ };
49
+ });
50
+ if (!column || !filterContext) {
51
+ return null;
52
+ }
53
+ return React.createElement("div", { id: getContainerId(colId) }, (0, FilterForm_1.FilterFormReact)(filterContext));
54
+ });
55
+ }
6
56
  return class FilterWrapper {
7
57
  init(params) {
8
58
  this.params = params;
9
59
  this.column = params.column;
10
60
  this.filterContainer = document.createElement('div');
11
- this.filterContainer.id =
12
- 'filter_' + this.params.column.getColId() + '_' + adaptable.adaptableOptions.adaptableId;
13
- }
14
- isFilterActive() {
15
- // we need this here
16
- if (adaptable.isDestroyed) {
17
- return false;
18
- }
19
- //make the small filter icon to appear when there is a filter
20
- return (adaptable.api.filterApi
21
- .getColumnFilters()
22
- .findIndex((x) => x.ColumnId == this.params.column.getColId()) > -1);
61
+ this.filterContainer.id = getContainerId(this.params.column.getColId());
23
62
  }
24
63
  doesFilterPass(params) {
25
64
  //we do not filter here.... we filter using the doesExternalFilterPass. Not sure there is a difference....
26
65
  return true;
27
66
  }
67
+ isFilterActive() {
68
+ return isFilterActive(this.params.column.getColId());
69
+ }
28
70
  getModel() {
29
71
  //
30
72
  }
@@ -35,17 +77,14 @@ let FilterWrapperFactory = (adaptable) => {
35
77
  return this.filterContainer;
36
78
  }
37
79
  afterGuiAttached(params) {
38
- var _a;
80
+ var _a, _b;
39
81
  //we always unmount first so the autofocus from the form works... in other grids we unmount when hidden
40
82
  (_a = this.unmountReactRoot) === null || _a === void 0 ? void 0 : _a.call(this);
41
83
  let column = adaptable.api.columnApi.getColumnFromId(this.column.getColId());
42
84
  if (column) {
43
- let filterContext = {
44
- Column: column,
45
- Adaptable: adaptable,
46
- ShowCloseButton: params != null && params.hidePopup != null,
47
- };
48
- adaptable.hideFilterFormPopup = params ? params.hidePopup : null;
85
+ const hidePopup = (_b = params === null || params === void 0 ? void 0 : params.hidePopup) !== null && _b !== void 0 ? _b : null;
86
+ const filterContext = getFilterContext(this.column.getColId(), !!hidePopup);
87
+ adaptable.hideFilterFormPopup = hidePopup;
49
88
  this.unmountReactRoot = adaptable.renderReactRoot((0, FilterForm_1.FilterFormReact)(filterContext), this.filterContainer);
50
89
  }
51
90
  }