@adaptabletools/adaptable 12.1.7 → 12.1.8-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/base.css +11 -49
  2. package/bundle.cjs.js +105 -105
  3. package/index.css +13 -60
  4. package/package.json +1 -1
  5. package/publishTimestamp.d.ts +1 -1
  6. package/publishTimestamp.js +1 -1
  7. package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -0
  8. package/src/AdaptableOptions/FilterOptions.d.ts +12 -0
  9. package/src/AdaptableOptions/FinancePluginOptions.d.ts +22 -1
  10. package/src/AdaptableOptions/StateOptions.d.ts +25 -12
  11. package/src/Api/ColumnApi.d.ts +5 -0
  12. package/src/Api/ExportApi.d.ts +5 -0
  13. package/src/Api/FilterApi.d.ts +23 -0
  14. package/src/Api/GridApi.d.ts +1 -0
  15. package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -0
  16. package/src/Api/Implementation/ColumnApiImpl.js +5 -0
  17. package/src/Api/Implementation/ExportApiImpl.d.ts +3 -1
  18. package/src/Api/Implementation/ExportApiImpl.js +19 -3
  19. package/src/Api/Implementation/FilterApiImpl.d.ts +5 -0
  20. package/src/Api/Implementation/FilterApiImpl.js +25 -2
  21. package/src/Api/Implementation/GridApiImpl.d.ts +1 -0
  22. package/src/Api/Implementation/InternalApiImpl.d.ts +0 -1
  23. package/src/Api/Implementation/InternalApiImpl.js +0 -3
  24. package/src/Api/Implementation/PredicateApiImpl.js +4 -0
  25. package/src/Api/Implementation/QueryLanguageApiImpl.js +9 -1
  26. package/src/Api/InternalApi.d.ts +0 -1
  27. package/src/PredefinedConfig/CalculatedColumnState.d.ts +2 -2
  28. package/src/PredefinedConfig/Common/AdaptablePredicate.js +16 -4
  29. package/src/PredefinedConfig/Common/AdaptableQuery.js +1 -1
  30. package/src/PredefinedConfig/Common/AggregationColumns.d.ts +6 -0
  31. package/src/PredefinedConfig/Common/AggregationColumns.js +4 -0
  32. package/src/PredefinedConfig/Common/ColumnFilter.d.ts +2 -2
  33. package/src/PredefinedConfig/Common/Enums.d.ts +0 -15
  34. package/src/PredefinedConfig/Common/Enums.js +1 -18
  35. package/src/PredefinedConfig/ExportState.d.ts +12 -4
  36. package/src/PredefinedConfig/LayoutState.d.ts +2 -1
  37. package/src/PredefinedConfig/PopupState.d.ts +1 -2
  38. package/src/Redux/ActionsReducers/AlertRedux.d.ts +1 -1
  39. package/src/Redux/ActionsReducers/AlertRedux.js +1 -1
  40. package/src/Redux/ActionsReducers/ConditionalStyleRedux.d.ts +1 -1
  41. package/src/Redux/ActionsReducers/ConditionalStyleRedux.js +1 -1
  42. package/src/Redux/ActionsReducers/CustomSortRedux.d.ts +1 -1
  43. package/src/Redux/ActionsReducers/CustomSortRedux.js +1 -1
  44. package/src/Redux/ActionsReducers/FlashingCellRedux.d.ts +1 -1
  45. package/src/Redux/ActionsReducers/FlashingCellRedux.js +1 -1
  46. package/src/Redux/ActionsReducers/FormatColumnRedux.d.ts +1 -1
  47. package/src/Redux/ActionsReducers/FormatColumnRedux.js +1 -1
  48. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +28 -0
  49. package/src/Redux/ActionsReducers/LayoutRedux.js +80 -2
  50. package/src/Redux/ActionsReducers/PlusMinusRedux.d.ts +1 -1
  51. package/src/Redux/ActionsReducers/PlusMinusRedux.js +1 -1
  52. package/src/Redux/ActionsReducers/PopupRedux.d.ts +0 -2
  53. package/src/Redux/ActionsReducers/PopupRedux.js +1 -28
  54. package/src/Redux/ActionsReducers/ScheduleRedux.d.ts +5 -5
  55. package/src/Redux/ActionsReducers/ScheduleRedux.js +5 -5
  56. package/src/Redux/ActionsReducers/ShortcutRedux.d.ts +1 -1
  57. package/src/Redux/ActionsReducers/ShortcutRedux.js +1 -1
  58. package/src/Redux/Store/AdaptableStore.js +15 -6
  59. package/src/Strategy/AlertModule.d.ts +1 -0
  60. package/src/Strategy/AlertModule.js +20 -0
  61. package/src/Strategy/CalculatedColumnModule.js +2 -2
  62. package/src/Strategy/ExportModule.d.ts +0 -1
  63. package/src/Strategy/ExportModule.js +0 -16
  64. package/src/Strategy/FilterModule.js +6 -0
  65. package/src/Strategy/Interface/IModule.d.ts +4 -0
  66. package/src/Strategy/LayoutModule.js +20 -20
  67. package/src/Strategy/Utilities/FormatColumn/getFormatColumnStyleViewItems.js +16 -1
  68. package/src/Strategy/Utilities/Layout/getLayoutFilterViewItems.js +15 -11
  69. package/src/Utilities/Constants/DocumentationLinkConstants.d.ts +1 -0
  70. package/src/Utilities/Constants/DocumentationLinkConstants.js +2 -1
  71. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +2 -0
  72. package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.d.ts +12 -2
  73. package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +30 -66
  74. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +22 -6
  75. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +423 -220
  76. package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.d.ts +7 -1
  77. package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +23 -7
  78. package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.d.ts +0 -1
  79. package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +6 -54
  80. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +17 -5
  81. package/src/Utilities/Interface/MessagePopups.d.ts +0 -4
  82. package/src/Utilities/ObjectFactory.d.ts +4 -2
  83. package/src/Utilities/ObjectFactory.js +16 -3
  84. package/src/Utilities/Services/AggregatedScalarLiveValue.d.ts +25 -0
  85. package/src/Utilities/Services/AggregatedScalarLiveValue.js +103 -0
  86. package/src/Utilities/Services/AlertService.d.ts +0 -1
  87. package/src/Utilities/Services/AlertService.js +5 -17
  88. package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +4 -4
  89. package/src/Utilities/Services/CalculatedColumnExpressionService.js +29 -154
  90. package/src/Utilities/Services/Interface/ICalculatedColumnExpressionService.d.ts +2 -2
  91. package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +6 -3
  92. package/src/Utilities/Services/QueryLanguageService.d.ts +6 -3
  93. package/src/Utilities/Services/QueryLanguageService.js +23 -6
  94. package/src/Utilities/Services/ReportService.js +47 -46
  95. package/src/View/AdaptableView.js +1 -2
  96. package/src/View/CalculatedColumn/Utilities/getCalculatedColumnSettingsTags.d.ts +2 -0
  97. package/src/View/CalculatedColumn/Utilities/{getCalculatedColumnSettingTags.js → getCalculatedColumnSettingsTags.js} +3 -3
  98. package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.d.ts +10 -0
  99. package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.js +80 -0
  100. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +20 -11
  101. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.d.ts +1 -2
  102. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +9 -52
  103. package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +17 -6
  104. package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +42 -6
  105. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +1 -1
  106. package/src/View/Components/EntityRulesEditor/index.js +26 -5
  107. package/src/View/Components/FilterForm/FilterForm.js +8 -4
  108. package/src/View/Components/FilterForm/ListBoxFilterForm.js +1 -0
  109. package/src/View/Components/FilterForm/QuickFilterForm.js +10 -6
  110. package/src/View/Components/PermittedValuesSelector/PermitedValuesSelector.d.ts +9 -0
  111. package/src/View/Components/PermittedValuesSelector/PermitedValuesSelector.js +28 -0
  112. package/src/View/Components/PermittedValuesSelector/index.d.ts +1 -0
  113. package/src/View/Components/PermittedValuesSelector/index.js +5 -0
  114. package/src/View/Components/Popups/AdaptablePopup/Navigation.js +2 -2
  115. package/src/View/Components/Popups/AdaptableToaster.js +2 -7
  116. package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +0 -1
  117. package/src/View/Components/Popups/WindowPopups/windowFactory.js +1 -4
  118. package/src/View/Export/ExportViewPanel.d.ts +1 -2
  119. package/src/View/Export/ExportViewPanel.js +2 -6
  120. package/src/View/Export/Wizard/ReportColumnTypeWizard.d.ts +1 -2
  121. package/src/View/Export/Wizard/ReportColumnTypeWizard.js +11 -12
  122. package/src/View/Export/Wizard/ReportRowTypeWizard.d.ts +1 -2
  123. package/src/View/Export/Wizard/ReportRowTypeWizard.js +12 -13
  124. package/src/View/Export/Wizard/ReportSettingsWizard.js +1 -2
  125. package/src/View/Filter/FilterViewPanel.js +20 -4
  126. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +1 -1
  127. package/src/View/Layout/Wizard/{LayoutEditor → Components}/ColumnLabels.d.ts +0 -0
  128. package/src/View/Layout/Wizard/{LayoutEditor → Components}/ColumnLabels.js +0 -0
  129. package/src/View/Layout/Wizard/LayoutWizard.js +1 -0
  130. package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +1 -0
  131. package/src/View/Layout/Wizard/sections/AggregationsSection.js +69 -8
  132. package/src/View/Layout/Wizard/sections/ColumnsSection.js +1 -1
  133. package/src/View/Query/QueryViewPanel.js +1 -1
  134. package/src/agGrid/Adaptable.d.ts +10 -3
  135. package/src/agGrid/Adaptable.js +211 -142
  136. package/src/agGrid/agGridHelper.d.ts +1 -0
  137. package/src/agGrid/agGridHelper.js +5 -3
  138. package/src/agGrid/agGridMenuHelper.d.ts +1 -0
  139. package/src/agGrid/agGridMenuHelper.js +4 -2
  140. package/src/agGrid/weightedAverage.d.ts +6 -0
  141. package/src/agGrid/weightedAverage.js +66 -0
  142. package/src/components/ExpressionEditor/BaseEditorInput.d.ts +1 -0
  143. package/src/components/ExpressionEditor/BaseEditorInput.js +2 -3
  144. package/src/components/ExpressionEditor/EditorInput.d.ts +1 -1
  145. package/src/components/ExpressionEditor/EditorInput.js +24 -4
  146. package/src/components/ExpressionEditor/{EditorInputReactive.d.ts → EditorInputWithWhereClause.d.ts} +3 -3
  147. package/src/components/ExpressionEditor/{EditorInputReactive.js → EditorInputWithWhereClause.js} +6 -5
  148. package/src/components/ExpressionEditor/editorButtonsAggregatedBoolean.d.ts +2 -0
  149. package/src/components/ExpressionEditor/{editorButtonsReactive.js → editorButtonsAggregatedBoolean.js} +22 -37
  150. package/src/components/ExpressionEditor/editorButtonsAggregatedScalar.js +5 -10
  151. package/src/components/ExpressionEditor/editorButtonsCumulativeAggregatedScalar.d.ts +2 -0
  152. package/src/components/ExpressionEditor/editorButtonsCumulativeAggregatedScalar.js +50 -0
  153. package/src/components/ExpressionEditor/editorButtonsObservable.d.ts +2 -0
  154. package/src/components/ExpressionEditor/editorButtonsObservable.js +40 -0
  155. package/src/components/ExpressionEditor/index.d.ts +1 -1
  156. package/src/components/ExpressionEditor/index.js +26 -5
  157. package/src/metamodel/adaptable.metamodel.d.ts +55 -1
  158. package/src/metamodel/adaptable.metamodel.js +1 -1
  159. package/src/types.d.ts +3 -3
  160. package/version.d.ts +1 -1
  161. package/version.js +1 -1
  162. package/src/View/CalculatedColumn/Utilities/getCalculatedColumnSettingTags.d.ts +0 -2
  163. package/src/View/Layout/LayoutEditorStandalonePopup.d.ts +0 -3
  164. package/src/View/Layout/LayoutEditorStandalonePopup.js +0 -78
  165. package/src/View/Layout/Wizard/LayoutEditor/ColumnList.d.ts +0 -27
  166. package/src/View/Layout/Wizard/LayoutEditor/ColumnList.js +0 -86
  167. package/src/View/Layout/Wizard/LayoutEditor/ColumnSortList.d.ts +0 -16
  168. package/src/View/Layout/Wizard/LayoutEditor/ColumnSortList.js +0 -89
  169. package/src/View/Layout/Wizard/LayoutEditor/PivotList.d.ts +0 -15
  170. package/src/View/Layout/Wizard/LayoutEditor/PivotList.js +0 -70
  171. package/src/View/Layout/Wizard/LayoutEditor/RowGroupsList.d.ts +0 -15
  172. package/src/View/Layout/Wizard/LayoutEditor/RowGroupsList.js +0 -70
  173. package/src/View/Layout/Wizard/LayoutEditor/droppableIds.d.ts +0 -7
  174. package/src/View/Layout/Wizard/LayoutEditor/droppableIds.js +0 -11
  175. package/src/View/Layout/Wizard/LayoutEditor/getItemStyle.d.ts +0 -6
  176. package/src/View/Layout/Wizard/LayoutEditor/getItemStyle.js +0 -26
  177. package/src/View/Layout/Wizard/LayoutEditor/index.d.ts +0 -9
  178. package/src/View/Layout/Wizard/LayoutEditor/index.js +0 -367
  179. package/src/View/Layout/Wizard/LayoutEditor/reducer.d.ts +0 -28
  180. package/src/View/Layout/Wizard/LayoutEditor/reducer.js +0 -46
  181. package/src/View/Layout/Wizard/LayoutEditor/utils.d.ts +0 -10
  182. package/src/View/Layout/Wizard/LayoutEditor/utils.js +0 -14
  183. package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +0 -30
  184. package/src/View/Layout/Wizard/LayoutEditorWizard.js +0 -132
  185. package/src/components/ExpressionEditor/editorButtonsReactive.d.ts +0 -2
@@ -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: ArrayExtensions_1.default.IsNullOrEmptyOrContainsSingleEmptyValue(this.state.distinctColumnValues) }, selectedValues)));
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(toastId);
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
- if (api) {
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 = exports.WINDOW_LAYOUT_EDITOR = void 0;
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" | "Reports" | "CurrentDestination">>;
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.ReportColumnScope == 'CustomColumns', accessLevel: accessLevel }),
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 == Enums_1.ReportColumnScope.AllColumns, onChange: (_, e) => this.onScopeSelectChanged(e), marginRight: 3 }, "All Columns"),
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 == Enums_1.ReportColumnScope.VisibleColumns, onChange: (_, e) => this.onScopeSelectChanged(e), marginRight: 3 }, "Visible Columns Only"),
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 == Enums_1.ReportColumnScope.ScopeColumns, onChange: (_, e) => this.onScopeSelectChanged(e) }, "Bespoke Columns"),
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: Enums_1.ReportColumnScope.AllColumns,
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: Enums_1.ReportColumnScope.VisibleColumns,
41
+ ReportColumnScope: 'VisibleColumns',
43
42
  SelectedColumnValues: [],
44
43
  }, () => this.props.updateGoBackState());
45
44
  }
46
45
  else {
47
46
  this.setState({
48
- ReportColumnScope: Enums_1.ReportColumnScope.ScopeColumns,
47
+ ReportColumnScope: 'ScopeColumns',
49
48
  }, () => this.props.updateGoBackState());
50
49
  }
51
50
  }
52
51
  canNext() {
53
- return (this.state.ReportColumnScope == Enums_1.ReportColumnScope.AllColumns ||
54
- this.state.ReportColumnScope == Enums_1.ReportColumnScope.VisibleColumns ||
55
- this.state.ReportColumnScope == Enums_1.ReportColumnScope.ScopeColumns);
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 != Enums_1.ReportColumnScope.ScopeColumns) {
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 == Enums_1.ReportColumnScope.ScopeColumns ? 1 : 2;
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 == Enums_1.ReportRowScope.AllRows, onChange: (_, e) => this.onScopeSelectChanged(e), marginRight: 3 }, "All Rows"),
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 == Enums_1.ReportRowScope.VisibleRows, onChange: (_, e) => this.onScopeSelectChanged(e), marginRight: 3 }, "Visible Rows Only"),
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 == Enums_1.ReportRowScope.ExpressionRows, onChange: (_, e) => this.onScopeSelectChanged(e), marginRight: 3 }, "By Query - built by you in next step"),
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: Enums_1.ReportRowScope.AllRows,
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: Enums_1.ReportRowScope.VisibleRows,
41
+ ReportRowScope: 'VisibleRows',
43
42
  SelectedColumnValues: [],
44
43
  }, () => this.props.updateGoBackState());
45
44
  }
46
45
  else {
47
46
  this.setState({
48
- ReportRowScope: Enums_1.ReportRowScope.ExpressionRows,
47
+ ReportRowScope: 'ExpressionRows',
49
48
  }, () => this.props.updateGoBackState());
50
49
  }
51
50
  }
52
51
  canNext() {
53
- return (this.state.ReportRowScope == Enums_1.ReportRowScope.AllRows ||
54
- this.state.ReportRowScope == Enums_1.ReportRowScope.VisibleRows ||
55
- this.state.ReportRowScope == Enums_1.ReportRowScope.ExpressionRows);
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 != Enums_1.ReportRowScope.ExpressionRows) {
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 == Enums_1.ReportRowScope.ExpressionRows ? 1 : 2;
67
+ return this.state.ReportRowScope == 'ExpressionRows' ? 1 : 2;
69
68
  }
70
69
  getIndexStepDecrement() {
71
- return this.props.data.ReportColumnScope == Enums_1.ReportColumnScope.ScopeColumns ? 1 : 2;
70
+ return this.props.data.ReportColumnScope == 'ScopeColumns' ? 1 : 2;
72
71
  }
73
72
  }
74
73
  exports.ReportRowTypeWizard = ReportRowTypeWizard;
@@ -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 == Enums_1.ReportRowScope.ExpressionRows ? 1 : 2;
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, 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)],
22
- // tooltipText={'Show Filter Details'}
23
- useButton: true, showEvent: 'focus', hideEvent: "blur", popoverMinWidth: 400 }))),
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
- } }, "Show Quick Filter")))));
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(displayFormatter.scope, data.Scope));
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
  }
@@ -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;