@adaptabletools/adaptable-cjs 20.0.0-canary.2 → 20.0.0-canary.4
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/package.json +1 -1
- package/src/AdaptableOptions/CellSummaryOptions.d.ts +1 -1
- package/src/AdaptableOptions/ContainerOptions.d.ts +0 -7
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +0 -1
- package/src/AdaptableOptions/EditOptions.d.ts +1 -1
- package/src/AdaptableOptions/ExportOptions.d.ts +4 -18
- package/src/AdaptableOptions/PredicateOptions.d.ts +4 -4
- package/src/Api/Implementation/AdaptableApiImpl.js +1 -0
- package/src/Api/Implementation/ExportApiImpl.js +3 -2
- package/src/Api/Implementation/ScheduleApiImpl.js +1 -1
- package/src/Api/Implementation/StyledColumnApiImpl.js +1 -1
- package/src/Api/Internal/EventInternalApi.js +6 -1
- package/src/Api/Internal/ExportInternalApi.js +1 -1
- package/src/PredefinedConfig/Common/AdaptableColumnContext.d.ts +1 -1
- package/src/PredefinedConfig/ExportState.d.ts +3 -3
- package/src/PredefinedConfig/LayoutState.d.ts +14 -14
- package/src/PredefinedConfig/StyledColumnState.d.ts +1 -1
- package/src/Strategy/StyledColumnModule.js +6 -6
- package/src/Utilities/ObjectFactory.js +1 -0
- 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/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 +1 -6
- package/src/agGrid/AdaptableAgGrid.js +24 -42
- package/src/agGrid/AgGridAdapter.js +3 -0
- package/src/agGrid/AgGridColumnAdapter.js +5 -3
- package/src/components/ColorPicker/ColorPicker.js +2 -2
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +0 -15
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/migration/VersionUpgrade20.d.ts +1 -0
- package/src/migration/VersionUpgrade20.js +25 -0
- package/src/types.d.ts +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
|
@@ -18,7 +18,7 @@ const renderStyledColumnTypeSummary = (data) => {
|
|
|
18
18
|
else if (data.PercentBarStyle) {
|
|
19
19
|
type = 'Percent Bar';
|
|
20
20
|
}
|
|
21
|
-
else if (data.
|
|
21
|
+
else if (data.SparklineStyle) {
|
|
22
22
|
type = 'Spark Line';
|
|
23
23
|
}
|
|
24
24
|
else if (data.BadgeStyle) {
|
|
@@ -38,7 +38,7 @@ const StyledColumnWizardTypeSection = (props) => {
|
|
|
38
38
|
};
|
|
39
39
|
delete newStyledColumn.GradientStyle;
|
|
40
40
|
delete newStyledColumn.PercentBarStyle;
|
|
41
|
-
delete newStyledColumn.
|
|
41
|
+
delete newStyledColumn.SparklineStyle;
|
|
42
42
|
delete newStyledColumn.BadgeStyle;
|
|
43
43
|
switch (type) {
|
|
44
44
|
case 'gradient':
|
|
@@ -48,7 +48,7 @@ const StyledColumnWizardTypeSection = (props) => {
|
|
|
48
48
|
newStyledColumn.PercentBarStyle = {};
|
|
49
49
|
break;
|
|
50
50
|
case 'sparkline':
|
|
51
|
-
newStyledColumn.
|
|
51
|
+
newStyledColumn.SparklineStyle = {
|
|
52
52
|
options: {
|
|
53
53
|
type: 'line',
|
|
54
54
|
},
|
|
@@ -69,7 +69,7 @@ const StyledColumnWizardTypeSection = (props) => {
|
|
|
69
69
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
70
70
|
React.createElement(TypeRadio_1.TypeRadio, { text: "Gradient", description: "Colour each cell in the column using a Gradient value (Numeric Columns)", checked: Boolean(data.GradientStyle), onClick: () => handleTypeChange('gradient') }),
|
|
71
71
|
React.createElement(TypeRadio_1.TypeRadio, { text: "Percent Bar", description: "Display a coloured Bar where the width is based on the cell (Numeric Columns)", checked: Boolean(data.PercentBarStyle), onClick: () => handleTypeChange('percent') }),
|
|
72
|
-
adaptable.api.styledColumnApi.canDisplaySparklines() && (React.createElement(TypeRadio_1.TypeRadio, { text: "Sparkline", description: "Render the column as a Sparkline (Numeric Array Columns)", checked: Boolean(data.
|
|
72
|
+
adaptable.api.styledColumnApi.canDisplaySparklines() && (React.createElement(TypeRadio_1.TypeRadio, { text: "Sparkline", description: "Render the column as a Sparkline (Numeric Array Columns)", checked: Boolean(data.SparklineStyle), onClick: () => handleTypeChange('sparkline') })),
|
|
73
73
|
React.createElement(TypeRadio_1.TypeRadio, { text: "Badge", description: "Display the column's values as Badges (All Columns)", checked: Boolean(data.BadgeStyle), onClick: () => handleTypeChange('badge') })))));
|
|
74
74
|
};
|
|
75
75
|
exports.StyledColumnWizardTypeSection = StyledColumnWizardTypeSection;
|
|
@@ -61,11 +61,6 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
61
61
|
hasAutogeneratedPrimaryKey: boolean;
|
|
62
62
|
hasAdaptableToolPanel: boolean;
|
|
63
63
|
private initWithLazyData;
|
|
64
|
-
/**
|
|
65
|
-
* once layouts are properly handled with the new aggrid methods & events
|
|
66
|
-
* we can remove this hack
|
|
67
|
-
*/
|
|
68
|
-
private previousAgGridLayoutState;
|
|
69
64
|
_rawAdaptableOptions: AdaptableOptions;
|
|
70
65
|
adaptableOptions: AdaptableOptions;
|
|
71
66
|
_isDetailGrid: boolean;
|
|
@@ -147,6 +142,7 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
147
142
|
*/
|
|
148
143
|
static _initInternal(config: AdaptableInitInternalConfig): Promise<AdaptableApi>;
|
|
149
144
|
private _initAdaptableAgGrid;
|
|
145
|
+
midwayDestroy(): void;
|
|
150
146
|
normalizeAdaptableState(state: AdaptableState, agGridOptions: NormalizeAdaptableStateOptions): AdaptableState;
|
|
151
147
|
private normaliseLayoutState;
|
|
152
148
|
private normaliseToolPanelState;
|
|
@@ -337,6 +333,5 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
337
333
|
refreshLayout(): void;
|
|
338
334
|
private isRowGroupDifferentInLayout;
|
|
339
335
|
private onLayoutChange;
|
|
340
|
-
private getColumnSorts;
|
|
341
336
|
}
|
|
342
337
|
export {};
|
|
@@ -135,11 +135,6 @@ const adaptableInstances = {};
|
|
|
135
135
|
const publishTimestamp = Number(EnvVars_1.ADAPTABLE_PUBLISH_TIMESTAMP);
|
|
136
136
|
class AdaptableAgGrid {
|
|
137
137
|
constructor(config) {
|
|
138
|
-
/**
|
|
139
|
-
* once layouts are properly handled with the new aggrid methods & events
|
|
140
|
-
* we can remove this hack
|
|
141
|
-
*/
|
|
142
|
-
this.previousAgGridLayoutState = '';
|
|
143
138
|
this.filteredOutPrimaryKeys = new Set();
|
|
144
139
|
this.columnMinMaxValuesCache = {};
|
|
145
140
|
this.renderReactRoot = (node, container) => (0, renderReactRoot_1.renderReactRoot)(node, container);
|
|
@@ -299,11 +294,6 @@ class AdaptableAgGrid {
|
|
|
299
294
|
this.api = new AdaptableApiImpl_1.AdaptableApiImpl(this);
|
|
300
295
|
this.forPlugins((plugin) => plugin.afterInitApi(this, this.api));
|
|
301
296
|
this.lifecycleState = 'initAdaptableState';
|
|
302
|
-
// just in case Adaptable was destroyed while loading the store (which is an async operation)
|
|
303
|
-
if (this.isDestroyed) {
|
|
304
|
-
return Promise.reject('Adaptable was destroyed while loading the store.');
|
|
305
|
-
// FIXME AFL MIG: is this enough?! talk with the team
|
|
306
|
-
}
|
|
307
297
|
this.initServices();
|
|
308
298
|
this.forPlugins((plugin) => plugin.afterInitServices(this));
|
|
309
299
|
this.adaptableModules = this.initModules();
|
|
@@ -334,6 +324,7 @@ class AdaptableAgGrid {
|
|
|
334
324
|
perfLoadStore.end();
|
|
335
325
|
// just in case Adaptable was destroyed while loading the store (which is an async operation)
|
|
336
326
|
if (this.isDestroyed) {
|
|
327
|
+
this.midwayDestroy();
|
|
337
328
|
return Promise.reject('Adaptable was destroyed while loading the store.');
|
|
338
329
|
// FIXME AFL MIG: is this enough?! talk with the team
|
|
339
330
|
}
|
|
@@ -369,6 +360,7 @@ class AdaptableAgGrid {
|
|
|
369
360
|
this.agGridColumnAdapter.setupColumnFloatingFilterTemporarily(gridOptions);
|
|
370
361
|
const agGridApi = await this.initializeAgGrid(gridOptions, config.modules, config.renderAgGridFrameworkComponent);
|
|
371
362
|
if (agGridApi === false) {
|
|
363
|
+
this.midwayDestroy();
|
|
372
364
|
this.logger.consoleError(`Adaptable failed to initialize AG Grid!`);
|
|
373
365
|
return Promise.reject('Adaptable failed to initialize AG Grid!');
|
|
374
366
|
}
|
|
@@ -476,6 +468,12 @@ class AdaptableAgGrid {
|
|
|
476
468
|
perfInitAdaptableAgGrid.end();
|
|
477
469
|
return Promise.resolve(this.api);
|
|
478
470
|
}
|
|
471
|
+
midwayDestroy() {
|
|
472
|
+
this.destroy({
|
|
473
|
+
destroyAgGrid: false,
|
|
474
|
+
unmount: false,
|
|
475
|
+
});
|
|
476
|
+
}
|
|
479
477
|
normalizeAdaptableState(state, agGridOptions) {
|
|
480
478
|
state = this.normaliseLayoutState(state, agGridOptions);
|
|
481
479
|
state = this.normaliseToolPanelState(state);
|
|
@@ -1046,7 +1044,14 @@ You need to define at least one Layout!`);
|
|
|
1046
1044
|
*/
|
|
1047
1045
|
async initializeAgGrid(gridOptions, modules, renderAgGridFrameworkComponent) {
|
|
1048
1046
|
if (renderAgGridFrameworkComponent) {
|
|
1049
|
-
|
|
1047
|
+
let result = false;
|
|
1048
|
+
try {
|
|
1049
|
+
result = await renderAgGridFrameworkComponent(gridOptions);
|
|
1050
|
+
}
|
|
1051
|
+
catch (err) {
|
|
1052
|
+
console.log('Failed to get AG Grid API');
|
|
1053
|
+
result = false;
|
|
1054
|
+
}
|
|
1050
1055
|
if (result === false) {
|
|
1051
1056
|
return false;
|
|
1052
1057
|
}
|
|
@@ -1054,6 +1059,10 @@ You need to define at least one Layout!`);
|
|
|
1054
1059
|
// framework wrapper may have altered the context value via props
|
|
1055
1060
|
// in that case, we have to re-populate it with the Adaptable context values
|
|
1056
1061
|
const agGridContext = agGridApi.getGridOption('context');
|
|
1062
|
+
if (!agGridContext) {
|
|
1063
|
+
console.log('Failed to get AG Grid context');
|
|
1064
|
+
return false;
|
|
1065
|
+
}
|
|
1057
1066
|
if (!agGridContext.__adaptable) {
|
|
1058
1067
|
agGridContext.__adaptable = this;
|
|
1059
1068
|
agGridContext.adaptableApi = this.api;
|
|
@@ -1339,7 +1348,7 @@ You need to define at least one Layout!`);
|
|
|
1339
1348
|
return currentLayout.AutoSizeColumns;
|
|
1340
1349
|
}
|
|
1341
1350
|
autoSizeLayoutIfNeeded() {
|
|
1342
|
-
if (this.shouldAutoSizeLayout()) {
|
|
1351
|
+
if (this.isAvailable && this.shouldAutoSizeLayout()) {
|
|
1343
1352
|
requestAnimationFrame(() => {
|
|
1344
1353
|
if (this.isAvailable) {
|
|
1345
1354
|
this.autoSizeAllColumns();
|
|
@@ -2796,8 +2805,9 @@ You need to define at least one Layout!`);
|
|
|
2796
2805
|
}
|
|
2797
2806
|
}
|
|
2798
2807
|
this.__prevLayoutForOnChange = undefined;
|
|
2799
|
-
this.layoutManager
|
|
2800
|
-
this.
|
|
2808
|
+
this.layoutManager?.destroy();
|
|
2809
|
+
this.layoutManager = null;
|
|
2810
|
+
this.filteredOutPrimaryKeys?.clear();
|
|
2801
2811
|
if (this.agGridAdapter?.getAgGridApi() && !this.agGridAdapter.getAgGridApi().isDestroyed()) {
|
|
2802
2812
|
this.agGridAdapter
|
|
2803
2813
|
.getAgGridApi()
|
|
@@ -2876,7 +2886,6 @@ You need to define at least one Layout!`);
|
|
|
2876
2886
|
if (config?.destroyAgGrid === true) {
|
|
2877
2887
|
this.agGridAdapter.getAgGridApi()?.destroy();
|
|
2878
2888
|
}
|
|
2879
|
-
this.previousAgGridLayoutState = '';
|
|
2880
2889
|
const gridContainerElement = this.getAgGridContainerElement();
|
|
2881
2890
|
if (gridContainerElement) {
|
|
2882
2891
|
gridContainerElement.removeEventListener('keydown', this.agGridListenerKeydown, true);
|
|
@@ -2887,8 +2896,6 @@ You need to define at least one Layout!`);
|
|
|
2887
2896
|
this.agGridListenerMouseLeave = null;
|
|
2888
2897
|
}
|
|
2889
2898
|
this.api._internalDestroySelf();
|
|
2890
|
-
this.layoutManager?.destroy();
|
|
2891
|
-
this.layoutManager = null;
|
|
2892
2899
|
this.agGridOptionsService?.destroy();
|
|
2893
2900
|
this.agGridOptionsService = null;
|
|
2894
2901
|
this.agGridAdapter?.destroy();
|
|
@@ -3344,30 +3351,5 @@ You need to define at least one Layout!`);
|
|
|
3344
3351
|
this.__prevLayoutForOnChange = layout;
|
|
3345
3352
|
this.api.layoutApi.createOrUpdateLayout(layout);
|
|
3346
3353
|
}
|
|
3347
|
-
getColumnSorts() {
|
|
3348
|
-
const columnSorts = [];
|
|
3349
|
-
const { columnApi } = this.api;
|
|
3350
|
-
const columnState = this.agGridAdapter.getAgGridApi().getColumnState();
|
|
3351
|
-
columnState.forEach((colState) => {
|
|
3352
|
-
const { colId } = colState;
|
|
3353
|
-
if (columnApi.isAutoRowGroupColumn(colId)) {
|
|
3354
|
-
return;
|
|
3355
|
-
}
|
|
3356
|
-
if (colState.sort && colState.sortIndex != null) {
|
|
3357
|
-
columnSorts.push({
|
|
3358
|
-
ColumnId: colId,
|
|
3359
|
-
SortOrder: colState.sort === 'asc' ? 'Asc' : 'Desc',
|
|
3360
|
-
SortIndex: colState.sortIndex,
|
|
3361
|
-
});
|
|
3362
|
-
}
|
|
3363
|
-
});
|
|
3364
|
-
columnSorts.sort((a, b) => a.SortIndex - b.SortIndex);
|
|
3365
|
-
return columnSorts.map((c) => {
|
|
3366
|
-
return {
|
|
3367
|
-
ColumnId: c.ColumnId,
|
|
3368
|
-
SortOrder: c.SortOrder,
|
|
3369
|
-
};
|
|
3370
|
-
});
|
|
3371
|
-
}
|
|
3372
3354
|
}
|
|
3373
3355
|
exports.AdaptableAgGrid = AdaptableAgGrid;
|
|
@@ -35,6 +35,9 @@ class AgGridAdapter {
|
|
|
35
35
|
}
|
|
36
36
|
destroy() {
|
|
37
37
|
delete DANGER_AG_GRID_BEANS_MAP[this._agGridId];
|
|
38
|
+
this.initialGridOptions = null;
|
|
39
|
+
this.DANGER_gridApi_from_args = null;
|
|
40
|
+
this.DANGER_USE_GETTER_gridApi = null;
|
|
38
41
|
this.DANGER_updateGridOptionsMonkeyPatcher = null;
|
|
39
42
|
this._adaptableInstance = null;
|
|
40
43
|
}
|
|
@@ -16,6 +16,7 @@ const Helper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/Helper"))
|
|
|
16
16
|
const AdaptableNumberEditor_1 = require("./editors/AdaptableNumberEditor");
|
|
17
17
|
const AdaptableDateEditor_1 = require("./editors/AdaptableDateEditor");
|
|
18
18
|
const AgGridExportAdapter_1 = require("./AgGridExportAdapter");
|
|
19
|
+
const AdaptableHelper_1 = require("../Utilities/Helpers/AdaptableHelper");
|
|
19
20
|
function getEditorForColumnDataType(columnDataType, variant) {
|
|
20
21
|
if (columnDataType === 'number') {
|
|
21
22
|
return variant === 'react' ? AdaptableNumberEditor_1.AdaptableReactNumberEditor : AdaptableNumberEditor_1.AdaptableNumberEditor;
|
|
@@ -283,7 +284,7 @@ class AgGridColumnAdapter {
|
|
|
283
284
|
if (styledColumn.BadgeStyle) {
|
|
284
285
|
return (0, BadgeRenderer_1.getBadgeRendererForColumn)(styledColumn.BadgeStyle, abColumn, this.adaptableApi);
|
|
285
286
|
}
|
|
286
|
-
if (styledColumn.
|
|
287
|
+
if (styledColumn.SparklineStyle) {
|
|
287
288
|
return 'agSparklineCellRenderer';
|
|
288
289
|
}
|
|
289
290
|
}
|
|
@@ -291,8 +292,9 @@ class AgGridColumnAdapter {
|
|
|
291
292
|
this.setColDefProperty(col, 'cellRendererParams', (userDefined) => {
|
|
292
293
|
const styledColumn = this.adaptableApi.styledColumnApi.getStyledColumnForColumnId(abColumn.columnId);
|
|
293
294
|
if (styledColumn && !styledColumn.IsSuspended) {
|
|
294
|
-
if (styledColumn.
|
|
295
|
-
const
|
|
295
|
+
if (styledColumn.SparklineStyle) {
|
|
296
|
+
const sanitizedSparklineOptions = AdaptableHelper_1.AdaptableHelper.removeAdaptableObjectPrimitives(styledColumn.SparklineStyle.options);
|
|
297
|
+
const sparklineOptions = (0, merge_1.default)({}, userDefined?.sparklineOptions, sanitizedSparklineOptions);
|
|
296
298
|
return {
|
|
297
299
|
...userDefined,
|
|
298
300
|
sparklineOptions,
|
|
@@ -35,11 +35,11 @@ exports.ColorPicker = React.forwardRef((props, ref) => {
|
|
|
35
35
|
}, value: preparedValue, ref: ref, type: "color", style: {
|
|
36
36
|
width: 70,
|
|
37
37
|
padding: 0 /* we need this to be 0, since otherwise on Windows browsers, the chosen color cannot be seen */,
|
|
38
|
-
}, list: "ABcolorChoices" }),
|
|
38
|
+
}, list: "ABcolorChoices", title: props.title }),
|
|
39
39
|
ABcolorChoices,
|
|
40
40
|
includeAlpha && (React.createElement(rebass_1.Flex, { alignItems: "center" },
|
|
41
41
|
React.createElement(rebass_1.Box, { mr: 1 }, "Opacity"),
|
|
42
|
-
React.createElement(Input_1.default, { className: "ab-ColorPicker-range", style: { background: rangeBackround }, value: alpha, onChange: (event) => {
|
|
42
|
+
React.createElement(Input_1.default, { disabled: props.disabled, className: "ab-ColorPicker-range", style: { background: rangeBackround }, value: alpha, onChange: (event) => {
|
|
43
43
|
const color = (0, tinycolor2_1.default)(value).setAlpha(event.target.value).toRgbString();
|
|
44
44
|
props.onChange(color);
|
|
45
45
|
}, min: 0, max: 1, step: 0.01, type: "range" })))));
|
package/src/env.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = {
|
|
4
4
|
NEXT_PUBLIC_INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
|
|
5
|
-
PUBLISH_TIMESTAMP:
|
|
6
|
-
VERSION: "20.0.0-canary.
|
|
5
|
+
PUBLISH_TIMESTAMP: 1740989636450 || Date.now(),
|
|
6
|
+
VERSION: "20.0.0-canary.4" || '--current-version--',
|
|
7
7
|
};
|
|
@@ -2721,16 +2721,6 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
2721
2721
|
kind: string;
|
|
2722
2722
|
desc: string;
|
|
2723
2723
|
};
|
|
2724
|
-
DataFormatTypeContext: {
|
|
2725
|
-
name: string;
|
|
2726
|
-
kind: string;
|
|
2727
|
-
desc: string;
|
|
2728
|
-
props: {
|
|
2729
|
-
name: string;
|
|
2730
|
-
kind: string;
|
|
2731
|
-
desc: string;
|
|
2732
|
-
}[];
|
|
2733
|
-
};
|
|
2734
2724
|
DataImportFileHandler: {
|
|
2735
2725
|
name: string;
|
|
2736
2726
|
kind: string;
|
|
@@ -2967,11 +2957,6 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
2967
2957
|
ref: string;
|
|
2968
2958
|
})[];
|
|
2969
2959
|
};
|
|
2970
|
-
ExportableColumnContext: {
|
|
2971
|
-
name: string;
|
|
2972
|
-
kind: string;
|
|
2973
|
-
desc: string;
|
|
2974
|
-
};
|
|
2975
2960
|
ExportFormContext: {
|
|
2976
2961
|
name: string;
|
|
2977
2962
|
kind: string;
|