@adaptabletools/adaptable 12.1.6 → 12.1.8-canary.1
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 +11 -49
- package/bundle.cjs.js +106 -106
- package/index.css +13 -60
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -0
- package/src/AdaptableOptions/ColumnOptions.d.ts +2 -4
- package/src/AdaptableOptions/FilterOptions.d.ts +12 -0
- package/src/AdaptableOptions/FinancePluginOptions.d.ts +22 -1
- package/src/AdaptableOptions/StateOptions.d.ts +25 -12
- package/src/Api/ColumnApi.d.ts +5 -0
- package/src/Api/ExportApi.d.ts +5 -0
- package/src/Api/FilterApi.d.ts +23 -0
- package/src/Api/FlashingCellApi.d.ts +8 -0
- package/src/Api/GridApi.d.ts +1 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -0
- package/src/Api/Implementation/ColumnApiImpl.js +5 -1
- package/src/Api/Implementation/ExportApiImpl.d.ts +3 -1
- package/src/Api/Implementation/ExportApiImpl.js +19 -3
- package/src/Api/Implementation/FilterApiImpl.d.ts +5 -0
- package/src/Api/Implementation/FilterApiImpl.js +35 -3
- package/src/Api/Implementation/FlashingCellApiImpl.d.ts +1 -0
- package/src/Api/Implementation/FlashingCellApiImpl.js +4 -0
- package/src/Api/Implementation/GridApiImpl.d.ts +1 -0
- package/src/Api/Implementation/InternalApiImpl.d.ts +0 -1
- package/src/Api/Implementation/InternalApiImpl.js +0 -3
- package/src/Api/Implementation/PredicateApiImpl.js +4 -0
- package/src/Api/Implementation/QueryLanguageApiImpl.js +9 -1
- package/src/Api/InternalApi.d.ts +0 -1
- package/src/Api/SystemStatusApi.d.ts +1 -1
- package/src/Api/ToolPanelApi.d.ts +1 -1
- package/src/PredefinedConfig/CalculatedColumnState.d.ts +2 -2
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +30 -10
- package/src/PredefinedConfig/Common/AdaptableQuery.js +1 -1
- package/src/PredefinedConfig/Common/AggregationColumns.d.ts +6 -0
- package/src/PredefinedConfig/Common/AggregationColumns.js +4 -0
- package/src/PredefinedConfig/Common/ColumnFilter.d.ts +2 -2
- package/src/PredefinedConfig/Common/Enums.d.ts +0 -15
- package/src/PredefinedConfig/Common/Enums.js +1 -18
- package/src/PredefinedConfig/Common/SpecialColumnSettings.d.ts +6 -6
- package/src/PredefinedConfig/ExportState.d.ts +12 -4
- package/src/PredefinedConfig/LayoutState.d.ts +2 -1
- package/src/PredefinedConfig/PopupState.d.ts +1 -2
- package/src/Redux/ActionsReducers/AlertRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/AlertRedux.js +1 -1
- package/src/Redux/ActionsReducers/ConditionalStyleRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/ConditionalStyleRedux.js +1 -1
- package/src/Redux/ActionsReducers/CustomSortRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/CustomSortRedux.js +1 -1
- package/src/Redux/ActionsReducers/FlashingCellRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/FlashingCellRedux.js +1 -1
- package/src/Redux/ActionsReducers/FormatColumnRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/FormatColumnRedux.js +1 -1
- package/src/Redux/ActionsReducers/LayoutRedux.d.ts +28 -0
- package/src/Redux/ActionsReducers/LayoutRedux.js +80 -2
- package/src/Redux/ActionsReducers/PlusMinusRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/PlusMinusRedux.js +1 -1
- package/src/Redux/ActionsReducers/PopupRedux.d.ts +0 -2
- package/src/Redux/ActionsReducers/PopupRedux.js +1 -28
- package/src/Redux/ActionsReducers/ScheduleRedux.d.ts +5 -5
- package/src/Redux/ActionsReducers/ScheduleRedux.js +5 -5
- package/src/Redux/ActionsReducers/ShortcutRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/ShortcutRedux.js +1 -1
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +1 -2
- package/src/Redux/ActionsReducers/SystemRedux.js +1 -2
- package/src/Redux/Store/AdaptableStore.js +20 -6
- package/src/Strategy/AlertModule.d.ts +1 -0
- package/src/Strategy/AlertModule.js +20 -0
- package/src/Strategy/CalculatedColumnModule.js +2 -2
- package/src/Strategy/ExportModule.d.ts +0 -1
- package/src/Strategy/ExportModule.js +0 -16
- package/src/Strategy/FilterModule.js +6 -0
- package/src/Strategy/FlashingCellModule.js +2 -2
- package/src/Strategy/Interface/IModule.d.ts +4 -0
- package/src/Strategy/LayoutModule.js +20 -20
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnStyleViewItems.js +16 -1
- package/src/Strategy/Utilities/Layout/getLayoutFilterViewItems.js +15 -11
- package/src/Utilities/Constants/DocumentationLinkConstants.d.ts +1 -0
- package/src/Utilities/Constants/DocumentationLinkConstants.js +2 -1
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +2 -0
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.d.ts +12 -2
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +30 -66
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +22 -6
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +423 -220
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.d.ts +7 -1
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +23 -7
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.d.ts +0 -1
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +6 -54
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +17 -5
- package/src/Utilities/Helpers/CalendarHelper.js +10 -7
- package/src/Utilities/Helpers/DateHelper.d.ts +0 -26
- package/src/Utilities/Helpers/DateHelper.js +2 -32
- package/src/Utilities/Interface/MessagePopups.d.ts +0 -4
- package/src/Utilities/ObjectFactory.d.ts +6 -4
- package/src/Utilities/ObjectFactory.js +30 -17
- package/src/Utilities/Services/AggregatedScalarLiveValue.d.ts +25 -0
- package/src/Utilities/Services/AggregatedScalarLiveValue.js +103 -0
- package/src/Utilities/Services/AlertService.d.ts +0 -1
- package/src/Utilities/Services/AlertService.js +5 -17
- package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +4 -4
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +29 -154
- package/src/Utilities/Services/Interface/ICalculatedColumnExpressionService.d.ts +2 -2
- package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +6 -3
- package/src/Utilities/Services/QueryLanguageService.d.ts +6 -3
- package/src/Utilities/Services/QueryLanguageService.js +23 -6
- package/src/Utilities/Services/ReportService.js +47 -46
- package/src/View/AdaptableView.js +1 -2
- package/src/View/CalculatedColumn/Utilities/getCalculatedColumnSettingsTags.d.ts +2 -0
- package/src/View/CalculatedColumn/Utilities/{getCalculatedColumnSettingTags.js → getCalculatedColumnSettingsTags.js} +5 -3
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.d.ts +10 -0
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.js +80 -0
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +21 -15
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.d.ts +1 -2
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +10 -53
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +14 -3
- package/src/View/Components/AdaptableDateInput/index.js +1 -1
- package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +42 -6
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +1 -1
- package/src/View/Components/EntityRulesEditor/index.js +26 -5
- package/src/View/Components/FilterForm/FilterForm.js +8 -4
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +1 -0
- package/src/View/Components/FilterForm/QuickFilterForm.js +10 -6
- package/src/View/Components/PermittedValuesSelector/PermitedValuesSelector.d.ts +9 -0
- package/src/View/Components/PermittedValuesSelector/PermitedValuesSelector.js +28 -0
- package/src/View/Components/PermittedValuesSelector/index.d.ts +1 -0
- package/src/View/Components/PermittedValuesSelector/index.js +5 -0
- package/src/View/Components/Popups/AdaptablePopup/Navigation.js +2 -2
- package/src/View/Components/Popups/AdaptableToaster.js +2 -7
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +0 -1
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +1 -4
- package/src/View/Export/ExportViewPanel.d.ts +1 -2
- package/src/View/Export/ExportViewPanel.js +2 -6
- package/src/View/Export/Wizard/ReportColumnTypeWizard.d.ts +1 -2
- package/src/View/Export/Wizard/ReportColumnTypeWizard.js +11 -12
- package/src/View/Export/Wizard/ReportRowTypeWizard.d.ts +1 -2
- package/src/View/Export/Wizard/ReportRowTypeWizard.js +12 -13
- package/src/View/Export/Wizard/ReportSettingsWizard.js +1 -2
- package/src/View/Filter/FilterViewPanel.js +20 -4
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +1 -1
- package/src/View/FreeTextColumn/FreeTextColumnSummary.js +1 -2
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.d.ts +1 -1
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +1 -1
- package/src/View/Layout/Wizard/{LayoutEditor → Components}/ColumnLabels.d.ts +0 -0
- package/src/View/Layout/Wizard/{LayoutEditor → Components}/ColumnLabels.js +0 -0
- package/src/View/Layout/Wizard/LayoutWizard.js +1 -0
- package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +1 -0
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +69 -8
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +1 -1
- package/src/View/Query/QueryViewPanel.js +1 -1
- package/src/agGrid/Adaptable.d.ts +11 -3
- package/src/agGrid/Adaptable.js +224 -150
- package/src/agGrid/agGridHelper.d.ts +1 -0
- package/src/agGrid/agGridHelper.js +5 -3
- package/src/agGrid/agGridMenuHelper.d.ts +1 -0
- package/src/agGrid/agGridMenuHelper.js +4 -2
- package/src/agGrid/weightedAverage.d.ts +6 -0
- package/src/agGrid/weightedAverage.js +66 -0
- package/src/bundle-dependencies/bundles/react-toastify/index.js +1 -1
- package/src/components/ExpressionEditor/BaseEditorInput.d.ts +1 -0
- package/src/components/ExpressionEditor/BaseEditorInput.js +2 -3
- package/src/components/ExpressionEditor/EditorInput.d.ts +1 -1
- package/src/components/ExpressionEditor/EditorInput.js +24 -4
- package/src/components/ExpressionEditor/{EditorInputReactive.d.ts → EditorInputWithWhereClause.d.ts} +3 -3
- package/src/components/ExpressionEditor/{EditorInputReactive.js → EditorInputWithWhereClause.js} +6 -5
- package/src/components/ExpressionEditor/editorButtonsAggregatedBoolean.d.ts +2 -0
- package/src/components/ExpressionEditor/{editorButtonsReactive.js → editorButtonsAggregatedBoolean.js} +22 -37
- package/src/components/ExpressionEditor/editorButtonsAggregatedScalar.js +5 -10
- package/src/components/ExpressionEditor/editorButtonsCumulativeAggregatedScalar.d.ts +2 -0
- package/src/components/ExpressionEditor/editorButtonsCumulativeAggregatedScalar.js +50 -0
- package/src/components/ExpressionEditor/editorButtonsObservable.d.ts +2 -0
- package/src/components/ExpressionEditor/editorButtonsObservable.js +40 -0
- package/src/components/ExpressionEditor/index.d.ts +1 -1
- package/src/components/ExpressionEditor/index.js +26 -5
- package/src/metamodel/adaptable.metamodel.d.ts +55 -1
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +3 -3
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/View/CalculatedColumn/Utilities/getCalculatedColumnSettingTags.d.ts +0 -2
- package/src/View/Layout/LayoutEditorStandalonePopup.d.ts +0 -3
- package/src/View/Layout/LayoutEditorStandalonePopup.js +0 -78
- package/src/View/Layout/Wizard/LayoutEditor/ColumnList.d.ts +0 -27
- package/src/View/Layout/Wizard/LayoutEditor/ColumnList.js +0 -86
- package/src/View/Layout/Wizard/LayoutEditor/ColumnSortList.d.ts +0 -16
- package/src/View/Layout/Wizard/LayoutEditor/ColumnSortList.js +0 -89
- package/src/View/Layout/Wizard/LayoutEditor/PivotList.d.ts +0 -15
- package/src/View/Layout/Wizard/LayoutEditor/PivotList.js +0 -70
- package/src/View/Layout/Wizard/LayoutEditor/RowGroupsList.d.ts +0 -15
- package/src/View/Layout/Wizard/LayoutEditor/RowGroupsList.js +0 -70
- package/src/View/Layout/Wizard/LayoutEditor/droppableIds.d.ts +0 -7
- package/src/View/Layout/Wizard/LayoutEditor/droppableIds.js +0 -11
- package/src/View/Layout/Wizard/LayoutEditor/getItemStyle.d.ts +0 -6
- package/src/View/Layout/Wizard/LayoutEditor/getItemStyle.js +0 -26
- package/src/View/Layout/Wizard/LayoutEditor/index.d.ts +0 -9
- package/src/View/Layout/Wizard/LayoutEditor/index.js +0 -367
- package/src/View/Layout/Wizard/LayoutEditor/reducer.d.ts +0 -28
- package/src/View/Layout/Wizard/LayoutEditor/reducer.js +0 -46
- package/src/View/Layout/Wizard/LayoutEditor/utils.d.ts +0 -10
- package/src/View/Layout/Wizard/LayoutEditor/utils.js +0 -14
- package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +0 -30
- package/src/View/Layout/Wizard/LayoutEditorWizard.js +0 -132
- package/src/components/ExpressionEditor/editorButtonsReactive.d.ts +0 -2
|
@@ -11,7 +11,7 @@ const ValueSelector_1 = require("../ValueSelector");
|
|
|
11
11
|
const baseClassName = 'ab-Adaptable-Object-Compact-List';
|
|
12
12
|
const ICON_SIZE = 20;
|
|
13
13
|
const AdaptableObjectCompactListItem = (props) => {
|
|
14
|
-
var _a, _b, _c, _d, _e, _f;
|
|
14
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
15
15
|
const dispatch = react_redux_1.useDispatch();
|
|
16
16
|
const adaptable = AdaptableContext_1.useAdaptable();
|
|
17
17
|
const objectView = props.module.toViewCompact(props.abObject);
|
|
@@ -20,9 +20,24 @@ const AdaptableObjectCompactListItem = (props) => {
|
|
|
20
20
|
const moduleAccessLevel = adaptable.api.internalApi
|
|
21
21
|
.getEntitlementService()
|
|
22
22
|
.getEntitlementAccessLevelForModule(props.module.moduleInfo.ModuleName);
|
|
23
|
-
const
|
|
23
|
+
const suspendAction = (_d = viewOptions === null || viewOptions === void 0 ? void 0 : viewOptions.getCompactSuspendAction) === null || _d === void 0 ? void 0 : _d.call(viewOptions, props.abObject);
|
|
24
|
+
const unSuspendAction = (_e = viewOptions === null || viewOptions === void 0 ? void 0 : viewOptions.getCompactUnSuspendAction) === null || _e === void 0 ? void 0 : _e.call(viewOptions, props.abObject);
|
|
25
|
+
const isSuspended = props.abObject.IsSuspended;
|
|
26
|
+
const handleDelete = React.useCallback((event) => {
|
|
27
|
+
event.stopPropagation();
|
|
28
|
+
event.preventDefault();
|
|
24
29
|
dispatch(deleteAction);
|
|
25
30
|
}, []);
|
|
31
|
+
const handleSuspendUnSuspend = React.useCallback((event) => {
|
|
32
|
+
event.stopPropagation();
|
|
33
|
+
event.preventDefault();
|
|
34
|
+
if (isSuspended) {
|
|
35
|
+
dispatch(unSuspendAction);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
dispatch(suspendAction);
|
|
39
|
+
}
|
|
40
|
+
}, [props.abObject]);
|
|
26
41
|
let labelEl = objectView.item.label;
|
|
27
42
|
if (typeof labelEl === 'function') {
|
|
28
43
|
labelEl = React.createElement(labelEl, { data: props.abObject });
|
|
@@ -35,21 +50,42 @@ const AdaptableObjectCompactListItem = (props) => {
|
|
|
35
50
|
React.createElement(objectView.item.view, {
|
|
36
51
|
data: props.abObject,
|
|
37
52
|
}),
|
|
38
|
-
Boolean(((
|
|
53
|
+
Boolean(((_f = objectView.item) === null || _f === void 0 ? void 0 : _f.values) && ((_h = (_g = objectView.item) === null || _g === void 0 ? void 0 : _g.values) === null || _h === void 0 ? void 0 : _h.length)) && (React.createElement(rebass_1.Box, { mb: 2, className: `${baseClassName}__Item__Values` },
|
|
39
54
|
React.createElement(ValueSelector_1.ValueOptionsTags, { style: { marginRight: 0 }, readOnly: true, options: objectView.item.values, value: objectView.item.values, allowWrap: true, toIdentifier: (c) => c, toLabel: (c) => React.createElement(React.Fragment, null, c) })))),
|
|
40
|
-
|
|
55
|
+
suspendAction && unSuspendAction && (React.createElement(SimpleButton_1.default, { onMouseDown: handleSuspendUnSuspend, tone: isSuspended ? 'neutral' : 'success', variant: "text", icon: isSuspended ? 'play' : 'pause' })),
|
|
56
|
+
React.createElement(rebass_1.Flex, { ml: 1 }, deleteAction && (React.createElement(SimpleButton_1.default, { iconSize: ICON_SIZE, icon: "delete", variant: "text", onMouseDown: handleDelete, accessLevel: moduleAccessLevel })))));
|
|
41
57
|
};
|
|
42
58
|
exports.AdaptableObjectCompactListItem = AdaptableObjectCompactListItem;
|
|
43
59
|
const AdaptableObjectCompactList = (props) => {
|
|
44
|
-
var _a, _b, _c;
|
|
60
|
+
var _a, _b, _c, _d, _e;
|
|
61
|
+
const adaptable = AdaptableContext_1.useAdaptable();
|
|
45
62
|
const viewProperties = (_b = (_a = props.module).getViewProperties) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
46
63
|
const deleteAllAction = (_c = viewProperties === null || viewProperties === void 0 ? void 0 : viewProperties.getDeleteAllAction) === null || _c === void 0 ? void 0 : _c.call(viewProperties);
|
|
64
|
+
const suspendAllAction = (_d = viewProperties === null || viewProperties === void 0 ? void 0 : viewProperties.getSuspendAllAction) === null || _d === void 0 ? void 0 : _d.call(viewProperties);
|
|
65
|
+
const unSuspendAllAction = (_e = viewProperties === null || viewProperties === void 0 ? void 0 : viewProperties.getUnSuspendAllAction) === null || _e === void 0 ? void 0 : _e.call(viewProperties);
|
|
47
66
|
const dispatch = react_redux_1.useDispatch();
|
|
67
|
+
const accessLevel = adaptable.api.internalApi
|
|
68
|
+
.getEntitlementService()
|
|
69
|
+
.getEntitlementAccessLevelForModule(props.module.moduleInfo.ModuleName);
|
|
70
|
+
const isAtLeastOneAbObjectActive = props.abObjects.some((abObject) => {
|
|
71
|
+
return !abObject.IsSuspended;
|
|
72
|
+
});
|
|
73
|
+
const handleSuspendUnsuspendAll = React.useCallback((event) => {
|
|
74
|
+
event.stopPropagation();
|
|
75
|
+
event.preventDefault();
|
|
76
|
+
if (isAtLeastOneAbObjectActive) {
|
|
77
|
+
dispatch(suspendAllAction);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
dispatch(unSuspendAllAction);
|
|
81
|
+
}
|
|
82
|
+
}, [isAtLeastOneAbObjectActive]);
|
|
48
83
|
return (React.createElement(rebass_1.Flex, { flexDirection: "column", className: baseClassName },
|
|
49
84
|
React.createElement(rebass_1.Flex, { className: `${baseClassName}__Header`, fontSize: 3 },
|
|
50
85
|
React.createElement(rebass_1.Box, { className: `${baseClassName}__Title` }, props.module.moduleInfo.FriendlyName),
|
|
51
86
|
React.createElement(rebass_1.Box, { flex: 1 }),
|
|
52
|
-
|
|
87
|
+
suspendAllAction && unSuspendAllAction && (React.createElement(SimpleButton_1.default, { mr: 2, onMouseDown: handleSuspendUnsuspendAll, tone: isAtLeastOneAbObjectActive ? 'neutral' : 'success', variant: "raised", icon: isAtLeastOneAbObjectActive ? 'pause' : 'play', accessLevel: accessLevel }, isAtLeastOneAbObjectActive ? 'Suspend All' : 'Unsuspend All')),
|
|
88
|
+
deleteAllAction && (React.createElement(SimpleButton_1.default, { onMouseDown: () => dispatch(deleteAllAction), variant: "raised", tone: "neutral", accessLevel: accessLevel }, "Clear All"))),
|
|
53
89
|
React.createElement(rebass_1.Box, { className: `${baseClassName}__Body` }, props.abObjects.map((abObject) => {
|
|
54
90
|
return (React.createElement(exports.AdaptableObjectCompactListItem, { key: abObject.Uuid, abObject: abObject, module: props.module }));
|
|
55
91
|
}))));
|
|
@@ -28,7 +28,7 @@ const AdaptableObjectListItemView = (props) => {
|
|
|
28
28
|
labelEl = React.createElement(tag.label, { data: props.abObject });
|
|
29
29
|
}
|
|
30
30
|
labelEl = labelEl !== null && labelEl !== void 0 ? labelEl : tag.name;
|
|
31
|
-
return (React.createElement(rebass_1.Flex, { "data-name": tag.name, key: index
|
|
31
|
+
return (React.createElement(rebass_1.Flex, { "data-name": tag.name, key: `${index}-${tag.name}`, mb: 2, className: `${baseClassName}__row` },
|
|
32
32
|
React.createElement(rebass_1.Box, { className: `${baseClassName}__label`, mr: 3 },
|
|
33
33
|
labelEl,
|
|
34
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: () => {
|
|
@@ -14,6 +14,7 @@ const AdaptableContext_1 = require("../../AdaptableContext");
|
|
|
14
14
|
const ButtonInfo_1 = require("../Buttons/ButtonInfo");
|
|
15
15
|
const DocumentationLinkConstants_1 = require("../../../Utilities/Constants/DocumentationLinkConstants");
|
|
16
16
|
const react_1 = require("react");
|
|
17
|
+
const PermittedValuesSelector_1 = require("../PermittedValuesSelector");
|
|
17
18
|
const isRuleValid = (abObject, api, context) => {
|
|
18
19
|
var _a, _b, _c, _d, _e, _f;
|
|
19
20
|
if (!((_a = abObject === null || abObject === void 0 ? void 0 : abObject.Rule) === null || _a === void 0 ? void 0 : _a.Predicate) && !((_b = abObject === null || abObject === void 0 ? void 0 : abObject.Rule) === null || _b === void 0 ? void 0 : _b.BooleanExpression)) {
|
|
@@ -90,6 +91,19 @@ const EntityRulesEditor = (props) => {
|
|
|
90
91
|
const predicateId = data.Rule.Predicate != undefined ? data.Rule.Predicate.PredicateId : undefined;
|
|
91
92
|
const predicateInputs = predicateId ? (_a = data.Rule.Predicate.Inputs) !== null && _a !== void 0 ? _a : [] : [];
|
|
92
93
|
const currentPredicateDef = api.predicateApi.getPredicateDefById(predicateId);
|
|
94
|
+
const isValuesPredicateDef = (colDef) => colDef && ['Values', 'ExcludeValues'].includes(colDef.id);
|
|
95
|
+
const predicateDefsOptions = predicateDefs
|
|
96
|
+
.filter((def) => {
|
|
97
|
+
if (isValuesPredicateDef(def)) {
|
|
98
|
+
return 'ColumnIds' in data.Scope && data.Scope.ColumnIds.length === 1;
|
|
99
|
+
}
|
|
100
|
+
return true;
|
|
101
|
+
})
|
|
102
|
+
.map((item) => ({
|
|
103
|
+
value: item.id,
|
|
104
|
+
label: item.label,
|
|
105
|
+
onClick: () => onPredicateChange(item),
|
|
106
|
+
}));
|
|
93
107
|
const onPredicateInputChange = (e, index) => {
|
|
94
108
|
const { value } = e.target;
|
|
95
109
|
const newInputs = [...predicateInputs];
|
|
@@ -101,6 +115,14 @@ const EntityRulesEditor = (props) => {
|
|
|
101
115
|
},
|
|
102
116
|
} }));
|
|
103
117
|
};
|
|
118
|
+
const onPredicateValuesChange = (inputs) => {
|
|
119
|
+
props.onChange(Object.assign(Object.assign({}, data), { Rule: {
|
|
120
|
+
Predicate: {
|
|
121
|
+
PredicateId: predicateId,
|
|
122
|
+
Inputs: inputs,
|
|
123
|
+
},
|
|
124
|
+
} }));
|
|
125
|
+
};
|
|
104
126
|
const onPredicateChange = (item) => {
|
|
105
127
|
var _a;
|
|
106
128
|
if (item) {
|
|
@@ -146,14 +168,13 @@ const EntityRulesEditor = (props) => {
|
|
|
146
168
|
overflow: 'hidden',
|
|
147
169
|
textOverflow: 'ellipsis',
|
|
148
170
|
maxWidth: 'inherit',
|
|
149
|
-
}, placeholder: "Select Rule", showClearButton: !!data.Rule.Predicate, onClear: clearPredicate, items:
|
|
150
|
-
value: item.id,
|
|
151
|
-
label: item.label,
|
|
152
|
-
onClick: () => onPredicateChange(item),
|
|
153
|
-
})), columns: ['label'] }, currentPredicateDef ? currentPredicateDef.label : 'Select Rule'), (_b = currentPredicateDef === null || currentPredicateDef === void 0 ? void 0 : currentPredicateDef.inputs) === null || _b === void 0 ? void 0 :
|
|
171
|
+
}, placeholder: "Select Rule", showClearButton: !!data.Rule.Predicate, onClear: clearPredicate, items: predicateDefsOptions, columns: ['label'] }, currentPredicateDef ? currentPredicateDef.label : 'Select Rule'), (_b = currentPredicateDef === null || currentPredicateDef === void 0 ? void 0 : currentPredicateDef.inputs) === null || _b === void 0 ? void 0 :
|
|
154
172
|
_b.map((predicateDefInput, index) => (React.createElement(rebass_1.Flex, { key: predicateId + index, flexDirection: "column" },
|
|
155
173
|
index > 0 && React.createElement(HelpBlock_1.default, { marginTop: 2 }, "AND"),
|
|
156
174
|
React.createElement(AdaptableInput_1.default, { marginTop: 2, type: predicateDefInput.type, autoFocus: index === 0, value: predicateInputs[index], onChange: (e) => onPredicateInputChange(e, index) })))),
|
|
175
|
+
isValuesPredicateDef(currentPredicateDef) &&
|
|
176
|
+
'ColumnIds' in data.Scope &&
|
|
177
|
+
data.Scope.ColumnIds.length === 1 && (React.createElement(PermittedValuesSelector_1.PermitedValuesSelector, { onPredicateValuesChange: onPredicateValuesChange, predicate: data.Rule.Predicate, scope: data.Scope })),
|
|
157
178
|
showDocumentationLinks && (React.createElement(HelpBlock_1.default, { "data-name": "query-documentation", mt: 3, mb: 2, style: {
|
|
158
179
|
fontSize: 'var(--ab-font-size-3)',
|
|
159
180
|
padding: 0,
|
|
@@ -144,7 +144,7 @@ class FilterFormComponent extends React.Component {
|
|
|
144
144
|
React.createElement(Radio_1.default, { marginLeft: 2, flex: 1, checked: this.state.currentTab == 'predicates', onChange: () => this.setState({ currentTab: 'predicates' }) },
|
|
145
145
|
React.createElement(rebass_1.Flex, { fontSize: 'var( --ab-font-size-2)' }, "Filters")))),
|
|
146
146
|
this.state.currentTab === 'values' && (React.createElement("div", null,
|
|
147
|
-
React.createElement(ListBoxFilterForm_1.ListBoxFilterForm, { suppressClientSideFilter: this.state.suppressClientSideFilter, isLoading: this.state.isDistinctColumnValuesLoading, onFilterChange: this.handleFilterChange, currentColumn: this.props.currentColumn, columns: this.props.columns, columnDistinctValues: this.state.distinctColumnValues, dataType: this.props.currentColumn.dataType, uiSelectedColumnValues: uiSelectedColumnValues, useAgGridStyle: useAgGridStyle, onColumnValueSelectedChange: (list) => this.onColumnValuesChange(list) }))),
|
|
147
|
+
React.createElement(ListBoxFilterForm_1.ListBoxFilterForm, { disabled: this.isFilterDisabled(), suppressClientSideFilter: this.state.suppressClientSideFilter, isLoading: this.state.isDistinctColumnValuesLoading, onFilterChange: this.handleFilterChange, currentColumn: this.props.currentColumn, columns: this.props.columns, columnDistinctValues: this.state.distinctColumnValues, dataType: this.props.currentColumn.dataType, uiSelectedColumnValues: uiSelectedColumnValues, useAgGridStyle: useAgGridStyle, onColumnValueSelectedChange: (list) => this.onColumnValuesChange(list) }))),
|
|
148
148
|
this.state.currentTab === 'predicates' && (React.createElement("div", null,
|
|
149
149
|
' ',
|
|
150
150
|
this.state.showTab && React.createElement("hr", null),
|
|
@@ -157,7 +157,7 @@ class FilterFormComponent extends React.Component {
|
|
|
157
157
|
const { editedColumnFilter } = this.state;
|
|
158
158
|
const checked = ((_a = editedColumnFilter === null || editedColumnFilter === void 0 ? void 0 : editedColumnFilter.Predicate) === null || _a === void 0 ? void 0 : _a.PredicateId) === predicateDef.id;
|
|
159
159
|
return (React.createElement(rebass_1.Flex, { key: index, flexDirection: "column" },
|
|
160
|
-
React.createElement(Radio_1.default, { fontSize: 'var(--ab-font-size-2)', margin: 1, flex: 1, checked: checked, onChange: () => this.selectColumnPredicate(predicateDef) }, predicateDef.label),
|
|
160
|
+
React.createElement(Radio_1.default, { disabled: this.isFilterDisabled(), fontSize: 'var(--ab-font-size-2)', margin: 1, flex: 1, checked: checked, onChange: () => this.selectColumnPredicate(predicateDef) }, predicateDef.label),
|
|
161
161
|
React.createElement(rebass_1.Flex, { flexDirection: "column", flex: 0, marginLeft: 3, marginRight: 2 }, checked && this.renderPredicateInput(predicateDef, editedColumnFilter))));
|
|
162
162
|
}
|
|
163
163
|
renderPredicateInput(predicateDef, filter) {
|
|
@@ -165,7 +165,7 @@ class FilterFormComponent extends React.Component {
|
|
|
165
165
|
if ((predicateDef === null || predicateDef === void 0 ? void 0 : predicateDef.id) === 'BooleanToggle') {
|
|
166
166
|
// custom tri-state checkbox: true, false, all(indeterminate)
|
|
167
167
|
return (React.createElement(rebass_1.Flex, { flexDirection: "row", flex: 1, justifyContent: "center", alignItems: "center" },
|
|
168
|
-
React.createElement(CheckBox_1.CheckBox, { checked: filter.Predicate.Inputs[0] === 'true'
|
|
168
|
+
React.createElement(CheckBox_1.CheckBox, { disabled: this.isFilterDisabled(), checked: filter.Predicate.Inputs[0] === 'true'
|
|
169
169
|
? true
|
|
170
170
|
: filter.Predicate.Inputs[0] === 'false'
|
|
171
171
|
? false
|
|
@@ -181,12 +181,16 @@ class FilterFormComponent extends React.Component {
|
|
|
181
181
|
} })));
|
|
182
182
|
}
|
|
183
183
|
return (_a = predicateDef.inputs) === null || _a === void 0 ? void 0 : _a.map((predicateInput, index) => (React.createElement(rebass_1.Flex, { key: index, flexDirection: "row" },
|
|
184
|
-
React.createElement(AdaptableInput_1.default, { type: predicateInput.type, autoFocus: index === 0, value: filter.Predicate.Inputs[index], onChange: (e) => this.changeColumnPredicateInput(e.target.value, index), style: {
|
|
184
|
+
React.createElement(AdaptableInput_1.default, { disabled: this.isFilterDisabled(), type: predicateInput.type, autoFocus: index === 0, value: filter.Predicate.Inputs[index], onChange: (e) => this.changeColumnPredicateInput(e.target.value, index), style: {
|
|
185
185
|
marginBottom: 5,
|
|
186
186
|
flex: 1,
|
|
187
187
|
fontSize: 'var( --ab-font-size-2)',
|
|
188
188
|
} }))));
|
|
189
189
|
}
|
|
190
|
+
isFilterDisabled() {
|
|
191
|
+
var _a;
|
|
192
|
+
return Boolean((_a = this.state.editedColumnFilter) === null || _a === void 0 ? void 0 : _a.IsSuspended);
|
|
193
|
+
}
|
|
190
194
|
isFilterable() {
|
|
191
195
|
if (!this.props.currentColumn.filterable) {
|
|
192
196
|
return 'Column is not filterable';
|
|
@@ -58,6 +58,7 @@ const ListBoxFilterForm = (props) => {
|
|
|
58
58
|
children: distinctValue.label,
|
|
59
59
|
checked: isActive,
|
|
60
60
|
onChange: () => onClickItemColumnValue(distinctValue.value),
|
|
61
|
+
disabled: props.disabled,
|
|
61
62
|
});
|
|
62
63
|
}
|
|
63
64
|
return (React.createElement(ListGroupItem_1.default, { noZebra: props.useAgGridStyle, key: 'columnValue' + index, onClick: () => onClickItemColumnValue(distinctValue.value), active: isActive, value: distinctValue.value }, distinctValue.label));
|
|
@@ -74,6 +74,9 @@ class QuickFilterFormComponent extends React.Component {
|
|
|
74
74
|
(_a = this.unsubscribeOnCellChanged) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
75
75
|
(_b = this.unsubscribeOnGridDataChanged) === null || _b === void 0 ? void 0 : _b.call(this);
|
|
76
76
|
}
|
|
77
|
+
isFilterDisabled() {
|
|
78
|
+
return Boolean(this.state.filter.IsSuspended);
|
|
79
|
+
}
|
|
77
80
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
78
81
|
const filter = this.getFilterFromProps(nextProps);
|
|
79
82
|
if (isEqual_1.default(filter, this.state.filter)) {
|
|
@@ -142,7 +145,7 @@ class QuickFilterFormComponent extends React.Component {
|
|
|
142
145
|
React.createElement("span", { style: { width: 20, marginRight: 10 } },
|
|
143
146
|
React.createElement(icons_1.Icon, { name: "delete" })),
|
|
144
147
|
"Clear"))),
|
|
145
|
-
predicateDefs.map((p) => (React.createElement(SimpleButton_1.default, { key: p.id, p: 2, variant: "text", tone: (filter === null || filter === void 0 ? void 0 : filter.Predicate.PredicateId) === p.id ? 'info' : 'none', onClick: () => this.selectColumnPredicate(p.id) },
|
|
148
|
+
predicateDefs.map((p) => (React.createElement(SimpleButton_1.default, { disabled: this.isFilterDisabled(), key: p.id, p: 2, variant: "text", tone: (filter === null || filter === void 0 ? void 0 : filter.Predicate.PredicateId) === p.id ? 'info' : 'none', onClick: () => this.selectColumnPredicate(p.id) },
|
|
146
149
|
React.createElement("span", { style: { width: 20, marginRight: 10 } }, this.renderPredicateIcon(p)),
|
|
147
150
|
p.label))))) },
|
|
148
151
|
React.createElement(SimpleButton_1.default, { style: {
|
|
@@ -161,7 +164,7 @@ class QuickFilterFormComponent extends React.Component {
|
|
|
161
164
|
return this.renderValuesDropdown(filter);
|
|
162
165
|
}
|
|
163
166
|
return (activePredicateDef &&
|
|
164
|
-
(activePredicateDef === null || activePredicateDef === void 0 ? void 0 : activePredicateDef.inputs) === undefined && (React.createElement(rebass_1.Box, { p: 1, alignSelf: "center" }, activePredicateDef.label)));
|
|
167
|
+
(activePredicateDef === null || activePredicateDef === void 0 ? void 0 : activePredicateDef.inputs) === undefined && (React.createElement(rebass_1.Box, { color: this.isFilterDisabled() && 'var(--ab-color-text-on-primary)', disabled: this.isFilterDisabled(), p: 1, alignSelf: "center" }, activePredicateDef.label)));
|
|
165
168
|
}
|
|
166
169
|
renderPredicateIcon(predicateDef) {
|
|
167
170
|
if (!predicateDef || !predicateDef.icon) {
|
|
@@ -179,7 +182,7 @@ class QuickFilterFormComponent extends React.Component {
|
|
|
179
182
|
if ((predicateDef === null || predicateDef === void 0 ? void 0 : predicateDef.id) === 'BooleanToggle') {
|
|
180
183
|
// custom tri-state checkbox: 'checked', 'unchecked', 'all'
|
|
181
184
|
return (React.createElement(rebass_1.Flex, { flexDirection: "row", flex: 1, justifyContent: "center", alignItems: "center", style: { position: 'absolute', left: 0, right: 0, bottom: 0, top: 0 } },
|
|
182
|
-
React.createElement(CheckBox_1.CheckBox, { checked: filter.Predicate.Inputs[0] === 'checked'
|
|
185
|
+
React.createElement(CheckBox_1.CheckBox, { disabled: this.isFilterDisabled(), checked: filter.Predicate.Inputs[0] === 'checked'
|
|
183
186
|
? true
|
|
184
187
|
: filter.Predicate.Inputs[0] === 'unchecked'
|
|
185
188
|
? false
|
|
@@ -196,7 +199,7 @@ class QuickFilterFormComponent extends React.Component {
|
|
|
196
199
|
}
|
|
197
200
|
return (_a = predicateDef === null || predicateDef === void 0 ? void 0 : predicateDef.inputs) === null || _a === void 0 ? void 0 : _a.map((predicateInput, index) => {
|
|
198
201
|
var _a, _b;
|
|
199
|
-
return (React.createElement(AdaptableInput_1.default, { key: index, type: predicateInput.type === 'number' ? 'text' : predicateInput.type,
|
|
202
|
+
return (React.createElement(AdaptableInput_1.default, { disabled: this.isFilterDisabled(), key: index, type: predicateInput.type === 'number' ? 'text' : predicateInput.type,
|
|
200
203
|
// autoFocus has to be FALSE because if the input receives focus in the init phase,
|
|
201
204
|
// it may scroll the ag-grid header viewport into view and de-synchronize it (relative to the content viewport)
|
|
202
205
|
autoFocus: false, value: (_b = (_a = filter.Predicate.Inputs) === null || _a === void 0 ? void 0 : _a[index]) !== null && _b !== void 0 ? _b : '', onChange: (e) => this.changeColumnPredicateInput(e.target.value, index), onKeyDownCapture: (e) => {
|
|
@@ -266,7 +269,7 @@ class QuickFilterFormComponent extends React.Component {
|
|
|
266
269
|
React.createElement(SimpleButton_1.default, { onClick: () => this.clearFilter() }, "Clear Filter"),
|
|
267
270
|
((_a = this.props.api.internalApi.getAdaptableOptions().filterOptions) === null || _a === void 0 ? void 0 : _a.autoApplyFilter) ==
|
|
268
271
|
false && (React.createElement(SimpleButton_1.default, { ml: 2, onClick: () => this.updateFilter(this.state.filter) }, "Apply Filter"))),
|
|
269
|
-
React.createElement(ListBoxFilterForm_1.ListBoxFilterForm, { suppressClientSideFilter: this.state.suppressClientSideFilter, isLoading: this.state.isDistinctColumnValuesLoading, onFilterChange: this.handleFilterChange, currentColumn: this.props.currentColumn, columns: [], columnDistinctValues: this.state.distinctColumnValues, dataType: this.props.currentColumn.dataType, uiSelectedColumnValues: this.state.filter.Predicate.Inputs.filter((input) => input !== ''), useAgGridStyle: true, onColumnValueSelectedChange: (list) => this.onColumnValuesChange(list) })));
|
|
272
|
+
React.createElement(ListBoxFilterForm_1.ListBoxFilterForm, { disabled: this.isFilterDisabled(), suppressClientSideFilter: this.state.suppressClientSideFilter, isLoading: this.state.isDistinctColumnValuesLoading, onFilterChange: this.handleFilterChange, currentColumn: this.props.currentColumn, columns: [], columnDistinctValues: this.state.distinctColumnValues, dataType: this.props.currentColumn.dataType, uiSelectedColumnValues: this.state.filter.Predicate.Inputs.filter((input) => input !== ''), useAgGridStyle: true, onColumnValueSelectedChange: (list) => this.onColumnValuesChange(list) })));
|
|
270
273
|
} },
|
|
271
274
|
React.createElement(SimpleButton_1.default, { style: {
|
|
272
275
|
flex: 1,
|
|
@@ -276,7 +279,8 @@ class QuickFilterFormComponent extends React.Component {
|
|
|
276
279
|
borderRadius: 0,
|
|
277
280
|
borderLeftWidth: 0,
|
|
278
281
|
borderColor: 'var(--ab-color-primarydark)',
|
|
279
|
-
}, disabled:
|
|
282
|
+
}, disabled: this.isFilterDisabled() ||
|
|
283
|
+
ArrayExtensions_1.default.IsNullOrEmptyOrContainsSingleEmptyValue(this.state.distinctColumnValues) }, selectedValues)));
|
|
280
284
|
}
|
|
281
285
|
onColumnValuesChange(columnValues) {
|
|
282
286
|
var _a;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ScopeColumnIds } from '../../../PredefinedConfig/Common/AdaptableScope';
|
|
3
|
+
import { AdaptablePredicate } from '../../../types';
|
|
4
|
+
export interface PermitedValuesSelectorProps {
|
|
5
|
+
scope: ScopeColumnIds;
|
|
6
|
+
onPredicateValuesChange: (inputs: any[]) => void;
|
|
7
|
+
predicate: AdaptablePredicate;
|
|
8
|
+
}
|
|
9
|
+
export declare const PermitedValuesSelector: React.FunctionComponent<PermitedValuesSelectorProps>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PermitedValuesSelector = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const rebass_1 = require("rebass");
|
|
7
|
+
const OverlayTrigger_1 = tslib_1.__importDefault(require("../../../components/OverlayTrigger"));
|
|
8
|
+
const SimpleButton_1 = tslib_1.__importDefault(require("../../../components/SimpleButton"));
|
|
9
|
+
const AdaptableContext_1 = require("../../AdaptableContext");
|
|
10
|
+
const ListBoxFilterForm_1 = require("../FilterForm/ListBoxFilterForm");
|
|
11
|
+
const PermitedValuesSelector = (props) => {
|
|
12
|
+
var _a;
|
|
13
|
+
const adaptable = AdaptableContext_1.useAdaptable();
|
|
14
|
+
const columnId = props.scope.ColumnIds[0];
|
|
15
|
+
const column = adaptable.api.columnApi.getColumnFromId(columnId);
|
|
16
|
+
const distinctValues = ((_a = adaptable.api.columnApi.getDistinctDisplayValuesForColumn(columnId)) !== null && _a !== void 0 ? _a : []).map((value) => ({ value: value, label: value }));
|
|
17
|
+
const predicateInputs = props.predicate.Inputs;
|
|
18
|
+
const isClearDisabled = predicateInputs.filter((item) => item !== undefined || item !== null || item !== '')
|
|
19
|
+
.length === 0;
|
|
20
|
+
const popupContent = (React.createElement(rebass_1.Flex, { className: "ab-PermitedValuesSelector__PopupContent", padding: 1, flexDirection: "column" },
|
|
21
|
+
React.createElement(ListBoxFilterForm_1.ListBoxFilterForm, { currentColumn: column, columns: [], columnDistinctValues: distinctValues, dataType: column.dataType, uiSelectedColumnValues: props.predicate.Inputs, useAgGridStyle: true, onColumnValueSelectedChange: (list) => props.onPredicateValuesChange(list) })));
|
|
22
|
+
return (React.createElement(rebass_1.Box, { className: "ab-PermitedValuesSelector", mt: 2 },
|
|
23
|
+
React.createElement(rebass_1.Box, { flex: 1 },
|
|
24
|
+
React.createElement(OverlayTrigger_1.default, { render: () => popupContent },
|
|
25
|
+
React.createElement(SimpleButton_1.default, { width: "100%", mb: 2 }, (predicateInputs === null || predicateInputs === void 0 ? void 0 : predicateInputs.join(', ')) || 'No Selected values'))),
|
|
26
|
+
React.createElement(SimpleButton_1.default, { disabled: isClearDisabled, onClick: () => props.onPredicateValuesChange([]) }, "Clear Values")));
|
|
27
|
+
};
|
|
28
|
+
exports.PermitedValuesSelector = PermitedValuesSelector;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PermitedValuesSelector } from './PermitedValuesSelector';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PermitedValuesSelector = void 0;
|
|
4
|
+
var PermitedValuesSelector_1 = require("./PermitedValuesSelector");
|
|
5
|
+
Object.defineProperty(exports, "PermitedValuesSelector", { enumerable: true, get: function () { return PermitedValuesSelector_1.PermitedValuesSelector; } });
|
|
@@ -35,7 +35,7 @@ const Navigation = (props) => {
|
|
|
35
35
|
useGlobalEvent_1.useGlobalEvent('keydown', handleKeyPress);
|
|
36
36
|
return (React.createElement("nav", { className: "ab-Adaptable-Popup__Navigation" },
|
|
37
37
|
React.createElement("ul", { className: "ab-Adaptable-Popup__Navigation__List" }, props.menuItems.map((menuItem, index) => {
|
|
38
|
-
var _a, _b, _c, _d;
|
|
38
|
+
var _a, _b, _c, _d, _e;
|
|
39
39
|
const baseClassName = 'ab-Adaptable-Popup__Navigation__List__Item';
|
|
40
40
|
if (menuItem === '-') {
|
|
41
41
|
return React.createElement("li", { key: `separator-${index}`, className: `${baseClassName}__Separator` });
|
|
@@ -46,7 +46,7 @@ const Navigation = (props) => {
|
|
|
46
46
|
return (React.createElement("li", { className: className, key: menuItem.label },
|
|
47
47
|
React.createElement("button", { type: "button", className: `${baseClassName}__Button`, onClick: () => {
|
|
48
48
|
dispatch(menuItem.reduxAction);
|
|
49
|
-
} },
|
|
49
|
+
}, "data-name": (_e = menuItem.module) !== null && _e !== void 0 ? _e : menuItem.label },
|
|
50
50
|
menuItem.icon && (React.createElement(AdaptableIconComponent_1.AdaptableIconComponent, { icon: menuItem.icon, iconClassName: `${baseClassName}__Icon` })),
|
|
51
51
|
customIcon && React.createElement(AdaptableIconComponent_1.AdaptableIconComponent, { icon: customIcon }),
|
|
52
52
|
menuItem.label)));
|
|
@@ -11,19 +11,14 @@ const showToast = (props) => {
|
|
|
11
11
|
// leak where the api is still kept around in memory by the toaster
|
|
12
12
|
let api = props.api;
|
|
13
13
|
const off = api.eventApi.on('AdaptableDestroy', () => {
|
|
14
|
-
Toastify_1.toast.dismiss(
|
|
14
|
+
Toastify_1.toast.dismiss();
|
|
15
15
|
api = null;
|
|
16
16
|
});
|
|
17
17
|
const adaptableOptions = props.api.internalApi.getAdaptableOptions();
|
|
18
18
|
const toastProps = ObjectFactory_1.default.CreateToastOptions(adaptableOptions.notificationsOptions, {
|
|
19
19
|
containerId: adaptableOptions.adaptableId,
|
|
20
20
|
onClose: () => {
|
|
21
|
-
|
|
22
|
-
off();
|
|
23
|
-
if (!api.isDestroyed()) {
|
|
24
|
-
api.internalApi.hidePopupAlert();
|
|
25
|
-
}
|
|
26
|
-
}
|
|
21
|
+
off();
|
|
27
22
|
},
|
|
28
23
|
});
|
|
29
24
|
const content = (React.createElement(AdaptablePopupAlert_1.AdaptablePopupAlert, { headless: true, adaptableAlert: props.adaptableAlert, onClose: () => {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { WindowPopupChildProps } from './WindowPopups';
|
|
3
|
-
export declare const WINDOW_LAYOUT_EDITOR = "WINDOW_LAYOUT_EDITOR";
|
|
4
3
|
export declare const WINDOW_QUERY_EDITOR = "WINDOW_QUERY_EDITOR";
|
|
5
4
|
export declare const windowFactory: Record<string, React.FunctionComponent<WindowPopupChildProps>>;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.windowFactory = exports.WINDOW_QUERY_EDITOR =
|
|
4
|
-
const LayoutEditorStandalonePopup_1 = require("../../../Layout/LayoutEditorStandalonePopup");
|
|
3
|
+
exports.windowFactory = exports.WINDOW_QUERY_EDITOR = void 0;
|
|
5
4
|
const ExpandedQueryPopup_1 = require("../../../Query/ExpandedQueryPopup");
|
|
6
|
-
exports.WINDOW_LAYOUT_EDITOR = 'WINDOW_LAYOUT_EDITOR';
|
|
7
5
|
exports.WINDOW_QUERY_EDITOR = 'WINDOW_QUERY_EDITOR';
|
|
8
6
|
exports.windowFactory = {
|
|
9
|
-
[exports.WINDOW_LAYOUT_EDITOR]: LayoutEditorStandalonePopup_1.LayoutEditorStandalonePopup,
|
|
10
7
|
[exports.WINDOW_QUERY_EDITOR]: ExpandedQueryPopup_1.ExpandedQueryPopup,
|
|
11
8
|
};
|
|
@@ -13,7 +13,6 @@ export interface ExportViewPanelComponentProps extends ViewPanelProps {
|
|
|
13
13
|
onEditReport: (popup: string) => PopupRedux.PopupShowScreenAction;
|
|
14
14
|
onNewReportSchedule: (reportSchedule: ReportSchedule) => PopupRedux.PopupShowScreenAction;
|
|
15
15
|
Columns: AdaptableColumn[];
|
|
16
|
-
Reports: Report[] | undefined;
|
|
17
16
|
CurrentReport: string | undefined;
|
|
18
17
|
CurrentDestination: ExportDestination | string | undefined;
|
|
19
18
|
}
|
|
@@ -25,5 +24,5 @@ declare class ExportViewPanelComponent extends React.Component<ExportViewPanelCo
|
|
|
25
24
|
private isCustomDestination;
|
|
26
25
|
private onNewReportSchedule;
|
|
27
26
|
}
|
|
28
|
-
export declare let ExportViewPanelControl: import("react-redux").ConnectedComponent<typeof ExportViewPanelComponent, import("react-redux").Omit<React.ClassAttributes<ExportViewPanelComponent> & ExportViewPanelComponentProps, "api" | "accessLevel" | "CurrentReport" | "moduleInfo" | "Columns" | "viewType" | "onApplyExport" | "onSelectReport" | "onSelectDestination" | "onNewReport" | "onEditReport" | "onNewReportSchedule" | "
|
|
27
|
+
export declare let ExportViewPanelControl: import("react-redux").ConnectedComponent<typeof ExportViewPanelComponent, import("react-redux").Omit<React.ClassAttributes<ExportViewPanelComponent> & ExportViewPanelComponentProps, "api" | "accessLevel" | "CurrentReport" | "moduleInfo" | "Columns" | "viewType" | "onApplyExport" | "onSelectReport" | "onSelectDestination" | "onNewReport" | "onEditReport" | "onNewReportSchedule" | "CurrentDestination">>;
|
|
29
28
|
export {};
|
|
@@ -83,7 +83,7 @@ class ExportViewPanelComponent extends React.Component {
|
|
|
83
83
|
React.createElement(DropdownButton_1.default, { disabled: currentReportId === constants_1.SELECT_REPORT_STRING, style: { width: '100%', fontSize: 'small' }, items: destinationItems, columns: ['label'], className: `ab-${elementType}__Export__export`, onClear: () => this.onSelectedDestinationChanged(null), showClearButton: !!currentDestination, variant: "outlined", marginRight: 2 }, currentDestinationId)),
|
|
84
84
|
React.createElement(rebass_1.Flex, { className: join_1.default(accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__Export__controls`), style: { width: '100%' } },
|
|
85
85
|
React.createElement(ButtonExport_1.ButtonExport, { onClick: () => onApplyExport(), tooltip: "Export Report", className: `ab-${elementType}__Export__export`, disabled: currentReport == null || currentDestination == null }),
|
|
86
|
-
React.createElement(ButtonEdit_1.ButtonEdit, { onClick: () => this.props.onEditReport(this.props.moduleInfo.Popup), tooltip: "Edit Report", className: `ab-${elementType}__Export__edit`, disabled: currentReport == null || currentReport
|
|
86
|
+
React.createElement(ButtonEdit_1.ButtonEdit, { onClick: () => this.props.onEditReport(this.props.moduleInfo.Popup), tooltip: "Edit Report", className: `ab-${elementType}__Export__edit`, disabled: currentReport == null || this.props.api.exportApi.isCustomReport(currentReport), accessLevel: accessLevel }),
|
|
87
87
|
React.createElement(ButtonNew_1.ButtonNew, { variant: "text", className: `ab-${elementType}__Export__new`, tone: "neutral", children: null, onClick: () => this.props.onNewReport(this.props.moduleInfo.Popup), tooltip: "Create New Report", accessLevel: accessLevel }),
|
|
88
88
|
React.createElement(ButtonDelete_1.ButtonDelete, { tooltip: "Delete Report", className: `ab-${elementType}__Export__delete`, disabled: currentReport == null, ConfirmAction: ExportRedux.ReportDelete(currentReport), ConfirmationMsg: deleteMessage, ConfirmationTitle: 'Delete Report', accessLevel: accessLevel }),
|
|
89
89
|
this.props.api.internalApi
|
|
@@ -97,10 +97,7 @@ class ExportViewPanelComponent extends React.Component {
|
|
|
97
97
|
this.props.onSelectDestination(destination);
|
|
98
98
|
}
|
|
99
99
|
getAllReportNames() {
|
|
100
|
-
return [
|
|
101
|
-
...this.props.api.exportApi.getAvailableSystemReports(),
|
|
102
|
-
...this.props.Reports.map((r) => r.Name),
|
|
103
|
-
];
|
|
100
|
+
return [...this.props.api.exportApi.getAllReports().map((r) => r.Name)];
|
|
104
101
|
}
|
|
105
102
|
isCustomDestination(destination) {
|
|
106
103
|
var _a;
|
|
@@ -116,7 +113,6 @@ function mapStateToProps(state) {
|
|
|
116
113
|
return {
|
|
117
114
|
CurrentReport: state.Export.CurrentReport,
|
|
118
115
|
CurrentDestination: state.Export.CurrentDestination,
|
|
119
|
-
Reports: state.Export.Reports,
|
|
120
116
|
};
|
|
121
117
|
}
|
|
122
118
|
function mapDispatchToProps(dispatch) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Report } from '../../../PredefinedConfig/ExportState';
|
|
1
|
+
import { Report, ReportColumnScope } from '../../../PredefinedConfig/ExportState';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { AdaptableWizardStep, AdaptableWizardStepProps } from '../../Wizard/Interface/IAdaptableWizard';
|
|
4
|
-
import { ReportColumnScope } from '../../../PredefinedConfig/Common/Enums';
|
|
5
4
|
export interface ReportColumnTypeWizardProps extends AdaptableWizardStepProps<Report> {
|
|
6
5
|
}
|
|
7
6
|
export interface ReportColumnsWizardState {
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ReportColumnTypeWizard = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const Enums_1 = require("../../../PredefinedConfig/Common/Enums");
|
|
7
6
|
const WizardPanel_1 = tslib_1.__importDefault(require("../../../components/WizardPanel"));
|
|
8
7
|
const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
|
|
9
8
|
const rebass_1 = require("rebass");
|
|
@@ -20,52 +19,52 @@ class ReportColumnTypeWizard extends React.Component {
|
|
|
20
19
|
React.createElement(WizardPanel_1.default, null,
|
|
21
20
|
React.createElement(rebass_1.Flex, { flexDirection: "column", padding: 2 },
|
|
22
21
|
React.createElement(HelpBlock_1.default, { marginBottom: 1 }, "All columns in the datasource will be included in the Report, whether visible or not at time of export"),
|
|
23
|
-
React.createElement(Radio_1.default, { value: "All", checked: this.state.ReportColumnScope ==
|
|
22
|
+
React.createElement(Radio_1.default, { value: "All", checked: this.state.ReportColumnScope == 'AllColumns', onChange: (_, e) => this.onScopeSelectChanged(e), marginRight: 3 }, "All Columns"),
|
|
24
23
|
' ',
|
|
25
24
|
React.createElement(HelpBlock_1.default, { marginBottom: 1 }, "Only columns that are visible at the time the Report is exported will be included"),
|
|
26
|
-
React.createElement(Radio_1.default, { value: "Visible", checked: this.state.ReportColumnScope ==
|
|
25
|
+
React.createElement(Radio_1.default, { value: "Visible", checked: this.state.ReportColumnScope == 'VisibleColumns', onChange: (_, e) => this.onScopeSelectChanged(e), marginRight: 3 }, "Visible Columns Only"),
|
|
27
26
|
' ',
|
|
28
27
|
React.createElement(HelpBlock_1.default, { marginBottom: 1 }, "Only selected columns (which you will choose in the next step) will be exported - whether visible or not"),
|
|
29
|
-
React.createElement(Radio_1.default, { value: "Bespoke", marginRight: 3, checked: this.state.ReportColumnScope ==
|
|
28
|
+
React.createElement(Radio_1.default, { value: "Bespoke", marginRight: 3, checked: this.state.ReportColumnScope == 'ScopeColumns', onChange: (_, e) => this.onScopeSelectChanged(e) }, "Bespoke Columns"),
|
|
30
29
|
' '))));
|
|
31
30
|
}
|
|
32
31
|
onScopeSelectChanged(event) {
|
|
33
32
|
let e = event.target;
|
|
34
33
|
if (e.value == 'All') {
|
|
35
34
|
this.setState({
|
|
36
|
-
ReportColumnScope:
|
|
35
|
+
ReportColumnScope: 'AllColumns',
|
|
37
36
|
SelectedColumnValues: [],
|
|
38
37
|
}, () => this.props.updateGoBackState());
|
|
39
38
|
}
|
|
40
39
|
else if (e.value == 'Visible') {
|
|
41
40
|
this.setState({
|
|
42
|
-
ReportColumnScope:
|
|
41
|
+
ReportColumnScope: 'VisibleColumns',
|
|
43
42
|
SelectedColumnValues: [],
|
|
44
43
|
}, () => this.props.updateGoBackState());
|
|
45
44
|
}
|
|
46
45
|
else {
|
|
47
46
|
this.setState({
|
|
48
|
-
ReportColumnScope:
|
|
47
|
+
ReportColumnScope: 'ScopeColumns',
|
|
49
48
|
}, () => this.props.updateGoBackState());
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
51
|
canNext() {
|
|
53
|
-
return (this.state.ReportColumnScope ==
|
|
54
|
-
this.state.ReportColumnScope ==
|
|
55
|
-
this.state.ReportColumnScope ==
|
|
52
|
+
return (this.state.ReportColumnScope == 'AllColumns' ||
|
|
53
|
+
this.state.ReportColumnScope == 'VisibleColumns' ||
|
|
54
|
+
this.state.ReportColumnScope == 'ScopeColumns');
|
|
56
55
|
}
|
|
57
56
|
canBack() {
|
|
58
57
|
return true;
|
|
59
58
|
}
|
|
60
59
|
next() {
|
|
61
60
|
this.props.data.ReportColumnScope = this.state.ReportColumnScope;
|
|
62
|
-
if (this.state.ReportColumnScope !=
|
|
61
|
+
if (this.state.ReportColumnScope != 'ScopeColumns') {
|
|
63
62
|
this.props.data.Scope = undefined;
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
65
|
back() { }
|
|
67
66
|
getIndexStepIncrement() {
|
|
68
|
-
return this.state.ReportColumnScope ==
|
|
67
|
+
return this.state.ReportColumnScope == 'ScopeColumns' ? 1 : 2;
|
|
69
68
|
}
|
|
70
69
|
getIndexStepDecrement() {
|
|
71
70
|
return 1;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Report } from '../../../PredefinedConfig/ExportState';
|
|
1
|
+
import { Report, ReportRowScope } from '../../../PredefinedConfig/ExportState';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { AdaptableWizardStep, AdaptableWizardStepProps } from '../../Wizard/Interface/IAdaptableWizard';
|
|
4
|
-
import { ReportRowScope } from '../../../PredefinedConfig/Common/Enums';
|
|
5
4
|
export interface ReportRowTypeWizardProps extends AdaptableWizardStepProps<Report> {
|
|
6
5
|
}
|
|
7
6
|
export interface ReportRowsWizardState {
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ReportRowTypeWizard = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const Enums_1 = require("../../../PredefinedConfig/Common/Enums");
|
|
7
6
|
const WizardPanel_1 = tslib_1.__importDefault(require("../../../components/WizardPanel"));
|
|
8
7
|
const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
|
|
9
8
|
const rebass_1 = require("rebass");
|
|
@@ -20,55 +19,55 @@ class ReportRowTypeWizard extends React.Component {
|
|
|
20
19
|
React.createElement(WizardPanel_1.default, null,
|
|
21
20
|
React.createElement(rebass_1.Flex, { flexDirection: "column", padding: 2 },
|
|
22
21
|
React.createElement(HelpBlock_1.default, { marginBottom: 1 }, "All rows in the datasource will be included in the report, whether visible or not at time of export."),
|
|
23
|
-
React.createElement(Radio_1.default, { value: "All", checked: this.state.ReportRowScope ==
|
|
22
|
+
React.createElement(Radio_1.default, { value: "All", checked: this.state.ReportRowScope == 'AllRows', onChange: (_, e) => this.onScopeSelectChanged(e), marginRight: 3 }, "All Rows"),
|
|
24
23
|
' ',
|
|
25
24
|
React.createElement(HelpBlock_1.default, { marginBottom: 1 }, "Only rows that are visible at the time the Report is exported will be included in the Export"),
|
|
26
|
-
React.createElement(Radio_1.default, { value: "Visible", checked: this.state.ReportRowScope ==
|
|
25
|
+
React.createElement(Radio_1.default, { value: "Visible", checked: this.state.ReportRowScope == 'VisibleRows', onChange: (_, e) => this.onScopeSelectChanged(e), marginRight: 3 }, "Visible Rows Only"),
|
|
27
26
|
' ',
|
|
28
27
|
React.createElement(HelpBlock_1.default, { marginBottom: 1 }, "Only the rows which match the Query (built in next step) will be exported - whether visible or not."),
|
|
29
|
-
React.createElement(Radio_1.default, { value: "Expression", checked: this.state.ReportRowScope ==
|
|
28
|
+
React.createElement(Radio_1.default, { value: "Expression", checked: this.state.ReportRowScope == 'ExpressionRows', onChange: (_, e) => this.onScopeSelectChanged(e), marginRight: 3 }, "By Query - built by you in next step"),
|
|
30
29
|
' '))));
|
|
31
30
|
}
|
|
32
31
|
onScopeSelectChanged(event) {
|
|
33
32
|
let e = event.target;
|
|
34
33
|
if (e.value == 'All') {
|
|
35
34
|
this.setState({
|
|
36
|
-
ReportRowScope:
|
|
35
|
+
ReportRowScope: 'AllRows',
|
|
37
36
|
SelectedColumnValues: [],
|
|
38
37
|
}, () => this.props.updateGoBackState());
|
|
39
38
|
}
|
|
40
39
|
else if (e.value == 'Visible') {
|
|
41
40
|
this.setState({
|
|
42
|
-
ReportRowScope:
|
|
41
|
+
ReportRowScope: 'VisibleRows',
|
|
43
42
|
SelectedColumnValues: [],
|
|
44
43
|
}, () => this.props.updateGoBackState());
|
|
45
44
|
}
|
|
46
45
|
else {
|
|
47
46
|
this.setState({
|
|
48
|
-
ReportRowScope:
|
|
47
|
+
ReportRowScope: 'ExpressionRows',
|
|
49
48
|
}, () => this.props.updateGoBackState());
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
51
|
canNext() {
|
|
53
|
-
return (this.state.ReportRowScope ==
|
|
54
|
-
this.state.ReportRowScope ==
|
|
55
|
-
this.state.ReportRowScope ==
|
|
52
|
+
return (this.state.ReportRowScope == 'AllRows' ||
|
|
53
|
+
this.state.ReportRowScope == 'VisibleRows' ||
|
|
54
|
+
this.state.ReportRowScope == 'ExpressionRows');
|
|
56
55
|
}
|
|
57
56
|
canBack() {
|
|
58
57
|
return true;
|
|
59
58
|
}
|
|
60
59
|
next() {
|
|
61
60
|
this.props.data.ReportRowScope = this.state.ReportRowScope;
|
|
62
|
-
if (this.props.data.Query && this.state.ReportRowScope !=
|
|
61
|
+
if (this.props.data.Query && this.state.ReportRowScope != 'ExpressionRows') {
|
|
63
62
|
this.props.data.Query = undefined;
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
65
|
back() { }
|
|
67
66
|
getIndexStepIncrement() {
|
|
68
|
-
return this.state.ReportRowScope ==
|
|
67
|
+
return this.state.ReportRowScope == 'ExpressionRows' ? 1 : 2;
|
|
69
68
|
}
|
|
70
69
|
getIndexStepDecrement() {
|
|
71
|
-
return this.props.data.ReportColumnScope ==
|
|
70
|
+
return this.props.data.ReportColumnScope == 'ScopeColumns' ? 1 : 2;
|
|
72
71
|
}
|
|
73
72
|
}
|
|
74
73
|
exports.ReportRowTypeWizard = ReportRowTypeWizard;
|