@adaptabletools/adaptable 11.1.1 → 11.1.2

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 (57) hide show
  1. package/base.css +2 -0
  2. package/bundle.cjs.js +97 -97
  3. package/index.css +3 -0
  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 +2 -1
  8. package/src/AdaptableOptions/LayoutOptions.d.ts +11 -0
  9. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +1 -1
  10. package/src/Api/Implementation/GridApiImpl.js +9 -10
  11. package/src/Api/Implementation/InternalApiImpl.js +1 -1
  12. package/src/Api/Implementation/LayoutApiImpl.js +7 -1
  13. package/src/Strategy/CalculatedColumnModule.js +5 -0
  14. package/src/Strategy/FreeTextColumnModule.js +1 -1
  15. package/src/Strategy/Interface/IModule.d.ts +2 -1
  16. package/src/Strategy/LayoutModule.d.ts +23 -0
  17. package/src/Strategy/LayoutModule.js +70 -0
  18. package/src/Strategy/Utilities/getFlashingCellStyleViewItems.d.ts +1 -0
  19. package/src/Strategy/Utilities/getFlashingCellStyleViewItems.js +2 -1
  20. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +3 -0
  21. package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -1
  22. package/src/Utilities/Helpers/StyleHelper.d.ts +1 -0
  23. package/src/Utilities/Helpers/StyleHelper.js +13 -1
  24. package/src/View/AdaptableViewFactory.js +2 -4
  25. package/src/View/ColorPicker.d.ts +4 -2
  26. package/src/View/ColorPicker.js +16 -4
  27. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +24 -19
  28. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupBody.js +3 -1
  29. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +23 -15
  30. package/src/View/Components/Popups/WindowPopups/WindowPopups.d.ts +2 -0
  31. package/src/View/Components/Popups/WindowPopups/WindowPopups.js +9 -5
  32. package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +1 -0
  33. package/src/View/Components/Popups/WindowPopups/windowFactory.js +4 -1
  34. package/src/View/Components/RangesComponent.js +4 -6
  35. package/src/View/Components/StyleComponent.js +6 -9
  36. package/src/View/Components/ValueSelector/index.d.ts +1 -0
  37. package/src/View/Components/ValueSelector/index.js +1 -1
  38. package/src/View/Dashboard/CustomToolbarWrapper.js +9 -1
  39. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +2 -3
  40. package/src/View/GridInfo/AdaptableObjectsSummary.d.ts +2 -0
  41. package/src/View/GridInfo/AdaptableObjectsSummary.js +26 -0
  42. package/src/View/GridInfo/GridInfoPopup.js +11 -3
  43. package/src/View/Layout/LayoutEditorStandalonePopup.js +3 -4
  44. package/src/View/Layout/LayoutRadioSelector.d.ts +5 -0
  45. package/src/View/Layout/LayoutRadioSelector.js +18 -0
  46. package/src/View/Query/ExpandedQueryPopup.d.ts +2 -18
  47. package/src/View/Query/ExpandedQueryPopup.js +42 -57
  48. package/src/View/Query/QueryViewPanel.js +8 -5
  49. package/src/agGrid/Adaptable.d.ts +2 -1
  50. package/src/agGrid/Adaptable.js +16 -16
  51. package/src/components/ExpressionEditor/index.js +0 -1
  52. package/src/components/OverlayTrigger/index.js +1 -0
  53. package/src/components/Radio/index.d.ts +1 -1
  54. package/src/components/Radio/index.js +2 -2
  55. package/src/metamodel/adaptable.metamodel.js +7 -0
  56. package/version.d.ts +1 -1
  57. package/version.js +1 -1
@@ -17,21 +17,29 @@ exports.AdaptablePopupModuleView = (props) => {
17
17
  * Not sure yet how to trigger this component to render when an item is edited.
18
18
  */
19
19
  react_redux_1.useSelector((state) => state);
20
+ const [abObjectType, setAbObjectType] = React.useState(null);
21
+ const moduleInfo = props.module.moduleInfo;
22
+ const items = (_a = props.module) === null || _a === void 0 ? void 0 : _a.toViewAll();
23
+ const moduleViewProperties = props.module.getViewProperties();
24
+ const EditWizard = (_b = moduleViewProperties === null || moduleViewProperties === void 0 ? void 0 : moduleViewProperties.getEditWizard) === null || _b === void 0 ? void 0 : _b.call(moduleViewProperties);
20
25
  const [isWizardOpen, setIsWizardOpen] = React.useState(() => {
21
26
  var _a, _b;
22
27
  return ((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'New' || ((_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.action) === 'Edit';
23
28
  });
29
+ const handleOpenEditPopup = React.useCallback(() => {
30
+ if (EditWizard) {
31
+ setIsWizardOpen(true);
32
+ }
33
+ if (moduleViewProperties.onOpenEditPopup) {
34
+ moduleViewProperties.onOpenEditPopup();
35
+ }
36
+ }, []);
24
37
  React.useEffect(() => {
25
38
  var _a, _b;
26
39
  if (((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'New' || ((_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.action) === 'Edit') {
27
- setIsWizardOpen(true);
40
+ handleOpenEditPopup();
28
41
  }
29
- }, [(_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action]);
30
- const [abObjectType, setAbObjectType] = React.useState(null);
31
- const moduleInfo = props.module.moduleInfo;
32
- const items = (_b = props.module) === null || _b === void 0 ? void 0 : _b.toViewAll();
33
- const moduleViewProperties = props.module.getViewProperties();
34
- const EditWizard = (_c = moduleViewProperties === null || moduleViewProperties === void 0 ? void 0 : moduleViewProperties.getEditWizard) === null || _c === void 0 ? void 0 : _c.call(moduleViewProperties);
42
+ }, [(_c = props.popupParams) === null || _c === void 0 ? void 0 : _c.action]);
35
43
  const emptyView = moduleViewProperties.emptyView;
36
44
  let emptyContent = null;
37
45
  if (typeof emptyView === 'function') {
@@ -44,23 +52,23 @@ exports.AdaptablePopupModuleView = (props) => {
44
52
  // e.g. filter
45
53
  let newButton = null;
46
54
  if ((_d = moduleViewProperties === null || moduleViewProperties === void 0 ? void 0 : moduleViewProperties.abObjectTypes) === null || _d === void 0 ? void 0 : _d.length) {
47
- const items = moduleViewProperties === null || moduleViewProperties === void 0 ? void 0 : moduleViewProperties.abObjectTypes.map((abObjctType) => {
55
+ const items = moduleViewProperties === null || moduleViewProperties === void 0 ? void 0 : moduleViewProperties.abObjectTypes.map((abObjectType) => {
48
56
  var _a;
49
57
  return {
50
- disabled: (abObjctType === null || abObjctType === void 0 ? void 0 : abObjctType.accessLevel) === 'ReadOnly',
58
+ disabled: (abObjectType === null || abObjectType === void 0 ? void 0 : abObjectType.accessLevel) === 'ReadOnly',
51
59
  onClick: () => {
52
- setAbObjectType(abObjctType);
53
- setIsWizardOpen(true);
60
+ setAbObjectType(abObjectType);
61
+ handleOpenEditPopup();
54
62
  },
55
- label: (_a = abObjctType.label) !== null && _a !== void 0 ? _a : abObjctType.name,
63
+ label: (_a = abObjectType.label) !== null && _a !== void 0 ? _a : abObjectType.name,
56
64
  };
57
65
  });
58
66
  newButton = (React.createElement(DropdownButton_1.default, { tone: "accent", variant: "raised", columns: ['label'], items: items, tooltip: 'Create ' + moduleInfo.FriendlyName },
59
67
  React.createElement(icons_1.Icon, { name: "plus" }),
60
68
  " New"));
61
69
  }
62
- else if (EditWizard) {
63
- newButton = (React.createElement(ButtonNew_1.ButtonNew, { onClick: () => setIsWizardOpen(true), tooltip: 'Create ' + moduleInfo.FriendlyName, accessLevel: props.accessLevel, style: {
70
+ else if (EditWizard || moduleViewProperties.onOpenEditPopup) {
71
+ newButton = (React.createElement(ButtonNew_1.ButtonNew, { onClick: () => handleOpenEditPopup(), tooltip: 'Create ' + moduleInfo.FriendlyName, accessLevel: props.accessLevel, style: {
64
72
  color: 'var(--ab-color-text-on-add)',
65
73
  fill: 'var(--ab-color-text-on-add)',
66
74
  background: 'var(--ab-color-action-add)',
@@ -76,5 +84,5 @@ exports.AdaptablePopupModuleView = (props) => {
76
84
  };
77
85
  return (React.createElement(PopupPanel_1.PopupPanel, { glyphicon: moduleInfo.Glyph, infoLink: moduleInfo.HelpPage, headerText: moduleInfo.FriendlyName, button: newButton },
78
86
  (items === null || items === void 0 ? void 0 : items.length) ? (React.createElement(AdaptableObjectList_1.AdaptableObjectList, { module: props.module, items: items })) : (React.createElement(EmptyContent_1.default, null, emptyContent !== null && emptyContent !== void 0 ? emptyContent : `Click 'New' to create a new ${moduleInfo.FriendlyName}`)),
79
- isWizardOpen && (React.createElement(EditWizard, { abObjectType: abObjectType, moduleInfo: moduleInfo, data: null, popupParams: props.popupParams, configEntities: null, onCloseWizard: handleWizardClose, onFinishWizard: handleWizardClose }))));
87
+ isWizardOpen && EditWizard && (React.createElement(EditWizard, { abObjectType: abObjectType, moduleInfo: moduleInfo, data: null, popupParams: props.popupParams, configEntities: null, onCloseWizard: handleWizardClose, onFinishWizard: handleWizardClose }))));
80
88
  };
@@ -1,6 +1,8 @@
1
1
  import * as React from 'react';
2
+ import { AdaptableApi } from '../../../../../types';
2
3
  export interface WindowPopupChildProps {
3
4
  onDismiss: () => void;
4
5
  popupProps: any;
6
+ api: AdaptableApi;
5
7
  }
6
8
  export declare const WindowPopups: React.FunctionComponent;
@@ -6,6 +6,8 @@ const React = tslib_1.__importStar(require("react"));
6
6
  const react_redux_1 = require("react-redux");
7
7
  const Dialog_1 = tslib_1.__importDefault(require("../../../../components/Dialog"));
8
8
  const PopupRedux_1 = require("../../../../Redux/ActionsReducers/PopupRedux");
9
+ const AdaptableContext_1 = require("../../../AdaptableContext");
10
+ const PanelWithImage_1 = require("../../Panels/PanelWithImage");
9
11
  const Utilities_1 = require("../Utilities");
10
12
  const windowFactory_1 = require("./windowFactory");
11
13
  const NoopComponent = () => {
@@ -13,20 +15,22 @@ const NoopComponent = () => {
13
15
  };
14
16
  exports.WindowPopups = () => {
15
17
  const [windowModalSettings, setWindowModalSettings] = React.useState({});
18
+ const adaptable = AdaptableContext_1.useAdaptable();
16
19
  const dispatch = react_redux_1.useDispatch();
17
20
  const windowItems = react_redux_1.useSelector((state) => state.Popup.WindowPopup.PopupList);
18
21
  return (React.createElement(React.Fragment, null, windowItems === null || windowItems === void 0 ? void 0 : windowItems.map((windowItem, index) => {
19
- var _a, _b, _c, _d, _e;
22
+ var _a, _b, _c, _d, _e, _f;
20
23
  const Component = (_a = windowFactory_1.windowFactory[windowItem.Id]) !== null && _a !== void 0 ? _a : NoopComponent;
21
- const _f = windowItem.PopupProps, { windowModalProps } = _f, restPopupProps = tslib_1.__rest(_f, ["windowModalProps"]);
24
+ const _g = (_b = windowItem === null || windowItem === void 0 ? void 0 : windowItem.PopupProps) !== null && _b !== void 0 ? _b : {}, { windowModalProps } = _g, restPopupProps = tslib_1.__rest(_g, ["windowModalProps"]);
22
25
  const handleDismiss = () => {
23
26
  dispatch(PopupRedux_1.PopupWindowHide(windowItem.Id));
24
27
  };
25
- const size = (_c = (_b = windowModalSettings === null || windowModalSettings === void 0 ? void 0 : windowModalSettings[windowItem.Id]) === null || _b === void 0 ? void 0 : _b.size) !== null && _c !== void 0 ? _c : Utilities_1.getWindowPopupSize();
26
- const position = (_e = (_d = windowModalSettings === null || windowModalSettings === void 0 ? void 0 : windowModalSettings[windowItem.Id]) === null || _d === void 0 ? void 0 : _d.position) !== null && _e !== void 0 ? _e : Utilities_1.getMiddlePosition(size);
28
+ const size = (_d = (_c = windowModalSettings === null || windowModalSettings === void 0 ? void 0 : windowModalSettings[windowItem.Id]) === null || _c === void 0 ? void 0 : _c.size) !== null && _d !== void 0 ? _d : Utilities_1.getWindowPopupSize();
29
+ const position = (_f = (_e = windowModalSettings === null || windowModalSettings === void 0 ? void 0 : windowModalSettings[windowItem.Id]) === null || _e === void 0 ? void 0 : _e.position) !== null && _f !== void 0 ? _f : Utilities_1.getMiddlePosition(size);
27
30
  return (React.createElement(Dialog_1.default, { "data-name": windowItem.Id, style: { height: '100%' }, className: "ab-Window-Modal", key: windowItem.Id, windowModal: true, windowModalProps: Object.assign(Object.assign({}, windowModalProps), { onChange: (settings) => {
28
31
  setWindowModalSettings((settingsMap) => (Object.assign(Object.assign({}, settingsMap), { [windowItem.Id]: settings })));
29
32
  }, handleSelector: '.ab-Window-Modal .ab-Panel__header', size: size, position: position }), fixed: false, padding: 0, onDismiss: handleDismiss, isOpen: true, showCloseButton: true },
30
- React.createElement(Component, { onDismiss: handleDismiss, popupProps: restPopupProps })));
33
+ React.createElement(PanelWithImage_1.PanelWithImage, { style: { height: '100%' }, bodyProps: { padding: 0, height: '100%' }, header: windowItem.Title, glyphicon: windowItem.Icon, variant: "primary" },
34
+ React.createElement(Component, { api: adaptable.api, onDismiss: handleDismiss, popupProps: restPopupProps }))));
31
35
  })));
32
36
  };
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { WindowPopupChildProps } from './WindowPopups';
3
3
  export declare const WINDOW_LAYOUT_EDITOR = "WINDOW_LAYOUT_EDITOR";
4
+ export declare const WINDOW_QUERY_EDITOR = "WINDOW_QUERY_EDITOR";
4
5
  export declare const windowFactory: Record<string, React.FunctionComponent<WindowPopupChildProps>>;
@@ -1,8 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.windowFactory = exports.WINDOW_LAYOUT_EDITOR = void 0;
3
+ exports.windowFactory = exports.WINDOW_QUERY_EDITOR = exports.WINDOW_LAYOUT_EDITOR = void 0;
4
4
  const LayoutEditorStandalonePopup_1 = require("../../../Layout/LayoutEditorStandalonePopup");
5
+ const ExpandedQueryPopup_1 = require("../../../Query/ExpandedQueryPopup");
5
6
  exports.WINDOW_LAYOUT_EDITOR = 'WINDOW_LAYOUT_EDITOR';
7
+ exports.WINDOW_QUERY_EDITOR = 'WINDOW_QUERY_EDITOR';
6
8
  exports.windowFactory = {
7
9
  [exports.WINDOW_LAYOUT_EDITOR]: LayoutEditorStandalonePopup_1.LayoutEditorStandalonePopup,
10
+ [exports.WINDOW_QUERY_EDITOR]: ExpandedQueryPopup_1.ExpandedQueryPopup,
8
11
  };
@@ -63,9 +63,8 @@ class RangesComponent extends React.Component {
63
63
  const { value } = event.target;
64
64
  this.changeRangeMax(index, value);
65
65
  }, mr: 2 }),
66
- React.createElement(ColorPicker_1.ColorPicker, { api: this.props.api, value: range.Color, onChange: (event) => {
67
- const { value } = event.target;
68
- this.changeRangeColor(index, value);
66
+ React.createElement(ColorPicker_1.ColorPicker, { api: this.props.api, value: range.Color, onChange: (color) => {
67
+ this.changeRangeColor(index, color);
69
68
  }, mr: 2, height: "100%" }),
70
69
  this.props.showRangeDirection && (React.createElement(CheckBox_1.CheckBox, { marginLeft: 2, marginRight: 2, checked: range.ReverseGradient && range.ReverseGradient == true, onChange: (checked) => this.changeRangeDirectionUp(index, checked) }, "Reverse Gradient")),
71
70
  React.createElement(SimpleButton_1.default, { icon: "delete", disabled: this.state.ranges && this.state.ranges.length == 1, onClick: () => this.removeRange(index) })))),
@@ -84,9 +83,8 @@ class RangesComponent extends React.Component {
84
83
  React.createElement(FormLayout_1.FormRow, { label: "Max Value:", first: React.createElement(Input_1.default, { type: "number", value: comparisonMaxValueNumber, onChange: (e) => {
85
84
  this.changeColumnComparisonMaxValue(e);
86
85
  } }), or: "OR", second: React.createElement(ColumnSelector_1.ColumnSelector, { style: { maxWidth: '15rem' }, SelectedColumnIds: [comparisonMaxValueColumnId], ColumnList: this.props.api.columnApi.getNumericColumns(), onColumnChange: (columns) => this.onMaxColumnSelectedChanged(columns), SelectionMode: Enums_1.SelectionMode.Single }) }),
87
- React.createElement(FormLayout_1.FormRow, { label: "Bar Colour:", first: React.createElement(ColorPicker_1.ColorPicker, { api: this.props.api, value: comparisonColor, onChange: (event) => {
88
- const { value } = event.target;
89
- this.changeColumnComparisonColor(value);
86
+ React.createElement(FormLayout_1.FormRow, { label: "Bar Colour:", first: React.createElement(ColorPicker_1.ColorPicker, { api: this.props.api, value: comparisonColor, onChange: (color) => {
87
+ this.changeColumnComparisonColor(color);
90
88
  } }) }))))))));
91
89
  }
92
90
  onRangesTypeChanged(checked) {
@@ -120,19 +120,16 @@ class StyleComponent extends React.Component {
120
120
  this.state.componentStyle.FontSize = checked ? Enums_1.FontSize.Medium : null;
121
121
  this.props.UpdateStyle(this.state.componentStyle);
122
122
  }
123
- onBackColorSelectChange(event) {
124
- let e = event.target;
125
- this.state.componentStyle.BackColor = e.value;
123
+ onBackColorSelectChange(color) {
124
+ this.state.componentStyle.BackColor = color;
126
125
  this.props.UpdateStyle(this.state.componentStyle);
127
126
  }
128
- onForeColorSelectChange(event) {
129
- let e = event.target;
130
- this.state.componentStyle.ForeColor = e.value;
127
+ onForeColorSelectChange(color) {
128
+ this.state.componentStyle.ForeColor = color;
131
129
  this.props.UpdateStyle(this.state.componentStyle);
132
130
  }
133
- onBorderColorSelectChange(event) {
134
- let e = event.target;
135
- this.state.componentStyle.BorderColor = e.value;
131
+ onBorderColorSelectChange(color) {
132
+ this.state.componentStyle.BorderColor = color;
136
133
  this.props.UpdateStyle(this.state.componentStyle);
137
134
  }
138
135
  onFontWeightChange(checked) {
@@ -25,6 +25,7 @@ export declare namespace ValueSelector {
25
25
  };
26
26
  }
27
27
  declare type ValueOptionsTagsProps<OPTION_TYPE, ID_TYPE extends number | string> = {
28
+ style?: React.CSSProperties;
28
29
  options: OPTION_TYPE[];
29
30
  value: ID_TYPE[];
30
31
  selectedMap?: Map<ID_TYPE, OPTION_TYPE>;
@@ -198,6 +198,6 @@ function ValueOptionsTags(props) {
198
198
  " ",
199
199
  remaining > 1 ? 'others' : 'other'));
200
200
  }, []);
201
- return (React.createElement(EllipsisContainer_1.EllipsisContainer, { marginRight: 4, my: 1, allowWrap: allowWrap, count: value.length, direction: "horizontal", renderItem: renderOptionTag, renderEllipsis: renderEllipsis }));
201
+ return (React.createElement(EllipsisContainer_1.EllipsisContainer, { style: props.style, marginRight: 4, my: 1, allowWrap: allowWrap, count: value.length, direction: "horizontal", renderItem: renderOptionTag, renderEllipsis: renderEllipsis }));
202
202
  }
203
203
  exports.ValueOptionsTags = ValueOptionsTags;
@@ -11,6 +11,8 @@ exports.CustomToolbarWrapper = (props) => {
11
11
  let contentsDivId = 'ab-CustomToolbar__' + props.customToolbar.name + '__contents';
12
12
  let buttonsDivId = 'ab-CustomToolbar__' + props.customToolbar.name + '__buttons';
13
13
  const [contentsHTML, setContentsHTML] = react_1.useState('');
14
+ // dummy object which is used to force a re-render of the toolbar
15
+ const [revision, setRevision] = react_1.useState(1);
14
16
  const contentsDivRef = react_1.useRef(null);
15
17
  const { api } = AdaptableContext_1.useAdaptable();
16
18
  react_1.useLayoutEffect(() => {
@@ -65,7 +67,13 @@ exports.CustomToolbarWrapper = (props) => {
65
67
  const disabled = button.disabled && button.disabled(button, dashboardContext);
66
68
  let buttonVariant = buttonStyle && buttonStyle.variant ? buttonStyle.variant : 'outlined';
67
69
  let buttonTone = buttonStyle && buttonStyle.tone ? buttonStyle.tone : 'neutral';
68
- return (React.createElement(SimpleButton_1.default, { style: { marginLeft: index ? 'var(--ab-space-1)' : 0 }, key: index, disabled: disabled, tooltip: buttonTooltip, variant: buttonVariant, tone: buttonTone, onClick: () => (button.onClick ? button.onClick(button, dashboardContext) : null) },
70
+ return (React.createElement(SimpleButton_1.default, { style: { marginLeft: index ? 'var(--ab-space-1)' : 0 }, key: index, disabled: disabled, tooltip: buttonTooltip, variant: buttonVariant, tone: buttonTone, onClick: () => {
71
+ button.onClick ? button.onClick(button, dashboardContext) : null;
72
+ setTimeout(() => {
73
+ // mutate state to force a re-rendering
74
+ setRevision(revision + 1);
75
+ }, 16);
76
+ } },
69
77
  button.icon ? React.createElement("img", Object.assign({}, button.icon)) : null,
70
78
  buttonLabel));
71
79
  }))));
@@ -204,11 +204,10 @@ function FormatColumnStyleWizardSection(props) {
204
204
  PercentBarStyle: percentBarStyle,
205
205
  } }));
206
206
  };
207
- const onForeColorSelectChange = (event) => {
207
+ const onForeColorSelectChange = (color) => {
208
208
  var _a;
209
- let e = event.target;
210
209
  let percentBarStyle = (_a = data.ColumnStyle) === null || _a === void 0 ? void 0 : _a.PercentBarStyle;
211
- percentBarStyle.BackColor = e.value;
210
+ percentBarStyle.BackColor = color;
212
211
  props.onChange(Object.assign(Object.assign({}, data), { ColumnStyle: {
213
212
  PercentBarStyle: percentBarStyle,
214
213
  } }));
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export declare const AdaptableObjectsSummary: React.FunctionComponent;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdaptableObjectsSummary = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const react_redux_1 = require("react-redux");
7
+ const AdaptableContext_1 = require("../AdaptableContext");
8
+ const AdaptableObjectList_1 = require("../Components/AdaptableObjectList");
9
+ exports.AdaptableObjectsSummary = () => {
10
+ const state = react_redux_1.useSelector((state) => state);
11
+ const adaptable = AdaptableContext_1.useAdaptable();
12
+ const modules = adaptable.ModuleService.getModuleCollection();
13
+ return (React.createElement(React.Fragment, null, [...modules].map(([moduleName, module]) => {
14
+ var _a;
15
+ if (!module.isModuleAvailable()) {
16
+ return null;
17
+ }
18
+ const items = (_a = module === null || module === void 0 ? void 0 : module.toViewAll) === null || _a === void 0 ? void 0 : _a.call(module);
19
+ if (!(items === null || items === void 0 ? void 0 : items.length)) {
20
+ return null;
21
+ }
22
+ return (React.createElement("div", null,
23
+ React.createElement("b", null, module.moduleInfo.FriendlyName),
24
+ (items === null || items === void 0 ? void 0 : items.length) && React.createElement(AdaptableObjectList_1.AdaptableObjectList, { items: items, module: module })));
25
+ })));
26
+ };
@@ -14,12 +14,18 @@ const AdaptablePopover_1 = require("../AdaptablePopover");
14
14
  const version_1 = tslib_1.__importDefault(require("../../../version"));
15
15
  const ColumnInfoComponent_1 = require("./ColumnInfoComponent");
16
16
  const AdaptableOptionsComponent_1 = require("./AdaptableOptionsComponent");
17
+ const AdaptableObjectsSummary_1 = require("./AdaptableObjectsSummary");
17
18
  exports.GridInfoPopup = (props) => {
18
19
  var _a, _b, _c;
19
20
  const entitlementService = props.api.internalApi.getEntitlementService();
20
21
  const showGridSummary = entitlementService.isGridInfoSectionVisible('GridSummary');
21
22
  const showAdaptableOptions = entitlementService.isGridInfoSectionVisible('AdaptableOptions');
22
23
  const showColumnInfo = entitlementService.isGridInfoSectionVisible('ColumnInfo');
24
+ /**
25
+ * Because it is not associated with a module yet, setting this flag to true.
26
+ * Needed for the logic weather to show radio buttons (buttons.length >= 2)
27
+ */
28
+ const showAdaptableObjects = true;
23
29
  const [state, setState] = React.useState({
24
30
  ActiveTab: ((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.column) ? 'ColumnInfo'
25
31
  : showGridSummary
@@ -91,15 +97,17 @@ exports.GridInfoPopup = (props) => {
91
97
  let gridSummaries = CreateGridSummaries(propValueColItems).map((x, index) => {
92
98
  return React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { key: index, colItems: x });
93
99
  });
94
- const showRadioButtons = [showGridSummary, showAdaptableOptions, showColumnInfo].filter((item) => item).length > 1;
100
+ const showRadioButtons = [showGridSummary, showAdaptableOptions, showColumnInfo, showAdaptableObjects].filter((item) => item).length > 1;
95
101
  return (React.createElement(PopupPanel_1.PopupPanel, { headerText: 'Grid Info', glyphicon: 'info-sign' },
96
102
  React.createElement(rebass_1.Flex, { marginBottom: 2, padding: 3 }, showRadioButtons && (React.createElement(React.Fragment, null,
97
103
  showGridSummary && (React.createElement(Radio_1.default, { "data-name": "radioButton-GridSummary", marginRight: 3, value: "GridSummary", checked: state.ActiveTab == 'GridSummary', onChange: (_, e) => onShowGridSummaryChanged('GridSummary') }, "Grid Summary")),
98
104
  showAdaptableOptions && (React.createElement(Radio_1.default, { "data-name": "radioButton-AdaptableOptions", marginRight: 3, value: "AdaptableOptions", checked: state.ActiveTab == 'AdaptableOptions', onChange: (_, e) => onShowGridSummaryChanged('AdaptableOptions') }, "Adaptable Options")),
99
- showColumnInfo && (React.createElement(Radio_1.default, { "data-name": "radioButton-Column", value: "Column", checked: state.ActiveTab == 'ColumnInfo', onChange: (_, e) => onShowGridSummaryChanged('ColumnInfo') }, "Column Info"))))),
105
+ showColumnInfo && (React.createElement(Radio_1.default, { "data-name": "radioButton-Column", marginRight: 3, value: "Column", checked: state.ActiveTab == 'ColumnInfo', onChange: (_, e) => onShowGridSummaryChanged('ColumnInfo') }, "Column Info")),
106
+ showAdaptableObjects && (React.createElement(Radio_1.default, { "data-name": "radioButton-Column", value: "Column", checked: state.ActiveTab == 'AdaptableObjectsSummary', onChange: (_, e) => onShowGridSummaryChanged('AdaptableObjectsSummary') }, "Adaptable Objects"))))),
100
107
  state.ActiveTab == 'GridSummary' && (React.createElement(rebass_1.Box, { margin: 2 },
101
108
  React.createElement(AdaptableObjectCollection_1.AdaptableObjectCollection, { colItems: propValueColItems, items: gridSummaries }))),
102
109
  state.ActiveTab == 'AdaptableOptions' && React.createElement(AdaptableOptionsComponent_1.AdaptableOptionsComponent, { api: props.api }),
103
110
  state.ActiveTab == 'ColumnInfo' && (React.createElement("div", null,
104
- React.createElement(ColumnInfoComponent_1.ColumnInfoComponent, { api: props.api, teamSharingActivated: props.teamSharingActivated, column: state.CurrentColumn })))));
111
+ React.createElement(ColumnInfoComponent_1.ColumnInfoComponent, { api: props.api, teamSharingActivated: props.teamSharingActivated, column: state.CurrentColumn }))),
112
+ state.ActiveTab === 'AdaptableObjectsSummary' && React.createElement(AdaptableObjectsSummary_1.AdaptableObjectsSummary, null)));
105
113
  };
@@ -9,9 +9,9 @@ const Helper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/Helper
9
9
  const ObjectFactory_1 = tslib_1.__importDefault(require("../../Utilities/ObjectFactory"));
10
10
  const AdaptableContext_1 = require("../AdaptableContext");
11
11
  const PanelFooter_1 = require("../Components/Panels/PanelFooter");
12
- const PanelWithImage_1 = require("../Components/Panels/PanelWithImage");
13
12
  const LayoutEditorWizard_1 = require("./Wizard/LayoutEditorWizard");
14
13
  const LayoutRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/LayoutRedux"));
14
+ const rebass_1 = require("rebass");
15
15
  exports.LayoutEditorStandalonePopup = (props) => {
16
16
  /**
17
17
  * This is here because the old code mutates the object.
@@ -69,8 +69,7 @@ exports.LayoutEditorStandalonePopup = (props) => {
69
69
  props.onDismiss();
70
70
  }, []);
71
71
  const finishDisabled = !layoutData.Name;
72
- return (React.createElement(React.Fragment, null,
73
- React.createElement(PanelWithImage_1.PanelWithImage, { bodyProps: { padding: 2 }, flex: 1, glyphicon: layoutModule.moduleInfo.Glyph, header: layoutModule.moduleInfo.FriendlyName, infoLink: layoutModule.moduleInfo.HelpPage, infoLinkDisabled: false, variant: "primary" },
74
- React.createElement(LayoutEditorWizard_1.LayoutEditorWizard, { data: layoutData, api: adaptable.api, Layouts: layouts, moduleInfo: layoutModule.moduleInfo, onLayoutChange: setStateLayout, updateGoBackState: () => null })),
72
+ return (React.createElement(rebass_1.Flex, { height: "100%", flexDirection: "column" },
73
+ React.createElement(LayoutEditorWizard_1.LayoutEditorWizard, { data: layoutData, api: adaptable.api, Layouts: layouts, moduleInfo: layoutModule.moduleInfo, onLayoutChange: setStateLayout, updateGoBackState: () => null }),
75
74
  React.createElement(PanelFooter_1.PanelFooter, { acceptDisabled: finishDisabled, onAccept: handleAccept, onCancel: handleCancel })));
76
75
  };
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ import { Layout } from '../../../types';
3
+ export declare const LayoutRadioSelector: React.FunctionComponent<{
4
+ data: Layout;
5
+ }>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LayoutRadioSelector = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const Radio_1 = tslib_1.__importDefault(require("../../components/Radio"));
7
+ const AdaptableContext_1 = require("../AdaptableContext");
8
+ exports.LayoutRadioSelector = ({ data }) => {
9
+ const adaptable = AdaptableContext_1.useAdaptable();
10
+ const currentLayout = adaptable.api.layoutApi.getCurrentLayout();
11
+ const layouts = adaptable.api.layoutApi.getAllLayout();
12
+ const isDisabled = (layouts === null || layouts === void 0 ? void 0 : layouts.length) === 1;
13
+ const isSelected = currentLayout.Name === data.Name;
14
+ const handleToggle = React.useCallback(() => {
15
+ adaptable.api.layoutApi.setLayout(data.Name);
16
+ }, [isSelected]);
17
+ return React.createElement(Radio_1.default, { disabled: isDisabled, checked: isSelected, onClick: handleToggle });
18
+ };
@@ -1,19 +1,3 @@
1
1
  import * as React from 'react';
2
- import * as QueryRedux from '../../Redux/ActionsReducers/QueryRedux';
3
- import { ModuleViewPopupProps } from '../Components/SharedProps/ModuleViewPopupProps';
4
- import { NamedQuery } from '../../PredefinedConfig/QueryState';
5
- import { ExpressionEditorNamedQuery } from '../../components/ExpressionEditor/NamedQueryContext';
6
- interface ExpandedQueryPopupComponentProps extends ModuleViewPopupProps<ExpandedQueryPopupComponent> {
7
- onRunQuery: (expression: string) => QueryRedux.QueryRunAction;
8
- onAddNamedQuery: (namedQuery: NamedQuery) => QueryRedux.NamedQueryAddAction;
9
- }
10
- export interface ExpandedQueryPopupState {
11
- namedQuery: ExpressionEditorNamedQuery;
12
- expression: string;
13
- }
14
- declare class ExpandedQueryPopupComponent extends React.Component<ExpandedQueryPopupComponentProps, ExpandedQueryPopupState> {
15
- constructor(props: ExpandedQueryPopupComponentProps);
16
- render(): JSX.Element;
17
- }
18
- export declare let ExpandedQueryPopup: import("react-redux").ConnectedComponent<typeof ExpandedQueryPopupComponent, Pick<React.ClassAttributes<ExpandedQueryPopupComponent> & ExpandedQueryPopupComponentProps, never>>;
19
- export {};
2
+ import { WindowPopupChildProps } from '../Components/Popups/WindowPopups/WindowPopups';
3
+ export declare const ExpandedQueryPopup: React.FunctionComponent<WindowPopupChildProps>;
@@ -9,62 +9,47 @@ const ExpressionEditor_1 = require("../../components/ExpressionEditor");
9
9
  const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
10
10
  const QueryRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/QueryRedux"));
11
11
  const StringExtensions_1 = require("../../Utilities/Extensions/StringExtensions");
12
- const PanelWithButton_1 = require("../Components/Panels/PanelWithButton");
13
12
  const NamedQueryContext_1 = require("../../components/ExpressionEditor/NamedQueryContext");
14
13
  const ModuleConstants_1 = require("../../Utilities/Constants/ModuleConstants");
15
- class ExpandedQueryPopupComponent extends React.Component {
16
- constructor(props) {
17
- super(props);
18
- this.state = {
19
- namedQuery: false,
20
- expression: this.props.popupParams.value,
21
- };
22
- }
23
- render() {
24
- const isExpressionValid = this.props.api.internalApi
25
- .getQueryLanguageService()
26
- .validateBoolean(this.state.expression, ModuleConstants_1.QueryModuleId).isValid;
27
- const initialData = this.props.api.internalApi.getQueryPreviewData();
28
- const namedQueryValidationError = this.state.namedQuery
29
- ? this.props.api.queryApi.isValidNamedQueryName(this.state.namedQuery).message
30
- : '';
31
- const hasNamedQueryError = StringExtensions_1.IsNotNullOrEmpty(namedQueryValidationError);
32
- return (React.createElement(NamedQueryContext_1.NamedQueryContext.Provider, { value: {
33
- namedQuery: this.state.namedQuery,
34
- setNamedQuery: (namedQuery) => this.setState({ namedQuery }),
35
- } },
36
- React.createElement(PanelWithButton_1.PanelWithButton, { headerText: "Current Query", bodyProps: {
37
- padding: 0,
38
- style: { display: 'flex', flexDirection: 'column' },
39
- }, glyphicon: this.props.moduleInfo.Glyph },
40
- React.createElement(ExpressionEditor_1.ExpressionEditor, { type: 'boolean', module: ModuleConstants_1.QueryModuleId, value: this.state.expression, onChange: (expression) => this.setState({ expression }), initialData: initialData, columns: this.props.api.columnApi.getQueryableColumns(), namedQueries: this.props.api.queryApi.getAllNamedQuery(), api: this.props.api }),
41
- React.createElement(rebass_1.Flex, { flexDirection: "row", padding: 1, backgroundColor: "primary", alignItems: "center" },
42
- React.createElement(SimpleButton_1.default, { margin: 1, variant: "text", "data-name": "action-close", onClick: () => {
43
- this.props.onClosePopup();
44
- } }, "CLOSE"),
45
- React.createElement(rebass_1.Text, { fontSize: 2, mr: 3, style: {
46
- flex: 1,
47
- color: 'var(--ab-color-error)',
48
- textAlign: 'end',
49
- } }, namedQueryValidationError),
50
- React.createElement(SimpleButton_1.default, { variant: "raised", tone: "accent", "data-name": "action-run", margin: 1, onClick: () => {
51
- if (this.state.namedQuery) {
52
- this.props.onAddNamedQuery(this.state.namedQuery);
53
- }
54
- this.props.onRunQuery(this.state.expression);
55
- this.props.onClosePopup();
56
- }, disabled: !isExpressionValid || StringExtensions_1.IsNullOrEmpty(this.state.expression) || hasNamedQueryError }, "Run Query")))));
57
- }
58
- }
59
- function mapStateToProps() {
60
- return {
61
- // GridState: state.Grid,
62
- };
63
- }
64
- function mapDispatchToProps(dispatch) {
65
- return {
66
- onRunQuery: (expression) => dispatch(QueryRedux.QueryRun(expression)),
67
- onAddNamedQuery: (namedQuery) => dispatch(QueryRedux.NamedQueryAdd(namedQuery)),
68
- };
69
- }
70
- exports.ExpandedQueryPopup = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(ExpandedQueryPopupComponent);
14
+ exports.ExpandedQueryPopup = (props) => {
15
+ const dispatch = react_redux_1.useDispatch();
16
+ const [namedQuery, setNamedQuery] = React.useState(null);
17
+ const [expression, setExpression] = React.useState(props.popupProps.value);
18
+ const isExpressionValid = props.api.internalApi
19
+ .getQueryLanguageService()
20
+ .validateBoolean(expression, ModuleConstants_1.QueryModuleId).isValid;
21
+ const initialData = React.useMemo(() => props.api.internalApi.getQueryPreviewData(), []);
22
+ const namedQueryValidationError = namedQuery
23
+ ? props.api.queryApi.isValidNamedQueryName(namedQuery).message
24
+ : '';
25
+ const hasNamedQueryError = StringExtensions_1.IsNotNullOrEmpty(namedQueryValidationError);
26
+ const onRunQuery = (expression) => dispatch(QueryRedux.QueryRun(expression));
27
+ const onAddNamedQuery = (namedQuery) => dispatch(QueryRedux.NamedQueryAdd(namedQuery));
28
+ return (React.createElement(NamedQueryContext_1.NamedQueryContext.Provider, { value: {
29
+ namedQuery: namedQuery,
30
+ setNamedQuery: (newQuery) => {
31
+ setNamedQuery(newQuery);
32
+ },
33
+ } },
34
+ React.createElement(rebass_1.Flex, { height: "100%", flexDirection: "column" },
35
+ React.createElement(ExpressionEditor_1.ExpressionEditor, { type: 'boolean', module: ModuleConstants_1.QueryModuleId, value: expression, onChange: (expression) => setExpression(expression), initialData: initialData, columns: props.api.columnApi.getQueryableColumns(), namedQueries: props.api.queryApi.getAllNamedQuery(), api: props.api }),
36
+ React.createElement(rebass_1.Flex, { flexDirection: "row", padding: 1, backgroundColor: "primary", alignItems: "center" },
37
+ React.createElement(SimpleButton_1.default, { margin: 1, variant: "text", "data-name": "action-close", onClick: () => {
38
+ props.onDismiss();
39
+ } }, "CLOSE"),
40
+ React.createElement(rebass_1.Text, { fontSize: 2, mr: 3, style: {
41
+ flex: 1,
42
+ color: 'var(--ab-color-error)',
43
+ textAlign: 'end',
44
+ } }, namedQueryValidationError),
45
+ React.createElement(SimpleButton_1.default, { variant: "raised", tone: "accent", "data-name": "action-run", margin: 1, onClick: () => {
46
+ if (namedQuery) {
47
+ onAddNamedQuery({
48
+ Name: namedQuery.Name,
49
+ BooleanExpression: expression,
50
+ });
51
+ }
52
+ onRunQuery(expression);
53
+ props.onDismiss();
54
+ }, disabled: !isExpressionValid || StringExtensions_1.IsNullOrEmpty(expression) || hasNamedQueryError }, "Run Query")))));
55
+ };
@@ -22,6 +22,7 @@ const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Exte
22
22
  const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
23
23
  const ModuleConstants_1 = require("../../Utilities/Constants/ModuleConstants");
24
24
  const react_redux_1 = require("react-redux");
25
+ const windowFactory_1 = require("../Components/Popups/WindowPopups/windowFactory");
25
26
  class QueryViewPanelComponent extends React.Component {
26
27
  constructor(props) {
27
28
  super(props);
@@ -165,11 +166,13 @@ function mapDispatchToProps(dispatch) {
165
166
  source: 'Toolbar',
166
167
  value,
167
168
  })),
168
- onExpand: (value) => dispatch(PopupRedux.PopupShowScreen(ModuleConstants.QueryModuleId, 'ExpandedQueryPopup', {
169
- source: 'Toolbar',
170
- value,
171
- }, {
172
- footer: null,
169
+ onExpand: (value) => dispatch(PopupRedux.PopupShowWindow({
170
+ Id: windowFactory_1.WINDOW_QUERY_EDITOR,
171
+ Title: 'Current Query',
172
+ Icon: 'query',
173
+ PopupProps: {
174
+ value: value,
175
+ },
173
176
  })),
174
177
  };
175
178
  }
@@ -150,7 +150,8 @@ export declare class Adaptable implements IAdaptable {
150
150
  private updateLayoutFromGrid;
151
151
  setSelectedCells(): SelectedCellInfo | undefined;
152
152
  setSelectedRows(): SelectedRowInfo | undefined;
153
- setValue(cellDataChangedInfo: CellDataChangedInfo): void;
153
+ setDataValue(value: any, column: AdaptableColumn, primaryKeyValue: any, rowNode?: RowNode): void;
154
+ setCellValue(cellDataChangedInfo: CellDataChangedInfo): void;
154
155
  cancelEdit(): void;
155
156
  isCellEditable(rowNode: RowNode, column: Column): boolean;
156
157
  getDistinctValuesForColumn(column: AdaptableColumn, visibleRowsOnly: boolean, skipRowNode?: RowNode, permittedValues?: any[]): GridCell[];