@adaptabletools/adaptable 13.0.0-canary.0 → 13.0.0-canary.10

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 (169) hide show
  1. package/agGrid.d.ts +23 -1
  2. package/agGrid.js +23 -1
  3. package/base.css +1 -0
  4. package/bundle.cjs.js +169 -169
  5. package/index.css +1 -0
  6. package/package.json +3 -3
  7. package/publishTimestamp.d.ts +1 -1
  8. package/publishTimestamp.js +1 -1
  9. package/src/AdaptableInterfaces/IAdaptable.d.ts +7 -3
  10. package/src/AdaptableOptions/AdaptableOptions.d.ts +0 -2
  11. package/src/AdaptableOptions/AdaptableQLOptions.d.ts +108 -23
  12. package/src/AdaptableOptions/FinsemblePluginOptions.d.ts +32 -0
  13. package/src/AdaptableOptions/FinsemblePluginOptions.js +2 -0
  14. package/src/AdaptableOptions/GeneralOptions.d.ts +5 -0
  15. package/src/Api/ConditionalStyleApi.d.ts +20 -42
  16. package/src/Api/ConfigApi.d.ts +1 -2
  17. package/src/Api/FinsembleApi.d.ts +10 -0
  18. package/src/Api/FinsembleApi.js +2 -0
  19. package/src/Api/FormatColumnApi.d.ts +47 -3
  20. package/src/Api/Implementation/ColumnApiImpl.js +3 -3
  21. package/src/Api/Implementation/DashboardApiImpl.js +2 -3
  22. package/src/Api/Implementation/FormatColumnApiImpl.d.ts +18 -1
  23. package/src/Api/Implementation/FormatColumnApiImpl.js +97 -14
  24. package/src/Api/Implementation/InternalApiImpl.d.ts +1 -0
  25. package/src/Api/Implementation/InternalApiImpl.js +4 -0
  26. package/src/Api/Implementation/PluginsApiImpl.d.ts +2 -0
  27. package/src/Api/Implementation/PluginsApiImpl.js +6 -0
  28. package/src/Api/Implementation/QueryLanguageApiImpl.d.ts +0 -2
  29. package/src/Api/Implementation/QueryLanguageApiImpl.js +0 -3
  30. package/src/Api/Implementation/SystemStatusApiImpl.js +1 -2
  31. package/src/Api/Implementation/ToolPanelApiImpl.d.ts +3 -1
  32. package/src/Api/Implementation/ToolPanelApiImpl.js +8 -0
  33. package/src/Api/InternalApi.d.ts +1 -0
  34. package/src/Api/PluginsApi.d.ts +5 -0
  35. package/src/Api/QueryLanguageApi.d.ts +0 -5
  36. package/src/Api/ToolPanelApi.d.ts +10 -1
  37. package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +1 -1
  38. package/src/PredefinedConfig/Common/AdaptablePredicate.js +37 -37
  39. package/src/PredefinedConfig/ConditionalStyleState.d.ts +10 -19
  40. package/src/PredefinedConfig/FormatColumnState.d.ts +19 -6
  41. package/src/PredefinedConfig/PredefinedConfig.d.ts +1 -0
  42. package/src/Redux/ActionsReducers/FormatColumnRedux.d.ts +14 -0
  43. package/src/Redux/ActionsReducers/FormatColumnRedux.js +43 -1
  44. package/src/Redux/Store/AdaptableStore.js +2 -0
  45. package/src/Strategy/ConditionalStyleModule.d.ts +2 -0
  46. package/src/Strategy/ConditionalStyleModule.js +6 -0
  47. package/src/Strategy/DataChangeHistoryModule.d.ts +1 -0
  48. package/src/Strategy/DataChangeHistoryModule.js +12 -0
  49. package/src/Strategy/FormatColumnModule.d.ts +4 -9
  50. package/src/Strategy/FormatColumnModule.js +52 -2
  51. package/src/Strategy/Interface/IModule.d.ts +11 -10
  52. package/src/Strategy/Utilities/Alert/getAlertBehaviourViewItems.d.ts +2 -2
  53. package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.d.ts +1 -1
  54. package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.js +3 -4
  55. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +6 -10
  56. package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.d.ts +3 -2
  57. package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +3 -1
  58. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +1 -0
  59. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +3 -1
  60. package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.d.ts +1 -0
  61. package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +3 -1
  62. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.d.ts +1 -0
  63. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -1
  64. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -0
  65. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +3 -1
  66. package/src/Utilities/Extensions/TypeExtensions.d.ts +1 -0
  67. package/src/Utilities/Extensions/TypeExtensions.js +5 -0
  68. package/src/Utilities/ObjectFactory.js +0 -1
  69. package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +14 -4
  70. package/src/Utilities/Services/{LicenseService.d.ts → LicenseService/index.d.ts} +3 -3
  71. package/src/Utilities/Services/LicenseService/index.js +1 -0
  72. package/src/Utilities/Services/LicenseService/shouldLogThankYouMessage.d.ts +1 -0
  73. package/src/Utilities/Services/LicenseService/shouldLogThankYouMessage.js +15 -0
  74. package/src/Utilities/Services/QueryLanguageService.d.ts +3 -3
  75. package/src/Utilities/Services/QueryLanguageService.js +88 -39
  76. package/src/Utilities/license/LicenseDetails.d.ts +1 -1
  77. package/src/Utilities/license/decode.d.ts +1 -0
  78. package/src/Utilities/license/decode.js +1 -1
  79. package/src/View/AdaptablePopover/index.d.ts +2 -2
  80. package/src/View/AdaptableView.d.ts +3 -3
  81. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/Components/FormBox.d.ts +1 -1
  82. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.d.ts +1 -1
  83. package/src/View/AdaptableWizardView/index.d.ts +1 -1
  84. package/src/View/ColorPicker.d.ts +1 -5
  85. package/src/View/Components/AdaptableDateInput/index.d.ts +1 -1
  86. package/src/View/Components/Buttons/ButtonEdit.d.ts +1 -1
  87. package/src/View/Components/EntityRulesEditor/index.d.ts +2 -1
  88. package/src/View/Components/EntityRulesEditor/index.js +29 -19
  89. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupBody.d.ts +1 -1
  90. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.d.ts +2 -2
  91. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.d.ts +1 -1
  92. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +1 -0
  93. package/src/View/Components/Popups/AdaptablePopup/Navigation.d.ts +1 -1
  94. package/src/View/Components/Popups/AdaptablePopup/PopupPanel.d.ts +1 -1
  95. package/src/View/Components/Popups/AdaptablePopup/TopBar.d.ts +1 -1
  96. package/src/View/Components/Popups/AdaptablePopupPrompt.d.ts +1 -1
  97. package/src/View/Components/ToolPanel/AdaptableToolPanel.d.ts +4 -0
  98. package/src/View/Components/ToolPanel/AdaptableToolPanel.js +5 -2
  99. package/src/View/ConditionalStyle/ConditionalStylePopupHeader.d.ts +2 -0
  100. package/src/View/ConditionalStyle/ConditionalStylePopupHeader.js +18 -0
  101. package/src/View/FormatColumn/MoveFormatColumn.d.ts +7 -0
  102. package/src/View/FormatColumn/MoveFormatColumn.js +27 -0
  103. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +1 -1
  104. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +8 -0
  105. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +29 -0
  106. package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +20 -2
  107. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +0 -22
  108. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +2 -2
  109. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +13 -0
  110. package/src/View/FormatColumn/Wizard/constants.d.ts +1 -0
  111. package/src/View/FormatColumn/Wizard/constants.js +4 -0
  112. package/src/View/Layout/Wizard/sections/AggregationsSection.js +1 -1
  113. package/src/View/Layout/Wizard/sections/SettingsSection.d.ts +2 -2
  114. package/src/View/License/LicenseWatermark.d.ts +1 -1
  115. package/src/View/StateManagement/components/ClearButton.d.ts +1 -1
  116. package/src/View/StateManagement/components/LoadButton.d.ts +1 -1
  117. package/src/View/StatusBar/StatusBarPanel.d.ts +4 -4
  118. package/src/View/Wizard/OnePageAdaptableWizard.d.ts +3 -3
  119. package/src/View/Wizard/OnePageAdaptableWizard.js +2 -2
  120. package/src/View/Wizard/OnePageWizards.d.ts +3 -3
  121. package/src/View/Wizard/OnePageWizards.js +2 -2
  122. package/src/agGrid/ActionColumnRenderer.d.ts +1 -0
  123. package/src/agGrid/ActionColumnRenderer.js +5 -5
  124. package/src/agGrid/Adaptable.d.ts +13 -2
  125. package/src/agGrid/Adaptable.js +142 -85
  126. package/src/agGrid/FilterWrapper.js +5 -5
  127. package/src/agGrid/FloatingFilterWrapper.js +3 -4
  128. package/src/agGrid/createAgStatusPanelComponent.d.ts +1 -0
  129. package/src/agGrid/createAgStatusPanelComponent.js +3 -3
  130. package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +1 -0
  131. package/src/agGrid/editors/AdaptableDateEditor/index.js +3 -3
  132. package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +1 -0
  133. package/src/agGrid/editors/AdaptableNumberEditor/index.js +3 -3
  134. package/src/components/CheckBox/index.d.ts +1 -1
  135. package/src/components/Datepicker/index.d.ts +1 -1
  136. package/src/components/Dialog/index.d.ts +4 -2
  137. package/src/components/Dialog/index.js +2 -2
  138. package/src/components/DropdownButton/index.d.ts +21 -4
  139. package/src/components/DropdownButton/index.js +5 -6
  140. package/src/components/ExpressionEditor/BaseEditorInput.d.ts +1 -1
  141. package/src/components/ExpressionEditor/EditorInput.js +1 -1
  142. package/src/components/ExpressionEditor/EditorInputWithWhereClause.js +1 -1
  143. package/src/components/Input/index.d.ts +1 -1
  144. package/src/components/List/ListGroupItem/index.d.ts +4 -2
  145. package/src/components/Loader/Loader.d.ts +2 -2
  146. package/src/components/Logo/index.d.ts +1 -1
  147. package/src/components/Modal/index.d.ts +1 -1
  148. package/src/components/PopupWithFooter.d.ts +2 -2
  149. package/src/components/ProgressIndicator/ProgressIndicator.d.ts +1 -1
  150. package/src/components/SelectList.d.ts +1 -1
  151. package/src/components/SimpleButton/index.d.ts +4 -5
  152. package/src/components/SimpleButton/index.js +3 -2
  153. package/src/components/StylePreview.d.ts +1 -1
  154. package/src/components/Tag/Tag.d.ts +1 -1
  155. package/src/components/Textarea/index.d.ts +6 -4
  156. package/src/components/ToggleButton/index.d.ts +1 -1
  157. package/src/components/WindowModal/WindowModal.d.ts +1 -1
  158. package/src/components/icons/index.d.ts +3 -2
  159. package/src/components/icons/layout.d.ts +2 -1
  160. package/src/components/utils/useContainerScrollObserver/index.d.ts +1 -1
  161. package/src/metamodel/adaptable.metamodel.d.ts +100 -64
  162. package/src/metamodel/adaptable.metamodel.js +1 -1
  163. package/src/parser/src/types.d.ts +6 -3
  164. package/src/renderReactRoot.d.ts +3 -0
  165. package/src/renderReactRoot.js +54 -0
  166. package/src/types.d.ts +4 -2
  167. package/version.d.ts +1 -1
  168. package/version.js +1 -1
  169. package/src/Utilities/Services/LicenseService.js +0 -1
@@ -27,17 +27,21 @@ export declare const ConnectedAdaptableToolPanel: import("react-redux").Connecte
27
27
  export declare const getAdaptableToolPanelAgGridComponent: (adaptable?: IAdaptable) => {
28
28
  new (): {
29
29
  gui: HTMLElement;
30
+ unmountReactRoot?: VoidFunction;
30
31
  init(params?: IToolPanelParams): void;
31
32
  getGui(): HTMLElement;
32
33
  refresh(): void;
34
+ destroy(): void;
33
35
  };
34
36
  };
35
37
  export declare const AdaptableToolPanelAgGridComponent: {
36
38
  new (): {
37
39
  gui: HTMLElement;
40
+ unmountReactRoot?: VoidFunction;
38
41
  init(params?: IToolPanelParams): void;
39
42
  getGui(): HTMLElement;
40
43
  refresh(): void;
44
+ destroy(): void;
41
45
  };
42
46
  };
43
47
  export {};
@@ -7,7 +7,6 @@ const kebabCase_1 = tslib_1.__importDefault(require("lodash/kebabCase"));
7
7
  const ToolPanelRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/ToolPanelRedux"));
8
8
  const SystemRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/SystemRedux"));
9
9
  const react_redux_1 = require("react-redux");
10
- const react_dom_1 = require("react-dom");
11
10
  const rebass_1 = require("rebass");
12
11
  const ArrayExtensions_1 = tslib_1.__importDefault(require("../../../Utilities/Extensions/ArrayExtensions"));
13
12
  const icons_1 = require("../../../components/icons");
@@ -238,7 +237,7 @@ const getAdaptableToolPanelAgGridComponent = (adaptable) => {
238
237
  this.gui.className = 'ag-adaptable-panel';
239
238
  this.gui.style.width = '100%';
240
239
  this.gui.style.overflow = 'auto';
241
- (0, react_dom_1.render)((0, renderWithAdaptableContext_1.renderWithAdaptableContext)(React.createElement(exports.ConnectedAdaptableToolPanel, { api: api, teamSharingActivated: false }), Adaptable), this.gui);
240
+ this.unmountReactRoot = Adaptable.renderReactRoot((0, renderWithAdaptableContext_1.renderWithAdaptableContext)(React.createElement(exports.ConnectedAdaptableToolPanel, { api: api, teamSharingActivated: false }), Adaptable), this.gui);
242
241
  }
243
242
  getGui() {
244
243
  if (!this.gui) {
@@ -249,6 +248,10 @@ const getAdaptableToolPanelAgGridComponent = (adaptable) => {
249
248
  refresh() {
250
249
  // no refresh logic needed
251
250
  }
251
+ destroy() {
252
+ var _a;
253
+ (_a = this.unmountReactRoot) === null || _a === void 0 ? void 0 : _a.call(this);
254
+ }
252
255
  };
253
256
  };
254
257
  exports.getAdaptableToolPanelAgGridComponent = getAdaptableToolPanelAgGridComponent;
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export declare const ConditionalStylePopupHeader: React.FunctionComponent;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConditionalStylePopupHeader = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const HelpBlock_1 = tslib_1.__importDefault(require("../../components/HelpBlock"));
7
+ const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
8
+ const AdaptableContext_1 = require("../AdaptableContext");
9
+ const ConditionalStylePopupHeader = () => {
10
+ const adaptable = (0, AdaptableContext_1.useAdaptable)();
11
+ return (React.createElement(HelpBlock_1.default, null,
12
+ "Conditional Styles are deprecated, use",
13
+ ' ',
14
+ React.createElement(SimpleButton_1.default, { onClick: () => adaptable.api.settingsPanelApi.showSettingsPanel('FormatColumn'), variant: "outlined" }, "Format Columns"),
15
+ ' ',
16
+ "instead."));
17
+ };
18
+ exports.ConditionalStylePopupHeader = ConditionalStylePopupHeader;
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import { AccessLevel, FormatColumn } from '../../types';
3
+ export declare const MoveFormatColumn: React.FunctionComponent<{
4
+ data: FormatColumn;
5
+ id?: string;
6
+ accessLevel: AccessLevel;
7
+ }>;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MoveFormatColumn = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
7
+ const FormatColumnRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/FormatColumnRedux"));
8
+ const react_redux_1 = require("react-redux");
9
+ const AdaptableContext_1 = require("../AdaptableContext");
10
+ const MoveFormatColumn = (props) => {
11
+ const dispatch = (0, react_redux_1.useDispatch)();
12
+ const adaptable = (0, AdaptableContext_1.useAdaptable)();
13
+ const formatColumn = adaptable.api.formatColumnApi.getAllFormatColumn();
14
+ const handleMoveUp = React.useCallback(() => {
15
+ dispatch(FormatColumnRedux.FormatColumnMoveUp(props.data));
16
+ }, []);
17
+ const handleMoveDown = React.useCallback(() => {
18
+ dispatch(FormatColumnRedux.FormatColumnMoveDown(props.data));
19
+ }, []);
20
+ if ((formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.length) <= 1) {
21
+ return React.createElement(React.Fragment, null);
22
+ }
23
+ return (React.createElement(React.Fragment, null,
24
+ React.createElement(SimpleButton_1.default, { "data-id": "move-up", title: "move up", onClick: handleMoveUp, variant: "text", icon: "arrow-up" }),
25
+ React.createElement(SimpleButton_1.default, { "data-name": "move-down", title: "move down", onClick: handleMoveDown, variant: "text", icon: "arrow-down" })));
26
+ };
27
+ exports.MoveFormatColumn = MoveFormatColumn;
@@ -125,7 +125,7 @@ const getFormatDisplayTypeForScope = (scope, api) => {
125
125
  }
126
126
  // need to see if all columns are numeric or date
127
127
  if ('ColumnIds' in scope) {
128
- const columns = scope.ColumnIds.map((c) => api.columnApi.getColumnFromId(c));
128
+ const columns = scope.ColumnIds.map((c) => api.columnApi.getColumnFromId(c)).filter(Boolean);
129
129
  const columnDataTypes = (0, uniq_1.default)(columns.map((c) => c.dataType));
130
130
  if (columnDataTypes.length == 1 && columnDataTypes[0] == 'Number') {
131
131
  return 'Number';
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { FormatColumn } from '../../../../types';
3
+ declare type FormatColumnRuleWizardSectionProps = {
4
+ onChange: (data: FormatColumn) => void;
5
+ defaultPredicateId: string;
6
+ };
7
+ export declare function FormatColumnRuleWizardSection(props: FormatColumnRuleWizardSectionProps): JSX.Element;
8
+ export {};
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FormatColumnRuleWizardSection = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
7
+ const EntityRulesEditor_1 = require("../../Components/EntityRulesEditor");
8
+ function FormatColumnRuleWizardSection(props) {
9
+ const { data, api, moduleInfo } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
10
+ const hasIncompatibleStyle = Boolean(data.ColumnStyle);
11
+ return (React.createElement(EntityRulesEditor_1.EntityRulesEditor, { module: moduleInfo.ModuleName, defaultPredicateId: props.defaultPredicateId,
12
+ // TODO see what is this
13
+ predicateDefs: api.formatColumnApi.getFormatColumnDefsForScope(data.Scope), showNoRule: true, showBoolean: !hasIncompatibleStyle, showAggregation: false, showObservable: false, showPredicate: !hasIncompatibleStyle && !api.scopeApi.scopeIsAll(data.Scope), data: data, onChange: (formatColumn) => props.onChange(formatColumn), descriptions: {
14
+ selectPredicate: 'Select a Format Column Rule - to be applied when data changes',
15
+ useBooleanQuery: (React.createElement(React.Fragment, null,
16
+ "Use an BooleanQuery if ",
17
+ React.createElement("i", null, "Scope"),
18
+ " is 'Whole Row' - so any data change may be evaluated in a complex BooleanExpression")),
19
+ useObservableQuery: (React.createElement(React.Fragment, null,
20
+ "Use an ObservableQuery if ",
21
+ React.createElement("i", null, "Scope"),
22
+ " is 'Whole Row' - so any data change may be evaluated in a complex ObservableExpression")),
23
+ useAggregationQuery: (React.createElement(React.Fragment, null,
24
+ "Use an AggregatedBooleanQuery if ",
25
+ React.createElement("i", null, "Scope"),
26
+ " is 'Whole Row' - so any data change may be evaluated in a complex AggregatedBooleanExpression")),
27
+ } }));
28
+ }
29
+ exports.FormatColumnRuleWizardSection = FormatColumnRuleWizardSection;
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
6
  const NewScopeComponent_1 = require("../../Components/NewScopeComponent");
7
7
  const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
8
+ const constants_1 = require("./constants");
8
9
  const renderFormatColumnScopeSummary = (data) => {
9
10
  return (0, NewScopeComponent_1.renderScopeSummary)(data.Scope, {
10
11
  scopeWholeRow: 'Matching rows will be formatted',
@@ -14,12 +15,29 @@ const renderFormatColumnScopeSummary = (data) => {
14
15
  };
15
16
  exports.renderFormatColumnScopeSummary = renderFormatColumnScopeSummary;
16
17
  const FormatColumnScopeWizardSection = (props) => {
17
- const { data } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
18
+ const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
18
19
  return (React.createElement(NewScopeComponent_1.NewScopeComponent, { descriptions: {
19
20
  rowScope: 'Apply a style to an entire row',
20
21
  columnScope: 'Select columns to format',
21
22
  }, scope: data.Scope, updateScope: (Scope) => {
22
- props.onChange(Object.assign(Object.assign({}, data), { Scope }));
23
+ var _a;
24
+ const newData = Object.assign(Object.assign({}, data), { Scope });
25
+ const wholeRow = api.scopeApi.scopeIsAll(Scope);
26
+ if ((_a = newData.Rule) === null || _a === void 0 ? void 0 : _a.Predicate) {
27
+ if (wholeRow) {
28
+ // if scope is whole row, a predicate cannot be present, so we set the rule
29
+ // to be a boolean expression
30
+ delete newData.Rule.Predicate;
31
+ newData.Rule.BooleanExpression = '';
32
+ }
33
+ else {
34
+ // if scope is not whole row, if you have a predicate, reset it
35
+ newData.Rule.Predicate = {
36
+ PredicateId: constants_1.DEFAULT_PREDICATE_ID_FOR_FORMAT_COLUMN,
37
+ };
38
+ }
39
+ }
40
+ props.onChange(newData);
23
41
  } }));
24
42
  };
25
43
  exports.FormatColumnScopeWizardSection = FormatColumnScopeWizardSection;
@@ -6,13 +6,9 @@ const React = tslib_1.__importStar(require("react"));
6
6
  const rebass_1 = require("rebass");
7
7
  const DropdownButton_1 = tslib_1.__importDefault(require("../../../components/DropdownButton"));
8
8
  const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
9
- const Input_1 = tslib_1.__importDefault(require("../../../components/Input"));
10
9
  const CheckBox_1 = require("../../../components/CheckBox");
11
10
  const Tabs_1 = require("../../../components/Tabs");
12
11
  const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
13
- const StringExtensions_1 = tslib_1.__importDefault(require("../../../Utilities/Extensions/StringExtensions"));
14
- const react_1 = require("react");
15
- const LoggingHelper_1 = require("../../../Utilities/Helpers/LoggingHelper");
16
12
  const Tag_1 = require("../../../components/Tag");
17
13
  let alignmentOptions = [
18
14
  { value: 'Left', label: 'Left' },
@@ -25,9 +21,6 @@ const renderFormatColumnSettingsSummary = (data) => {
25
21
  React.createElement(rebass_1.Text, null,
26
22
  "Cell alignment ",
27
23
  React.createElement(Tag_1.Tag, null, (_a = data.CellAlignment) !== null && _a !== void 0 ? _a : 'default')),
28
- data.HeaderName ? (React.createElement(rebass_1.Text, { mt: 3 },
29
- "Header name ",
30
- React.createElement(Tag_1.Tag, null, data.HeaderName))) : null,
31
24
  React.createElement(rebass_1.Text, { mt: 3 },
32
25
  "Include grouped rows ",
33
26
  React.createElement(Tag_1.Tag, null, data.IncludeGroupedRows ? 'yes' : 'no'))));
@@ -41,18 +34,6 @@ const FormatColumnSettingsWizardSection = (props) => {
41
34
  const onIncludeGroupedRowsChanged = (IncludeGroupedRows) => {
42
35
  props.onChange(Object.assign(Object.assign({}, data), { IncludeGroupedRows }));
43
36
  };
44
- const onHeaderNameChanged = (event) => {
45
- let e = event.target;
46
- props.onChange(Object.assign(Object.assign({}, data), { HeaderName: e.value }));
47
- };
48
- const [hasHeaderName, setHasHeaderName] = (0, react_1.useState)(false);
49
- (0, react_1.useEffect)(() => {
50
- const hasCustomHeaderName = StringExtensions_1.default.IsNotNullOrEmpty(data.HeaderName);
51
- setHasHeaderName(hasCustomHeaderName);
52
- if (hasCustomHeaderName) {
53
- (0, LoggingHelper_1.ConsoleLogWarning)(`DEPRECATED: The 'FormatColumn.HeaderName' property is deprecated; use a Layout custom Column Header instead!`);
54
- }
55
- }, []);
56
37
  return (React.createElement(Tabs_1.Tabs, null,
57
38
  React.createElement(Tabs_1.Tabs.Tab, null, "Format"),
58
39
  React.createElement(Tabs_1.Tabs.Content, null,
@@ -70,9 +51,6 @@ const FormatColumnSettingsWizardSection = (props) => {
70
51
  label: item.label,
71
52
  onClick: () => onCellAlignmentSelectChanged(item.value),
72
53
  })), columns: ['label'] }, data.CellAlignment ? data.CellAlignment : 'Select Option')),
73
- hasHeaderName && api.scopeApi.isSingleColumnScope(data.Scope) && (React.createElement(FormLayout_1.FormRow, { label: "Header Name" },
74
- React.createElement(Input_1.default, { value: data.HeaderName, onChange: (e) => onHeaderNameChanged(e), style: { minWidth: '15rem' } }),
75
- ' ')),
76
54
  React.createElement(FormLayout_1.FormRow, { label: "Include Grouped Rows:" },
77
55
  React.createElement(rebass_1.Flex, { alignItems: "center", marginLeft: 2 },
78
56
  React.createElement(CheckBox_1.CheckBox, { checked: data.IncludeGroupedRows, onChange: onIncludeGroupedRowsChanged, mr: 2 }))))))));
@@ -22,7 +22,6 @@ const isFormatColumnStyleValid = (data, api) => {
22
22
  data.Style &&
23
23
  UIHelper_1.default.IsEmptyStyle(data.Style) &&
24
24
  data.DisplayFormat === undefined &&
25
- data.HeaderName === undefined &&
26
25
  data.CellAlignment === undefined &&
27
26
  !api.scopeApi.isSingleBooleanColumnScope(data.Scope)) {
28
27
  return 'No format applied';
@@ -278,6 +277,7 @@ function FormatColumnStyleWizardSection(props) {
278
277
  props.onChange(newData);
279
278
  }
280
279
  };
280
+ const onlyStandardStyleAvailable = Boolean(data.Rule);
281
281
  return (React.createElement(React.Fragment, null,
282
282
  onlyBooleanColumnsInScope && (React.createElement(Tabs_1.Tabs, null,
283
283
  React.createElement(Tabs_1.Tabs.Tab, null, "CheckBox Column"),
@@ -293,7 +293,7 @@ function FormatColumnStyleWizardSection(props) {
293
293
  }
294
294
  props.onChange(formatColumn);
295
295
  } }, "Display Column As CheckBox")))),
296
- singleNumericColumn ? (React.createElement(React.Fragment, null,
296
+ singleNumericColumn && !onlyStandardStyleAvailable ? (React.createElement(React.Fragment, null,
297
297
  React.createElement(Tabs_1.Tabs, null,
298
298
  React.createElement(Tabs_1.Tabs.Tab, null, "Create a Format Column Style"),
299
299
  React.createElement(Tabs_1.Tabs.Content, null,
@@ -17,6 +17,9 @@ const ObjectFactory_1 = tslib_1.__importDefault(require("../../../Utilities/Obje
17
17
  const react_redux_1 = require("react-redux");
18
18
  const FormatColumnRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/FormatColumnRedux"));
19
19
  const ObjectTagsWizardSection_1 = require("../../Wizard/ObjectTagsWizardSection");
20
+ const EntityRulesEditor_1 = require("../../Components/EntityRulesEditor");
21
+ const FormatColumnRuleWizardSection_1 = require("./FormatColumnRuleWizardSection");
22
+ const constants_1 = require("./constants");
20
23
  const adjustDisplayFormat = (formatColumn, api) => {
21
24
  formatColumn = Object.assign({}, formatColumn);
22
25
  const formatDataType = (0, FormatColumnFormatWizardSection_1.getFormatDisplayTypeForScope)(formatColumn.Scope, api);
@@ -113,6 +116,16 @@ function FormatColumnWizard(props) {
113
116
  React.createElement(FormatColumnScopeWizardSection_1.FormatColumnScopeWizardSection, { onChange: setFormatColumn })));
114
117
  },
115
118
  },
119
+ {
120
+ isValid: (abObject, api, context) => {
121
+ return abObject.Rule ? (0, EntityRulesEditor_1.isRuleValid)(abObject, api, context) : true;
122
+ },
123
+ title: 'Condition',
124
+ details: 'Build the rules when Format column should be applied',
125
+ render: () => {
126
+ return (React.createElement(FormatColumnRuleWizardSection_1.FormatColumnRuleWizardSection, { onChange: setFormatColumn, defaultPredicateId: constants_1.DEFAULT_PREDICATE_ID_FOR_FORMAT_COLUMN }));
127
+ },
128
+ },
116
129
  {
117
130
  title: 'Style',
118
131
  details: 'Format Column Style',
@@ -0,0 +1 @@
1
+ export declare const DEFAULT_PREDICATE_ID_FOR_FORMAT_COLUMN = "NonBlanks";
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_PREDICATE_ID_FOR_FORMAT_COLUMN = void 0;
4
+ exports.DEFAULT_PREDICATE_ID_FOR_FORMAT_COLUMN = 'NonBlanks';
@@ -33,7 +33,7 @@ const AggregationsSectionSummary = () => {
33
33
  let content = null;
34
34
  if (entires.length) {
35
35
  content = (React.createElement(FormLayout_1.default, null, entires.map(([columnId, aggregation]) => (React.createElement(FormLayout_1.FormRow, { key: columnId, label: adaptable.api.columnApi.getFriendlyNameFromColumnId(columnId) },
36
- React.createElement(Tag_1.Tag, null, aggregation))))));
36
+ React.createElement(Tag_1.Tag, null, aggregation /* TODO fix for Bogdan */))))));
37
37
  }
38
38
  else {
39
39
  content = React.createElement(Tag_1.Tag, null, "No Aggregations");
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import { Layout } from '../../../../../types';
3
- export declare const SettingsSectionSummary: React.FunctionComponent;
3
+ export declare const SettingsSectionSummary: React.FunctionComponent<React.PropsWithChildren<unknown>>;
4
4
  interface SettingsSectionProps {
5
5
  onChange: (data: Layout) => void;
6
6
  }
7
- export declare const SettingsSection: React.FunctionComponent<SettingsSectionProps>;
7
+ export declare const SettingsSection: React.FunctionComponent<React.PropsWithChildren<SettingsSectionProps>>;
8
8
  export {};
@@ -1,2 +1,2 @@
1
1
  import * as React from 'react';
2
- export declare const LicenseWatermark: React.FunctionComponent;
2
+ export declare const LicenseWatermark: React.FunctionComponent<React.PropsWithChildren<unknown>>;
@@ -2,5 +2,5 @@ import * as React from 'react';
2
2
  import { SimpleButtonProps } from '../../../components/SimpleButton';
3
3
  interface ClearButtonProps extends SimpleButtonProps {
4
4
  }
5
- export declare const ClearButton: React.FunctionComponent<ClearButtonProps>;
5
+ export declare const ClearButton: React.FunctionComponent<React.PropsWithChildren<ClearButtonProps>>;
6
6
  export {};
@@ -3,5 +3,5 @@ import { SimpleButtonProps } from '../../../components/SimpleButton';
3
3
  interface LoadButtonProps extends SimpleButtonProps {
4
4
  onLoad: (json: any) => void;
5
5
  }
6
- export declare const LoadButton: React.FunctionComponent<LoadButtonProps>;
6
+ export declare const LoadButton: React.FunctionComponent<React.PropsWithChildren<LoadButtonProps>>;
7
7
  export {};
@@ -15,7 +15,7 @@ import { FlexProps } from 'rebass';
15
15
  */
16
16
  export interface StatusBarPanelProps extends Omit<FlexProps, 'content'> {
17
17
  icon?: string;
18
- content?: React.ReactNode | React.FunctionComponent;
18
+ content?: React.ReactNode | React.FunctionComponent<React.PropsWithChildren<unknown>>;
19
19
  /**
20
20
  * weather to trigger onAction when the wrapper is clicked
21
21
  */
@@ -24,14 +24,14 @@ export interface StatusBarPanelProps extends Omit<FlexProps, 'content'> {
24
24
  * When specified this content will be rendered when the text
25
25
  * is clicked.
26
26
  */
27
- popover?: React.ReactNode | React.FunctionComponent;
27
+ popover?: React.ReactNode | React.FunctionComponent<React.PropsWithChildren<unknown>>;
28
28
  popoverMinWidth?: number;
29
29
  /**
30
30
  * Allow to render custom content
31
31
  */
32
- view?: React.FunctionComponent;
32
+ view?: React.FunctionComponent<React.PropsWithChildren<unknown>>;
33
33
  onAction?: () => void;
34
- extraActions?: React.FunctionComponent[];
34
+ extraActions?: React.FunctionComponent<React.PropsWithChildren<unknown>>[];
35
35
  tooltip?: string;
36
36
  }
37
37
  /**
@@ -11,9 +11,9 @@ export declare type OnePageAdaptableWizardContextType<T> = {
11
11
  api: AdaptableApi;
12
12
  namedQuery: ExpressionEditorNamedQuery;
13
13
  };
14
- export declare const SummaryTag: React.FunctionComponent<TextProps>;
15
- export declare const SummaryText: React.FunctionComponent<TextProps>;
16
- export declare const FormDescriptionText: React.FunctionComponent<TextProps>;
14
+ export declare const SummaryTag: React.FunctionComponent<React.PropsWithChildren<TextProps>>;
15
+ export declare const SummaryText: React.FunctionComponent<React.PropsWithChildren<TextProps>>;
16
+ export declare const FormDescriptionText: React.FunctionComponent<React.PropsWithChildren<TextProps>>;
17
17
  export declare const OnePageAdaptableWizardContext: React.Context<OnePageAdaptableWizardContextType<any>>;
18
18
  export declare function useOnePageAdaptableWizardContext<ENTITY>(): OnePageAdaptableWizardContextType<ENTITY>;
19
19
  export interface OnePageAdaptableWizardSection<ENTITY> {
@@ -13,11 +13,11 @@ const Tabs_1 = require("../../components/Tabs");
13
13
  const NamedQueryContext_1 = require("../../components/ExpressionEditor/NamedQueryContext");
14
14
  const OnePageWizards_1 = require("./OnePageWizards");
15
15
  const kebabCase_1 = tslib_1.__importDefault(require("lodash/kebabCase"));
16
- const SummaryTag = (props) => React.createElement(rebass_1.Text, Object.assign({}, props));
16
+ const SummaryTag = (props) => (React.createElement(rebass_1.Text, Object.assign({}, props)));
17
17
  exports.SummaryTag = SummaryTag;
18
18
  const SummaryText = (props) => (React.createElement(rebass_1.Text, Object.assign({ fontSize: 2, mb: 3 }, props)));
19
19
  exports.SummaryText = SummaryText;
20
- const FormDescriptionText = (props) => (React.createElement(rebass_1.Text, Object.assign({ fontSize: 2, mt: 1 }, props)));
20
+ const FormDescriptionText = (props) => React.createElement(rebass_1.Text, Object.assign({ fontSize: 2, mt: 1 }, props));
21
21
  exports.FormDescriptionText = FormDescriptionText;
22
22
  exports.OnePageAdaptableWizardContext = React.createContext({
23
23
  data: null,
@@ -6,9 +6,9 @@ export declare type OnePageWizardContextType<T> = {
6
6
  sections: (OnePageWizardSection<T> | '-')[];
7
7
  setCurrentSection: (index: number) => void;
8
8
  };
9
- export declare const SummaryTag: React.FunctionComponent<TextProps>;
10
- export declare const SummaryText: React.FunctionComponent<TextProps>;
11
- export declare const FormDescriptionText: React.FunctionComponent<TextProps>;
9
+ export declare const SummaryTag: React.FunctionComponent<React.PropsWithChildren<TextProps>>;
10
+ export declare const SummaryText: React.FunctionComponent<React.PropsWithChildren<TextProps>>;
11
+ export declare const FormDescriptionText: React.FunctionComponent<React.PropsWithChildren<TextProps>>;
12
12
  export declare const OnePageWizardContext: React.Context<OnePageWizardContextType<any>>;
13
13
  export declare function useOnePageWizardContext<ENTITY>(): OnePageWizardContextType<ENTITY>;
14
14
  export declare type OnePageWizardSection<ENTITY> = {
@@ -14,11 +14,11 @@ const icons_1 = require("../../components/icons");
14
14
  const ResizeObserver_1 = require("../../components/ResizeObserver");
15
15
  const NamedQueryContext_1 = require("../../components/ExpressionEditor/NamedQueryContext");
16
16
  const useKeyboardNavigation_1 = require("./useKeyboardNavigation");
17
- const SummaryTag = (props) => React.createElement(rebass_1.Text, Object.assign({}, props));
17
+ const SummaryTag = (props) => (React.createElement(rebass_1.Text, Object.assign({}, props)));
18
18
  exports.SummaryTag = SummaryTag;
19
19
  const SummaryText = (props) => (React.createElement(rebass_1.Text, Object.assign({ fontSize: 2, mb: 3 }, props)));
20
20
  exports.SummaryText = SummaryText;
21
- const FormDescriptionText = (props) => (React.createElement(rebass_1.Text, Object.assign({ fontSize: 2, mt: 1 }, props)));
21
+ const FormDescriptionText = (props) => React.createElement(rebass_1.Text, Object.assign({ fontSize: 2, mt: 1 }, props));
22
22
  exports.FormDescriptionText = FormDescriptionText;
23
23
  exports.OnePageWizardContext = React.createContext({
24
24
  data: null,
@@ -6,6 +6,7 @@ interface ActionColumnCellRendererParams extends ICellRendererParams {
6
6
  export declare class ActionColumnRenderer implements ICellRendererComp {
7
7
  private eGui;
8
8
  private eventListener;
9
+ private unmountReactRoot?;
9
10
  init(params: ActionColumnCellRendererParams): void;
10
11
  render(): void;
11
12
  getGui(): HTMLElement;
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActionColumnRenderer = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const SimpleButton_1 = tslib_1.__importDefault(require("../components/SimpleButton"));
6
- const react_dom_1 = require("react-dom");
7
6
  const React = tslib_1.__importStar(require("react"));
8
7
  const uuid_1 = require("../components/utils/uuid");
9
8
  class ActionColumnRenderer {
@@ -66,9 +65,9 @@ class ActionColumnRenderer {
66
65
  })));
67
66
  };
68
67
  const eGui = this.eGui;
69
- function doRender() {
70
- (0, react_dom_1.render)(renderActionButtons(actionButtons, adaptable.api, buttonContext), eGui);
71
- }
68
+ const doRender = () => {
69
+ this.unmountReactRoot = adaptable.renderReactRoot(renderActionButtons(actionButtons, adaptable.api, buttonContext), eGui);
70
+ };
72
71
  this.render = doRender;
73
72
  doRender();
74
73
  }
@@ -88,7 +87,8 @@ class ActionColumnRenderer {
88
87
  }
89
88
  // gets called when the cell is removed from the grid
90
89
  destroy() {
91
- (0, react_dom_1.unmountComponentAtNode)(this.eGui);
90
+ var _a;
91
+ (_a = this.unmountReactRoot) === null || _a === void 0 ? void 0 : _a.call(this);
92
92
  // do cleanup, remove event listener from button
93
93
  if (this.eGui) {
94
94
  this.eGui.removeEventListener('click', this.eventListener);
@@ -1,4 +1,4 @@
1
- import { ChartModel, ChartRef, ColDef, ColGroupDef, Column, ExcelStyle, GridOptions, Module, RowNode } from '@ag-grid-community/core';
1
+ import { ChartModel, ChartRef, ColDef, ColGroupDef, Column, ExcelStyle, GridOptions, Module, ModuleNames, RowNode } from '@ag-grid-community/core';
2
2
  import { AdaptableNoCodeWizardOptions, IAdaptableNoCodeWizard } from '../AdaptableInterfaces/AdaptableNoCodeWizard';
3
3
  import { IAdaptable } from '../AdaptableInterfaces/IAdaptable';
4
4
  import { AdaptableOptions } from '../AdaptableOptions/AdaptableOptions';
@@ -35,8 +35,11 @@ import { CustomSort } from '../PredefinedConfig/CustomSortState';
35
35
  import { ColumnValuesComparer } from '../AdaptableOptions/GeneralOptions';
36
36
  import { IMetamodelService } from '../Utilities/Services/Interface/IMetamodelService';
37
37
  import { IRowEditService } from '../Utilities/Services/Interface/IRowEditService';
38
+ import { RenderReactRootFn } from '../renderReactRoot';
38
39
  declare type RuntimeConfig = {
39
40
  waitForAgGrid?: boolean;
41
+ supressReact18RenderWarning?: boolean;
42
+ renderReactRoot?: RenderReactRootFn;
40
43
  };
41
44
  export declare class Adaptable implements IAdaptable {
42
45
  api: AdaptableApi;
@@ -75,6 +78,7 @@ export declare class Adaptable implements IAdaptable {
75
78
  private currentColumnDefs?;
76
79
  private rowListeners;
77
80
  private isCheckedColumnDataType;
81
+ private unmountReactRoot?;
78
82
  get isLive(): boolean;
79
83
  _on: (eventName: string, callback: EmitterCallback) => (() => void);
80
84
  _onIncludeFired: (eventName: string, callback: EmitterCallback) => (() => void);
@@ -83,6 +87,8 @@ export declare class Adaptable implements IAdaptable {
83
87
  private _adaptableReady;
84
88
  isDestroyed: boolean;
85
89
  private listenerKeydown;
90
+ supressReact18RenderWarning: boolean;
91
+ renderReactRoot: RenderReactRootFn;
86
92
  private listenerFirstDataRendered;
87
93
  private listenerPivotModeChanged;
88
94
  private listenerPivotChanged;
@@ -148,7 +154,11 @@ export declare class Adaptable implements IAdaptable {
148
154
  updateColumnsIntoStore(): void;
149
155
  private createAdaptableColumn;
150
156
  private safeSetColDefs;
157
+ private getFormatColumnSpecialColumnStyle;
158
+ private getFormatColumnColumnStyle;
151
159
  private getFormatColumnCellStyle;
160
+ private getFormatColumnCellClass;
161
+ private getFormatColumnRowClass;
152
162
  private getActiveAlertWithHighlightCell;
153
163
  private getActiveAlertWithHighlightRow;
154
164
  private getAlertCellStyle;
@@ -283,7 +293,7 @@ export declare class Adaptable implements IAdaptable {
283
293
  setupColumnComparator({ col, colId, abColumn }: ColumnSetupInfo): void;
284
294
  private applyCurrentTheme;
285
295
  private applyFinalRendering;
286
- private isAgGridModulePresent;
296
+ isAgGridModulePresent(moduleName: ModuleNames): boolean;
287
297
  private getAgGridRegisteredModules;
288
298
  private onRowDataChanged;
289
299
  private onCellDataChanged;
@@ -352,6 +362,7 @@ export declare class Adaptable implements IAdaptable {
352
362
  private setupColumnHeaderAggregations;
353
363
  private getConditionalStyleRowClass;
354
364
  private getConditionalStyleRowStyle;
365
+ private getFormatColumnRowStyle;
355
366
  private getGridOptionsApi;
356
367
  canGenerateCharts(): boolean;
357
368
  canHaveSparklines(): boolean;