@adaptabletools/adaptable 12.0.0-canary.6 → 12.0.0-canary.7

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": "12.0.0-canary.6",
3
+ "version": "12.0.0-canary.7",
4
4
  "description": "Powerful data-agnostic HTML5 datagrid add-on that sits on top of an underlying grid component and provides all the rich functionality that advanced users expect from their DataGrids and Data Tables",
5
5
  "keywords": [
6
6
  "web-components",
@@ -1,2 +1,2 @@
1
- declare const _default: 1655383572755;
1
+ declare const _default: 1655632388110;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1655383572755;
3
+ exports.default = 1655632388110;
@@ -29,6 +29,9 @@ export declare type AngularFrameworkComponent<T = unknown> = {
29
29
  export declare type ReactFrameworkComponent = ({ adaptableApi, }: {
30
30
  adaptableApi: AdaptableApi;
31
31
  }) => ReactElement;
32
+ /**
33
+ * Context provided for any custom rendering
34
+ */
32
35
  export interface CustomRenderContext {
33
36
  visible: boolean;
34
37
  element: HTMLDivElement;
@@ -86,7 +86,7 @@ export interface FDC3Column {
86
86
  /**
87
87
  * Returns a custom icon to display in the Raise Intent Context Menu Item;
88
88
  */
89
- getIconForIntent?: (intent: FDC3Intent | CustomFDC3Intent) => AdaptableIcon;
89
+ intentIcon?: (intent: FDC3Intent | CustomFDC3Intent) => AdaptableIcon;
90
90
  }
91
91
  /**
92
92
  * A Column which will be defined as an FDC3 Instrument
@@ -108,4 +108,11 @@ export interface FilterApi {
108
108
  * @param node Row Node to evaluate
109
109
  */
110
110
  evaluateColumnFilter(columnFilter: ColumnFilter, node: RowNode): boolean;
111
+ /**
112
+ * Checks if a filter is active or applied.
113
+ * It is applied when:
114
+ * - filter predicate does not have inputs
115
+ * - filter predicate has inputs with values
116
+ */
117
+ isFilterActive(columnFilter: ColumnFilter): boolean;
111
118
  }
@@ -28,4 +28,12 @@ export declare class FilterApiImpl extends ApiBase implements FilterApi {
28
28
  columnFiltersToString(columnFilters: ColumnFilter[]): string;
29
29
  evaluateColumnFilter(columnFilter: ColumnFilter, node: RowNode): boolean;
30
30
  private getColumnFilterById;
31
+ /**
32
+ * Checks if a filter is applied. It is applied when:
33
+ * - has no inputs
34
+ * - has inputs and inputs have values
35
+ *
36
+ * @param filter
37
+ */
38
+ isFilterActive(filter: ColumnFilter): boolean;
31
39
  }
@@ -7,6 +7,7 @@ const LayoutRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/La
7
7
  const ApiBase_1 = require("./ApiBase");
8
8
  const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
9
9
  const LoggingHelper_1 = require("../../Utilities/Helpers/LoggingHelper");
10
+ const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
10
11
  class FilterApiImpl extends ApiBase_1.ApiBase {
11
12
  getAllSystemFilterIds() {
12
13
  return this.getFilterOptions().systemFilters;
@@ -179,5 +180,29 @@ class FilterApiImpl extends ApiBase_1.ApiBase {
179
180
  var _a;
180
181
  return (_a = this.getColumnFilters()) === null || _a === void 0 ? void 0 : _a.find((columnFilter) => columnFilter.Uuid === id);
181
182
  }
183
+ /**
184
+ * Checks if a filter is applied. It is applied when:
185
+ * - has no inputs
186
+ * - has inputs and inputs have values
187
+ *
188
+ * @param filter
189
+ */
190
+ isFilterActive(filter) {
191
+ const predicateDef = this.adaptable.api.predicateApi.getPredicateDefById(filter === null || filter === void 0 ? void 0 : filter.Predicate.PredicateId);
192
+ if (ArrayExtensions_1.default.IsNull(predicateDef.inputs) &&
193
+ // values predicates have no inputs in the definition
194
+ !this.adaptable.api.predicateApi.hasPredicateValues(filter.Predicate)) {
195
+ return true;
196
+ }
197
+ const inputs = filter.Predicate.Inputs;
198
+ if (ArrayExtensions_1.default.IsEmpty(inputs)) {
199
+ return false;
200
+ }
201
+ // all values in the array need to be non-empty (e.g. between has two values, [min, max])
202
+ const allInputsHaveValues = inputs.every((value) => {
203
+ return value !== undefined && value !== null && value !== '';
204
+ });
205
+ return allInputsHaveValues;
206
+ }
182
207
  }
183
208
  exports.FilterApiImpl = FilterApiImpl;
@@ -14,4 +14,5 @@ export declare class PredicateApiImpl extends ApiBase implements PredicateApi {
14
14
  isValidPredicate(predicate: AdaptablePredicate | undefined): boolean;
15
15
  handlePredicate(predicate: AdaptablePredicate | undefined, params: Omit<PredicateDefHandlerParams, 'api' | 'inputs'>, defaultReturn: boolean): boolean;
16
16
  getEqualityPredicateForDataType(dataType: AdaptableColumnDataType): SystemFilterPredicateId;
17
+ hasPredicateValues(predicate: AdaptablePredicate): boolean;
17
18
  }
@@ -96,5 +96,8 @@ class PredicateApiImpl extends ApiBase_1.ApiBase {
96
96
  }
97
97
  return predicateId;
98
98
  }
99
+ hasPredicateValues(predicate) {
100
+ return (predicate === null || predicate === void 0 ? void 0 : predicate.PredicateId) === 'Values' || (predicate === null || predicate === void 0 ? void 0 : predicate.PredicateId) === 'ExcludeValues';
101
+ }
99
102
  }
100
103
  exports.PredicateApiImpl = PredicateApiImpl;
@@ -12,4 +12,8 @@ export declare class TeamSharingApiImpl extends ApiBase implements TeamSharingAp
12
12
  fireTeamSharingEntityChangedEvent(sharedEntity: SharedEntity): void;
13
13
  shareEntity(entity: AdaptableObject, module: AdaptableModule, sharedEntityConfig: SharedEntityConfig): void;
14
14
  unshareEntity(entityId: string): void;
15
+ importSharedEntry(sharedEntity: SharedEntity): void;
16
+ private getTeamSharingState;
17
+ getLoadedSharedEntities(): SharedEntity[];
18
+ triggerLoadingTeamSharingEntries(): void;
15
19
  }
@@ -69,5 +69,17 @@ class TeamSharingApiImpl extends ApiBase_1.ApiBase {
69
69
  }
70
70
  this.dispatchAction(TeamSharingRedux.TeamSharingRemoveItem(entityId));
71
71
  }
72
+ importSharedEntry(sharedEntity) {
73
+ this.adaptable.api.internalApi.dispatchReduxAction(TeamSharingRedux.TeamSharingImportItem(sharedEntity));
74
+ }
75
+ getTeamSharingState() {
76
+ return this.getAdaptableState().TeamSharing;
77
+ }
78
+ getLoadedSharedEntities() {
79
+ return this.getTeamSharingState().SharedEntities;
80
+ }
81
+ triggerLoadingTeamSharingEntries() {
82
+ this.adaptable.api.internalApi.dispatchReduxAction(TeamSharingRedux.TeamSharingGet());
83
+ }
72
84
  }
73
85
  exports.TeamSharingApiImpl = TeamSharingApiImpl;
@@ -59,4 +59,10 @@ export interface PredicateApi {
59
59
  * @param dataType DataType of Column
60
60
  */
61
61
  getEqualityPredicateForDataType(dataType: AdaptableColumnDataType): SystemFilterPredicateId;
62
+ /**
63
+ * Returns true if the predicate has a dropdown.
64
+ *
65
+ * @param predicate
66
+ */
67
+ hasPredicateValues(predicate: AdaptablePredicate): boolean;
62
68
  }
@@ -54,4 +54,19 @@ export interface TeamSharingApi {
54
54
  * @param entityId the ID of the AdaptableObject to be removed from Team Share
55
55
  */
56
56
  unshareEntity(entityId: string): void;
57
+ /**
58
+ * Import shared entry.
59
+ *
60
+ * @param sharedEntity shared entry to import
61
+ */
62
+ importSharedEntry(sharedEntity: SharedEntity): void;
63
+ /**
64
+ * Retrieves already loaded shared entries.
65
+ */
66
+ getLoadedSharedEntities(): SharedEntity[];
67
+ /**
68
+ * Trigger loading of shared entries.
69
+ * By default shared entries are loaded when the Team Sharing popup is visible.
70
+ */
71
+ triggerLoadingTeamSharingEntries(): void;
57
72
  }
@@ -325,7 +325,7 @@ class QuickFilterFormComponent extends React.Component {
325
325
  this.props.api.filterApi.clearColumnFilterByColumn(filter.ColumnId);
326
326
  }
327
327
  hasValuesPredicate(predicate) {
328
- return (predicate === null || predicate === void 0 ? void 0 : predicate.PredicateId) === 'Values' || (predicate === null || predicate === void 0 ? void 0 : predicate.PredicateId) === 'ExcludeValues';
328
+ return this.props.api.predicateApi.hasPredicateValues(predicate);
329
329
  }
330
330
  }
331
331
  function mapStateToProps(state, ownProps) {
@@ -39,6 +39,6 @@ const StatusBarPopup = (props) => {
39
39
  dragAndDropTab: false,
40
40
  deleteTab: false,
41
41
  editTabName: false,
42
- }, onTabsChange: handleTabChange, disabled: disabled, tabs: tabs, availableItems: availableItems, tabsTitle: 'Status Bar Panels', unusedPanelTitle: "Available Status Panels", dragItemText: "Drag into a Status Bar Panel below" })) : (React.createElement(EmptyContent_1.default, null, "To enable this feature add to Grid Options statusPanels the Adaptable Status Panel."))));
42
+ }, onTabsChange: handleTabChange, disabled: disabled, tabs: tabs, availableItems: availableItems, tabsTitle: 'AdapTable Status Bar Panels', unusedPanelTitle: "Available Module Status Panels", dragItemText: "Drag into a Status Bar Panel below" })) : (React.createElement(EmptyContent_1.default, null, "To enable this feature add to Grid Options statusPanels the Adaptable Status Panel."))));
43
43
  };
44
44
  exports.StatusBarPopup = StatusBarPopup;
@@ -2935,12 +2935,14 @@ class Adaptable {
2935
2935
  this.prepareGrid();
2936
2936
  }
2937
2937
  updateColumnFilterActiveState() {
2938
+ var _a;
2938
2939
  const columnFilters = this.api.filterApi.getColumnFilters();
2939
- const isFilterActive = ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(columnFilters);
2940
+ const activeFilters = (_a = columnFilters === null || columnFilters === void 0 ? void 0 : columnFilters.filter) === null || _a === void 0 ? void 0 : _a.call(columnFilters, (columnFilter) => this.api.filterApi.isFilterActive(columnFilter));
2941
+ const isFilterActive = ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(activeFilters);
2940
2942
  const columnsWithActiveFilters = {};
2941
2943
  if (isFilterActive) {
2942
2944
  // used in particular at init time to show the filter icon correctly
2943
- for (const colFilter of columnFilters) {
2945
+ for (const colFilter of activeFilters) {
2944
2946
  const agGridCol = this.gridOptions.columnApi.getColumn(colFilter.ColumnId);
2945
2947
  if (agGridCol) {
2946
2948
  columnsWithActiveFilters[agGridCol.getColId()] = true;
@@ -43,7 +43,7 @@ function Dashboard(props) {
43
43
  } }, child.props.title)))));
44
44
  const renderTabsDropdown = () => {
45
45
  var _a, _b, _c;
46
- if (children && children.length === 0) {
46
+ if (children && children.length < 2) {
47
47
  return null;
48
48
  }
49
49
  const activeTabTitle = (_c = (_b = (_a = children === null || children === void 0 ? void 0 : children[activeTabIndex]) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : 'Select Toolbar';
@@ -72,6 +72,7 @@ function Dashboard(props) {
72
72
  const renderHomeToolbar = () => (React.createElement(DashboardToolbar_1.DashboardToolbar, { onConfigure: onShowDashboardPopup, className: "ab-Dashboard__home-toolbar", title: title, tooltip: `Configure Dashboard`, showConfigure: true, showClose: false, accessLevel: 'Full' },
73
73
  left,
74
74
  right,
75
+ children && children.length > 1,
75
76
  renderTabsDropdown()));
76
77
  return (React.createElement("div", {
77
78
  // @ts-ignore
@@ -1755,6 +1755,11 @@ export declare const ADAPTABLE_METAMODEL: {
1755
1755
  kind: string;
1756
1756
  description: string;
1757
1757
  };
1758
+ CustomRenderContext: {
1759
+ name: string;
1760
+ kind: string;
1761
+ description: string;
1762
+ };
1758
1763
  CustomReport: {
1759
1764
  name: string;
1760
1765
  kind: string;