@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
|
@@ -9,7 +9,6 @@ const Input_1 = tslib_1.__importDefault(require("../../../components/Input"));
|
|
|
9
9
|
const rebass_1 = require("rebass");
|
|
10
10
|
const ErrorBox_1 = tslib_1.__importDefault(require("../../../components/ErrorBox"));
|
|
11
11
|
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
12
|
-
const Enums_1 = require("../../../PredefinedConfig/Common/Enums");
|
|
13
12
|
class ReportSettingsWizard extends React.Component {
|
|
14
13
|
constructor(props) {
|
|
15
14
|
super(props);
|
|
@@ -56,7 +55,7 @@ class ReportSettingsWizard extends React.Component {
|
|
|
56
55
|
return 1;
|
|
57
56
|
}
|
|
58
57
|
getIndexStepDecrement() {
|
|
59
|
-
return this.props.data.ReportRowScope ==
|
|
58
|
+
return this.props.data.ReportRowScope == 'ExpressionRows' ? 1 : 2;
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
61
|
exports.ReportSettingsWizard = ReportSettingsWizard;
|
|
@@ -8,23 +8,39 @@ const ActiveFiltersPanel_1 = require("./ActiveFiltersPanel");
|
|
|
8
8
|
const rebass_1 = require("rebass");
|
|
9
9
|
const ArrayExtensions_1 = require("../../Utilities/Extensions/ArrayExtensions");
|
|
10
10
|
const AdaptablePopover_1 = require("../AdaptablePopover");
|
|
11
|
+
const ButtonClear_1 = require("../Components/Buttons/ButtonClear");
|
|
11
12
|
const CheckBox_1 = require("../../components/CheckBox");
|
|
12
13
|
const react_redux_1 = require("react-redux");
|
|
13
14
|
const LayoutRedux_1 = require("../../Redux/ActionsReducers/LayoutRedux");
|
|
15
|
+
const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
|
|
14
16
|
class FilterViewPanelComponent extends React.Component {
|
|
15
17
|
constructor(props) {
|
|
16
18
|
super(props);
|
|
17
19
|
}
|
|
18
20
|
render() {
|
|
21
|
+
var _a, _b, _c, _d;
|
|
19
22
|
const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
23
|
+
const showClearButton = (_b = (_a = this.props.api.internalApi.getAdaptableOptions()) === null || _a === void 0 ? void 0 : _a.filterOptions) === null || _b === void 0 ? void 0 : _b.showClearFilterButton;
|
|
24
|
+
const showSuspendFilterButton = (_d = (_c = this.props.api.internalApi.getAdaptableOptions()) === null || _c === void 0 ? void 0 : _c.filterOptions) === null || _d === void 0 ? void 0 : _d.showSuspendFilterButton;
|
|
25
|
+
const isAtLeastOneFilterActive = this.props.api.filterApi.getActiveColumnFilters().length > 0;
|
|
26
|
+
const isAtLeastOneFilter = this.props.api.filterApi.getColumnFilters().length > 0;
|
|
27
|
+
const handleSuspendUnsuspendAll = () => {
|
|
28
|
+
if (isAtLeastOneFilterActive) {
|
|
29
|
+
this.props.api.filterApi.suspendAllColumnFilters();
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
this.props.api.filterApi.unSuspendAllColumnFilters();
|
|
33
|
+
}
|
|
34
|
+
};
|
|
20
35
|
return (React.createElement(rebass_1.Flex, { flexDirection: "row", className: `ab-${elementType}__Filter__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
|
|
21
|
-
React.createElement(rebass_1.Flex, null,
|
|
22
|
-
|
|
23
|
-
|
|
36
|
+
React.createElement(rebass_1.Flex, null,
|
|
37
|
+
ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(this.props.ColumnFilters) && (React.createElement(AdaptablePopover_1.AdaptablePopover, { popupPadding: 0, className: `ab-${elementType}__Filter__info`, headerText: "", bodyText: [React.createElement(ActiveFiltersPanel_1.ActiveFiltersPanel, null)], useButton: true, showEvent: 'focus', hideEvent: "blur", popoverMinWidth: 400 })),
|
|
38
|
+
showClearButton && (React.createElement(ButtonClear_1.ButtonClear, { marginLeft: 1, marginBottom: 0, marginRight: 1, className: `ab-${elementType}__Filter__clear`, onClick: () => this.onClearFilters(), tooltip: "Clear Filters", disabled: this.props.ColumnFilters.length == 0, showText: this.props.viewType === 'ToolPanel' }, this.props.viewType === 'ToolPanel' && 'Clear')),
|
|
39
|
+
showSuspendFilterButton && (React.createElement(SimpleButton_1.default, { disabled: !isAtLeastOneFilter, onClick: handleSuspendUnsuspendAll, tone: isAtLeastOneFilterActive ? 'neutral' : 'success', variant: "text", icon: isAtLeastOneFilterActive ? 'pause' : 'play', accessLevel: this.props.accessLevel }))),
|
|
24
40
|
React.createElement(rebass_1.Flex, { alignItems: "center" }, this.props.api.filterApi.isQuickFilterAvailable() && (React.createElement(CheckBox_1.CheckBox, { className: `ab-${elementType}__Filter__active-check`, disabled: this.props.accessLevel === 'ReadOnly' ||
|
|
25
41
|
this.props.api.internalApi.isGridInPivotMode(), marginTop: 0, marginBottom: 0, fontSize: 2, padding: 1, checked: this.props.IsQuickFilterVisible, onChange: (checked) => {
|
|
26
42
|
checked ? this.props.onShowQuickFilterBar() : this.props.onHideQuickFilterBar();
|
|
27
|
-
} }, "
|
|
43
|
+
} }, "Quick Filter")))));
|
|
28
44
|
}
|
|
29
45
|
onClearFilters() {
|
|
30
46
|
this.props.api.filterApi.clearColumnFilters();
|
|
@@ -378,7 +378,7 @@ const FormatColumnFormatWizardSection = (props) => {
|
|
|
378
378
|
update({ DisplayFormat });
|
|
379
379
|
};
|
|
380
380
|
const Type = data.DisplayFormat && data.DisplayFormat.Formatter;
|
|
381
|
-
const customScopedFormatters = customDisplayFormatters.filter((displayFormatter) => adaptable.api.scopeApi.isScopeInScope(
|
|
381
|
+
const customScopedFormatters = customDisplayFormatters.filter((displayFormatter) => adaptable.api.scopeApi.isScopeInScope(data.Scope, displayFormatter.scope));
|
|
382
382
|
if (Type === 'NumberFormatter') {
|
|
383
383
|
return renderNumberFormat(data, update, setFormatOption, customScopedFormatters, formatColumnApi);
|
|
384
384
|
}
|
|
@@ -49,8 +49,7 @@ class FreeTextColumnSummaryComponent extends React.Component {
|
|
|
49
49
|
this.state.editedAdaptableObject && (React.createElement(FreeTextColumnWizard_1.FreeTextColumnWizard, { moduleInfo: this.props.moduleInfo, data: this.state.editedAdaptableObject, configEntities: this.props.FreeTextColumns, onCloseWizard: () => this.onCloseWizard(), onFinishWizard: this.onFinishWizard }))));
|
|
50
50
|
}
|
|
51
51
|
onNew() {
|
|
52
|
-
|
|
53
|
-
let configEntity = ObjectFactory_1.ObjectFactory.CreateEmptyFreeTextColumn(specialColumnsAreFilterable);
|
|
52
|
+
let configEntity = ObjectFactory_1.ObjectFactory.CreateEmptyFreeTextColumn();
|
|
54
53
|
configEntity.ColumnId = this.props.summarisedColumn.columnId;
|
|
55
54
|
this.setState({
|
|
56
55
|
editedAdaptableObject: configEntity,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { FreeTextColumn } from '../../../PredefinedConfig/FreeTextColumnState';
|
|
3
3
|
import { AdaptableApi } from '../../../Api/AdaptableApi';
|
|
4
4
|
export declare const renderFreeTextColumnSummary: (data: FreeTextColumn) => JSX.Element;
|
|
5
|
-
export declare const isValidFreeTextColumn: (data: FreeTextColumn, api: AdaptableApi) => true | "Column Id cannot be empty" | "
|
|
5
|
+
export declare const isValidFreeTextColumn: (data: FreeTextColumn, api: AdaptableApi) => true | "Column Id cannot be empty" | "A Column already exists with that id" | "No data type specified for column";
|
|
6
6
|
export declare type FreeTextColumnSettingsWizardSectionProps = {
|
|
7
7
|
onChange: (data: FreeTextColumn) => void;
|
|
8
8
|
isEdit: boolean;
|
|
@@ -23,7 +23,7 @@ const FreeTextColumnWizard = (props) => {
|
|
|
23
23
|
if (((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'Edit' && ((_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.column)) {
|
|
24
24
|
return allFreeTextColumns.find((column) => column.ColumnId === props.popupParams.column.columnId);
|
|
25
25
|
}
|
|
26
|
-
return ObjectFactory_1.default.CreateEmptyFreeTextColumn(
|
|
26
|
+
return ObjectFactory_1.default.CreateEmptyFreeTextColumn();
|
|
27
27
|
});
|
|
28
28
|
const dispatch = react_redux_1.useDispatch();
|
|
29
29
|
const isEdit = props.data || ((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'Edit';
|
|
File without changes
|
|
File without changes
|
|
@@ -112,6 +112,7 @@ const LayoutWizard = (props) => {
|
|
|
112
112
|
title: 'Aggregations',
|
|
113
113
|
details: 'Select Column Aggregations',
|
|
114
114
|
renderSummary: () => React.createElement(AggregationsSection_1.AggregationsSectionSummary, null),
|
|
115
|
+
isValid: (data) => AggregationsSection_1.isAggregationsSectionValid(data),
|
|
115
116
|
render: () => (React.createElement(rebass_1.Box, { p: 2, style: { height: '100%' } },
|
|
116
117
|
React.createElement(AggregationsSection_1.AggregationsSection, { onChange: setLayout }))),
|
|
117
118
|
},
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Layout } from '../../../../../types';
|
|
3
|
+
export declare const isAggregationsSectionValid: (data: Layout) => true | string;
|
|
3
4
|
export declare const AggregationsSectionSummary: React.FunctionComponent;
|
|
4
5
|
interface AggregationsSectionProps {
|
|
5
6
|
onChange: (data: Layout) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AggregationsSection = exports.AggregationsSectionSummary = void 0;
|
|
3
|
+
exports.AggregationsSection = exports.AggregationsSectionSummary = exports.isAggregationsSectionValid = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const rebass_1 = require("rebass");
|
|
@@ -14,6 +14,17 @@ const AdaptableContext_1 = require("../../../AdaptableContext");
|
|
|
14
14
|
const ValueSelector_1 = require("../../../Components/ValueSelector");
|
|
15
15
|
const OnePageAdaptableWizard_1 = require("../../../Wizard/OnePageAdaptableWizard");
|
|
16
16
|
const Utilities_1 = require("./Utilities");
|
|
17
|
+
const WEIGHTED_AVERAGE_AGG_FN_NAME = 'weightedAvg';
|
|
18
|
+
const isAggregationsSectionValid = (data) => {
|
|
19
|
+
const weightedAvg = data.AggregationColumns
|
|
20
|
+
? Object.values(data.AggregationColumns).find((agg) => typeof agg === 'object' && agg.type === 'weightedAverage')
|
|
21
|
+
: null;
|
|
22
|
+
if (weightedAvg && !weightedAvg.weightedColumnId) {
|
|
23
|
+
return 'Weighted Average aggregation requires a weighted column';
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
};
|
|
27
|
+
exports.isAggregationsSectionValid = isAggregationsSectionValid;
|
|
17
28
|
const AggregationsSectionSummary = () => {
|
|
18
29
|
const adaptable = AdaptableContext_1.useAdaptable();
|
|
19
30
|
const { data: layout } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
|
|
@@ -32,8 +43,13 @@ const AggregationsSectionSummary = () => {
|
|
|
32
43
|
exports.AggregationsSectionSummary = AggregationsSectionSummary;
|
|
33
44
|
const ColumnRow = (props) => {
|
|
34
45
|
var _a, _b;
|
|
46
|
+
const adaptable = AdaptableContext_1.useAdaptable();
|
|
35
47
|
const aggValue = (_b = (_a = props.layout) === null || _a === void 0 ? void 0 : _a.AggregationColumns) === null || _b === void 0 ? void 0 : _b[props.column.columnId];
|
|
36
|
-
const
|
|
48
|
+
const adaptableAggFunctions = [];
|
|
49
|
+
if (props.column.dataType === 'Number') {
|
|
50
|
+
adaptableAggFunctions.push(WEIGHTED_AVERAGE_AGG_FN_NAME);
|
|
51
|
+
}
|
|
52
|
+
const aggOptions = [...props.column.availableAggregationFunctions, ...adaptableAggFunctions].map((fnName) => {
|
|
37
53
|
return {
|
|
38
54
|
label: fnName,
|
|
39
55
|
onClick: () => {
|
|
@@ -41,14 +57,51 @@ const ColumnRow = (props) => {
|
|
|
41
57
|
if (!aggCols) {
|
|
42
58
|
return;
|
|
43
59
|
}
|
|
44
|
-
|
|
60
|
+
if (fnName === WEIGHTED_AVERAGE_AGG_FN_NAME) {
|
|
61
|
+
aggCols[props.column.columnId] = {
|
|
62
|
+
type: 'weightedAverage',
|
|
63
|
+
weightedColumnId: null,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
aggCols[props.column.columnId] = fnName;
|
|
68
|
+
}
|
|
45
69
|
props.onChangeAggFunction(aggCols);
|
|
46
70
|
},
|
|
47
71
|
};
|
|
48
72
|
});
|
|
49
|
-
|
|
73
|
+
const numericColumnsOptions = props.numberColumns
|
|
74
|
+
.filter((col) => col.columnId !== props.column.columnId)
|
|
75
|
+
.map((col) => {
|
|
76
|
+
return {
|
|
77
|
+
label: col.friendlyName,
|
|
78
|
+
onClick: () => {
|
|
79
|
+
const aggCols = Object.assign({}, props.layout.AggregationColumns);
|
|
80
|
+
if (!aggCols) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
aggCols[props.column.columnId] = {
|
|
84
|
+
type: 'weightedAverage',
|
|
85
|
+
weightedColumnId: col.columnId,
|
|
86
|
+
};
|
|
87
|
+
props.onChangeAggFunction(aggCols);
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
});
|
|
91
|
+
const currentAggFnName = props.aggregationColumnsMap[props.column.columnId];
|
|
92
|
+
let weightName = null;
|
|
93
|
+
if (typeof aggValue === 'object' && aggValue.type === 'weightedAverage') {
|
|
94
|
+
weightName = aggValue.weightedColumnId
|
|
95
|
+
? adaptable.api.columnApi.getFriendlyNameFromColumnId(aggValue.weightedColumnId)
|
|
96
|
+
: 'Select Weight';
|
|
97
|
+
}
|
|
98
|
+
return (React.createElement(rebass_1.Flex, { alignItems: "center" },
|
|
50
99
|
props.column.friendlyName,
|
|
51
|
-
aggValue && (React.createElement(DropdownButton_1.default, { columns: ['label'], items: aggOptions, ml: 2 },
|
|
100
|
+
aggValue && (React.createElement(DropdownButton_1.default, { columns: ['label'], items: aggOptions, ml: 2 }, currentAggFnName)),
|
|
101
|
+
currentAggFnName === WEIGHTED_AVERAGE_AGG_FN_NAME && (React.createElement(rebass_1.Flex, { backgroundColor: "primary", ml: 3, alignItems: "center" },
|
|
102
|
+
React.createElement(rebass_1.Text, null, "Weight"),
|
|
103
|
+
' ',
|
|
104
|
+
React.createElement(DropdownButton_1.default, { columns: ['label'], items: numericColumnsOptions, ml: 2 }, weightName)))));
|
|
52
105
|
};
|
|
53
106
|
const AggregationsSection = (props) => {
|
|
54
107
|
var _a, _b;
|
|
@@ -56,6 +109,7 @@ const AggregationsSection = (props) => {
|
|
|
56
109
|
const { data: layout } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
|
|
57
110
|
const allAggregableColumns = adaptable.api.columnApi.getAggregetableColumns();
|
|
58
111
|
const allColumns = adaptable.api.columnApi.getColumns();
|
|
112
|
+
const numberColumns = adaptable.api.columnApi.getNumericColumns();
|
|
59
113
|
const sortedAggregableColumns = React.useMemo(() => {
|
|
60
114
|
var _a, _b;
|
|
61
115
|
return sortWithOrder_1.sortWithOrderArray(allAggregableColumns.map((col) => col.columnId), (_b = Object.keys((_a = layout.AggregationColumns) !== null && _a !== void 0 ? _a : {})) !== null && _b !== void 0 ? _b : [], { sortUnorderedItems: false }).map((colId) => adaptable.api.columnApi.getColumnFromId(colId));
|
|
@@ -79,10 +133,17 @@ const AggregationsSection = (props) => {
|
|
|
79
133
|
return Object.keys(layout.AggregationColumns || {}).reduce((acc, colId) => {
|
|
80
134
|
var _a;
|
|
81
135
|
let fn = (_a = layout.AggregationColumns) === null || _a === void 0 ? void 0 : _a[colId];
|
|
136
|
+
let fnName = '';
|
|
82
137
|
if (typeof fn === 'boolean') {
|
|
83
|
-
|
|
138
|
+
fnName = allColumnsMap[colId].aggregationFunction;
|
|
139
|
+
}
|
|
140
|
+
if (typeof fn === 'object' && fn.type === 'weightedAverage') {
|
|
141
|
+
fnName = WEIGHTED_AVERAGE_AGG_FN_NAME;
|
|
142
|
+
}
|
|
143
|
+
else if (typeof fn === 'string') {
|
|
144
|
+
fnName = fn;
|
|
84
145
|
}
|
|
85
|
-
acc[colId] =
|
|
146
|
+
acc[colId] = fnName;
|
|
86
147
|
return acc;
|
|
87
148
|
}, {});
|
|
88
149
|
}, [layout]);
|
|
@@ -95,7 +156,7 @@ const AggregationsSection = (props) => {
|
|
|
95
156
|
React.createElement(rebass_1.Flex, null,
|
|
96
157
|
React.createElement(FormLayout_1.default, null,
|
|
97
158
|
React.createElement(CheckBox_1.CheckBox, { checked: layout.SuppressAggFuncInHeader, onChange: handleSuppressAggFuncInHeader }, "Suppress Aggregation Function in Header"))),
|
|
98
|
-
React.createElement(ValueSelector_1.ValueSelector, { showFilterInput: true, showSelectedOnlyPosition: "top", filter: Utilities_1.columnFilter, toIdentifier: (option) => `${option.columnId}`, toLabel: (option) => { var _a; return (_a = option.friendlyName) !== null && _a !== void 0 ? _a : option.columnId; }, toListLabel: (column) => (React.createElement(ColumnRow, { onChangeAggFunction: handleAggregationChange, layout: layout, column: column, aggregationColumnsMap: aggregationColumnsMap })), options: sortedAggregableColumns, value: (_b = Object.keys((_a = layout.AggregationColumns) !== null && _a !== void 0 ? _a : {})) !== null && _b !== void 0 ? _b : [], allowReorder: () => false, xSelectedLabel: () => {
|
|
159
|
+
React.createElement(ValueSelector_1.ValueSelector, { showFilterInput: true, showSelectedOnlyPosition: "top", filter: Utilities_1.columnFilter, toIdentifier: (option) => `${option.columnId}`, toLabel: (option) => { var _a; return (_a = option.friendlyName) !== null && _a !== void 0 ? _a : option.columnId; }, toListLabel: (column) => (React.createElement(ColumnRow, { onChangeAggFunction: handleAggregationChange, layout: layout, column: column, aggregationColumnsMap: aggregationColumnsMap, numberColumns: numberColumns })), options: sortedAggregableColumns, value: (_b = Object.keys((_a = layout.AggregationColumns) !== null && _a !== void 0 ? _a : {})) !== null && _b !== void 0 ? _b : [], allowReorder: () => false, xSelectedLabel: () => {
|
|
99
160
|
return `Active aggregations:`;
|
|
100
161
|
}, onChange: handleColumnsSelectionChange }))));
|
|
101
162
|
};
|
|
@@ -16,11 +16,11 @@ const sortWithOrder_1 = require("../../../../Utilities/sortWithOrder");
|
|
|
16
16
|
const AdaptableContext_1 = require("../../../AdaptableContext");
|
|
17
17
|
const ValueSelector_1 = require("../../../Components/ValueSelector");
|
|
18
18
|
const OnePageAdaptableWizard_1 = require("../../../Wizard/OnePageAdaptableWizard");
|
|
19
|
-
const ColumnLabels_1 = require("../LayoutEditor/ColumnLabels");
|
|
20
19
|
const Utilities_1 = require("./Utilities");
|
|
21
20
|
const icons_1 = require("../../../../components/icons");
|
|
22
21
|
const CheckBox_1 = require("../../../../components/CheckBox");
|
|
23
22
|
const Helper_1 = require("../../../../Utilities/Helpers/Helper");
|
|
23
|
+
const ColumnLabels_1 = require("../Components/ColumnLabels");
|
|
24
24
|
const PropertyOrderText = (props) => (React.createElement(rebass_1.Text, { fontWeight: 600, fontSize: 2 }, props.children));
|
|
25
25
|
const ColumnsSectionSummary = () => {
|
|
26
26
|
const adaptable = AdaptableContext_1.useAdaptable();
|
|
@@ -88,7 +88,7 @@ class QueryViewPanelComponent extends React.Component {
|
|
|
88
88
|
const renderTextInput = () => {
|
|
89
89
|
return this.props.viewType === 'Toolbar' ? (React.createElement(FieldWrap_1.default, { marginRight: 1, width: 600 },
|
|
90
90
|
React.createElement(ButtonExpand_1.ButtonExpand, { variant: "text", tone: "neutral", onClick: () => this.props.api.queryApi.expandCurrentQuery(this.state.expression), tooltip: "Expand", marginLeft: 1 }),
|
|
91
|
-
React.createElement(Input_1.default, { type: "text", placeholder: "Query", spellCheck: false, value: this.state.expression, onChange: (x) => this.setState({ expression: x.target.value }), style: { fontFamily: 'monospace', fontSize: 12 } }),
|
|
91
|
+
React.createElement(Input_1.default, { type: "text", "data-name": "query-input", placeholder: "Query", spellCheck: false, value: this.state.expression, onChange: (x) => this.setState({ expression: x.target.value }), style: { fontFamily: 'monospace', fontSize: 12 } }),
|
|
92
92
|
isExpressionValid ? (React.createElement(ButtonPlay_1.ButtonPlay, { onClick: () => this.runQuery(), tooltip: '', accessLevel: 'Full', variant: "text", tone: "neutral", disabled: this.state.expression == '' || this.state.expression == this.props.CurrentQuery, marginRight: 1 })) : (React.createElement(ButtonInvalid_1.ButtonInvalid, { variant: "text", tone: "neutral", tooltip: "Invalid Query", marginRight: 1 })),
|
|
93
93
|
' ',
|
|
94
94
|
this.props.CurrentQuery !== '' && (React.createElement(ButtonClear_1.ButtonClear, { onClick: () => this.clearQuery(), tooltip: "Clear Query", accessLevel: 'Full' })))) : (React.createElement(Input_1.default, { type: "text", placeholder: "Query", spellCheck: false, value: this.state.expression, onChange: (x) => this.setState({ expression: x.target.value }), style: { width: '100%' } }));
|
|
@@ -201,6 +201,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
201
201
|
getVisibleRowNodes(): RowNode[];
|
|
202
202
|
getAllRowNodes(config?: {
|
|
203
203
|
includeGroupRows?: boolean;
|
|
204
|
+
filterFn?: (rowNode: RowNode) => boolean;
|
|
204
205
|
}): RowNode[];
|
|
205
206
|
getRowsInViewport(): RowNode[];
|
|
206
207
|
selectNodes(rowNodes: RowNode[], clearSelection: boolean): void;
|
|
@@ -210,6 +211,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
210
211
|
selectCells(columnIds: string[], startNode: RowNode, endNode: RowNode): void;
|
|
211
212
|
isRowNodeVisible(rowNode: RowNode): boolean;
|
|
212
213
|
redrawBody(): void;
|
|
214
|
+
redrawRenderedRows(): void;
|
|
213
215
|
redrawHeader(): void;
|
|
214
216
|
redrawRow(rowNode: RowNode): void;
|
|
215
217
|
redrawRows(rowNodes: RowNode[]): void;
|
|
@@ -224,12 +226,11 @@ export declare class Adaptable implements IAdaptable {
|
|
|
224
226
|
private mapColumnDefs;
|
|
225
227
|
private getColDefsForSpecialColumns;
|
|
226
228
|
getColDefsForFreeTextColumns(): ColDef[];
|
|
227
|
-
setupColumnValueGetter({ col }: ColumnSetupInfo): void;
|
|
229
|
+
setupColumnValueGetter({ col, abColumn }: ColumnSetupInfo): void;
|
|
228
230
|
setupColumnAggFunc({ col }: ColumnSetupInfo): void;
|
|
229
231
|
private getColDefsForRowEditColumns;
|
|
230
232
|
getColDefsForActionColumns(): ColDef[];
|
|
231
233
|
updateColDefsForSpecialColumns(): void;
|
|
232
|
-
private cleanupFloatingFilters_WORKAROUND;
|
|
233
234
|
private getColDefsForCalculatedColumns;
|
|
234
235
|
private isRegularColDef;
|
|
235
236
|
private isGroupColDef;
|
|
@@ -252,6 +253,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
252
253
|
buildStandaloneColumnHeader(adaptableColumn: AdaptableColumn): AdaptableMenuItem[];
|
|
253
254
|
prepareGrid(): void;
|
|
254
255
|
setupColumns(): void;
|
|
256
|
+
revertGridOptionsPropertiesToUserValue<T extends keyof GridOptions>(propertyNames: T[]): void;
|
|
255
257
|
setGridOptionsProperty<T extends keyof GridOptions>(propertyName: T, propertyGetter: (userPropertyValue: GridOptions[T]) => GridOptions[T] | undefined): void;
|
|
256
258
|
setColDefProperty<T extends keyof ColDef>(col: Column, propertyName: T, propertyGetter: (userPropertyValue: ColDef[T]) => ColDef[T] | undefined): void;
|
|
257
259
|
private getUserColDefProperty;
|
|
@@ -262,6 +264,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
262
264
|
setupColumnCellRenderer({ col, colId, abColumn }: ColumnSetupInfo): void;
|
|
263
265
|
setupColumnTooltipValueGetter({ col, colId, abColumn }: ColumnSetupInfo): void;
|
|
264
266
|
setupColumnQuickFilerText({ col, abColumn }: ColumnSetupInfo): void;
|
|
267
|
+
setupAllowedAggFuncs({ col, abColumn }: ColumnSetupInfo): void;
|
|
265
268
|
setupColumnHeader({ col, abColumn }: ColumnSetupInfo): boolean;
|
|
266
269
|
setupColumnFilter({ col, colDef }: ColumnSetupInfo): void;
|
|
267
270
|
setupColumnFloatingFilter({ col, colDef }: ColumnSetupInfo): void;
|
|
@@ -270,7 +273,6 @@ export declare class Adaptable implements IAdaptable {
|
|
|
270
273
|
setupColumnValueSetter({ col, colId, abColumn }: ColumnSetupInfo): void;
|
|
271
274
|
setupColumnComparator({ col, colId, abColumn }: ColumnSetupInfo): void;
|
|
272
275
|
private applyCurrentTheme;
|
|
273
|
-
private getInitialGroupOrderComparator;
|
|
274
276
|
private applyFinalRendering;
|
|
275
277
|
private isModulePresent;
|
|
276
278
|
private getPreviousColDefInfo;
|
|
@@ -360,6 +362,12 @@ export declare class Adaptable implements IAdaptable {
|
|
|
360
362
|
initLicenseService(): LicenseService;
|
|
361
363
|
showCharts(charts: ChartModel[]): ChartRef[];
|
|
362
364
|
getChartModels(): ChartModel[];
|
|
365
|
+
private getActiveAdaptableAggFuncForCol;
|
|
366
|
+
private registerAdaptableAggFuncs;
|
|
367
|
+
/**
|
|
368
|
+
* When reading the state from the grid, we have to make sure 'avg' is not overriden with the 'avg' string.
|
|
369
|
+
*/
|
|
370
|
+
private handleUpdateWeightedAvgFromGrid;
|
|
363
371
|
}
|
|
364
372
|
export declare class AdaptableNoCodeWizard implements IAdaptableNoCodeWizard {
|
|
365
373
|
private init;
|