@adaptabletools/adaptable 12.0.7 → 12.1.0-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/base.css +231 -120
- package/bundle.cjs.js +142 -114
- package/index.css +268 -130
- package/package.json +3 -3
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -0
- package/src/AdaptableOptions/SettingsPanelOptions.d.ts +1 -2
- package/src/Api/ColumnApi.d.ts +5 -0
- package/src/Api/EventApi.d.ts +13 -1
- package/src/Api/Events/AdaptableStateReloaded.d.ts +23 -0
- package/src/Api/Events/AdaptableStateReloaded.js +2 -0
- package/src/Api/FilterApi.d.ts +15 -1
- package/src/Api/Implementation/CalculatedColumnApiImpl.js +2 -3
- package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -0
- package/src/Api/Implementation/ColumnApiImpl.js +10 -0
- package/src/Api/Implementation/ConfigApiImpl.js +11 -0
- package/src/Api/Implementation/FilterApiImpl.d.ts +6 -1
- package/src/Api/Implementation/FilterApiImpl.js +58 -0
- package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -1
- package/src/Api/Implementation/LayoutApiImpl.js +8 -16
- package/src/Api/Implementation/ScheduleApiImpl.js +4 -1
- package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +7 -2
- package/src/PredefinedConfig/Common/CellSummary.d.ts +2 -6
- package/src/PredefinedConfig/LayoutState.d.ts +2 -0
- package/src/PredefinedConfig/ScheduleState.d.ts +4 -0
- package/src/Redux/Store/AdaptableStore.js +12 -6
- package/src/Strategy/AdaptableModuleBase.d.ts +2 -0
- package/src/Strategy/AdaptableModuleBase.js +6 -0
- package/src/Strategy/AlertModule.js +2 -2
- package/src/Strategy/CalculatedColumnModule.d.ts +2 -0
- package/src/Strategy/CalculatedColumnModule.js +4 -0
- package/src/Strategy/CellSummaryModule.js +4 -3
- package/src/Strategy/CustomSortModule.js +2 -2
- package/src/Strategy/ExportModule.js +2 -2
- package/src/Strategy/FlashingCellModule.js +3 -3
- package/src/Strategy/FormatColumnModule.js +2 -2
- package/src/Strategy/LayoutModule.js +10 -17
- package/src/Strategy/ShortcutModule.js +1 -1
- package/src/Strategy/TeamSharingModule.js +4 -2
- package/src/Strategy/Utilities/{getAlertBehaviourViewItems.d.ts → Alert/getAlertBehaviourViewItems.d.ts} +0 -0
- package/src/Strategy/Utilities/{getAlertBehaviourViewItems.js → Alert/getAlertBehaviourViewItems.js} +2 -2
- package/src/Strategy/Utilities/{getAlertPreviewViewItems.d.ts → Alert/getAlertPreviewViewItems.d.ts} +2 -2
- package/src/Strategy/Utilities/{getAlertPreviewViewItems.js → Alert/getAlertPreviewViewItems.js} +2 -2
- package/src/Strategy/Utilities/{getCustomSortColumnViewItems.d.ts → CustomSort/getCustomSortColumnViewItems.d.ts} +1 -1
- package/src/Strategy/Utilities/{getCustomSortColumnViewItems.js → CustomSort/getCustomSortColumnViewItems.js} +0 -0
- package/src/Strategy/Utilities/{getCustomSortSortOrderViewItems.d.ts → CustomSort/getCustomSortSortOrderViewItems.d.ts} +1 -1
- package/src/Strategy/Utilities/{getCustomSortSortOrderViewItems.js → CustomSort/getCustomSortSortOrderViewItems.js} +0 -0
- package/src/Strategy/Utilities/Export/getExportColumnsViewItems.d.ts +3 -0
- package/src/Strategy/Utilities/{getExportColumnsViewItems.js → Export/getExportColumnsViewItems.js} +0 -0
- package/src/Strategy/Utilities/{getExportRowsViewItems.d.ts → Export/getExportRowsViewItems.d.ts} +0 -0
- package/src/Strategy/Utilities/{getExportRowsViewItems.js → Export/getExportRowsViewItems.js} +0 -0
- package/src/Strategy/Utilities/{getFlashingCellDurationViewItems.d.ts → FlashingCell/getFlashingCellDurationViewItems.d.ts} +1 -1
- package/src/Strategy/Utilities/{getFlashingCellDurationViewItems.js → FlashingCell/getFlashingCellDurationViewItems.js} +0 -0
- package/src/Strategy/Utilities/{getFlashingCellStyleViewItems.d.ts → FlashingCell/getFlashingCellStyleViewItems.d.ts} +1 -1
- package/src/Strategy/Utilities/{getFlashingCellStyleViewItems.js → FlashingCell/getFlashingCellStyleViewItems.js} +1 -1
- package/src/Strategy/Utilities/{getFlashingTargetViewItems.d.ts → FlashingCell/getFlashingTargetViewItems.d.ts} +1 -1
- package/src/Strategy/Utilities/{getFlashingTargetViewItems.js → FlashingCell/getFlashingTargetViewItems.js} +0 -0
- package/src/Strategy/Utilities/{getFormatColumnSettingsViewItems.d.ts → FormatColumn/getFormatColumnSettingsViewItems.d.ts} +1 -1
- package/src/Strategy/Utilities/{getFormatColumnSettingsViewItems.js → FormatColumn/getFormatColumnSettingsViewItems.js} +0 -0
- package/src/Strategy/Utilities/{getFormatColumnStyleViewItems.d.ts → FormatColumn/getFormatColumnStyleViewItems.d.ts} +0 -0
- package/src/Strategy/Utilities/{getFormatColumnStyleViewItems.js → FormatColumn/getFormatColumnStyleViewItems.js} +1 -1
- package/src/Strategy/Utilities/Layout/getLayoutFilterViewItems.d.ts +5 -0
- package/src/Strategy/Utilities/Layout/getLayoutFilterViewItems.js +24 -0
- package/src/Strategy/Utilities/Layout/getLayoutSortViewItems.d.ts +5 -0
- package/src/Strategy/Utilities/Layout/getLayoutSortViewItems.js +14 -0
- package/src/Strategy/Utilities/{getShortcutSettingsViewItems.d.ts → Shortcut/getShortcutSettingsViewItems.d.ts} +1 -1
- package/src/Strategy/Utilities/{getShortcutSettingsViewItems.js → Shortcut/getShortcutSettingsViewItems.js} +0 -0
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +4 -2
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +144 -0
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +6 -6
- package/src/Utilities/ObjectFactory.d.ts +1 -1
- package/src/Utilities/ObjectFactory.js +12 -11
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +50 -11
- package/src/View/AdaptableView.js +3 -2
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.d.ts +27 -1
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +46 -36
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +5 -4
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +4 -2
- package/src/View/Components/Popups/AdaptableToaster.js +16 -33
- package/src/View/Components/ValueSelector/index.d.ts +10 -1
- package/src/View/Components/ValueSelector/index.js +16 -8
- package/src/View/FormatColumn/FormatColumnSummary.js +2 -1
- package/src/View/Layout/Wizard/LayoutEditor/index.js +1 -1
- package/src/View/Layout/Wizard/LayoutWizard.d.ts +4 -7
- package/src/View/Layout/Wizard/LayoutWizard.js +127 -13
- package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +8 -0
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +102 -0
- package/src/View/Layout/Wizard/sections/ColumnsSection.d.ts +8 -0
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +226 -0
- package/src/View/Layout/Wizard/sections/FilterSection.d.ts +8 -0
- package/src/View/Layout/Wizard/sections/FilterSection.js +35 -0
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.d.ts +8 -0
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +39 -0
- package/src/View/Layout/Wizard/sections/RowGroupingSection.d.ts +8 -0
- package/src/View/Layout/Wizard/sections/RowGroupingSection.js +46 -0
- package/src/View/Layout/Wizard/sections/SettingsSection.d.ts +8 -0
- package/src/View/Layout/Wizard/sections/SettingsSection.js +51 -0
- package/src/View/Layout/Wizard/sections/SortSection.d.ts +8 -0
- package/src/View/Layout/Wizard/sections/SortSection.js +69 -0
- package/src/View/Layout/Wizard/sections/Utilities.d.ts +2 -0
- package/src/View/Layout/Wizard/sections/Utilities.js +5 -0
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReminder.js +7 -2
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReport.js +2 -2
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsSummary.js +4 -0
- package/src/View/StatusBar/StatusBarPanel.js +1 -1
- package/src/View/Wizard/OnePageAdaptableWizard.d.ts +1 -0
- package/src/View/Wizard/OnePageAdaptableWizard.js +3 -3
- package/src/View/Wizard/OnePageWizards.d.ts +1 -0
- package/src/View/Wizard/OnePageWizards.js +1 -1
- package/src/agGrid/Adaptable.d.ts +3 -0
- package/src/agGrid/Adaptable.js +47 -10
- package/src/agGrid/agGridHelper.js +11 -1
- package/src/components/ExpressionEditor/editorButtonsAggregatedScalar.js +5 -0
- package/src/components/ExpressionEditor/index.js +1 -1
- package/src/components/Tabs/index.js +4 -2
- package/src/components/icons/arrow-down-long.d.ts +3 -0
- package/src/components/icons/arrow-down-long.js +7 -0
- package/src/components/icons/arrow-up-long.d.ts +3 -0
- package/src/components/icons/arrow-up-long.js +7 -0
- package/src/components/icons/index.js +4 -0
- package/src/metamodel/adaptable.metamodel.d.ts +9 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/Strategy/Utilities/getExportColumnsViewItems.d.ts +0 -3
- package/src/View/Layout/LayoutEntityRow.d.ts +0 -13
- package/src/View/Layout/LayoutEntityRow.js +0 -23
- package/src/View/Layout/LayoutPopup.d.ts +0 -32
- package/src/View/Layout/LayoutPopup.js +0 -153
|
@@ -4,7 +4,7 @@ exports.ObjectFactory = exports.CreateToastOptions = exports.CreateCustomDisplay
|
|
|
4
4
|
const Enums_1 = require("../PredefinedConfig/Common/Enums");
|
|
5
5
|
const GeneralConstants_1 = require("./Constants/GeneralConstants");
|
|
6
6
|
const Uuid_1 = require("../PredefinedConfig/Uuid");
|
|
7
|
-
const
|
|
7
|
+
const react_toastify_js_1 = require("react-toastify/dist/react-toastify.js");
|
|
8
8
|
function CreateEmptyCustomSort() {
|
|
9
9
|
return { Uuid: Uuid_1.createUuid(), ColumnId: GeneralConstants_1.EMPTY_STRING, SortedValues: [] };
|
|
10
10
|
}
|
|
@@ -146,6 +146,7 @@ function CreateEmptyReminderSchedule() {
|
|
|
146
146
|
Message: GeneralConstants_1.EMPTY_STRING,
|
|
147
147
|
MessageType: 'Info',
|
|
148
148
|
DisplayNotification: true,
|
|
149
|
+
DisplaySystemStatusMessage: false,
|
|
149
150
|
};
|
|
150
151
|
}
|
|
151
152
|
exports.CreateEmptyReminderSchedule = CreateEmptyReminderSchedule;
|
|
@@ -392,29 +393,29 @@ exports.CreateToastOptions = CreateToastOptions;
|
|
|
392
393
|
function getToastPosition(position) {
|
|
393
394
|
switch (position) {
|
|
394
395
|
case 'BottomLeft':
|
|
395
|
-
return
|
|
396
|
+
return react_toastify_js_1.toast.POSITION.BOTTOM_LEFT;
|
|
396
397
|
case 'BottomCenter':
|
|
397
|
-
return
|
|
398
|
+
return react_toastify_js_1.toast.POSITION.BOTTOM_CENTER;
|
|
398
399
|
case 'BottomRight':
|
|
399
|
-
return
|
|
400
|
+
return react_toastify_js_1.toast.POSITION.BOTTOM_RIGHT;
|
|
400
401
|
case 'TopLeft':
|
|
401
|
-
return
|
|
402
|
+
return react_toastify_js_1.toast.POSITION.TOP_LEFT;
|
|
402
403
|
case 'TopCenter':
|
|
403
|
-
return
|
|
404
|
+
return react_toastify_js_1.toast.POSITION.TOP_CENTER;
|
|
404
405
|
case 'TopRight':
|
|
405
|
-
return
|
|
406
|
+
return react_toastify_js_1.toast.POSITION.TOP_RIGHT;
|
|
406
407
|
}
|
|
407
408
|
}
|
|
408
409
|
function getToastTransition(transition) {
|
|
409
410
|
switch (transition) {
|
|
410
411
|
case 'Bounce':
|
|
411
|
-
return
|
|
412
|
+
return react_toastify_js_1.Bounce;
|
|
412
413
|
case 'Slide':
|
|
413
|
-
return
|
|
414
|
+
return react_toastify_js_1.Slide;
|
|
414
415
|
case 'Zoom':
|
|
415
|
-
return
|
|
416
|
+
return react_toastify_js_1.Zoom;
|
|
416
417
|
case 'Flip':
|
|
417
|
-
return
|
|
418
|
+
return react_toastify_js_1.Flip;
|
|
418
419
|
}
|
|
419
420
|
}
|
|
420
421
|
exports.ObjectFactory = {
|
|
@@ -29,6 +29,16 @@ class CalculatedColumnExpressionService {
|
|
|
29
29
|
this.adaptableApi.gridApi.refreshCells(null, refreshedCalculatedColumns);
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
|
+
this.adaptableApi.eventApi.on('GridDataChanged', () => {
|
|
33
|
+
const refreshedCalculatedColumns = [];
|
|
34
|
+
this.aggregatedScalarCalculatedColumnsMap.forEach((aggregatedScalarCalculatedColumn) => {
|
|
35
|
+
aggregatedScalarCalculatedColumn.refreshAggregatedColumnValue();
|
|
36
|
+
refreshedCalculatedColumns.push(aggregatedScalarCalculatedColumn.getCalculatedColumnId());
|
|
37
|
+
});
|
|
38
|
+
if (refreshedCalculatedColumns.length) {
|
|
39
|
+
this.adaptableApi.gridApi.refreshCells(null, refreshedCalculatedColumns);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
32
42
|
}
|
|
33
43
|
destroy() {
|
|
34
44
|
[...this.aggregatedScalarCalculatedColumnsMap.values()].forEach((aggregatedScalarCalculatedColumn) => aggregatedScalarCalculatedColumn.destroy());
|
|
@@ -116,10 +126,7 @@ class CalculatedColumnExpressionService {
|
|
|
116
126
|
// if there is already an aggregated scalar, delete it (possible when editing)
|
|
117
127
|
this.destroyAggregatedScalarCalculatedColumn(calculatedColumn);
|
|
118
128
|
if ((_a = calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.AggregatedScalarExpression) {
|
|
119
|
-
const
|
|
120
|
-
.getQueryLanguageService()
|
|
121
|
-
.evaluateAggregatedScalarExpression(calculatedColumn.Query.AggregatedScalarExpression, ModuleConstants_1.CalculatedColumnModuleId);
|
|
122
|
-
const aggregatedScalarCalculatedColumn = new AggregatedScalarCalculatedColumn(aggregationConfig.value, calculatedColumn, this.adaptableApi);
|
|
129
|
+
const aggregatedScalarCalculatedColumn = new AggregatedScalarCalculatedColumn(calculatedColumn, this.adaptableApi);
|
|
123
130
|
this.aggregatedScalarCalculatedColumnsMap.set(calculatedColumn.Uuid, aggregatedScalarCalculatedColumn);
|
|
124
131
|
}
|
|
125
132
|
}
|
|
@@ -131,13 +138,16 @@ class CalculatedColumnExpressionService {
|
|
|
131
138
|
}
|
|
132
139
|
exports.CalculatedColumnExpressionService = CalculatedColumnExpressionService;
|
|
133
140
|
class AggregatedScalarCalculatedColumn {
|
|
134
|
-
constructor(
|
|
135
|
-
this.expressionEvaluation = expressionEvaluation;
|
|
141
|
+
constructor(calculatedColumn, adaptableApi) {
|
|
136
142
|
this.calculatedColumn = calculatedColumn;
|
|
137
143
|
this.adaptableApi = adaptableApi;
|
|
138
|
-
|
|
144
|
+
const aggregationConfig = this.adaptableApi.internalApi
|
|
145
|
+
.getQueryLanguageService()
|
|
146
|
+
.evaluateAggregatedScalarExpression(calculatedColumn.Query.AggregatedScalarExpression, ModuleConstants_1.CalculatedColumnModuleId);
|
|
147
|
+
this.expressionEvaluation = aggregationConfig.value;
|
|
148
|
+
this.aggregationResult = this.computeAggregatedValue(this.expressionEvaluation);
|
|
139
149
|
// currently we support only one reducer
|
|
140
|
-
this.aggregationReducerName = Object.keys(expressionEvaluation.aggregationParams.reducers)[0];
|
|
150
|
+
this.aggregationReducerName = Object.keys(this.expressionEvaluation.aggregationParams.reducers)[0];
|
|
141
151
|
}
|
|
142
152
|
destroy() {
|
|
143
153
|
this.expressionEvaluation = null;
|
|
@@ -153,6 +163,10 @@ class AggregatedScalarCalculatedColumn {
|
|
|
153
163
|
return aggregationValue;
|
|
154
164
|
}
|
|
155
165
|
refreshAggregatedColumnValue() {
|
|
166
|
+
const aggregationConfig = this.adaptableApi.internalApi
|
|
167
|
+
.getQueryLanguageService()
|
|
168
|
+
.evaluateAggregatedScalarExpression(this.calculatedColumn.Query.AggregatedScalarExpression, ModuleConstants_1.CalculatedColumnModuleId);
|
|
169
|
+
this.expressionEvaluation = aggregationConfig.value;
|
|
156
170
|
this.aggregationResult = this.computeAggregatedValue(this.expressionEvaluation);
|
|
157
171
|
}
|
|
158
172
|
getCalculatedColumnId() {
|
|
@@ -167,11 +181,13 @@ class AggregatedScalarCalculatedColumn {
|
|
|
167
181
|
// we iterate over the RowNode list (we need this to handle complex column values (nested values, valueGetters etc)
|
|
168
182
|
// so we will map the fieldNames to RowNode.data
|
|
169
183
|
const mapReducerValueGetter = (fieldName) => {
|
|
170
|
-
return (rowNode) =>
|
|
184
|
+
return (rowNode) => {
|
|
185
|
+
return this.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, fieldName);
|
|
186
|
+
};
|
|
171
187
|
};
|
|
172
188
|
Object.values(expressionEvaluation.aggregationParams.reducers).forEach((aggregationReducer) => {
|
|
173
189
|
aggregationReducer.getter = mapReducerValueGetter(aggregationReducer.field);
|
|
174
|
-
// nullify the
|
|
190
|
+
// nullify the field to force the fallback on the getter fn
|
|
175
191
|
aggregationReducer.field = null;
|
|
176
192
|
});
|
|
177
193
|
const mapGroupByToKey = (fieldName) => {
|
|
@@ -181,7 +197,30 @@ class AggregatedScalarCalculatedColumn {
|
|
|
181
197
|
groupByDef.toKey = mapGroupByToKey(groupByDef.field);
|
|
182
198
|
});
|
|
183
199
|
if (!expressionEvaluation.cumulateOver) {
|
|
184
|
-
|
|
200
|
+
let aggregatedRowNodes = gridRowNodes;
|
|
201
|
+
if (expressionEvaluation.sortByColumn) {
|
|
202
|
+
const sortByColumn = expressionEvaluation.sortByColumn;
|
|
203
|
+
const getRowNodeValue = (rowNode, columnId) => this.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, columnId);
|
|
204
|
+
if (expressionEvaluation.filterUndefinedValues) {
|
|
205
|
+
aggregatedRowNodes = gridRowNodes.filter((node) => {
|
|
206
|
+
const rowValue = getRowNodeValue(node, sortByColumn);
|
|
207
|
+
return rowValue != undefined;
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
// currently, we support only ascending sorting
|
|
211
|
+
aggregatedRowNodes.sort((first, second) => {
|
|
212
|
+
const firstValue = getRowNodeValue(first, sortByColumn);
|
|
213
|
+
const secondValue = getRowNodeValue(second, sortByColumn);
|
|
214
|
+
if (firstValue < secondValue) {
|
|
215
|
+
return -1;
|
|
216
|
+
}
|
|
217
|
+
if (firstValue > secondValue) {
|
|
218
|
+
return 1;
|
|
219
|
+
}
|
|
220
|
+
return 0;
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
return scalarAggregationHelper_1.aggregate(expressionEvaluation.aggregationParams, aggregatedRowNodes);
|
|
185
224
|
}
|
|
186
225
|
else {
|
|
187
226
|
// 1. sort grid data by given OVER column
|
|
@@ -13,7 +13,8 @@ const AdaptableLoadingScreen_1 = require("./Components/Popups/AdaptableLoadingSc
|
|
|
13
13
|
const renderWithAdaptableContext_1 = require("./renderWithAdaptableContext");
|
|
14
14
|
const License_1 = require("./License");
|
|
15
15
|
const ProgressIndicator_1 = require("../components/ProgressIndicator/ProgressIndicator");
|
|
16
|
-
|
|
16
|
+
//@ts-ignore - we need to avoid the esm from react-toastify for now
|
|
17
|
+
const react_toastify_js_1 = require("react-toastify/dist/react-toastify.js");
|
|
17
18
|
const WindowPopups_1 = require("./Components/Popups/WindowPopups/WindowPopups");
|
|
18
19
|
const FormPopups_1 = require("./Components/Popups/FormPopups/FormPopups");
|
|
19
20
|
class AdaptableView extends React.Component {
|
|
@@ -27,7 +28,7 @@ class AdaptableView extends React.Component {
|
|
|
27
28
|
this.props.PopupState.PromptPopup.ShowPromptPopup && (React.createElement(AdaptablePopupPrompt_1.AdaptablePopupPrompt, { message: this.props.PopupState.PromptPopup.Message, header: this.props.PopupState.PromptPopup.Header, onClose: this.props.onClosePromptPopup, onConfirm: this.props.onConfirmPromptPopup, onConfirmActionCreator: this.props.PopupState.PromptPopup.ConfirmActionCreator, defaultValue: this.props.PopupState.PromptPopup.DefaultValue })),
|
|
28
29
|
React.createElement(AdaptablePopupConfirmation_1.AdaptablePopupConfirmation, { header: this.props.PopupState.ConfirmationPopup.Header, messsage: this.props.PopupState.ConfirmationPopup.Msg, showPopup: this.props.PopupState.ConfirmationPopup.ShowConfirmationPopup, cancelButtonText: this.props.PopupState.ConfirmationPopup.CancelButtonText, confirmButtonText: this.props.PopupState.ConfirmationPopup.ConfirmButtonText, onCancel: this.props.onCancelConfirmationPopup, onConfirm: this.props.onConfirmConfirmationPopup, showInputBox: this.props.PopupState.ConfirmationPopup.ShowInputBox, messageType: this.props.PopupState.ConfirmationPopup.MessageType, api: this.props.AdaptableApi }),
|
|
29
30
|
Boolean(this.props.PopupState.ScreenPopup.ShowScreenPopup) && (React.createElement(AdaptablePopup_1.AdaptablePopup, { componentName: this.props.PopupState.ScreenPopup.ComponentName, componentModule: this.props.PopupState.ScreenPopup.ComponentModule, onHide: this.props.onCloseScreenPopup, api: this.props.AdaptableApi, onClearParams: () => this.props.onClearPopupParams(), moduleParams: this.props.PopupState.ScreenPopup.Params, moduleProps: this.props.PopupState.ScreenPopup.PopupProps })),
|
|
30
|
-
React.createElement(
|
|
31
|
+
React.createElement(react_toastify_js_1.ToastContainer
|
|
31
32
|
// we NEEEEED!!!! this containerId, otherwise, toastify will have memory leaks when the adaptable
|
|
32
33
|
// instance is destroyed and re-created many times
|
|
33
34
|
, {
|
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Action } from 'redux';
|
|
3
|
+
import { AdaptableObject } from '../../../PredefinedConfig/Common/AdaptableObject';
|
|
4
|
+
import { AdaptableObjectItemView, AdaptableObjectView, IModule } from '../../../Strategy/Interface/IModule';
|
|
5
|
+
import { AccessLevel, SharedEntityConfig } from '../../../types';
|
|
6
|
+
export declare const AdaptableObjectListItemView: React.FunctionComponent<{
|
|
7
|
+
abObject: AdaptableObject;
|
|
8
|
+
accessLevel?: AccessLevel;
|
|
9
|
+
actions?: React.ReactElement[];
|
|
10
|
+
className?: string;
|
|
11
|
+
deleteAction?: Action;
|
|
12
|
+
onDelete?: () => void;
|
|
13
|
+
deleteDisabled?: boolean;
|
|
14
|
+
deleteTooltip?: string;
|
|
15
|
+
editDisabled?: boolean;
|
|
16
|
+
entityType: string;
|
|
17
|
+
handleOnEdit?: (tagName?: string) => void;
|
|
18
|
+
items: AdaptableObjectItemView[];
|
|
19
|
+
onShare?: (config: SharedEntityConfig) => void;
|
|
20
|
+
onSuspend?: () => void;
|
|
21
|
+
onUnSuspend?: () => void;
|
|
22
|
+
showActions?: boolean;
|
|
23
|
+
showEditButton?: boolean;
|
|
24
|
+
style?: React.CSSProperties;
|
|
25
|
+
suspendedEnabled?: boolean;
|
|
26
|
+
teamSharingActivated?: boolean;
|
|
27
|
+
}>;
|
|
3
28
|
interface AdaptableObjectListItemProps {
|
|
4
29
|
data: AdaptableObjectView;
|
|
5
30
|
module: IModule;
|
|
@@ -21,6 +46,7 @@ export declare const AdaptableObjectListItem: React.FunctionComponent<AdaptableO
|
|
|
21
46
|
interface AdaptableObjectListProps {
|
|
22
47
|
items: AdaptableObjectView[];
|
|
23
48
|
module: IModule;
|
|
49
|
+
itemProps?: Partial<AdaptableObjectListItemProps>;
|
|
24
50
|
}
|
|
25
51
|
export declare const AdaptableObjectList: React.FunctionComponent<AdaptableObjectListProps>;
|
|
26
52
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AdaptableObjectList = exports.AdaptableObjectListItem = void 0;
|
|
3
|
+
exports.AdaptableObjectList = exports.AdaptableObjectListItem = exports.AdaptableObjectListItemView = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const react_redux_1 = require("react-redux");
|
|
@@ -15,9 +15,46 @@ const ButtonShare_1 = require("../Buttons/ButtonShare");
|
|
|
15
15
|
const SuspendToggleButton_1 = require("../Buttons/SuspendToggleButton/SuspendToggleButton");
|
|
16
16
|
const ValueSelector_1 = require("../ValueSelector");
|
|
17
17
|
const ICON_SIZE = 26;
|
|
18
|
-
const
|
|
18
|
+
const LIST_BASE_CLASS_NAME = 'ab-Adaptable-Object-List';
|
|
19
|
+
const ITEM_BASE_CLASS_NAME = `${LIST_BASE_CLASS_NAME}__Item`;
|
|
20
|
+
const AdaptableObjectListItemView = (props) => {
|
|
21
|
+
var _a, _b, _c;
|
|
22
|
+
const baseClassName = ITEM_BASE_CLASS_NAME;
|
|
23
|
+
return (React.createElement(rebass_1.Flex, { "data-name": "adaptable-object-list-item", "data-value": props.abObject.Uuid, as: "li", mb: 3, className: join_1.default(props.className, baseClassName), style: props.style },
|
|
24
|
+
React.createElement(rebass_1.Box, { flex: 1, className: `${baseClassName}__rows` }, (_c = (_b = (_a = props.items).filter) === null || _b === void 0 ? void 0 : _b.call(_a, Boolean)) === null || _c === void 0 ? void 0 : _c.map((tag, index) => {
|
|
25
|
+
var _a;
|
|
26
|
+
let labelEl = tag.label;
|
|
27
|
+
if (typeof tag.label === 'function') {
|
|
28
|
+
labelEl = React.createElement(tag.label, { data: props.abObject });
|
|
29
|
+
}
|
|
30
|
+
labelEl = labelEl !== null && labelEl !== void 0 ? labelEl : tag.name;
|
|
31
|
+
return (React.createElement(rebass_1.Flex, { "data-name": tag.name, key: index, mb: 2, className: `${baseClassName}__row` },
|
|
32
|
+
React.createElement(rebass_1.Box, { className: `${baseClassName}__label`, mr: 3 },
|
|
33
|
+
labelEl,
|
|
34
|
+
props.showEditButton && (React.createElement(SimpleButton_1.default, { accessLevel: props.accessLevel, className: `${baseClassName}__edit-property`, ml: 1, icon: "edit", tooltip: "edit", iconSize: 18, variant: "text", onClick: () => {
|
|
35
|
+
props.handleOnEdit(tag.name);
|
|
36
|
+
} }))),
|
|
37
|
+
React.createElement(rebass_1.Box, { flex: 1, className: `${baseClassName}__values` },
|
|
38
|
+
tag.view &&
|
|
39
|
+
React.createElement(tag.view, {
|
|
40
|
+
data: props.abObject,
|
|
41
|
+
}),
|
|
42
|
+
Boolean((tag === null || tag === void 0 ? void 0 : tag.values) && ((_a = tag === null || tag === void 0 ? void 0 : tag.values) === null || _a === void 0 ? void 0 : _a.length)) && (React.createElement(ValueSelector_1.ValueOptionsTags, { style: { marginRight: 0 }, readOnly: true, options: tag.values, value: tag.values, allowWrap: true, toIdentifier: (c) => c, toLabel: (c) => React.createElement(React.Fragment, null, c) })))));
|
|
43
|
+
})),
|
|
44
|
+
props.showActions && (React.createElement(rebass_1.Flex, { flexDirection: "column", className: `${baseClassName}__buttons` },
|
|
45
|
+
React.createElement(rebass_1.Flex, { justifyContent: "end" },
|
|
46
|
+
props.actions,
|
|
47
|
+
props.teamSharingActivated && (React.createElement(ButtonShare_1.ButtonShare, { iconSize: ICON_SIZE, Header: `TeamSharing ${props.entityType}`, accessLevel: props.accessLevel, onShare: props.onShare })),
|
|
48
|
+
props.onDelete && (React.createElement(SimpleButton_1.default, { "data-name": "delete", disabled: props.deleteDisabled, iconSize: ICON_SIZE, tooltip: props.deleteTooltip, icon: "trash", onClick: props.onDelete, variant: "text" })),
|
|
49
|
+
props.deleteAction && (React.createElement(ButtonDelete_1.ButtonDelete, { disabled: props.deleteDisabled, tooltip: props.deleteTooltip, iconSize: ICON_SIZE, ConfirmationMsg: `Are you sure you want to delete this ${props.entityType}?`, ConfirmationTitle: `Delete ${props.entityType}`, ConfirmAction: props.deleteAction, accessLevel: props.accessLevel })),
|
|
50
|
+
props.showEditButton && (React.createElement(ButtonEdit_1.ButtonEdit, { iconSize: ICON_SIZE, disabled: props.editDisabled, accessLevel: props.accessLevel, onClick: () => props.handleOnEdit() }))),
|
|
51
|
+
React.createElement(rebass_1.Box, { flex: 1 }),
|
|
52
|
+
props.suspendedEnabled && (React.createElement(rebass_1.Flex, { justifyContent: "end" },
|
|
53
|
+
React.createElement(SuspendToggleButton_1.SuspendToggleButton, { onSuspend: props.onSuspend, onUnSuspend: props.onUnSuspend, suspendableObject: props.abObject, accessLevel: props.accessLevel })))))));
|
|
54
|
+
};
|
|
55
|
+
exports.AdaptableObjectListItemView = AdaptableObjectListItemView;
|
|
19
56
|
const AdaptableObjectListItem = (props) => {
|
|
20
|
-
var _a, _b, _c, _d, _e, _f
|
|
57
|
+
var _a, _b, _c, _d, _e, _f;
|
|
21
58
|
const adaptable = AdaptableContext_1.useAdaptable();
|
|
22
59
|
const dispatch = react_redux_1.useDispatch();
|
|
23
60
|
const [isEditWizardVisible, setIsEditWizardVisible] = React.useState(false);
|
|
@@ -34,8 +71,8 @@ const AdaptableObjectListItem = (props) => {
|
|
|
34
71
|
.getEntitlementService()
|
|
35
72
|
.getEntitlementAccessLevelForModule(props.module.moduleInfo.ModuleName);
|
|
36
73
|
const accessLevel = AdaptableHelper_1.default.getAppropriateAccessLevel(props.data.abObject, moduleAccessLevel);
|
|
37
|
-
const
|
|
38
|
-
|
|
74
|
+
const itemClassName = join_1.default(props.data.className, ITEM_BASE_CLASS_NAME, props.data.abObject.IsSuspended &&
|
|
75
|
+
`${ITEM_BASE_CLASS_NAME}--is-suspended`);
|
|
39
76
|
const handleCloseWizard = React.useCallback(() => {
|
|
40
77
|
setIsEditWizardVisible(false);
|
|
41
78
|
setWizardStepName(null);
|
|
@@ -60,41 +97,14 @@ const AdaptableObjectListItem = (props) => {
|
|
|
60
97
|
});
|
|
61
98
|
const isEditDisabled = !Boolean(EditWizard || viewOptions.onOpenEditPopup);
|
|
62
99
|
const showActions = !props.hideControls;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
let labelEl = tag.label;
|
|
67
|
-
if (typeof tag.label === 'function') {
|
|
68
|
-
labelEl = React.createElement(tag.label, { data: props.data.abObject });
|
|
69
|
-
}
|
|
70
|
-
labelEl = labelEl !== null && labelEl !== void 0 ? labelEl : tag.name;
|
|
71
|
-
return (React.createElement(rebass_1.Flex, { "data-name": tag.name, key: index, mb: 2, className: `${itemBaseClassName}__row` },
|
|
72
|
-
React.createElement(rebass_1.Box, { className: `${itemBaseClassName}__label`, mr: 3 },
|
|
73
|
-
labelEl,
|
|
74
|
-
EditWizard && (React.createElement(SimpleButton_1.default, { accessLevel: accessLevel, className: `${itemBaseClassName}__edit-property`, ml: 1, icon: "edit", tooltip: "edit", iconSize: 18, variant: "text", onClick: () => {
|
|
75
|
-
handleOnEdit(tag.name);
|
|
76
|
-
} }))),
|
|
77
|
-
React.createElement(rebass_1.Box, { flex: 1, className: `${itemBaseClassName}__values` },
|
|
78
|
-
tag.view &&
|
|
79
|
-
React.createElement(tag.view, {
|
|
80
|
-
data: props.data.abObject,
|
|
81
|
-
}),
|
|
82
|
-
Boolean((tag === null || tag === void 0 ? void 0 : tag.values) && ((_a = tag === null || tag === void 0 ? void 0 : tag.values) === null || _a === void 0 ? void 0 : _a.length)) && (React.createElement(ValueSelector_1.ValueOptionsTags, { style: { marginRight: 0 }, readOnly: true, options: tag.values, value: tag.values, allowWrap: true, toIdentifier: (c) => c, toLabel: (c) => React.createElement(React.Fragment, null, c) })))));
|
|
83
|
-
})),
|
|
84
|
-
showActions && (React.createElement(rebass_1.Flex, { flexDirection: "column", className: `${itemBaseClassName}__buttons` },
|
|
85
|
-
React.createElement(rebass_1.Flex, { justifyContent: "end" },
|
|
86
|
-
actions,
|
|
87
|
-
teamSharingActivated && (React.createElement(ButtonShare_1.ButtonShare, { iconSize: ICON_SIZE, Header: `TeamSharing ${entityType}`, accessLevel: accessLevel, onShare: (config) => adaptable.api.teamSharingApi.shareEntity(props.data.abObject, props.module.moduleInfo.ModuleName, config) })),
|
|
88
|
-
deleteAction && (React.createElement(ButtonDelete_1.ButtonDelete, { disabled: props.deleteDisabled, tooltip: props.deleteTooltip, iconSize: ICON_SIZE, ConfirmationMsg: `Are you sure you want to delete this ${entityType}?`, ConfirmationTitle: `Delete ${entityType}`, ConfirmAction: deleteAction, accessLevel: accessLevel })),
|
|
89
|
-
React.createElement(ButtonEdit_1.ButtonEdit, { iconSize: ICON_SIZE, disabled: isEditDisabled, accessLevel: accessLevel, onClick: () => handleOnEdit() })),
|
|
90
|
-
React.createElement(rebass_1.Box, { flex: 1 }),
|
|
91
|
-
hasSuspend && (React.createElement(rebass_1.Flex, { justifyContent: "end" },
|
|
92
|
-
React.createElement(SuspendToggleButton_1.SuspendToggleButton, { onSuspend: () => dispatch(viewOptions.getSuspendAction(props.data.abObject)), onUnSuspend: () => dispatch(viewOptions.getUnSuspendAction(props.data.abObject)), suspendableObject: props.data.abObject, accessLevel: accessLevel }))))),
|
|
100
|
+
const showEditButton = Boolean(EditWizard);
|
|
101
|
+
return (React.createElement(React.Fragment, null,
|
|
102
|
+
React.createElement(exports.AdaptableObjectListItemView, { abObject: props.data.abObject, accessLevel: accessLevel, actions: actions, className: itemClassName, handleOnEdit: handleOnEdit, items: props.data.items, showActions: showActions, showEditButton: showEditButton, style: props.data.style, teamSharingActivated: teamSharingActivated, onShare: (config) => adaptable.api.teamSharingApi.shareEntity(props.data.abObject, props.module.moduleInfo.ModuleName, config), entityType: entityType, deleteAction: deleteAction, deleteDisabled: props.deleteDisabled, deleteTooltip: props.deleteTooltip, editDisabled: isEditDisabled, suspendedEnabled: hasSuspend, onSuspend: () => dispatch(viewOptions.getSuspendAction(props.data.abObject)), onUnSuspend: () => dispatch(viewOptions.getUnSuspendAction(props.data.abObject)) }),
|
|
93
103
|
isEditWizardVisible && EditWizard && (React.createElement(EditWizard, { defaultCurrentSectionName: wizardStepName, moduleInfo: props.module.moduleInfo, data: props.data.abObject, configEntities: null, onCloseWizard: handleCloseWizard, onFinishWizard: handleCloseWizard }))));
|
|
94
104
|
};
|
|
95
105
|
exports.AdaptableObjectListItem = AdaptableObjectListItem;
|
|
96
106
|
const AdaptableObjectList = (props) => {
|
|
97
107
|
var _a;
|
|
98
|
-
return (React.createElement("ul", { className:
|
|
108
|
+
return (React.createElement("ul", { className: LIST_BASE_CLASS_NAME }, (_a = props === null || props === void 0 ? void 0 : props.items) === null || _a === void 0 ? void 0 : _a.map((item) => (React.createElement(exports.AdaptableObjectListItem, Object.assign({ key: item.abObject.Uuid, data: item, module: props.module }, props.itemProps))))));
|
|
99
109
|
};
|
|
100
110
|
exports.AdaptableObjectList = AdaptableObjectList;
|
|
@@ -41,14 +41,15 @@ const ListBoxFilterForm = (props) => {
|
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
const columnValuesItemsElements = props.columnDistinctValues.map((distinctValue, index) => {
|
|
44
|
+
var _a, _b, _c;
|
|
44
45
|
const isActive = UiSelectedColumnValues.indexOf(distinctValue.value) >= 0;
|
|
45
|
-
const
|
|
46
|
-
if (StringExtensions_1.StringExtensions.IsNullOrEmpty(
|
|
46
|
+
const columnLabel = distinctValue.label;
|
|
47
|
+
if (StringExtensions_1.StringExtensions.IsNullOrEmpty(columnLabel)) {
|
|
47
48
|
return null;
|
|
48
49
|
}
|
|
49
50
|
if (!props.suppressClientSideFilter &&
|
|
50
51
|
StringExtensions_1.StringExtensions.IsNotNullOrEmpty(FilterValue) &&
|
|
51
|
-
|
|
52
|
+
((_c = (_a = columnLabel === null || columnLabel === void 0 ? void 0 : columnLabel.toLocaleLowerCase) === null || _a === void 0 ? void 0 : (_b = _a.call(columnLabel)).indexOf) === null || _c === void 0 ? void 0 : _c.call(_b, FilterValue.toLocaleLowerCase())) < 0) {
|
|
52
53
|
return null;
|
|
53
54
|
}
|
|
54
55
|
if (props.useAgGridStyle) {
|
|
@@ -59,7 +60,7 @@ const ListBoxFilterForm = (props) => {
|
|
|
59
60
|
onChange: () => onClickItemColumnValue(distinctValue.value),
|
|
60
61
|
});
|
|
61
62
|
}
|
|
62
|
-
return (React.createElement(ListGroupItem_1.default, { noZebra: props.useAgGridStyle, key: 'columnValue' + index, onClick: () => onClickItemColumnValue(distinctValue.value), active: isActive, value:
|
|
63
|
+
return (React.createElement(ListGroupItem_1.default, { noZebra: props.useAgGridStyle, key: 'columnValue' + index, onClick: () => onClickItemColumnValue(distinctValue.value), active: isActive, value: distinctValue.value }, distinctValue.label));
|
|
63
64
|
});
|
|
64
65
|
const textClear = (React.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { autoFocus: true, type: "text", placeholder: "Search Column Values", value: FilterValue, style: {
|
|
65
66
|
paddingTop: 'var(--ab-space-1)',
|
|
@@ -26,8 +26,10 @@ const AdaptablePopupModuleView = (props) => {
|
|
|
26
26
|
const moduleViewProperties = props.module.getViewProperties();
|
|
27
27
|
const EditWizard = (_b = moduleViewProperties === null || moduleViewProperties === void 0 ? void 0 : moduleViewProperties.getEditWizard) === null || _b === void 0 ? void 0 : _b.call(moduleViewProperties);
|
|
28
28
|
const [isWizardOpen, setIsWizardOpen] = React.useState(() => {
|
|
29
|
-
var _a, _b;
|
|
30
|
-
return ((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'New' ||
|
|
29
|
+
var _a, _b, _c;
|
|
30
|
+
return (((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'New' ||
|
|
31
|
+
((_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.action) === 'Edit' ||
|
|
32
|
+
((_c = props.popupParams) === null || _c === void 0 ? void 0 : _c.action) === 'Clone');
|
|
31
33
|
});
|
|
32
34
|
const handleOpenEditPopup = React.useCallback(() => {
|
|
33
35
|
if (EditWizard) {
|
|
@@ -5,61 +5,44 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const ObjectFactory_1 = tslib_1.__importDefault(require("../../../Utilities/ObjectFactory"));
|
|
7
7
|
const AdaptablePopupAlert_1 = require("./AdaptablePopupAlert");
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const weakMapKeys = new Map();
|
|
8
|
+
//@ts-ignore - we need to avoid the esm from react-toastify for now
|
|
9
|
+
const react_toastify_js_1 = require("react-toastify/dist/react-toastify.js");
|
|
11
10
|
const showToast = (props) => {
|
|
12
11
|
// we're doing this hack and not simply using props.api in order not to have a memory
|
|
13
12
|
// leak where the api is still kept around in memory by the toaster
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
weakMapKeys.set(adaptableId, { adaptableId });
|
|
19
|
-
}
|
|
20
|
-
weakMapKey = weakMapKeys.get(adaptableId);
|
|
21
|
-
const off = props.api.eventApi.on('AdaptableDestroy', () => {
|
|
22
|
-
react_toastify_1.toast.dismiss(); // remove all toasts
|
|
23
|
-
let weakMapKey = weakMapKeys.get(adaptableId);
|
|
24
|
-
if (weakMapKey) {
|
|
25
|
-
apiInstances.delete(weakMapKey);
|
|
26
|
-
weakMapKeys.delete(adaptableId);
|
|
27
|
-
}
|
|
13
|
+
let api = props.api;
|
|
14
|
+
const off = api.eventApi.on('AdaptableDestroy', () => {
|
|
15
|
+
react_toastify_js_1.toast.dismiss(toastId);
|
|
16
|
+
api = null;
|
|
28
17
|
});
|
|
29
|
-
|
|
18
|
+
const adaptableOptions = props.api.internalApi.getAdaptableOptions();
|
|
30
19
|
const toastProps = ObjectFactory_1.default.CreateToastOptions(adaptableOptions.notificationsOptions, {
|
|
31
|
-
containerId: adaptableId,
|
|
20
|
+
containerId: adaptableOptions.adaptableId,
|
|
32
21
|
onClose: () => {
|
|
33
|
-
|
|
34
|
-
const adaptableApi = weakMapKey ? apiInstances.get(weakMapKey) : null;
|
|
35
|
-
if (adaptableApi) {
|
|
22
|
+
if (api) {
|
|
36
23
|
off();
|
|
37
|
-
if (!
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
apiInstances.delete(weakMapKey);
|
|
42
|
-
weakMapKeys.delete(adaptableId);
|
|
24
|
+
if (!api.isDestroyed()) {
|
|
25
|
+
api.internalApi.hidePopupAlert();
|
|
43
26
|
}
|
|
44
27
|
}
|
|
45
28
|
},
|
|
46
29
|
});
|
|
47
30
|
const content = (React.createElement(AdaptablePopupAlert_1.AdaptablePopupAlert, { headless: true, adaptableAlert: props.adaptableAlert, onClose: () => {
|
|
48
|
-
|
|
31
|
+
react_toastify_js_1.toast.dismiss(toastId);
|
|
49
32
|
} }));
|
|
50
33
|
let toastId;
|
|
51
34
|
switch (props.adaptableAlert.alertDefinition.MessageType) {
|
|
52
35
|
case 'Info':
|
|
53
|
-
toastId =
|
|
36
|
+
toastId = react_toastify_js_1.toast.info(content, toastProps);
|
|
54
37
|
break;
|
|
55
38
|
case 'Error':
|
|
56
|
-
toastId =
|
|
39
|
+
toastId = react_toastify_js_1.toast.error(content, toastProps);
|
|
57
40
|
break;
|
|
58
41
|
case 'Success':
|
|
59
|
-
toastId =
|
|
42
|
+
toastId = react_toastify_js_1.toast.success(content, toastProps);
|
|
60
43
|
break;
|
|
61
44
|
case 'Warning':
|
|
62
|
-
toastId =
|
|
45
|
+
toastId = react_toastify_js_1.toast.warn(content, toastProps);
|
|
63
46
|
break;
|
|
64
47
|
}
|
|
65
48
|
};
|
|
@@ -5,13 +5,22 @@ export declare type ValueSelectorProps<OPTION_TYPE, ID_TYPE extends number | str
|
|
|
5
5
|
value: ID_TYPE[];
|
|
6
6
|
onChange: (selected: ID_TYPE[], selectedMap: Map<ID_TYPE, OPTION_TYPE>) => void;
|
|
7
7
|
allowReorder?: boolean | ((option: OPTION_TYPE) => boolean);
|
|
8
|
-
filter?: null | ((o: OPTION_TYPE) => boolean);
|
|
8
|
+
filter?: null | ((o: OPTION_TYPE, searchValue: string) => boolean);
|
|
9
|
+
/**
|
|
10
|
+
* To show the filter input, filter needs also to be defined.
|
|
11
|
+
*/
|
|
12
|
+
showFilterInput?: boolean;
|
|
9
13
|
singleSelect?: boolean;
|
|
10
14
|
toIdentifier: (v: OPTION_TYPE) => ID_TYPE;
|
|
11
15
|
toLabel: (v: OPTION_TYPE) => string | React.ReactElement;
|
|
16
|
+
/**
|
|
17
|
+
* Used to render list items, this extra prop allows to have different rendering for list & bottom tags.
|
|
18
|
+
*/
|
|
19
|
+
toListLabel?: (v: OPTION_TYPE) => string | React.ReactElement;
|
|
12
20
|
noSelectionLabel?: ReactNode;
|
|
13
21
|
clearSelectionLabel?: ReactNode;
|
|
14
22
|
showSelectedOnlyLabel?: ReactNode;
|
|
23
|
+
showSelectedOnlyPosition?: 'floating' | 'top';
|
|
15
24
|
xSelectedLabel?: (count: number) => ReactNode;
|
|
16
25
|
selectionBoxPosition?: 'top' | 'bottom';
|
|
17
26
|
onShowSelectedOnlyChange?: (selectedOnly: boolean) => void;
|
|
@@ -13,6 +13,7 @@ const SimpleButton_1 = tslib_1.__importDefault(require("../../../components/Simp
|
|
|
13
13
|
const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
|
|
14
14
|
const reorder_1 = require("../../../Utilities/reorder");
|
|
15
15
|
const Tag_1 = require("../../../components/Tag");
|
|
16
|
+
const AdaptableFormControlTextClear_1 = require("../Forms/AdaptableFormControlTextClear");
|
|
16
17
|
function useValuesMap({ options, value, toIdentifier, selectedMap, }) {
|
|
17
18
|
const optionsMap = react_1.useMemo(() => {
|
|
18
19
|
if (selectedMap) {
|
|
@@ -38,7 +39,10 @@ function useValuesMap({ options, value, toIdentifier, selectedMap, }) {
|
|
|
38
39
|
return { selectedMap: result, optionsMap };
|
|
39
40
|
}
|
|
40
41
|
function ValueSelector(props) {
|
|
41
|
-
|
|
42
|
+
var _a;
|
|
43
|
+
const { options, value, filter, onChange, allowReorder, singleSelect, toLabel, toListLabel, toIdentifier, noSelectionLabel, clearSelectionLabel, showSelectedOnlyLabel, showFilterInput, xSelectedLabel, selectionBoxPosition = 'bottom', onShowSelectedOnlyChange, isOptionDisabled, disabled, } = props;
|
|
44
|
+
const [searchInputValue, setSearchInputValue] = React.useState('');
|
|
45
|
+
const preparedToLabel = toListLabel !== null && toListLabel !== void 0 ? toListLabel : toLabel;
|
|
42
46
|
const [selectedOnly, doSetSelectedOnly] = react_1.useState(false);
|
|
43
47
|
const setSelectedOnly = react_1.useCallback((selectedOnly) => {
|
|
44
48
|
doSetSelectedOnly(selectedOnly);
|
|
@@ -58,11 +62,11 @@ function ValueSelector(props) {
|
|
|
58
62
|
}, [onChange, selectedOnly, selectedMap]);
|
|
59
63
|
const renderOption = (option, index) => {
|
|
60
64
|
const identifier = toIdentifier(option);
|
|
61
|
-
const label = !allowReorder ?
|
|
65
|
+
const label = !allowReorder ? preparedToLabel(option) : null;
|
|
62
66
|
const reorderable = typeof allowReorder === 'function' ? allowReorder(option) : allowReorder;
|
|
63
67
|
const renderNode = (props, dragHandleProps) => {
|
|
64
68
|
return (React.createElement(rebass_1.Flex, Object.assign({ alignItems: "center", mt: index ? 1 : 0, key: identifier, backgroundColor: 'primary', padding: 2, "data-index": index, "data-id": identifier, "data-name": "option" }, props, { style: Object.assign({ borderRadius: 'var(--ab__border-radius)' }, props === null || props === void 0 ? void 0 : props.style) }),
|
|
65
|
-
React.createElement(rebass_1.Flex, { flexDirection: "row", alignItems: "center" },
|
|
69
|
+
React.createElement(rebass_1.Flex, { flex: 1, flexDirection: "row", alignItems: "center" },
|
|
66
70
|
reorderable ? (React.createElement(rebass_1.Box, Object.assign({ mr: 3 }, dragHandleProps),
|
|
67
71
|
React.createElement(icons_1.Icon, { name: "drag", style: { cursor: 'grab' } }))) : null,
|
|
68
72
|
singleSelect ? (React.createElement(Radio_1.default, { checked: selectedMap.has(identifier), "data-name": identifier, onChange: (checked) => {
|
|
@@ -83,7 +87,7 @@ function ValueSelector(props) {
|
|
|
83
87
|
}
|
|
84
88
|
notifyChange();
|
|
85
89
|
}, checked: selectedMap.has(identifier) }, label)),
|
|
86
|
-
React.createElement(rebass_1.Text, { ml: 2 }, allowReorder ?
|
|
90
|
+
React.createElement(rebass_1.Text, { flex: 1, ml: 2 }, allowReorder ? preparedToLabel(option) : null))));
|
|
87
91
|
};
|
|
88
92
|
return (React.createElement(react_beautiful_dnd_1.Draggable, { key: identifier, index: index, draggableId: `${identifier}`, isDragDisabled: !reorderable }, (draggableProvided) => {
|
|
89
93
|
return renderNode(Object.assign(Object.assign({ ref: draggableProvided.innerRef }, draggableProvided.draggableProps), { style: draggableProvided.draggableProps.style }), draggableProvided.dragHandleProps);
|
|
@@ -108,9 +112,14 @@ function ValueSelector(props) {
|
|
|
108
112
|
selectionBox,
|
|
109
113
|
React.createElement(ValueOptionsTags, { options: options, value: value, selectedMap: selectedMap, toLabel: toLabel, toIdentifier: toIdentifier, onClearOption: notifyChange, readOnly: disabled })));
|
|
110
114
|
};
|
|
115
|
+
const showOnlySelectedCheckbox = (React.createElement(CheckBox_1.CheckBox, { disabled: !value.length, checked: selectedOnly, onChange: setSelectedOnly }, showSelectedOnlyLabel !== null && showSelectedOnlyLabel !== void 0 ? showSelectedOnlyLabel : 'Show Selected Only'));
|
|
116
|
+
const showSelectedOnlyPosition = (_a = props.showSelectedOnlyPosition) !== null && _a !== void 0 ? _a : 'floating';
|
|
111
117
|
return (React.createElement(rebass_1.Flex, { flexDirection: "column", flex: 1, className: "ab-ValueSelector", style: {
|
|
112
118
|
overflow: 'hidden',
|
|
113
119
|
} },
|
|
120
|
+
React.createElement(rebass_1.Flex, { mb: 1 },
|
|
121
|
+
showFilterInput && filter ? (React.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { value: searchInputValue, OnTextChange: setSearchInputValue, placeholder: "Type to search", style: { flex: 1, border: 0, margin: 3 } })) : (React.createElement(rebass_1.Box, { flex: 1 })),
|
|
122
|
+
showSelectedOnlyPosition === 'top' && React.createElement(rebass_1.Box, { ml: 20 }, showOnlySelectedCheckbox)),
|
|
114
123
|
selectionBoxPosition === 'top' && renderSelectionSection(),
|
|
115
124
|
React.createElement(react_beautiful_dnd_1.DragDropContext, { onDragEnd: (result) => {
|
|
116
125
|
const { source, destination } = result;
|
|
@@ -136,7 +145,7 @@ function ValueSelector(props) {
|
|
|
136
145
|
notifyChange();
|
|
137
146
|
} },
|
|
138
147
|
React.createElement(rebass_1.Flex, { flexDirection: "column", flex: 1, style: { overflow: 'auto' } },
|
|
139
|
-
React.createElement(rebass_1.Box, { style: {
|
|
148
|
+
showSelectedOnlyPosition === 'floating' && (React.createElement(rebass_1.Box, { style: {
|
|
140
149
|
position: 'sticky',
|
|
141
150
|
top: 0,
|
|
142
151
|
zIndex: 10000,
|
|
@@ -147,15 +156,14 @@ function ValueSelector(props) {
|
|
|
147
156
|
right: 0,
|
|
148
157
|
borderRadius: 'var(--ab__border-radius)',
|
|
149
158
|
overflow: 'hidden',
|
|
150
|
-
}, fontSize: 2, backgroundColor: "defaultbackground" },
|
|
151
|
-
React.createElement(CheckBox_1.CheckBox, { disabled: !value.length, checked: selectedOnly, onChange: setSelectedOnly }, showSelectedOnlyLabel !== null && showSelectedOnlyLabel !== void 0 ? showSelectedOnlyLabel : 'Show Selected Only'))),
|
|
159
|
+
}, fontSize: 2, backgroundColor: "defaultbackground" }, showOnlySelectedCheckbox))),
|
|
152
160
|
React.createElement(react_beautiful_dnd_1.Droppable, { droppableId: "droppable" }, (droppableProvided) => {
|
|
153
161
|
return (React.createElement("div", Object.assign({ ref: droppableProvided.innerRef }, droppableProvided.droppableProps),
|
|
154
162
|
options
|
|
155
163
|
.filter((option) => {
|
|
156
164
|
let result = true;
|
|
157
165
|
if (filter) {
|
|
158
|
-
result = filter(option);
|
|
166
|
+
result = filter(option, searchInputValue);
|
|
159
167
|
}
|
|
160
168
|
result =
|
|
161
169
|
result && (selectedOnly ? selectedMap.has(toIdentifier(option)) : true);
|
|
@@ -68,7 +68,8 @@ class FormatColumnSummaryComponent extends React.Component {
|
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
onCloseWizard() {
|
|
71
|
-
|
|
71
|
+
var _a;
|
|
72
|
+
(_a = this === null || this === void 0 ? void 0 : this.setState) === null || _a === void 0 ? void 0 : _a.call(this, {
|
|
72
73
|
editedAdaptableObject: null,
|
|
73
74
|
wizardStartIndex: 0,
|
|
74
75
|
wizardStatus: EditableConfigEntityState_1.WizardStatus.None,
|
|
@@ -226,7 +226,7 @@ exports.LayoutEditor = React.memo((props) => {
|
|
|
226
226
|
const initialHeader = api.columnApi.getFriendlyNameFromColumnId(c.columnId);
|
|
227
227
|
return (React.createElement(rebass_1.Flex, { flexDirection: "column", alignItems: "stretch", "data-name": "drag-item", "data-col-id": c.columnId },
|
|
228
228
|
React.createElement(rebass_1.Flex, { flexDirection: "row", alignItems: "center", backgroundColor: "secondary", color: "text-on-secondary" },
|
|
229
|
-
React.createElement(rebass_1.Flex, {
|
|
229
|
+
React.createElement(rebass_1.Flex, { alignItems: "center" },
|
|
230
230
|
React.createElement(rebass_1.Box, { ml: 2, mr: 2 },
|
|
231
231
|
React.createElement(icons_1.Icon, { name: "drag", size: 30 })),
|
|
232
232
|
initialHeader,
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export interface LayoutWizardProps extends
|
|
5
|
-
ColumnSorts: ColumnSort[];
|
|
6
|
-
}
|
|
7
|
-
export declare class LayoutWizard extends React.Component<LayoutWizardProps, {}> {
|
|
8
|
-
render(): JSX.Element;
|
|
2
|
+
import { AdaptableOnePageWizardProps } from '../../Wizard/Interface/IAdaptableWizard';
|
|
3
|
+
import { Layout } from '../../../../types';
|
|
4
|
+
export interface LayoutWizardProps extends AdaptableOnePageWizardProps<Layout> {
|
|
9
5
|
}
|
|
6
|
+
export declare const LayoutWizard: React.FunctionComponent<LayoutWizardProps>;
|