@adaptabletools/adaptable 16.2.0 → 16.2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "16.2.0",
3
+ "version": "16.2.2",
4
4
  "description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
5
5
  "keywords": [
6
6
  "web-components",
@@ -1,2 +1,2 @@
1
- declare const _default: 1700657829772;
1
+ declare const _default: 1701089574640;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1700657829772;
3
+ exports.default = 1701089574640;
@@ -33,16 +33,18 @@ export interface DashboardApi {
33
33
  */
34
34
  setDashboardTitle(title: string): void;
35
35
  /**
36
- * Returns 'div' element for given Custom Toolbar
36
+ * Returns the HTML Element for the given Custom Toolbar. This should only be used in Vanilla AdapTable for toolbars created via a `render` function.
37
37
  * @param customToolbarName the name of the Custom Toolbar
38
+ *
38
39
  */
39
- getCustomToolbarContentsDiv(customToolbarName: string): HTMLElement | null;
40
+ getCustomToolbarHTMLElement(customToolbarName: string): HTMLElement | null;
40
41
  /**
41
- * Populates a Custom Toolbar with content
42
+ * Renders the given HTML string in the given Custom Toolbar. This should only be used in Vanilla AdapTable for toolbars created via a `render` function!
42
43
  * @param customToolbarName name of Custom Toolbar hosting content
43
- * @param contents contents to render
44
+ * @param htmlContent HTML string to render
45
+ *
44
46
  */
45
- setCustomToolbarContents(customToolbarName: string, contents: string): void;
47
+ setCustomToolbarHTMLContent(customToolbarName: string, htmlContent: string): void;
46
48
  /**
47
49
  * Returns Custom Toolbar with the given name
48
50
  * @param customToolbarName the name of the Custom Toolbar
@@ -137,4 +139,15 @@ export interface DashboardApi {
137
139
  * Is Dashboard Visible
138
140
  */
139
141
  isDashboardVisible(): boolean;
142
+ /**
143
+ * DEPRECATED
144
+ */
145
+ /**
146
+ * @deprecated use `getCustomToolbarHTMLElement` instead
147
+ */
148
+ getCustomToolbarContentsDiv(customToolbarName: string): HTMLElement | null;
149
+ /**
150
+ * @deprecated use `setCustomToolbarHTMLContent` instead
151
+ */
152
+ setCustomToolbarContents(customToolbarName: string, contents: string): void;
140
153
  }
@@ -4,7 +4,6 @@ exports.ColumnApiImpl = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ApiBase_1 = require("./ApiBase");
6
6
  const GeneralConstants = tslib_1.__importStar(require("../../Utilities/Constants/GeneralConstants"));
7
- const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
8
7
  const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
9
8
  const ColumnInternalApi_1 = require("../Internal/ColumnInternalApi");
10
9
  class ColumnApiImpl extends ApiBase_1.ApiBase {
@@ -58,7 +57,7 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
58
57
  // put this here as there might be other indicators we are not aware of
59
58
  // perhaps with non auto groups ?
60
59
  //https://www.ag-grid.com/javascript-grid-grouping/
61
- return columnId === null || columnId === void 0 ? void 0 : columnId.startsWith(GeneralConstants_1.AG_GRID_GROUPED_COLUMN);
60
+ return columnId === null || columnId === void 0 ? void 0 : columnId.startsWith(GeneralConstants.AG_GRID_GROUPED_COLUMN);
62
61
  }
63
62
  isAutoPivotColumn(columnId) {
64
63
  // put this here as there might be other indicators we are not aware of?
@@ -3,8 +3,7 @@ import { DashboardApi } from '../DashboardApi';
3
3
  import { DashboardState, DashboardTab } from '../../PredefinedConfig/DashboardState';
4
4
  import { AdaptableDashboardToolbar, AdaptableDashboardToolbars, AdaptableModuleButtons } from '../../PredefinedConfig/Common/Types';
5
5
  import { AdaptableButton } from '../../PredefinedConfig/Common/AdaptableButton';
6
- import { DashboardButtonContext } from '../../types';
7
- import { CustomToolbar } from '../../AdaptableOptions/DashboardOptions';
6
+ import { CustomToolbar, DashboardButtonContext } from '../../types';
8
7
  import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
9
8
  import { DashboardInternalApi } from '../Internal/DashboardInternalApi';
10
9
  export declare class DashboardApiImpl extends ApiBase implements DashboardApi {
@@ -17,7 +16,9 @@ export declare class DashboardApiImpl extends ApiBase implements DashboardApi {
17
16
  setModuleButtons(moduleButtons: AdaptableModuleButtons): void;
18
17
  setDashboardTitle(title: string): void;
19
18
  getCustomToolbarContentsDiv(customToolbarName: string): HTMLElement | null;
19
+ getCustomToolbarHTMLElement(customToolbarName: string): HTMLElement | null;
20
20
  setCustomToolbarContents(customToolbarName: string, contents: string): void;
21
+ setCustomToolbarHTMLContent(customToolbarName: string, htmlContent: string): void;
21
22
  getCustomToolbarByName(customToolbarName: string): CustomToolbar;
22
23
  getTabByName(tabName: string): DashboardTab;
23
24
  collapseDashboard(): void;
@@ -32,7 +33,7 @@ export declare class DashboardApiImpl extends ApiBase implements DashboardApi {
32
33
  isToolbarVisible(toolbar: AdaptableDashboardToolbar | string): boolean;
33
34
  setActiveTabIndex(tabIndex: number): void;
34
35
  setActiveTab(tabName: string): void;
35
- getCurrentToolbars(): AdaptableDashboardToolbars | string[] | undefined;
36
+ getCurrentToolbars(): AdaptableDashboardToolbars | string[];
36
37
  openDashboardSettingsPanel(): void;
37
38
  isDashboardCollapsed(): boolean;
38
39
  isDashboardExpanded(): boolean;
@@ -8,6 +8,7 @@ const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/
8
8
  const React = tslib_1.__importStar(require("react"));
9
9
  const SystemRedux_1 = require("../../Redux/ActionsReducers/SystemRedux");
10
10
  const DashboardInternalApi_1 = require("../Internal/DashboardInternalApi");
11
+ const logDeprecation_1 = require("../../Utilities/logDeprecation");
11
12
  class DashboardApiImpl extends ApiBase_1.ApiBase {
12
13
  constructor(adaptable) {
13
14
  super(adaptable);
@@ -41,17 +42,40 @@ class DashboardApiImpl extends ApiBase_1.ApiBase {
41
42
  this.dispatchAction(DashboardRedux.DashboardSetTitle(title));
42
43
  }
43
44
  getCustomToolbarContentsDiv(customToolbarName) {
45
+ (0, logDeprecation_1.logDeprecation)(this.adaptable.logger, 'DashboardApi', 'getCustomToolbarContentsDiv', 'getCustomToolbarHTMLElement');
44
46
  let customToolbar = this.getCustomToolbarByName(customToolbarName);
45
47
  if (customToolbar) {
46
- let divId = 'ab-CustomToolbar__' + customToolbar.name + '__contents';
48
+ let divId = this.internalApi.getCustomToolbarRenderContainerId(customToolbarName);
47
49
  return document.getElementById(divId);
48
50
  }
49
51
  return null;
50
52
  }
53
+ getCustomToolbarHTMLElement(customToolbarName) {
54
+ let customToolbar = this.getCustomToolbarByName(customToolbarName);
55
+ if (!customToolbar) {
56
+ this.logWarn(`Could not find custom toolbar with name ${customToolbarName}`);
57
+ return;
58
+ }
59
+ if (customToolbar.render) {
60
+ return document.getElementById(this.internalApi.getCustomToolbarRenderContainerId(customToolbarName));
61
+ }
62
+ if (customToolbar.toolbarButtons) {
63
+ this.logWarn(`(get/set)CustomToolbarHTMLElement(${customToolbarName}) should only be used in Vanilla AdapTable for toolbars created via a 'render' function! For React/Adaptable components let the framework renderer handle it!`);
64
+ return document.getElementById(this.internalApi.getCustomToolbarButtonsContainerId(customToolbarName));
65
+ }
66
+ if (customToolbar.frameworkComponent) {
67
+ this.logWarn(`(get/set)CustomToolbarHTMLElement(${customToolbarName}) should only be used in Vanilla AdapTable for toolbars created via a 'render' function! For React/Adaptable components let the framework renderer handle it!`);
68
+ return document.getElementById(this.internalApi.getCustomToolbarComponentContainerId(customToolbarName));
69
+ }
70
+ }
51
71
  setCustomToolbarContents(customToolbarName, contents) {
52
- let contentsDiv = this.getCustomToolbarContentsDiv(customToolbarName);
53
- if (contentsDiv) {
54
- this.adaptable.renderReactRoot(React.createElement("div", { dangerouslySetInnerHTML: { __html: contents } }), contentsDiv);
72
+ (0, logDeprecation_1.logDeprecation)(this.adaptable.logger, 'DashboardApi', 'setCustomToolbarContents', 'setCustomToolbarHTMLContent');
73
+ this.setCustomToolbarHTMLContent(customToolbarName, contents);
74
+ }
75
+ setCustomToolbarHTMLContent(customToolbarName, htmlContent) {
76
+ let customRenderedContainer = this.getCustomToolbarHTMLElement(customToolbarName);
77
+ if (customRenderedContainer) {
78
+ this.adaptable.renderReactRoot(React.createElement("div", { dangerouslySetInnerHTML: { __html: htmlContent } }), customRenderedContainer);
55
79
  }
56
80
  }
57
81
  getCustomToolbarByName(customToolbarName) {
@@ -104,11 +128,11 @@ class DashboardApiImpl extends ApiBase_1.ApiBase {
104
128
  getCurrentToolbars() {
105
129
  // if hidden or collapsed return fasle
106
130
  if (this.getDashboardState().IsCollapsed == true || this.getDashboardState().IsHidden == true) {
107
- return undefined;
131
+ return [];
108
132
  }
109
133
  const currentTab = this.getActiveTab();
110
134
  if (!currentTab) {
111
- return undefined;
135
+ return [];
112
136
  }
113
137
  return currentTab.Toolbars;
114
138
  }
@@ -16,7 +16,7 @@ import { IDataService } from '../../Utilities/Services/Interface/IDataService';
16
16
  import { IEntitlementService } from '../../Utilities/Services/Interface/IEntitlementService';
17
17
  import { IQueryLanguageService } from '../../Utilities/Services/Interface/IQueryLanguageService';
18
18
  import { IAlertService } from '../../Utilities/Services/Interface/IAlertService';
19
- import { IRowNode } from '@ag-grid-community/core';
19
+ import { ColDef, IRowNode } from '@ag-grid-community/core';
20
20
  import { ITeamSharingService } from '../../Utilities/Services/Interface/ITeamSharingService';
21
21
  import { ButtonStyle } from '../../PredefinedConfig/Common/ButtonStyle';
22
22
  import { AdaptableButton } from '../../PredefinedConfig/Common/AdaptableButton';
@@ -26,7 +26,6 @@ import { IModuleCollection } from '../../Strategy/Interface/IModule';
26
26
  import { AdaptableObjectTag, AdaptableObjectWithScope } from '../../PredefinedConfig/Common/AdaptableObject';
27
27
  import { IRowEditService } from '../../Utilities/Services/Interface/IRowEditService';
28
28
  import { Fdc3Service } from '../../Utilities/Services/Fdc3Service';
29
- import { ColDef } from '@ag-grid-community/core/dist/esm/es6/entities/colDef';
30
29
  export declare class AdaptableInternalApi extends ApiBase {
31
30
  getSystemState(): SystemState;
32
31
  showPopupConfirmation(confirmation: UIConfirmation): void;
@@ -6,4 +6,7 @@ export declare class DashboardInternalApi extends ApiBase {
6
6
  */
7
7
  fireDashboardChangedEvent(trigger: string, oldDashboardState: DashboardState, newDashboardState: DashboardState): void;
8
8
  isToolbarInActiveTab(toolbarName: string, dashboardState: DashboardState): boolean;
9
+ getCustomToolbarRenderContainerId(customToolbarName: string): string;
10
+ getCustomToolbarButtonsContainerId(customToolbarName: string): string;
11
+ getCustomToolbarComponentContainerId(customToolbarName: string): string;
9
12
  }
@@ -12,11 +12,21 @@ class DashboardInternalApi extends ApiBase_1.ApiBase {
12
12
  const isToolbarStateChangedToVisible = (toolbarName) => {
13
13
  const visibleInNewState = this.isToolbarInActiveTab(toolbarName, newDashboardState);
14
14
  const visibleInOldState = this.isToolbarInActiveTab(toolbarName, oldDashboardState);
15
+ if (visibleInNewState && visibleInOldState) {
16
+ // check for dashboard collapse/expand/hidden changes
17
+ return ((oldDashboardState.IsCollapsed && !newDashboardState.IsCollapsed) ||
18
+ (oldDashboardState.IsHidden && !newDashboardState.IsHidden));
19
+ }
15
20
  return visibleInNewState && !visibleInOldState;
16
21
  };
17
22
  const isToolbarStateChangedToHidden = (toolbarName) => {
18
23
  const visibleInNewState = this.isToolbarInActiveTab(toolbarName, newDashboardState);
19
24
  const visibleInOldState = this.isToolbarInActiveTab(toolbarName, oldDashboardState);
25
+ if (visibleInNewState && visibleInOldState) {
26
+ // check for dashboard collapse/expand/hidden changes
27
+ return ((!oldDashboardState.IsCollapsed && newDashboardState.IsCollapsed) ||
28
+ (!oldDashboardState.IsHidden && newDashboardState.IsHidden));
29
+ }
20
30
  return visibleInOldState && !visibleInNewState;
21
31
  };
22
32
  const dashboardChangedInfo = {
@@ -30,7 +40,7 @@ class DashboardInternalApi extends ApiBase_1.ApiBase {
30
40
  adaptableId: this.adaptable.api.optionsApi.getAdaptableId(),
31
41
  };
32
42
  if (!(0, isEqual_1.default)(oldDashboardState, newDashboardState)) {
33
- this.adaptable.api.eventApi.emitSync('DashboardChanged', dashboardChangedInfo);
43
+ setTimeout(() => this.adaptable.api.eventApi.emit('DashboardChanged', dashboardChangedInfo));
34
44
  }
35
45
  }
36
46
  isToolbarInActiveTab(toolbarName, dashboardState) {
@@ -49,5 +59,14 @@ class DashboardInternalApi extends ApiBase_1.ApiBase {
49
59
  }
50
60
  return false;
51
61
  }
62
+ getCustomToolbarRenderContainerId(customToolbarName) {
63
+ return `ab-CustomToolbar__${customToolbarName}__renderContent`;
64
+ }
65
+ getCustomToolbarButtonsContainerId(customToolbarName) {
66
+ return `ab-CustomToolbar__${customToolbarName}__buttons`;
67
+ }
68
+ getCustomToolbarComponentContainerId(customToolbarName) {
69
+ return `ab-CustomToolbar__${customToolbarName}__component`;
70
+ }
52
71
  }
53
72
  exports.DashboardInternalApi = DashboardInternalApi;
@@ -8,15 +8,17 @@ const AdaptableContext_1 = require("../AdaptableContext");
8
8
  const AdaptableButton_1 = require("../Components/AdaptableButton");
9
9
  const PanelDashboard_1 = require("../Components/Panels/PanelDashboard");
10
10
  const CustomToolbarCmp = (props) => {
11
- let contentsDivId = 'ab-CustomToolbar__' + props.customToolbar.name + '__contents';
12
- let buttonsDivId = 'ab-CustomToolbar__' + props.customToolbar.name + '__buttons';
13
- const [contentsHTML, setContentsHTML] = (0, react_1.useState)('');
11
+ const { api } = (0, AdaptableContext_1.useAdaptable)();
14
12
  // dummy object which is used to force a re-render of the toolbar
15
13
  const [componentRevision, setComponentRevision] = (0, react_1.useState)(1);
16
- const contentsDivRef = (0, react_1.useRef)(null);
17
- const { api } = (0, AdaptableContext_1.useAdaptable)();
14
+ const renderContentContainerId = api.dashboardApi.internalApi.getCustomToolbarRenderContainerId(props.customToolbar.name);
15
+ const renderContentContainerRef = (0, react_1.useRef)(null);
16
+ const [renderedContentHTML, setRenderedContentHTML] = (0, react_1.useState)('');
17
+ const buttonsContainerId = api.dashboardApi.internalApi.getCustomToolbarButtonsContainerId(props.customToolbar.name);
18
+ const componentContainerId = api.dashboardApi.internalApi.getCustomToolbarComponentContainerId(props.customToolbar.name);
19
+ const componentContainerRef = (0, react_1.useRef)(null);
18
20
  (0, react_1.useLayoutEffect)(() => {
19
- const element = contentsDivRef.current;
21
+ const element = renderContentContainerRef.current;
20
22
  const adaptableApi = api;
21
23
  if (props.customToolbar.render) {
22
24
  const html = props.customToolbar.render({
@@ -26,11 +28,11 @@ const CustomToolbarCmp = (props) => {
26
28
  userName: adaptableApi.optionsApi.getUserName(),
27
29
  adaptableId: adaptableApi.optionsApi.getAdaptableId(),
28
30
  });
29
- setContentsHTML(html);
31
+ setRenderedContentHTML(html);
30
32
  }
31
33
  }, [componentRevision, props.dashboardRevision]);
32
34
  (0, react_1.useLayoutEffect)(() => {
33
- const element = contentsDivRef.current;
35
+ const element = renderContentContainerRef.current;
34
36
  const adaptableApi = api;
35
37
  // cleanup runs in a separate effect, this way it's executed only once on unmount
36
38
  return () => {
@@ -46,26 +48,26 @@ const CustomToolbarCmp = (props) => {
46
48
  };
47
49
  }, []);
48
50
  (0, react_1.useLayoutEffect)(() => {
49
- const element = contentsDivRef.current;
51
+ const containerElement = componentContainerRef.current;
50
52
  const adaptableApi = api;
51
53
  if (props.customToolbar.frameworkComponent) {
52
- adaptableApi.internalApi.createFrameworkComponent(element, props.customToolbar.frameworkComponent, 'toolbar');
54
+ adaptableApi.internalApi.createFrameworkComponent(containerElement, props.customToolbar.frameworkComponent, 'toolbar');
53
55
  }
54
56
  const destroyUnsubscribe = adaptableApi.eventApi.on('AdaptableDestroy', () => {
55
57
  var _a;
56
- (_a = adaptableApi === null || adaptableApi === void 0 ? void 0 : adaptableApi.internalApi) === null || _a === void 0 ? void 0 : _a.destroyFrameworkComponent(element, props.customToolbar.frameworkComponent, 'toolbar');
58
+ (_a = adaptableApi === null || adaptableApi === void 0 ? void 0 : adaptableApi.internalApi) === null || _a === void 0 ? void 0 : _a.destroyFrameworkComponent(containerElement, props.customToolbar.frameworkComponent, 'toolbar');
57
59
  });
58
60
  return () => {
59
61
  var _a;
60
62
  destroyUnsubscribe();
61
63
  if (props.customToolbar.frameworkComponent) {
62
- (_a = adaptableApi === null || adaptableApi === void 0 ? void 0 : adaptableApi.internalApi) === null || _a === void 0 ? void 0 : _a.destroyFrameworkComponent(element, props.customToolbar.frameworkComponent, 'toolbar');
64
+ (_a = adaptableApi === null || adaptableApi === void 0 ? void 0 : adaptableApi.internalApi) === null || _a === void 0 ? void 0 : _a.destroyFrameworkComponent(containerElement, props.customToolbar.frameworkComponent, 'toolbar');
63
65
  }
64
66
  };
65
67
  }, []);
66
68
  return (React.createElement(React.Fragment, null,
67
- contentsHTML && (React.createElement("div", { id: contentsDivId, ref: contentsDivRef, className: "CustomToolBarContents ab-CustomToolbar__contents ab-CustomToolbar__contents--render", style: { minHeight: 22 }, dangerouslySetInnerHTML: { __html: contentsHTML } })),
68
- props.customToolbar.toolbarButtons && (React.createElement("div", { id: buttonsDivId, className: "ab-CustomToolbar__buttons", style: { minHeight: 22 } }, props.customToolbar.toolbarButtons.map((button, index) => {
69
+ props.customToolbar.render && (React.createElement("div", { id: renderContentContainerId, ref: renderContentContainerRef, className: `ab-CustomToolbar__rendered-content ab-CustomToolbar--${props.customToolbar.name}`, style: { minHeight: 22 }, dangerouslySetInnerHTML: { __html: renderedContentHTML } })),
70
+ props.customToolbar.toolbarButtons && (React.createElement("div", { id: buttonsContainerId, className: `ab-CustomToolbar__buttons ab-CustomToolbar--${props.customToolbar.name}`, style: { minHeight: 22 } }, props.customToolbar.toolbarButtons.map((button, index) => {
69
71
  const dashboardContext = {
70
72
  customToolbar: props.customToolbar,
71
73
  adaptableApi: api,
@@ -90,12 +92,13 @@ const CustomToolbarCmp = (props) => {
90
92
  setComponentRevision(componentRevision + 1);
91
93
  }, 16);
92
94
  } }, buttonLabel));
93
- })))));
95
+ }))),
96
+ props.customToolbar.frameworkComponent && (React.createElement("div", { id: componentContainerId, ref: componentContainerRef, style: { minHeight: 22 }, className: `ab-CustomToolbar__component ab-CustomToolbar--${props.customToolbar.name}` }))));
94
97
  };
95
98
  exports.CustomToolbarCmp = CustomToolbarCmp;
96
99
  const CustomToolbarWrapper = (props) => {
97
100
  const { api } = (0, AdaptableContext_1.useAdaptable)();
98
- return (React.createElement(PanelDashboard_1.PanelDashboard, { className: `ab-CustomToolbar ab-DashboardToolbar__${props.customToolbar.name}`, "data-name": `ab-CustomToolbar ab-DashboardToolbar__${props.customToolbar.name}`, headerText: props.customToolbar.title ? props.customToolbar.title : '', showConfigureButton: props.customToolbar.showConfigureButton != null &&
101
+ return (React.createElement(PanelDashboard_1.PanelDashboard, { headerText: props.customToolbar.title ? props.customToolbar.title : '', showConfigureButton: props.customToolbar.showConfigureButton != null &&
99
102
  props.customToolbar.showConfigureButton == true, showCloseButton: props.customToolbar.showCloseButton != null && props.customToolbar.showCloseButton == true, onConfigure: () => {
100
103
  const customToolbarConfiguredInfo = {
101
104
  adaptableApi: api,
@@ -13,9 +13,9 @@ const PinnedDashboard = (props) => {
13
13
  return React.createElement(React.Fragment, null);
14
14
  }
15
15
  return (React.createElement(rebass_1.Flex, { p: 1, className: "ab-Dashboard__pinned-content" }, pinnedToolbars.map((toolbar, index) => {
16
- return (React.createElement(rebass_1.Box, { mr: 2, mb: 1, className: `ab-Dashboard__pinned-container ab-Dashboard__pinned-container--${toolbar}` },
16
+ return (React.createElement(rebass_1.Box, { key: index, mr: 2, mb: 1, className: `ab-Dashboard__pinned-container ab-Dashboard__pinned-container--${toolbar}` },
17
17
  React.createElement(rebass_1.Box, { className: "ab-Dashboard__toolbar-content" },
18
- React.createElement(DashboardToolbarFactory_1.DashboardToolbarFactory, { key: index, toolbarName: toolbar }))));
18
+ React.createElement(DashboardToolbarFactory_1.DashboardToolbarFactory, { toolbarName: toolbar }))));
19
19
  })));
20
20
  };
21
21
  exports.PinnedDashboard = PinnedDashboard;
@@ -86,7 +86,7 @@ class QueryViewPanelComponent extends React.Component {
86
86
  }
87
87
  };
88
88
  const renderTextInput = () => {
89
- return this.props.viewType === 'Toolbar' ? (React.createElement(FieldWrap_1.default, { marginRight: 1, width: 600 },
89
+ return this.props.viewType === 'Toolbar' ? (React.createElement(FieldWrap_1.default, { marginRight: 1, width: 500 },
90
90
  React.createElement(ButtonExpand_1.ButtonExpand, { variant: "text", tone: "neutral", onClick: () => this.props.api.queryApi.expandCurrentQuery(this.state.expression), tooltip: "Expand", marginLeft: 1 }),
91
91
  React.createElement(Input_1.default, { type: "text", "data-name": "query-input", placeholder: "Query", spellCheck: false, value: this.state.expression, onChange: (x) => this.setState({ expression: x.target.value }), style: { fontFamily: 'monospace', fontSize: 12 } }),
92
92
  isExpressionValid ? (React.createElement(ButtonPlay_1.ButtonPlay, { onClick: () => this.runQuery(), tooltip: '', accessLevel: 'Full', variant: "text", tone: "neutral", disabled: this.state.expression == '' || this.state.expression == this.props.CurrentQuery, marginRight: 1 })) : (React.createElement(ButtonInvalid_1.ButtonInvalid, { variant: "text", tone: "neutral", tooltip: "Invalid Query", marginRight: 1 })),
@@ -2,5 +2,6 @@ import React from 'react';
2
2
  export interface QuickSearchInputProps {
3
3
  className?: string;
4
4
  autoFocus?: boolean;
5
+ width?: string | number;
5
6
  }
6
7
  export declare const QuickSearchInput: React.FunctionComponent<QuickSearchInputProps>;
@@ -9,6 +9,7 @@ const AdaptableFormControlTextClear_1 = require("../Components/Forms/AdaptableFo
9
9
  const useQuickSearchDebounced_1 = require("./useQuickSearchDebounced");
10
10
  const AdaptableContext_1 = require("../AdaptableContext");
11
11
  const QuickSearchInput = (props) => {
12
+ var _a;
12
13
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
13
14
  const QuickSearchText = (0, react_redux_1.useSelector)((state) => state.QuickSearch.QuickSearchText);
14
15
  const dispatch = (0, react_redux_1.useDispatch)();
@@ -17,6 +18,6 @@ const QuickSearchInput = (props) => {
17
18
  QuickSearchText,
18
19
  onRunQuickSearch,
19
20
  });
20
- return (react_1.default.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { type: "text", autoFocus: props.autoFocus, placeholder: adaptable.api.optionsApi.getQuickSearchOptions().quickSearchPlaceholder, className: props.className, value: searchText, OnTextChange: search, style: { height: '100%' }, inputStyle: { width: '10rem' } }));
21
+ return (react_1.default.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { type: "text", autoFocus: props.autoFocus, placeholder: adaptable.api.optionsApi.getQuickSearchOptions().quickSearchPlaceholder, className: props.className, value: searchText, OnTextChange: search, style: { height: '100%' }, inputStyle: { width: (_a = props.width) !== null && _a !== void 0 ? _a : '10rem' } }));
21
22
  };
22
23
  exports.QuickSearchInput = QuickSearchInput;
@@ -6,6 +6,6 @@ const React = tslib_1.__importStar(require("react"));
6
6
  const QuickSearchInput_1 = require("./QuickSearchInput");
7
7
  const QuickSearchViewPanelControl = (props) => {
8
8
  let elementType = props.viewType === 'ToolPanel' ? 'DashboardToolbar' : 'ToolPanel';
9
- return React.createElement(QuickSearchInput_1.QuickSearchInput, { className: `ab-${elementType}__QuickSearch__text` });
9
+ return React.createElement(QuickSearchInput_1.QuickSearchInput, { className: `ab-${elementType}__QuickSearch__text`, width: '15rem' });
10
10
  };
11
11
  exports.QuickSearchViewPanelControl = QuickSearchViewPanelControl;
@@ -1626,7 +1626,7 @@ class Adaptable {
1626
1626
  .columnApi.getColumnState()
1627
1627
  .reduce((acc, col) => {
1628
1628
  var _a;
1629
- if (col.colId === (GeneralConstants === null || GeneralConstants === void 0 ? void 0 : GeneralConstants.AG_GRID_GROUPED_COLUMN)) {
1629
+ if (this.api.columnApi.isAutoRowGroupColumn(col.colId)) {
1630
1630
  const widthInLayout = (_a = layout.ColumnWidthMap) === null || _a === void 0 ? void 0 : _a[col.colId];
1631
1631
  if (widthInLayout && widthInLayout !== col.width) {
1632
1632
  acc.push(Object.assign(Object.assign({}, col), { width: widthInLayout }));
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "16.2.0";
1
+ declare const _default: "16.2.2";
2
2
  export default _default;
package/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = '16.2.0'; // PLEASE DONT UPDATE THIS!!! - will be updated at build time with the correct version
3
+ exports.default = '16.2.2'; // PLEASE DONT UPDATE THIS!!! - will be updated at build time with the correct version
@@ -1,5 +0,0 @@
1
- import { GroupCellRenderer } from '@ag-grid-community/core';
2
- export declare class AdaptableGroupCellRenderer extends GroupCellRenderer {
3
- constructor();
4
- init(params: any): void;
5
- }
@@ -1,82 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AdaptableGroupCellRenderer = void 0;
4
- const tslib_1 = require("tslib");
5
- const core_1 = require("@ag-grid-community/core");
6
- const ArrayExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensions/ArrayExtensions"));
7
- const GeneralConstants_1 = require("../Utilities/Constants/GeneralConstants");
8
- const TEMPLATE =
9
- /* html */
10
- `<span class="ag-cell-wrapper">
11
- <span class="ag-group-expanded" ref="eExpanded"></span>
12
- <span class="ag-group-contracted" ref="eContracted"></span>
13
- <span class="ag-group-checkbox ag-invisible" ref="eCheckbox"></span>
14
- <span class="ag-group-value" ref="eValue"></span>
15
- <span class="ag-group-child-count" ref="eChildCount"></span>
16
- </span>`;
17
- class AdaptableGroupCellRenderer extends core_1.GroupCellRenderer {
18
- constructor() {
19
- super();
20
- this.setTemplate(TEMPLATE);
21
- }
22
- init(params) {
23
- //@ts-ignore
24
- this.params = params;
25
- //@ts-ignore
26
- if (this.gridOptionsWrapper.isGroupIncludeTotalFooter()) {
27
- //@ts-ignore
28
- this.assignBlankValueToGroupFooterCell(params);
29
- }
30
- //@ts-ignore
31
- const embeddedRowMismatch = this.isEmbeddedRowMismatch();
32
- // This allows for empty strings to appear as groups since
33
- // it will only return for null or undefined.
34
- const nullValue = params.value == null;
35
- let skipCell = false;
36
- // if the groupCellRenderer is inside of a footer and groupHideOpenParents is true
37
- // we should only display the groupCellRenderer if the current column is the rowGroupedColumn
38
- if (
39
- //@ts-ignore
40
- this.gridOptionsWrapper.isGroupIncludeFooter() &&
41
- //@ts-ignore
42
- this.gridOptionsWrapper.isGroupHideOpenParents()) {
43
- const node = params.node;
44
- if (node.footer) {
45
- const showRowGroup = params.colDef && params.colDef.showRowGroup;
46
- const rowGroupColumnId = node.rowGroupColumn && node.rowGroupColumn.getColId();
47
- skipCell = showRowGroup !== rowGroupColumnId;
48
- }
49
- }
50
- let skipExpandTool = false;
51
- if (params.node.leafGroup == true) {
52
- const displayedCols = params.columnApi.getAllDisplayedColumns();
53
- if (displayedCols && displayedCols.length > 0) {
54
- const nonGroupingCols = displayedCols.map((col) => {
55
- if (!col.getColId().startsWith(GeneralConstants_1.AG_GRID_GROUPED_COLUMN)) {
56
- return col;
57
- }
58
- });
59
- skipExpandTool = ArrayExtensions_1.default.IsNullOrEmpty(nonGroupingCols.filter((c) => c != undefined));
60
- }
61
- }
62
- //@ts-ignore
63
- this.cellIsBlank = embeddedRowMismatch || nullValue || skipCell;
64
- //@ts-ignore
65
- if (this.cellIsBlank) {
66
- return;
67
- }
68
- //@ts-ignore
69
- this.setupDragOpenParents();
70
- if (!skipExpandTool) {
71
- //@ts-ignore
72
- this.addExpandAndContract();
73
- }
74
- //@ts-ignore
75
- this.addCheckboxIfNeeded();
76
- //@ts-ignore
77
- this.addValueElement();
78
- //@ts-ignore
79
- this.setupIndent();
80
- }
81
- }
82
- exports.AdaptableGroupCellRenderer = AdaptableGroupCellRenderer;